plainblack.com
Username Password
search
Bookmark and Share
View All Tickets
Secondary Admin can create user with Admin Privilege  (#3471)
IssueI want Secondary Admins to only add users to groups they're a member of? They just can't give "Admin privilege" if he himself is not a member of it. .. Make
Solution Summary
Comments
blacksilver
0
11/26/2007 1:57 pm

I found a solution for this.

here is the modification code at file /WebGUI/lib/WebGUI/Operation/User.pm

at line: 406 

    my @groupsToAdd = $session->form->group("groupsToAdd");
    my @exclude = $session->db->buildArray("select groupId from groupings where userId=".$session->db->quote($u->userId));
    @exclude = (@exclude,"1","2","7");
    $tabform->getTab("groups")->group(
        -name=>"groupsToAdd",
        -label=>$i18n->get("groups to add"),
        -excludeGroups=>\@exclude,
        -size=>15,
        -multiple=>1,
        -value=>\@groupsToAdd
        );


with
    my @groupsToAdd = $session->form->group("groupsToAdd");
        my @admin = $session->db->buildArray("select 'Admin' from groupings where userId=? and groupId = '3'",[$session->user->userId]);
        my @secondaryAdmin = $session->db->buildArray("select 'Secondary Admin' from groupings
                where userId=? and groupId = '11'",[$session->user->userId]);

        my @exclude = $session->db->buildArray("select groupId from groupings where userId=".$session->db->quote($u->userId));
        @exclude = (@exclude,"1","2","7");
        my @extraExclude;
        if ($admin[0] ne "Admin" && $secondaryAdmin[0] eq "Secondary Admin"){
                @extraExclude = $session->db->buildArray("select groupId from groups where groupId not in
                        (select groupId from groupings where userId = ?)",[$session->user->userId]);
                @extraExclude = (@extraExclude,@exclude);
        }
        else {
                @extraExclude = (@exclude);
        }


        $tabform->getTab("groups")->group(
                -name=>"groupsToAdd",
                -label=>$i18n->get("groups to add"),
                -excludeGroups=>\@extraExclude,
                -size=>15,
                -multiple=>1,
                -value=>\@groupsToAdd
                );

JT
0
12/6/2007 12:04 pm
That's the way this is supposed to already be. Moving it to the bugs
perlDreamer
0
12/11/2007 3:05 pm

Fixed in 7.4.18.

Since you provided a patch, we'd like to credit you for your work.  If you'll reply to this bug with your real name (and/or company), we'll add it to the changelog.

Details
Ticket Status Closed  
Rating0.0 
Submitted Byblacksilver 
Date Submitted2007-11-21 
Assigned To unassigned  
Date Assigned2010-03-16 
Assigned By 
Severity  
What's the bug in?  
WebGUI / WRE Version  
URLrfe/request-for-enhancement/secondary-admin-can-create-user-with-admin-privilege
Keywords
Ticket History
© 2010 Plain Black Corporation | All Rights Reserved