|

楼主 |
发表于 2022-1-9 12:29:15
|
显示全部楼层
create_user.php
第44行($_POST['user_lastname']....的下面一行)增加:
$_POST['user_password'] = trim(strip_tags(label_decode($_POST['user_password'])));
第70行($display_on_email_users....的下面一行)增加:
$pass = '';
if ($_POST['user_password'] != '') {
$pass = $_POST['user_password'];
}
else {
if (empty($ui_id)) {
$pass = generateRandomHash(8);
}
}
第236行(</tr>....的下面一行)增加:
<tr>
<td><?php echo $lang['global_32'].$lang['colon'] ?> </td>
<td>
<input type='password' class='x-form-text x-form-field' id='user_password' name='user_password' maxlength='255'
onkeydown='if(event.keyCode == 13) return false;'>
</td>
</tr>
RedCapDB.php
第1241行('ui_id=' . intval($ui_id));的下面一行)增加:
if ($pass != '') {
$password_salt = Authentication::generatePasswordSalt();
$hashed_password = Authentication::hashPassword($pass, $password_salt);
if ($isAaf === 0) {
$sql[] = $this->save('redcap_auth', array('username' => $username, 'password' => $hashed_password,
'password_salt' => $password_salt, 'temp_pwd' => 1));
$sql[] = $this->save('redcap_auth_history', array('username' => $username, 'password' => $hashed_password,
'timestamp' => NOW));
}
}
以上就是基于12.0.7官方版本的修改,完整的源码因为担心会违反官方的版权,就不公开在这里啦,需要的老师可以单独交流。 |
|