login MDL-19800 Upgrade deprecated calls and added set_url calls

This commit is contained in:
samhemelryk 2009-09-29 03:55:09 +00:00
parent eb5334ff48
commit 8570cff01f
7 changed files with 592 additions and 497 deletions

View file

@ -1,10 +1,39 @@
<?PHP // $Id$ <?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file is part of the login section Moodle
*
* @copyright 1999 Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package login
*/
require_once('../config.php'); require_once('../config.php');
require_once('change_password_form.php'); require_once('change_password_form.php');
$id = optional_param('id', SITEID, PARAM_INT); // current course $id = optional_param('id', SITEID, PARAM_INT); // current course
$url = new moodle_url($CFG->wwwroot.'/login/change_password.php');
if ($id !== SITEID) {
$url->param('id', $id);
}
$PAGE->set_url($url);
$strparticipants = get_string('participants'); $strparticipants = get_string('participants');
//HTTPS is potentially required in this page //HTTPS is potentially required in this page

View file

@ -1,4 +1,4 @@
<?php // $Id$ <?php
require_once("../config.php"); require_once("../config.php");
@ -7,6 +7,8 @@
$p = optional_param('p', '', PARAM_ALPHANUM); // Old parameter: secret $p = optional_param('p', '', PARAM_ALPHANUM); // Old parameter: secret
$s = optional_param('s', '', PARAM_CLEAN); // Old parameter: username $s = optional_param('s', '', PARAM_CLEAN); // Old parameter: username
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/login/confirm.php'));
if (empty($CFG->registerauth)) { if (empty($CFG->registerauth)) {
print_error('cannotusepage2'); print_error('cannotusepage2');
} }

View file

@ -1,5 +1,5 @@
<?php <?php
// $Id$
// forgot password routine. // forgot password routine.
// find the user and call the appropriate routine for their authentication // find the user and call the appropriate routine for their authentication
// type. // type.
@ -18,6 +18,7 @@ $systemcontext = get_context_instance(CONTEXT_SYSTEM);
$strforgotten = get_string('passwordforgotten'); $strforgotten = get_string('passwordforgotten');
$strlogin = get_string('login'); $strlogin = get_string('login');
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/login/forgot_password.php'));
$PAGE->navbar->add($strlogin, get_login_url()); $PAGE->navbar->add($strlogin, get_login_url());
$PAGE->navbar->add($strforgotten); $PAGE->navbar->add($strforgotten);

View file

@ -1,5 +1,27 @@
<?php // $Id$ <?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file is part of the login section Moodle
*
* @copyright 1999 Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package login
*/
require_once("../config.php"); require_once("../config.php");
@ -163,7 +185,7 @@
} }
/// Go to my-moodle page instead of homepage if mymoodleredirect enabled /// Go to my-moodle page instead of homepage if mymoodleredirect enabled
if (!has_capability('moodle/site:config', $context) and !empty($CFG->mymoodleredirect) and !isguest()) { if (!has_capability('moodle/site:config', $context) and !empty($CFG->mymoodleredirect) and !has_capability('moodle/legacy:guest',$context, 0, false)) {
if ($urltogo == $CFG->wwwroot or $urltogo == $CFG->wwwroot.'/' or $urltogo == $CFG->wwwroot.'/index.php') { if ($urltogo == $CFG->wwwroot or $urltogo == $CFG->wwwroot.'/' or $urltogo == $CFG->wwwroot.'/index.php') {
$urltogo = $CFG->wwwroot.'/my/'; $urltogo = $CFG->wwwroot.'/my/';
} }
@ -295,6 +317,3 @@
echo $OUTPUT->header(); echo $OUTPUT->header();
include("index_form.html"); include("index_form.html");
echo $OUTPUT->footer(); echo $OUTPUT->footer();
?>

View file

@ -1,5 +1,27 @@
<?php // $Id$ <?php
// Logs the user out and sends them to the home page
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Logs the user out and sends them to the home page
*
* @copyright 1999 Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package login
*/
require_once("../config.php"); require_once("../config.php");
@ -14,6 +36,9 @@
redirect($redirect); redirect($redirect);
} else if (!confirm_sesskey($sesskey)) { } else if (!confirm_sesskey($sesskey)) {
$url = new moodle_url($CFG->wwwroot.'/login/logout.php');
if ($sesskey !== '__notpresent__') $url->param('sesskey', $sesskey);
$PAGE->set_url($url);
$PAGE->set_title($SITE->fullname); $PAGE->set_title($SITE->fullname);
$PAGE->set_heading($SITE->fullname); $PAGE->set_heading($SITE->fullname);
echo $OUTPUT->header(); echo $OUTPUT->header();
@ -31,5 +56,3 @@
require_logout(); require_logout();
redirect($redirect); redirect($redirect);
?>

View file

@ -11,6 +11,8 @@ if (isloggedin() and !isguestuser()) {
redirect( $CFG->wwwroot.'/', get_string('loginalready'), 5); redirect( $CFG->wwwroot.'/', get_string('loginalready'), 5);
} }
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/login/mnet_email.php', array('u'=>$username)));
$PAGE->navbar->add('MNET ID Provider'); $PAGE->navbar->add('MNET ID Provider');
$PAGE->set_title('MNET ID Provider'); $PAGE->set_title('MNET ID Provider');
$PAGE->set_heading('MNET ID Provider'); $PAGE->set_heading('MNET ID Provider');
@ -40,5 +42,3 @@ echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthnormal');
echo $OUTPUT->box_end(); echo $OUTPUT->box_end();
echo $OUTPUT->footer(); echo $OUTPUT->footer();
?>

View file

@ -1,4 +1,27 @@
<?php // $Id$ <?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file is part of the login section Moodle
*
* @copyright 1999 Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package login
*/
require_once('../config.php'); require_once('../config.php');
@ -58,6 +81,7 @@
$PAGE->navbar->add($login); $PAGE->navbar->add($login);
$PAGE->navbar->add($newaccount); $PAGE->navbar->add($newaccount);
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/login/signup.php'));
$PAGE->set_title($newaccount); $PAGE->set_title($newaccount);
$PAGE->set_heading($newaccount); $PAGE->set_heading($newaccount);
$PAGE->set_focuscontrol($mform_signup->focus()); $PAGE->set_focuscontrol($mform_signup->focus());
@ -66,6 +90,3 @@
echo $OUTPUT->header(); echo $OUTPUT->header();
$mform_signup->display(); $mform_signup->display();
echo $OUTPUT->footer(); echo $OUTPUT->footer();
?>