ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-7483

User can become without group after deleting user group.

    Details

    • Type: Incident report Incident report
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.2rc1, 2.3.0
    • Component/s: Frontend (F)
    • Labels:
      None

      Activity

      Hide
      Eduards Samersovs (Inactive) added a comment -

      Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-7483

      Show
      Eduards Samersovs (Inactive) added a comment - Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-7483
      Hide
      Pavels Jelisejevs (Inactive) added a comment - - edited

      (1) When I try to delete a the last user group of a user:

      
      Argument 1 passed to CUserGroup::delete() must be an array, string given [usergrps.php:198 → CAPIObject->delete() → CAPIObject->__call() → czbxrpc::call() → czbxrpc::callAPI() → call_user_func() → CUserGroup->delete() in /opt/lampp/htdocs/zabbix/2.2/frontends/php/api/classes/CUserGroup.php:591]
      User group "0" is used in user "asdf". [usergrps.php:198 → CAPIObject->delete() → CAPIObject->__call() → czbxrpc::call() → czbxrpc::callAPI() → call_user_func() → CUserGroup->delete() → CUserGroup->validateDelete() → CZBXAPI::exception() in /opt/lampp/htdocs/zabbix/2.2/frontends/php/api/classes/CUserGroup.php:692]
      

      And another when trying to delete a user groups that's used in a script:

      Undefined variable: dbUserGroup [usergrps.php:226 → CAPIObject->delete() → CAPIObject->__call() → czbxrpc::call() → czbxrpc::callAPI() → call_user_func() → CUserGroup->delete() → CUserGroup->validateDelete() in /opt/lampp/htdocs/zabbix/2.2/frontends/php/api/classes/CUserGroup.php:656]
      User group "" is used in script "Detect operating system44". [usergrps.php:226 → CAPIObject->delete() → CAPIObject->__call() → czbxrpc::call() → czbxrpc::callAPI() → call_user_func() → CUserGroup->delete() → CUserGroup->validateDelete() → CZBXAPI::exception() in /opt/lampp/htdocs/zabbix/2.2/frontends/php/api/classes/CUserGroup.php:658]
      

      Please make sure that no such errors appear in other cases.

      Eduards Samersovs RESOLVED r.41033

      Pavels Jelisejevs CLOSED.

      Show
      Pavels Jelisejevs (Inactive) added a comment - - edited (1) When I try to delete a the last user group of a user: Argument 1 passed to CUserGroup::delete() must be an array, string given [usergrps.php:198 → CAPIObject->delete() → CAPIObject->__call() → czbxrpc::call() → czbxrpc::callAPI() → call_user_func() → CUserGroup->delete() in /opt/lampp/htdocs/zabbix/2.2/frontends/php/api/classes/CUserGroup.php:591] User group "0" is used in user "asdf" . [usergrps.php:198 → CAPIObject->delete() → CAPIObject->__call() → czbxrpc::call() → czbxrpc::callAPI() → call_user_func() → CUserGroup->delete() → CUserGroup->validateDelete() → CZBXAPI::exception() in /opt/lampp/htdocs/zabbix/2.2/frontends/php/api/classes/CUserGroup.php:692] And another when trying to delete a user groups that's used in a script: Undefined variable: dbUserGroup [usergrps.php:226 → CAPIObject->delete() → CAPIObject->__call() → czbxrpc::call() → czbxrpc::callAPI() → call_user_func() → CUserGroup->delete() → CUserGroup->validateDelete() in /opt/lampp/htdocs/zabbix/2.2/frontends/php/api/classes/CUserGroup.php:656] User group "" is used in script " Detect operating system44". [usergrps.php:226 → CAPIObject->delete() → CAPIObject->__call() → czbxrpc::call() → czbxrpc::callAPI() → call_user_func() → CUserGroup->delete() → CUserGroup->validateDelete() → CZBXAPI::exception() in /opt/lampp/htdocs/zabbix/2.2/frontends/php/api/classes/CUserGroup.php:658] Please make sure that no such errors appear in other cases. Eduards Samersovs RESOLVED r.41033 Pavels Jelisejevs CLOSED.
      Hide
      Pavels Jelisejevs (Inactive) added a comment - - edited

      (2) Regarding the changes in CUserGroup.php:

      • "editable" is a flag parameter, not boolean: it should be compared to null;
      • the else clause and the if clause inside of it in the permission checking code can be combined into a single elseif clause.
      • in CUserGroup::delete() there's no need for $userGroupIds = zbx_toArray($userGroupIds); since the method can only accept arrays.

      Eduards Samersovs RESOLVED r.41033

      Pavels Jelisejevs I've made a minor change in r41058. CLOSED.

      Eduards Samersovs Thanks, CLOSED!

      Show
      Pavels Jelisejevs (Inactive) added a comment - - edited (2) Regarding the changes in CUserGroup.php: "editable" is a flag parameter, not boolean: it should be compared to null; the else clause and the if clause inside of it in the permission checking code can be combined into a single elseif clause. in CUserGroup::delete() there's no need for $userGroupIds = zbx_toArray($userGroupIds); since the method can only accept arrays. Eduards Samersovs RESOLVED r.41033 Pavels Jelisejevs I've made a minor change in r41058. CLOSED. Eduards Samersovs Thanks, CLOSED!
      Hide
      Pavels Jelisejevs (Inactive) added a comment - - edited

      I've made a correction to the error message in r41059. Please review.

      Otherwise, TESTED.

      Show
      Pavels Jelisejevs (Inactive) added a comment - - edited I've made a correction to the error message in r41059. Please review. Otherwise, TESTED.
      Hide
      Eduards Samersovs (Inactive) added a comment -

      Fixed in versions 2.3.0 (trunk) r.41065, 2.2.2rc1 r.41064

      Show
      Eduards Samersovs (Inactive) added a comment - Fixed in versions 2.3.0 (trunk) r.41065, 2.2.2rc1 r.41064

        People

        • Assignee:
          Unassigned
          Reporter:
          Eduards Samersovs (Inactive)
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: