Project

General

Profile

« Previous | Next » 

Revision 546

Added by doc almost 17 years ago

added the "users in multiple groups" feature (closes parts of ticket #546)

View differences:

users.php
77 77
		while($group = $results->fetchRow()) {
78 78
			$template->set_var('ID', $group['group_id']);
79 79
			$template->set_var('NAME', $group['name']);
80
			if($user['group_id'] == $group['group_id']) {
80
			if(in_array($group['group_id'], split(",",$user['groups_id']))) {
81 81
				$template->set_var('SELECTED', 'selected');
82 82
			} else {
83 83
				$template->set_var('SELECTED', '');
......
86 86
		}
87 87
	}
88 88
	// Only allow the user to add a user to the Administrators group if they belong to it
89
	if($admin->get_group_id() == 1) {
89
	if(in_array(1, $admin->get_groups_id())) {
90 90
		$template->set_var('ID', '1');
91
		$template->set_var('NAME', $admin->get_group_name());
92
		if($user['group_id'] == $admin->get_group_id()) {
91
		$users_groups = $admin->get_groups_name();
92
		$template->set_var('NAME', $users_groups[1]);
93
		
94
		$in_group = FALSE;
95
		foreach($admin->get_groups_id() as $cur_gid){
96
		    if (in_array($cur_gid, split(",", $user['groups_id']))) {
97
		        $in_group = TRUE;
98
		    }
99
		}
100

  
101
		if($in_group) {
93 102
			$template->set_var('SELECTED', 'selected');
94 103
		} else {
95 104
			$template->set_var('SELECTED', '');

Also available in: Unified diff