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,8 +222,10 @@ if ($_GET["action"] == 'removegroup' && $caneditfield)
} }
} }
if ($_POST["action"] == 'update' && ! $_POST["cancel"] && $caneditfield) if ($_POST["action"] == 'update' && ! $_POST["cancel"])
{ {
if ($caneditfield)
{
$message=""; $message="";
if (! $_POST["nom"]) if (! $_POST["nom"])
@ -324,6 +326,18 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"] && $caneditfield)
$db->rollback(); $db->rollback();
} }
} }
}
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