Skip to content

Commit 132df21

Browse files
author
Till Brehm
committed
Prevent that the type of a sys_user that belongs to a client or reseller can be changed to admin.
1 parent 08462d0 commit 132df21

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

interface/web/admin/lib/lang/en_users.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ $wb['repeat_password_txt'] = 'Repeat Password';
3030
$wb['password_mismatch_txt'] = 'The passwords do not match.';
3131
$wb['password_match_txt'] = 'The passwords do match.';
3232
$wb['username_error_collision'] = 'The username may not be web or web plus a number."';
33+
$wb['client_not_admin_err'] = 'A user that belongs to a client can not be set to type: admin';
3334
?>

interface/web/admin/users_edit.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,14 @@ function onBeforeUpdate() {
6666
if(@is_array($this->dataRecord['modules']) && !in_array($this->dataRecord['startmodule'], $this->dataRecord['modules'])) {
6767
$app->tform->errorMessage .= $app->tform->wordbook['startmodule_err'];
6868
}
69+
6970
$this->oldDataRecord = $app->tform->getDataRecord($this->id);
71+
72+
//* A user that belongs to a client record (client or reseller) may not have typ admin
73+
if(isset($this->dataRecord['typ']) && $this->dataRecord['typ'][0] == 'admin' && $this->oldDataRecord['client_id'] > 0) {
74+
$app->tform->errorMessage .= $app->tform->wordbook['client_not_admin_err'];
75+
}
76+
7077
}
7178

7279
/*

0 commit comments

Comments
 (0)