Ad Widget

Collapse

patch for user creation bug in 1.9.2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • grizzlysmit
    Junior Member
    • Jul 2010
    • 3

    #1

    patch for user creation bug in 1.9.2

    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) {
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    tracked at https://support.zabbix.com/browse/ZBX-3639
    Zabbix 3.0 Network Monitoring book

    Comment

    • grizzlysmit
      Junior Member
      • Jul 2010
      • 3

      #3
      thats sort of similar but

      unless there's a typo in the bug report not quite the same, I guess the typo theory would be right as it's so similar and in the same bit of code, anything else is a bit far fetched. so looks like it's under control.

      Comment

      Working...