Skip to content

Commit

Permalink
User edit: Only admin can change status to admin
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Aug 18, 2021
1 parent d501af7 commit d2be861
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main/admin/user_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,12 @@ function confirmation(name) {
$phone = $user['phone'];
$username = isset($user['username']) ? $user['username'] : $userInfo['username'];
$status = (int) $user['status'];
$platform_admin = (int) $user['platform_admin'];
$platform_admin = 0;
// Only platform admin can change user status to admin.
if (api_is_platform_admin()) {
$platform_admin = (int) $user['platform_admin'];
}

$send_mail = (int) $user['send_mail'];
$reset_password = (int) $user['reset_password'];
$hr_dept_id = isset($user['hr_dept_id']) ? intval($user['hr_dept_id']) : null;
Expand Down

0 comments on commit d2be861

Please sign in to comment.