admin password hotfix
This commit is contained in:
@@ -135,16 +135,29 @@ class user {
|
||||
|
||||
public static function update_user($_name, $_helper, $_password, $_ua_id) {
|
||||
global $sql;
|
||||
return $sql->update_table('user_coach',
|
||||
array(
|
||||
'ua_name' => $_name,
|
||||
'ua_helper' => $_helper,
|
||||
'ua_password' => $_password
|
||||
),
|
||||
array(
|
||||
'ua_id' => $_ua_id
|
||||
)
|
||||
);
|
||||
if ($_password != "-1") {
|
||||
return $sql->update_table('user_coach',
|
||||
array(
|
||||
'ua_name' => $_name,
|
||||
'ua_helper' => $_helper,
|
||||
'ua_password' => $_password
|
||||
),
|
||||
array(
|
||||
'ua_id' => $_ua_id
|
||||
)
|
||||
);
|
||||
}
|
||||
else {
|
||||
return $sql->update_table('user_coach',
|
||||
array(
|
||||
'ua_name' => $_name,
|
||||
'ua_helper' => $_helper
|
||||
),
|
||||
array(
|
||||
'ua_id' => $_ua_id
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -142,9 +142,12 @@ if (isset($_POST['action'])) {
|
||||
break;
|
||||
case 'coach_data_edit':
|
||||
# edző update
|
||||
if (isset($_POST['ua_can_login']) && !empty($_POST['ua_can_login'])) {
|
||||
if (isset($_POST['ua_can_login']) && !empty($_POST['ua_can_login']) && !empty($_POST['ua_password'])) {
|
||||
$psw = md5($_POST['ua_password']);
|
||||
}
|
||||
elseif (isset($_POST['ua_can_login']) && !empty($_POST['ua_can_login']) && empty($_POST['ua_password'])) {
|
||||
$psw = "-1"; //ez jelzi h nem szabad updatelni
|
||||
}
|
||||
else {
|
||||
$psw = "null";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user