admin password hotfix

This commit is contained in:
Ricsi
2016-12-07 15:58:20 +01:00
parent 8350c1f546
commit 08627484da
2 changed files with 27 additions and 11 deletions

View File

@@ -135,16 +135,29 @@ class user {
public static function update_user($_name, $_helper, $_password, $_ua_id) { public static function update_user($_name, $_helper, $_password, $_ua_id) {
global $sql; global $sql;
return $sql->update_table('user_coach', if ($_password != "-1") {
array( return $sql->update_table('user_coach',
'ua_name' => $_name, array(
'ua_helper' => $_helper, 'ua_name' => $_name,
'ua_password' => $_password 'ua_helper' => $_helper,
), 'ua_password' => $_password
array( ),
'ua_id' => $_ua_id array(
) 'ua_id' => $_ua_id
); )
);
}
else {
return $sql->update_table('user_coach',
array(
'ua_name' => $_name,
'ua_helper' => $_helper
),
array(
'ua_id' => $_ua_id
)
);
}
} }
} }

View File

@@ -142,9 +142,12 @@ if (isset($_POST['action'])) {
break; break;
case 'coach_data_edit': case 'coach_data_edit':
# edző update # 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']); $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 { else {
$psw = "null"; $psw = "null";
} }