Skip to content

Commit

Permalink
auth/ldap cas/ldap MDL-23371 auth/ldap and auth/cas refactor
Browse files Browse the repository at this point in the history
They now share most of the code again, this time via subclassing, and they
share some code with enrol/ldap. They have also gained some features and a few
fixes.
  • Loading branch information
iarenaza committed Jul 25, 2010
1 parent a07dedf commit fcf46da
Show file tree
Hide file tree
Showing 17 changed files with 1,587 additions and 2,891 deletions.
1,180 changes: 200 additions & 980 deletions auth/cas/auth.php

Large diffs are not rendered by default.

17 changes: 2 additions & 15 deletions auth/cas/cas_form.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@


<div class="loginbox clearfix">

<div class="loginpanel">

<div>

<a href="<?php echo $CFG->wwwroot.'/login/index.php?authCAS=CAS';?>"><?php print_string("accesCAS","auth_cas");?></a>

<a href="<?php echo $CFG->wwwroot.'/login/index.php?authCAS=CAS';?>"><?php print_string('accesCAS', 'auth_cas');?></a>
</div>

<br/>

<div>

<a href="<?php echo $CFG->wwwroot.'/login/index.php?authCAS=NOCAS';?>"><?php print_string("accesNOCAS","auth_cas");?></a>

<a href="<?php echo $CFG->wwwroot.'/login/index.php?authCAS=NOCAS';?>"><?php print_string('accesNOCAS', 'auth_cas');?></a>
</div>

</div>

</div>

19 changes: 10 additions & 9 deletions auth/cas/cas_ldap_sync_users.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
/** auth_ldap_sync_users.php
/** cas_ldap_sync_users.php
* Modified for cas Module
*
* This script is meant to be called from a cronjob to sync moodle with the LDAP
* backend in those setups where the LDAP backend acts as 'master'.
* This script is meant to be called from a cronjob to sync moodle with the CAS
* backend in those setups where the CAS backend acts as 'master'.
*
* Recommended cron entry:
* # 5 minutes past 4am
* 5 4 * * * /usr/bin/php -c /etc/php4/cli/php.ini /var/www/moodle/auth/ldap/auth_ldap_sync_users.php
* 5 4 * * * /usr/bin/php -c /etc/php4/cli/php.ini /var/www/moodle/auth/cas/cas_ldap_sync_users.php
*
* Notes:
* - If you have a large number of users, you may want to raise the memory limits
Expand All @@ -21,20 +21,21 @@
*
*/


if (isset($_SERVER['REMOTE_ADDR'])) {
error_log("should not be called from web server!");
error_log('auth/cas/cas_ldap_sync_users.php can not be called from web server!');
echo 'auth/cas/cas_ldap_sync_users.php can not be called from web server!';
exit;
}

define('NO_MOODLE_COOKIES', true);

require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); // global moodle config file.

require_once($CFG->dirroot.'/course/lib.php');

// Ensure errors are well explained
$CFG->debug = DEBUG_NORMAL;

if (!is_enabled_auth('cas')) {
echo "Plugin not enabled!";
error_log('[AUTH CAS] '.get_string('pluginnotenabled', 'auth_ldap'));
die;
}

Expand Down
Loading

0 comments on commit fcf46da

Please sign in to comment.