moodle/login/index.php

moodle/login/index.php

by Ravi Naithani -
Number of replies: 0

Hi,

Can anyone explain this part of the code of index.php:-



if ($user !== false or $frm !== false or $errormsg !== '') {

    // some auth plugin already supplied full user, fake form data or prevented user login with error message


} 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

    //TODO: move weblink into own auth plugin

    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();

    }


} else {

    $frm = data_submitted();

}

My queries are:-

1- Where is the file "weblinkauth.php" located? Does it come during installation or if we add a plugin then we include it in login folder?

2- How $user & $frm objects are created?

Thanks in advance for your help!!

Ravi Naithani



Average of ratings: -