Commit fde153d0 authored by Tobias Reich's avatar Tobias Reich
Browse files

Removed "Set Password" menu after sharing without password

parent cf9ad486
...@@ -311,7 +311,6 @@ contextMenu = { ...@@ -311,7 +311,6 @@ contextMenu = {
contextMenu.fns = [ contextMenu.fns = [
function() { album.setPublic(albumID) }, function() { album.setPublic(albumID) },
function() { password.set(albumID) },
function() { album.share(0) }, function() { album.share(0) },
function() { album.share(1) }, function() { album.share(1) },
function() { album.share(2) }, function() { album.share(2) },
...@@ -322,15 +321,12 @@ contextMenu = { ...@@ -322,15 +321,12 @@ contextMenu = {
["<input readonly id='link' value='" + location.href + "'>", -1], ["<input readonly id='link' value='" + location.href + "'>", -1],
["separator", -1], ["separator", -1],
["<a class='icon-eye-close'></a> Make Private", 0], ["<a class='icon-eye-close'></a> Make Private", 0],
["<a class='icon-lock'></a> Set Password", 1],
["separator", -1], ["separator", -1],
["<a class='icon-twitter'></a> Twitter", 2], ["<a class='icon-twitter'></a> Twitter", 1],
["<a class='icon-facebook'></a> Facebook", 3], ["<a class='icon-facebook'></a> Facebook", 2],
["<a class='icon-envelope'></a> Mail", 4], ["<a class='icon-envelope'></a> Mail", 3],
]; ];
if (album.json.password==true) items[3] = ["<a class='icon-unlock'></a> Remove Password", 5];
contextMenu.show(items, mouse_x, mouse_y, "left"); contextMenu.show(items, mouse_x, mouse_y, "left");
$(".contextmenu input").focus().select(); $(".contextmenu input").focus().select();
......
...@@ -9,33 +9,6 @@ password = { ...@@ -9,33 +9,6 @@ password = {
value: "", value: "",
set: function(albumID) {
var buttons,
params;
buttons = [
["Set Password", function() {
if (visible.album()) {
album.json.password = true;
view.album.password();
}
params = "setAlbumPassword&albumID=" + albumID + "&password=" + md5($(".message input.text").val());
lychee.api(params, function(data) {
if (data!==true) lychee.error(null, params, data);
});
}],
["Cancel", function() {}]
];
modal.show("Set Password", "Set a password to protect '" + album.json.title + "' from unauthorized viewers. Only people with this password can view this album. <input class='text' type='password' placeholder='password' value=''>", buttons);
},
get: function(albumID, callback) { get: function(albumID, callback) {
var passwd = $(".message input.text").val(), var passwd = $(".message input.text").val(),
...@@ -85,24 +58,6 @@ password = { ...@@ -85,24 +58,6 @@ password = {
]; ];
modal.show("<a class='icon-lock'></a> Enter Password", "This album is protected by a password. Enter the password below to view the photos of this album: <input class='text' type='password' placeholder='password' value=''>", buttons, -110, false); modal.show("<a class='icon-lock'></a> Enter Password", "This album is protected by a password. Enter the password below to view the photos of this album: <input class='text' type='password' placeholder='password' value=''>", buttons, -110, false);
},
remove: function(albumID) {
var params;
if (visible.album()) {
album.json.password = false;
view.album.password();
}
params = "setAlbumPassword&albumID=" + albumID + "&password=";
lychee.api(params, function(data) {
if (data!==true) lychee.error(null, params, data);
});
} }
}; };
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -22,7 +22,6 @@ class Admin extends Access { ...@@ -22,7 +22,6 @@ class Admin extends Access {
case 'setAlbumTitle': $this->setAlbumTitle(); break; case 'setAlbumTitle': $this->setAlbumTitle(); break;
case 'setAlbumDescription': $this->setAlbumDescription(); break; case 'setAlbumDescription': $this->setAlbumDescription(); break;
case 'setAlbumPublic': $this->setAlbumPublic(); break; case 'setAlbumPublic': $this->setAlbumPublic(); break;
case 'setAlbumPassword': $this->setAlbumPassword(); break;
case 'deleteAlbum': $this->deleteAlbum(); break; case 'deleteAlbum': $this->deleteAlbum(); break;
# Photo functions # Photo functions
...@@ -116,14 +115,6 @@ class Admin extends Access { ...@@ -116,14 +115,6 @@ class Admin extends Access {
} }
private function setAlbumPassword() {
Module::dependencies(isset($_POST['albumID'], $_POST['password']));
$album = new Album($this->database, $this->plugins, $this->settings, $_POST['albumID']);
echo $album->setPassword($_POST['password']);
}
private function deleteAlbum() { private function deleteAlbum() {
Module::dependencies(isset($_POST['albumIDs'])); Module::dependencies(isset($_POST['albumIDs']));
......
...@@ -488,7 +488,7 @@ class Album extends Module { ...@@ -488,7 +488,7 @@ class Album extends Module {
} }
public function setPassword($password) { private function setPassword($password) {
# Check dependencies # Check dependencies
self::dependencies(isset($this->database, $this->albumIDs)); self::dependencies(isset($this->database, $this->albumIDs));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment