Skip to content

Commit

Permalink
[B] Editing user giving error, the email already existing (admin panel)
Browse files Browse the repository at this point in the history
  • Loading branch information
lianglee committed Mar 25, 2024
1 parent 4fa6711 commit e160907
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions actions/administrator/user/edit.php
Expand Up @@ -61,19 +61,19 @@
$user->new_type = $vars['type'];

//check if email is not in user
if($entity->email !== input('email')) {
if($user->email !== input('email')) {
$OssnUser = new OssnUser();
$OssnUser->email = $vars['email'];

if($OssnUser->isOssnEmail()) {
ossn_trigger_message(ossn_print('email:inuse'), 'error');
redirect(REF);
}
}
//check if email is valid email
if(!$OssnUser->isEmail()) {
ossn_trigger_message(ossn_print('email:invalid'), 'error');
redirect(REF);
//check if email is valid email
if(!$OssnUser->isEmail()) {
ossn_trigger_message(ossn_print('email:invalid'), 'error');
redirect(REF);
}
}
//check if password then change password
if(!empty($password)) {
Expand All @@ -98,4 +98,4 @@
ossn_trigger_message(ossn_print('user:updated'), 'success');
redirect(REF);
}
redirect(REF);
redirect(REF);

0 comments on commit e160907

Please sign in to comment.