if ($new) {
    // restart user search
} elseif ($userid) {
    if ($userid[0] == 'g') {
        $gid = substr($userid, 1);
        $group = sotf_Group::getById($gid);
        $users[$userid] = $group->get('name');
        $smarty->assign("USERS", $users);
    } else {
        $username = sotf_User::getUsername($userid);
        $users[$userid] = $username;
        $smarty->assign("USERS", $users);
    }
} elseif ($pattern) {
    $smarty->assign("PATTERN", $pattern);
    $users = sotf_User::findUsers($pattern, $prefix);
    debug("USERS", $users);
    $groups = sotf_Group::findGroups($pattern, $prefix);
    debug("GROUPS", $groups);
    if (count($users) + count($groups) > 50) {
        $smarty->assign("TOO_MANY_MATCHES", count($users) + count($groups));
    } elseif (empty($users) and empty($groups)) {
        $smarty->assign("NO_MATCHES", 1);
    } else {
        $smarty->assign("USERS", $users);
        $smarty->assign("GROUPS", $groups);
    }
}
checkPerm($objectid, "authorize");
if ($save) {
    if ($userid == $user->id) {
Esempio n. 2
0
        $install_color[$id] = $install_green;
    }
}
PrintTitle($id);
print '<DIV ALIGN="center"><BR />
	<INPUT type="submit" name="delete_topic" value="Delete vocabularies">
	<INPUT type="submit" name="create_topic" value="Create vocabularies (topic tree, genres, roles)">
	</DIV>';
PrintButton($id);
////////////////////////// Test 8
$id = 8;
if (RunTest($id, "Node administrator", 7)) {
    dbug("TEST 8");
    require_once "../init.inc.php";
    // this will most probably cause an error if the connector class is configured properly!
    $res = sotf_User::findUsers("a");
    $res = NULL;
    $adminId = $db->getOne("SELECT user_id FROM sotf_user_permissions WHERE object_id='node' AND permission_id='1'");
    if (!$adminId && $admin_name && $admin_pass) {
        if (!sotf_User::getUserid($admin_name)) {
            // let's register the new admin user
            $error = sotf_User::register($admin_pass, $admin_name, '', 'en', '');
        }
        if (!$error) {
            $error = sotf_User::login($admin_name, $admin_pass);
        }
        if ($error) {
            $install_test_result[$id] = "Invalid username or password";
            $install_color[$id] = $install_red;
            //trigger_error("Invalid username or password");
        } else {