~ubuntu-branches/ubuntu/natty/moodle/natty

« back to all changes in this revision

Viewing changes to login/mnet_email.php

  • Committer: Bazaar Package Importer
  • Author(s): Tomasz Muras
  • Date: 2010-10-30 12:19:28 UTC
  • mfrom: (1.1.12 upstream) (3.1.10 squeeze)
  • Revision ID: james.westby@ubuntu.com-20101030121928-qzobi6mctpnk4dif
Tags: 1.9.9.dfsg2-2
* Added Romanian translation
* Updated Japanese translation (closes: #596820)
* Backporting security fixes from Moodle 1.9.10 (closes: #601384)
   - Updated embedded CAS to 1.1.3
   - Added patch for MDL-24523:
     clean_text() not filtering text in markdown format
   - Added patch for MDL-24810 and upgraded customized HTML Purifier to 4.2.0 
   - Added patch for MDL-24258:
     students can delete their forum posts later than $CFG->maxeditingtime 
     under certain conditions
   - Added patch for MDL-23377:
     Can't delete quiz attempts in course without enrolled students

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
if (isloggedin() and !isguestuser()) {
11
11
    redirect( $CFG->wwwroot.'/', get_string('loginalready'), 5);
12
12
}
13
 
$navigation = build_navigation(array(array('name' => 'MNET ID Provider', 'link' => null, 'type' => 'misc')));
 
13
$mnetidprovider = get_string('mnetidprovider','mnet');
 
14
$navigation = build_navigation(array(array('name' => $mnetidprovider, 'link' => null, 'type' => 'misc')));
14
15
 
15
 
print_header('MNET ID Provider', 'MNET ID Provider', $navigation, 'form.email' );
 
16
print_header($mnetidprovider, $mnetidprovider, $navigation, 'form.email' );
 
17
notify(get_string('mnetidproviderdesc', 'mnet'));
16
18
 
17
19
if ($form = data_submitted() and confirm_sesskey()) {
18
 
    if ($user = get_record('user', 'username', $username, 'email', $form->email)) {
 
20
    if ($user = get_record_select('user', "username = '$username' AND email = '$form->email' AND mnethostid != $CFG->mnet_localhost_id")) {
19
21
        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.");
 
22
            $link = "<a href=\"{$host->wwwroot}/login/\">{$host->name}</a>";
 
23
            notice(get_string('mnetidprovidermsg','mnet',$link));
21
24
        }
22
25
    }
 
26
    if (empty($link)) {
 
27
        notice(get_string('mnetidprovidernotfound', 'mnet'));
 
28
    }
23
29
}
24
30
 
25
31
echo '<p>&nbsp;</p>';
30
36
    <input type="hidden" name="sesskey" value="<?php echo $sesskey; ?>">
31
37
    <?php echo get_string('email') ?>:
32
38
    <input type="text" name="email" size="" maxlength="100" />
33
 
    <input type="submit" value="Find Login" />
 
39
    <input type="submit" value="<?php echo get_string('findlogin','mnet'); ?>" />
34
40
  </form>
35
41
<?php
36
42