Quantcast
Channel: Authentication
Viewing all articles
Browse latest Browse all 8256

Re: Customising the authentication choice page when using multiple authentication methods

$
0
0
by Doc Hallam.  

Ah, since posting this we've found a solution that works so here's answering my own question!

There's a file under moodle/auth/cas called cas_form.html, which has default contents:

<div class="loginbox clearfix">
<div class="loginpanel">
<div>
<a href="<?php echo get_login_url() . '?authCAS=CAS';?>"><?php print_string('accesCAS', 'auth_cas');?></a>
</div>
<br/>
<div>
<a href="<?php echo get_login_url() . '?authCAS=NOCAS';?>"><?php print_string('accesNOCAS', 'auth_cas');?></a>
</div>
</div>
</div>

I saved a copy of the original cas_form.html file and replaced it with our custom HTML file, replacing our simple links with those specified in the default cas_form.html file, namely

<a href="<?php echo get_login_url() . '?authCAS=CAS';?>"><?php print_string('accesCAS', 'auth_cas');?></a>

for the CAS logins and

<a href="<?php echo get_login_url() . '?authCAS=NOCAS';?>"><?php print_string('accesNOCAS', 'auth_cas');?>

for the non-CAS logins (i.e. the manually created accounts). I would think you could use pretty much whatever HTML you liked in the cas_form.html, and provided you use the CAS and NOCAS href's then it would work.

Note that there's also a file moodle/auth/cas/lang/en/auth_cas.php where you can modify the text used for the CAS and NOCAS links; these are the defaults

$string['accesCAS'] = 'CAS users';

$string['accesNOCAS'] = 'other users';

Hope that helps someone, and apologies if it's a trivial solution that I should have known about - I'm quite new to Moodle admin.

Cheers,

dochallam


Viewing all articles
Browse latest Browse all 8256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>