mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 13:42:04 +00:00
add option to clear password of guests
This commit is contained in:
parent
7bf0850275
commit
22e2c851e8
|
@ -194,6 +194,10 @@ else if ($action == "edituser") {
|
||||||
|
|
||||||
$login = $_POST["login"];
|
$login = $_POST["login"];
|
||||||
$pwd = $_POST["pwd"];
|
$pwd = $_POST["pwd"];
|
||||||
|
if(isset($_POST['clearpwd']) && $_POST['clearpwd'])
|
||||||
|
$clearpwd = 1;
|
||||||
|
else
|
||||||
|
$clearpwd = 0;
|
||||||
if(isset($_POST["pwdexpiration"]))
|
if(isset($_POST["pwdexpiration"]))
|
||||||
$pwdexpiration = $_POST["pwdexpiration"];
|
$pwdexpiration = $_POST["pwdexpiration"];
|
||||||
else
|
else
|
||||||
|
@ -209,25 +213,28 @@ else if ($action == "edituser") {
|
||||||
$isHidden = (isset($_POST["ishidden"]) && $_POST["ishidden"]==1 ? 1 : 0);
|
$isHidden = (isset($_POST["ishidden"]) && $_POST["ishidden"]==1 ? 1 : 0);
|
||||||
$isDisabled = (isset($_POST["isdisabled"]) && $_POST["isdisabled"]==1 ? 1 : 0);
|
$isDisabled = (isset($_POST["isdisabled"]) && $_POST["isdisabled"]==1 ? 1 : 0);
|
||||||
|
|
||||||
if ($editedUser->getLogin() != $login)
|
|
||||||
$editedUser->setLogin($login);
|
|
||||||
if($pwdexpiration)
|
|
||||||
$editedUser->setPwdExpiration($pwdexpiration);
|
|
||||||
if (isset($pwd) && ($pwd != "")) {
|
if (isset($pwd) && ($pwd != "")) {
|
||||||
if($settings->_passwordStrength) {
|
if($settings->_passwordStrength) {
|
||||||
$ps = new Password_Strength();
|
$ps = new Password_Strength();
|
||||||
$ps->set_password($_POST["pwd"]);
|
$ps->set_password($pwd);
|
||||||
if($settings->_passwordStrengthAlgorithm == 'simple')
|
if($settings->_passwordStrengthAlgorithm == 'simple')
|
||||||
$ps->simple_calculate();
|
$ps->simple_calculate();
|
||||||
else
|
else
|
||||||
$ps->calculate();
|
$ps->calculate();
|
||||||
$score = $ps->get_score();
|
$score = $ps->get_score();
|
||||||
if($score >= $settings->_passwordStrength) {
|
if($score < $settings->_passwordStrength) {
|
||||||
$editedUser->setPwd(md5($pwd));
|
|
||||||
} else {
|
|
||||||
UI::exitError(getMLText("set_password"),getMLText("password_strength_insuffient"));
|
UI::exitError(getMLText("set_password"),getMLText("password_strength_insuffient"));
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
|
if ($editedUser->getLogin() != $login)
|
||||||
|
$editedUser->setLogin($login);
|
||||||
|
if($pwdexpiration)
|
||||||
|
$editedUser->setPwdExpiration($pwdexpiration);
|
||||||
|
if(($role == SeedDMS_Core_User::role_guest) && $clearpwd) {
|
||||||
|
$editedUser->setPwd('');
|
||||||
|
} else {
|
||||||
|
if (isset($pwd) && ($pwd != "")) {
|
||||||
$editedUser->setPwd(md5($pwd));
|
$editedUser->setPwd(md5($pwd));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,7 +194,7 @@ $(document).ready( function() {
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php printMLText("password");?>:</td>
|
<td><?php printMLText("password");?>:</td>
|
||||||
<td><input type="password" class="pwd" rel="strengthbar<?php echo $currUser ? $currUser->getID() : "0"; ?>" name="pwd" id="pwd"></td>
|
<td><input type="password" class="pwd" rel="strengthbar<?php echo $currUser ? $currUser->getID() : "0"; ?>" name="pwd" id="pwd"><?php if($currUser && $currUser->isGuest()) echo ' <input type="checkbox" name="clearpwd" value="1" /> '.getMLText('clear_password'); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
if($passwordstrength > 0) {
|
if($passwordstrength > 0) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user