} if ($admin_controller->Check_User_Name_For_Edit($User_Name, $User_ID)) { admin_redirect_error(Error_Type::SAME_USER_NAME); } /** * if there is no error */ if (empty($errors)) { /** * instantiate a new user */ $new_user = new User($User_Name, $New_Password); $new_user->setUserID($User_ID); /** * Edit the user and a new user will be returned if the user is updated */ $edited = $admin_controller->Admin_Edit_Profile($new_user); /** * inform the admin about the result */ if ($edited) { admin_redirect_success(); } else { admin_redirect_error(Error_Type::DATA_BASE); } } else { admin_redirect_error(Error_Type::FORM); } } } }