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:

save.php
40 40
}
41 41

  
42 42
// Gather details entered
43
$group_id = $admin->get_post('group');
43
$groups_id = implode(",", $_POST['groups']);
44 44
$active = $_POST['active'][0];
45 45
$username_fieldname = $admin->get_post('username_fieldname');
46 46
$username = strtolower($admin->get_post($username_fieldname));
......
54 54
$js_back = "javascript: history.go(-1);";
55 55

  
56 56
// Check values
57
if($group_id == "") {
57
if($groups_id == "") {
58 58
	$admin->print_error($MESSAGE['USERS']['NO_GROUP'], $js_back);
59 59
}
60 60
if(strlen($username) < 2) {
......
83 83

  
84 84
// Update the database
85 85
if($password == "") {
86
	$query = "UPDATE ".TABLE_PREFIX."users SET group_id = '$group_id', active = '$active'$username_code, display_name = '$display_name', home_folder = '$home_folder', email = '$email' WHERE user_id = '$user_id'";
86
	$query = "UPDATE ".TABLE_PREFIX."users SET groups_id = '$groups_id', active = '$active'$username_code, display_name = '$display_name', home_folder = '$home_folder', email = '$email' WHERE user_id = '$user_id'";
87 87
} else {
88 88
	// MD5 supplied password
89 89
	$md5_password = md5($password);
90
	$query = "UPDATE ".TABLE_PREFIX."users SET group_id = '$group_id', active = '$active'$username_code, display_name = '$display_name', home_folder = '$home_folder', email = '$email', password = '$md5_password' WHERE user_id = '$user_id'";
90
	$query = "UPDATE ".TABLE_PREFIX."users SET groups_id = '$groups_id', active = '$active'$username_code, display_name = '$display_name', home_folder = '$home_folder', email = '$email', password = '$md5_password' WHERE user_id = '$user_id'";
91 91
}
92 92
$database->query($query);
93 93
if($database->is_error()) {

Also available in: Unified diff