示例#1
0
         $group_name = ace_group_get_name_by_id($group_id);
         $user_id = $_POST['user_id'];
         $user_name = ace_user_get_name_by_id($user_id);
         $success = ace_group_remove_user($group_id, $user_id);
         $messages[] = create_message($success, 'removing ' . $user_name . ' from ' . $group_name . ' group');
     } else {
         $messages[] = create_message(FALSE, "removing member from group, no user_id specified");
     }
     break;
 case 'group_user_update':
     if ($_POST['user_id']) {
         $user_id = $_POST['user_id'];
         $user_name = $_POST['user_email'];
         $user_first = $_POST['user_first'];
         $user_last = $_POST['user_last'];
         $success = ace_user_update($user_id, $user_name, $user_first, $user_last);
         if ($success) {
             $message = create_message($success, 'User updated');
         } else {
             $message = create_message($success, 'User NOT updated');
         }
     } else {
         $message = create_message(FALSE, "updating user, no user_id specified");
     }
     break;
 case 'group_user_reset_password':
     $group_id = $_POST['group_id'];
     $group_name = ace_group_get_name_by_id($group_id);
     $user_id = $_POST['user_id'];
     $user_name = ace_user_get_name_by_id($user_id);
     $new_password = ace_user_reset_password($user_id);
示例#2
0
     $new_user_state = $current_user_state ? FALSE : TRUE;
     $success = ace_user_set_state($user_id, $new_user_state);
     $messages[] = create_message($success, ($new_user_state ? 'activating ' : 'deactivating ') . 'user (' . $user_name . ')');
     break;
 case 'user_create':
     $user_id = ace_user_create($_POST['user_email'], $_POST['user_first'], $_POST['user_last']);
     $success = $user_id !== FALSE ? TRUE : FALSE;
     $messages[] = create_message($success, 'creating user (' . $_POST['user_email'] . ')');
     break;
 case 'user_update':
     if ($_POST['user_id']) {
         $user_id = $_POST['user_id'];
         $user_email = $_POST['user_email'];
         $user_first = $_POST['user_first'];
         $user_last = $_POST['user_last'];
         $success = ace_user_update($user_id, $user_email, $user_first, $user_last);
         $messages[] = create_message($success, 'updating user (' . $user_email . ')');
     }
     break;
 case 'user_delete':
     $user_id = $_POST['user_id'];
     $user_email = ace_user_get_name_by_id($user_id);
     $success = ace_user_delete($user_id);
     $messages[] = create_message($success, 'deleting user (' . $user_email . ')');
     break;
 case 'quota_create':
     $quota_id = ace_quota_create($_POST['object_type'], $_POST['object_id'], $_POST['labs'], $_POST['vms'], $_POST['vcpu'], $_POST['memory'], $_POST['networks'], $_POST['volumes'], $_POST['storage']);
     $success = $quota_id !== FALSE ? TRUE : FALSE;
     $messages[] = create_message($success, 'creating quota');
     break;
 case 'quota_update':