Пример #1
0
function auth($update = false)
{
    global $success, $errors, $authmech, $lti;
    $returnedproc = login_processing(false);
    list($success, $errors) = $returnedproc;
    if ($success && empty($errors)) {
        if ($update) {
            $lti->update_lti_user();
        } else {
            $lti->add_lti_user($authmech->getUsername());
        }
        login_processing2();
        //sucessfull authentication
    } else {
        html_headers();
        login_prompt($errors, '../');
    }
}
Пример #2
0
     }
     $lti->init_lti();
 }
 if ($lti->valid) {
     $success = true;
     unset($errors);
 } else {
     $returnedproc = login_processing(false);
     list($success, $errors) = $returnedproc;
 }
 if ($success && empty($errors)) {
     //sucessfull authentication
     db_query("UPDATE {$xerte_toolkits_site->database_table_prefix}templatedetails SET number_of_uses=number_of_uses+1 WHERE template_id=?", array($safe_template_id));
     show_template($row_play);
 } else {
     html_headers();
     login_prompt($errors);
 }
 /*
  * Check the password
  */
 /*        $auth = Xerte_Authentication_Factory::create($xerte_toolkits_site->authentication_method);
         if ($auth->check() && isset($_POST['login']) && isset($_POST['password']) && $auth->login($_POST['login'], $_POST['password'])) {
 
             /*
              * Update uses and display the template
              *-/
 
             db_query("UPDATE {$xerte_toolkits_site->database_table_prefix}templatedetails SET number_of_uses=number_of_uses+1 WHERE template_id=?", array($safe_template_id));
 
             require $xerte_toolkits_site->root_file_path . "modules/" . $row_play['template_framework'] . "/play.php";