Fix: Can change password if has only permission change password.

This commit is contained in:
Laurent Destailleur 2010-02-27 16:14:34 +00:00
parent 3d380b46ac
commit d4ab0697f9

View File

@ -222,7 +222,9 @@ if ($_GET["action"] == 'removegroup' && $caneditfield)
} }
} }
if ($_POST["action"] == 'update' && ! $_POST["cancel"] && $caneditfield) if ($_POST["action"] == 'update' && ! $_POST["cancel"])
{
if ($caneditfield)
{ {
$message=""; $message="";
@ -325,6 +327,18 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"] && $caneditfield)
} }
} }
} }
else if ($caneditpassword) // Case we can edit only password
{
$edituser = new User($db, $_GET["id"]);
$edituser->fetch();
$ret=$edituser->setPassword($user,$_POST["password"]);
if ($ret < 0)
{
$message.='<div class="error">'.$edituser->error.'</div>';
}
}
}
// Action modif mot de passe // Action modif mot de passe
if ((($_REQUEST["action"] == 'confirm_password' && $_REQUEST["confirm"] == 'yes') if ((($_REQUEST["action"] == 'confirm_password' && $_REQUEST["confirm"] == 'yes')