[ZBX-7483] User can become without group after deleting user group. Created: 2013 Dec 04  Updated: 2017 May 30  Resolved: 2013 Dec 16

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.2.0
Fix Version/s: 2.2.2rc1, 2.3.0

Type: Incident report Priority: Minor
Reporter: Eduards Samersovs (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Comments   
Comment by Eduards Samersovs (Inactive) [ 2013 Dec 06 ]

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

Comment by Pavels Jelisejevs (Inactive) [ 2013 Dec 16 ]

(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 RESOLVED r.41033

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2013 Dec 16 ]

(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 RESOLVED r.41033

jelisejev I've made a minor change in r41058. CLOSED.

Eduards Thanks, CLOSED!

Comment by Pavels Jelisejevs (Inactive) [ 2013 Dec 17 ]

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

Otherwise, TESTED.

Comment by Eduards Samersovs (Inactive) [ 2013 Dec 17 ]

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

Generated at Fri Mar 29 10:14:27 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.