Hi,
I have been trying to set configure a html form to enable users on an external site to access the moodle site directly from that page.
The form works and directs the user to the moodle site, unfortunately it takes them to the login page rather than the frontpage
I added the following code to the index.php as suggested elsewhere
$frm = false;
$user = false;
$U=@$_GET['U'];
$P=@$_GET['P'];
if ((strlen($U)>=1) && (strlen($P)>=1)){
$frm->username = $U;
$frm->password = $P;
}
$authsequence = get_enabled_auth_plugins(true); // auths, in sequence
foreach($authsequence as $authname) {
$authplugin = get_auth_plugin($authname);
$authplugin->loginpage_hook();
}
The form code is:
<p>Username :
<input size=
"10"
name=
"username"
/>
</p>
<p>Password :
<input size=
"10"
name=
"password"
type=
"password"
/>
</p>
<p>
<input name=
"Submit"
value=
"Login"
type=
"submit"
/>
</p>
</form>
I don't have the option of adding a site to the alternate URL login as there will be possibly 3 or 4 sites where this will need to be inserted
Can anyone suggest where I am going wrong ?
Many Thanks