MDL-15683, get query string instead of calling me().
[moodle-linuxchix.git] / login / mnet_email.php
blob3181b4e1f4050961431ada149dfa1bb265e4c3b6
1 <?php
3 require_once dirname(dirname(__FILE__)) . '/config.php';
4 httpsrequired();
6 $username = required_param('u', PARAM_ALPHANUM);
7 $sesskey = sesskey();
9 // if you are logged in then you shouldn't be here
10 if (isloggedin() and !isguestuser()) {
11 redirect( $CFG->wwwroot.'/', get_string('loginalready'), 5);
13 $navigation = build_navigation(array(array('name' => 'MNET ID Provider', 'link' => null, 'type' => 'misc')));
15 print_header('MNET ID Provider', 'MNET ID Provider', $navigation, 'form.email' );
17 if ($form = data_submitted() and confirm_sesskey()) {
18 if ($user = get_record('user', 'username', $username, 'email', $form->email)) {
19 if (!empty($user->mnethostid) and $host = get_record('mnet_host', 'id', $user->mnethostid)) {
20 notice("You should be able to login at your <a href=\"{$host->wwwroot}/login/\">{$host->name}</a> provider.");
25 echo '<p>&nbsp;</p>';
26 print_simple_box_start('center','50%','','20');
29 <form method="post">
30 <input type="hidden" name="sesskey" value="<?php echo $sesskey; ?>">
31 <?php echo get_string('email') ?>:
32 <input type="text" name="email" size="" maxlength="100" />
33 <input type="submit" value="Find Login" />
34 </form>
35 <?php
37 print_simple_box_end();
38 print_footer();