Beispiel #1
0
/**
 * removes user from a group
 *
 * @api
 *
 * @param   int $group_id group id
 * @param   int $user_id  user_id
 *
 * @return  bool                    on success TRUE/FALSE
 */
function ace_group_remove_user($group_id, $user_id)
{
    $success = ace_db_group_remove_user($group_id, $user_id);
    $user_groups = ace_user_get_groups($user_id);
    if (count($user_groups) == 1) {
        $user_security_level = ace_user_get_security_level($user_id);
        if ($user_security_level == 3) {
            ace_user_delete($user_id);
        }
    }
    return $success ? TRUE : FALSE;
}
Beispiel #2
0
     $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':
     if ($_POST['quota_id']) {
         $quota_id = $_POST['quota_id'];
         $object_type = $_POST['object_type'];
         $object_id = $_POST['object_id'];
         $labs = $_POST['labs'];
         $vms = $_POST['vms'];
         $vcpu = $_POST['vcpu'];