This is a PATCH for a bug in creating user accounts
under version 1.9.2.
This problem affects both the web interface and the APIs.
The 2 possible bugs I fixed in order to get user account
creation to work are:
1. In the file "users.php" CHANGE ON line 158
API::User()->create($user)
call expects the field name
$user['usergrps']
instead of field name
$user['usrgrps']
I need to change
$user['usrgrps'] = $usrgrps;
to
$user['usergrps'] = $usrgrps;
to get it to work.
2. In the file "class.cuser.php" INSERT ABOVE line 520
If EXACTLY one media (instead of 0 or >=2) is supplied to
$user['user_medias']
then it would not work.
I fixed it by adding a line to normalise the array:
$user['user_medias'] = zbx_toArray($user['user_medias']);
just ABOVE the line 520. So above:
foreach($user['user_medias'] as $media_data) {
under version 1.9.2.
This problem affects both the web interface and the APIs.
The 2 possible bugs I fixed in order to get user account
creation to work are:
1. In the file "users.php" CHANGE ON line 158
API::User()->create($user)
call expects the field name
$user['usergrps']
instead of field name
$user['usrgrps']
I need to change
$user['usrgrps'] = $usrgrps;
to
$user['usergrps'] = $usrgrps;
to get it to work.
2. In the file "class.cuser.php" INSERT ABOVE line 520
If EXACTLY one media (instead of 0 or >=2) is supplied to
$user['user_medias']
then it would not work.
I fixed it by adding a line to normalise the array:
$user['user_medias'] = zbx_toArray($user['user_medias']);
just ABOVE the line 520. So above:
foreach($user['user_medias'] as $media_data) {
Comment