Skip to content

Commit d2be861

Browse files
committed
User edit: Only admin can change status to admin
1 parent d501af7 commit d2be861

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: main/admin/user_edit.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,12 @@ function confirmation(name) {
421421
$phone = $user['phone'];
422422
$username = isset($user['username']) ? $user['username'] : $userInfo['username'];
423423
$status = (int) $user['status'];
424-
$platform_admin = (int) $user['platform_admin'];
424+
$platform_admin = 0;
425+
// Only platform admin can change user status to admin.
426+
if (api_is_platform_admin()) {
427+
$platform_admin = (int) $user['platform_admin'];
428+
}
429+
425430
$send_mail = (int) $user['send_mail'];
426431
$reset_password = (int) $user['reset_password'];
427432
$hr_dept_id = isset($user['hr_dept_id']) ? intval($user['hr_dept_id']) : null;

0 commit comments

Comments
 (0)