moodle/auth/cas/languages.php
Iñaki Arenaza 02a9e4a7f3 MDL-31938, MDL-36138 auth_cas: upgrade phpCAS library
Proxy mode changes testing still pending (we don't have such a setup).
2013-10-25 11:51:23 +08:00

17 lines
486 B
PHP

<?php
$caslangconstprefix = 'PHPCAS_LANG_';
$caslangprefixlen = strlen('CAS_Language_') + 1;
$CASLANGUAGES = array ();
$consts = get_defined_constants(true);
foreach ($consts['user'] as $key => $value) {
if (preg_match("/^$caslangconstprefix/", $key)) {
$CASLANGUAGES[$value] = substr($value, $caslangprefixlen);
}
}
if (empty($CASLANGUAGES)) {
$CASLANGUAGES = array (PHPCAS_LANG_ENGLISH => 'English',
PHPCAS_LANG_FRENCH => 'French');
}