Esempio n. 1
0
if (isset($_REQUEST['search_course'])) {
    //echo "<p><strong>".get_lang('SearchResultsFor')." ".api_htmlentities($_POST['search_term'], ENT_QUOTES, api_get_system_encoding())."</strong><br />";
    if ($ctok == $_REQUEST['sec_token']) {
        $courses_controller->search_courses($_REQUEST['search_term'], null, null, null, $limit);
    }
}
// Subscribe user to course
if (isset($_REQUEST['subscribe_course'])) {
    if ($ctok == $_GET['sec_token']) {
        $courses_controller->subscribe_user($_GET['subscribe_course'], $_GET['search_term'], $_GET['category_code']);
    }
}
// We are unsubscribing from a course (=Unsubscribe from course).
if (isset($_GET['unsubscribe'])) {
    if ($ctok == $_GET['sec_token']) {
        $courses_controller->unsubscribe_user_from_course($_GET['unsubscribe'], $_GET['search_term'], $_GET['category_code']);
        //$message = remove_user_from_course($_user['user_id'], $_POST['unsubscribe']);
    }
}
// We are unsubscribing from a course (=Unsubscribe from course).
if (isset($_POST['unsubscribe'])) {
    if ($ctok == $_POST['sec_token']) {
        $courses_controller->unsubscribe_user_from_course($_POST['unsubscribe']);
        //$message = remove_user_from_course($_user['user_id'], $_POST['unsubscribe']);
    }
}
switch ($action) {
    case 'subscribe_user_with_password':
        $courses_controller->subscribe_user($_POST['subscribe_user_with_password'], $_POST['search_term'], $_POST['category_code']);
        exit;
        break;
Esempio n. 2
0
if (isset($_REQUEST['search_course'])) {
    if ($ctok == $_REQUEST['sec_token']) {
        $courses_controller->search_courses($_REQUEST['search_term'], null, null, null, $limit);
    }
}
// Subscribe user to course
if (isset($_REQUEST['subscribe_course'])) {
    if ($ctok == $_GET['sec_token']) {
        $courses_controller->subscribe_user($_GET['subscribe_course'], $_GET['search_term'], $categoryCode);
    }
}
// We are unsubscribing from a course (=Unsubscribe from course).
if (isset($_GET['unsubscribe'])) {
    $search_term = isset($_GET['search_term']) ? $_GET['search_term'] : null;
    if ($ctok == $_GET['sec_token']) {
        $courses_controller->unsubscribe_user_from_course($_GET['unsubscribe'], $search_term, $categoryCode);
        //$message = remove_user_from_course($_user['user_id'], $_POST['unsubscribe']);
    }
}
// We are unsubscribing from a course (=Unsubscribe from course).
if (isset($_POST['unsubscribe'])) {
    if ($ctok == $_POST['sec_token']) {
        $courses_controller->unsubscribe_user_from_course($_POST['unsubscribe']);
        //$message = remove_user_from_course($_user['user_id'], $_POST['unsubscribe']);
    }
}
switch ($action) {
    case 'subscribe_user_with_password':
        $courses_controller->subscribe_user(isset($_POST['subscribe_user_with_password']) ? $_POST['subscribe_user_with_password'] : '', isset($_POST['search_term']) ? $_POST['search_term'] : '', isset($_POST['category_code']) ? $_POST['category_code'] : '');
        break;
    case 'createcoursecategory':