Beispiel #1
0
// 4.0 User Identity and Roles
if (isset($user_id)) {
    mark_pass("4.1", "Sends user_id");
}
if (isset($roles)) {
    $therole = instructor_or_learner($roles);
    if ($therole == 'Learner') {
        mark_pass("4.2", "Sends Learner role");
    } else {
        if ($therole == 'Instructor') {
            mark_pass("4.3", "Sends Istructor role");
        } else {
            // Might want to get grouchy here...
        }
    }
    $notes = check_roles($roles);
    if (count($notes) > 0) {
        mark_fail("4.4", "Bad roles format");
        echo "<p>Your roles string is in error:</p>\n";
        echo "<pre>\n{$roles}\n\n";
        foreach ($notes as $key => $value) {
            echo $key . ' => ' . $value . "\n";
        }
        echo "</pre>";
    }
}
$good_name = false;
if (isset($_REQUEST['lis_person_name_given']) and isset($_REQUEST['lis_person_name_family']) or isset($_REQUEST['lis_person_name_full'])) {
    $good_name = true;
}
if ($good_name and isset($_REQUEST['lis_person_contact_email_primary'])) {
Beispiel #2
0
$hidden_vars['current_tab'] = $_GET['current_tab'];
$hidden_vars['gid'] = abs($_GET['gid']);
$hidden_vars['course_id'] = $course_id;
//get usernames of users about to be edited
$str = get_usernames($member_ids);
//Print appropriate confirm msg for action
if ($_GET['func'] == 'remove') {
    $confirm = array('REMOVE_STUDENT', $str);
    $msg->addConfirm($confirm, $hidden_vars);
} else {
    if ($_GET['func'] == 'enroll') {
        $confirm = array('ENROLL_STUDENT', $str);
        $msg->addConfirm($confirm, $hidden_vars);
    } else {
        if ($_GET['func'] == 'unenroll') {
            if (check_roles($member_ids) == 1) {
                $confirm = array('UNENROLL_PRIV', $str);
                $msg->addConfirm($confirm, $hidden_vars);
            } else {
                $confirm = array('UNENROLL_STUDENT', $str);
                $msg->addConfirm($confirm, $hidden_vars);
            }
        } else {
            if ($_GET['func'] == 'alumni') {
                $confirm = array('ALUMNI', $str);
                $msg->addConfirm($confirm, $hidden_vars);
            } else {
                if ($_GET['func'] == 'group') {
                    $sql = "SELECT title FROM " . TABLE_PREFIX . "groups WHERE group_id=" . $hidden_vars['gid'];
                    $result = mysql_query($sql, $db);
                    $row = mysql_fetch_assoc($result);