General fixes

+Fixed a bug that permitted to edit alliance leader's permissions
This commit is contained in:
iopietro
2018-05-30 20:25:29 +02:00
parent d171ac02cc
commit e0166b1242
4 changed files with 9 additions and 9 deletions
+2 -1
View File
@@ -452,8 +452,9 @@ class Alliance {
}
if($this->userPermArray['opt1'] == 0) $form->addError("perm", NO_PERMISSION);
elseif($database->getUserField($post['a_user'], "alliance", 0) != $session->alliance) $form->addError("perm", USER_NOT_IN_YOUR_ALLY);
elseif($database->getUserField($post['a_user'], "alliance", 0) != $session->alliance) $form->addError("perm", USER_NOT_IN_YOUR_ALLY);
elseif($post['a_user'] == $session->uid) $form->addError("perm", CANT_EDIT_YOUR_PERMISSIONS);
elseif($database->isAllianceOwner($_POST['a_user'])) $form->addError("perm", CANT_EDIT_LEADER_PERMISSIONS);
else
{
$database->updateAlliPermissions($post['a_user'], $session->alliance, $post['a_titel'], $post['e1'], $post['e2'], $post['e3'], $post['e4'], $post['e5'], $post['e6'], $post['e7']);
+1
View File
@@ -75,6 +75,7 @@ define("ALREADY_ALLY_MEMBER","You're already in an alliance");
define("ALLY_TOO_LOW", "You must have a level 3 or greater embassy");
define("USER_NOT_IN_YOUR_ALLY","This user is not in your alliance!");
define("CANT_EDIT_YOUR_PERMISSIONS","You can't edit your own permissions!");
define("CANT_EDIT_LEADER_PERMISSIONS","Alliance leader's permissions can't be edited!");
define("NO_PERMISSION", "You don't have enough permissions!");
define("NAME_OR_DIPL_EMPTY", "Name or diplomacy empty");
define("ALLY_DOESNT_EXISTS","Alliance does not exist");