Revision 546
Added by doc almost 17 years ago
add.php | ||
---|---|---|
32 | 32 |
$database = new database(); |
33 | 33 |
|
34 | 34 |
// Get details entered |
35 |
$group_id = $admin->get_post('group');
|
|
35 |
$groups_id = implode(",", $_POST['groups']); //should check permissions
|
|
36 | 36 |
$active = $_POST['active'][0]; |
37 | 37 |
$username_fieldname = $admin->get_post('username_fieldname'); |
38 | 38 |
$username = strtolower($admin->get_post($username_fieldname)); |
... | ... | |
46 | 46 |
$js_back = "javascript: history.go(-1);"; |
47 | 47 |
|
48 | 48 |
// Check values |
49 |
if($group_id == "") { |
|
49 |
if($groups_id == "") {
|
|
50 | 50 |
$admin->print_error($MESSAGE['USERS']['NO_GROUP'], $js_back); |
51 | 51 |
} |
52 | 52 |
if(strlen($username) < 2) { |
... | ... | |
84 | 84 |
$md5_password = md5($password); |
85 | 85 |
|
86 | 86 |
// Inser the user into the database |
87 |
$query = "INSERT INTO ".TABLE_PREFIX."users (group_id,active,username,password,display_name,home_folder,email,timezone) VALUES ('$group_id', '$active', '$username','$md5_password','$display_name','$home_folder','$email','-72000')";
|
|
87 |
$query = "INSERT INTO ".TABLE_PREFIX."users (groups_id,active,username,password,display_name,home_folder,email,timezone) VALUES ('$groups_id', '$active', '$username','$md5_password','$display_name','$home_folder','$email','-72000')";
|
|
88 | 88 |
$database->query($query); |
89 | 89 |
if($database->is_error()) { |
90 | 90 |
$admin->print_error($database->get_error()); |
Also available in: Unified diff
added the "users in multiple groups" feature (closes parts of ticket #546)