Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/admin/registration/hubselector.php
Go to the documentation of this file.
00001 <?php
00002 // This file is part of Moodle - http://moodle.org/
00003 //
00004 // Moodle is free software: you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation, either version 3 of the License, or
00007 // (at your option) any later version.
00008 //
00009 // Moodle is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
00016 
00017 /*
00018  * @package    moodle
00019  * @subpackage registration
00020  * @author     Jerome Mouneyrac <jerome@mouneyrac.com>
00021  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL
00022  * @copyright  (C) 1999 onwards Martin Dougiamas  http://dougiamas.com
00023  *
00024  * Thsi page displays a hub selector or a hub URL + password. Then it will redirect to
00025  * the site registration form (with the selected hub as parameter)
00026 */
00027 
00028 require('../../config.php');
00029 
00030 require_once($CFG->libdir.'/adminlib.php');
00031 require_once($CFG->dirroot.'/' . $CFG->admin . '/registration/forms.php');
00032 
00033 admin_externalpage_setup('registrationselector');
00034 
00035 $hubselectorform = new hub_selector_form();
00036 $fromform = $hubselectorform->get_data();
00037 
00039 
00040 $selectedhuburl = optional_param('publichub', false, PARAM_URL);
00041 $unlistedhuburl = optional_param('unlistedurl', false, PARAM_TEXT);
00042 $password = optional_param('password', '', PARAM_RAW);
00043 
00044 if (!empty($unlistedhuburl)) {
00045     if (clean_param($unlistedhuburl, PARAM_URL) !== '') {
00046         $huburl = $unlistedhuburl;
00047     }
00048 } else if (!empty($selectedhuburl)) {
00049     $huburl = $selectedhuburl;
00050 }
00051 
00052 
00053 //redirect
00054 if (!empty($huburl) and confirm_sesskey()) {
00055     $hubname = optional_param(clean_param($huburl, PARAM_ALPHANUMEXT), '', PARAM_TEXT);
00056     $params = array('sesskey' => sesskey(), 'huburl' => $huburl,
00057             'password' => $password, 'hubname' => $hubname);
00058     redirect(new moodle_url($CFG->wwwroot."/" . $CFG->admin . "/registration/register.php",
00059             $params));
00060 }
00061 
00062 
00064 
00065 echo $OUTPUT->header();
00066 echo $OUTPUT->heading(get_string('registeron', 'hub'), 3, 'main');
00067 $hubselectorform->display();
00068 echo $OUTPUT->footer();
 All Data Structures Namespaces Files Functions Variables Enumerations