|
@@ -442,8 +442,16 @@ class Album extends Module {
|
|
|
|
|
|
$this->plugins(__METHOD__, 0, func_get_args());
|
|
|
|
|
|
-
|
|
|
- $result = $this->database->query("UPDATE lychee_albums SET password = '$password' WHERE id IN ('$this->albumIDs');");
|
|
|
+ if (isset($password)&&strlen($password)>0) {
|
|
|
+
|
|
|
+ $password = get_hashed_password($password);
|
|
|
+
|
|
|
+
|
|
|
+ $result = $this->database->query("UPDATE lychee_albums SET password = '$password' WHERE id IN ('$this->albumIDs');");
|
|
|
+ } else {
|
|
|
+
|
|
|
+ $result = $this->database->query("UPDATE lychee_albums SET password = NULL WHERE id IN ('$this->albumIDs');");
|
|
|
+ }
|
|
|
|
|
|
|
|
|
$this->plugins(__METHOD__, 1, func_get_args());
|
|
@@ -469,7 +477,7 @@ class Album extends Module {
|
|
|
$this->plugins(__METHOD__, 1, func_get_args());
|
|
|
|
|
|
if ($album->password=='') return true;
|
|
|
- else if ($album->password===$password) return true;
|
|
|
+ else if ($album->password===$password||$album->password===crypt($password, $album->password)) return true;
|
|
|
return false;
|
|
|
|
|
|
}
|