Beispiel #1
0
 protected static function initDriverList()
 {
     // load static drivers
     self::$drivers = array('claroline' => new ClarolineLocalAuthDriver(), 'disabled' => new UserDisabledAuthDriver(), 'temp' => new TemporaryAccountAuthDriver(), 'CAS' => new ClarolineLocalAuthDriver());
     self::$driversAllowingLostPassword = array('claroline' => 'claroline', 'clarocrypt' => 'clarocrypt');
     // load dynamic drivers
     if (!file_exists(get_path('rootSys') . 'platform/conf/extauth')) {
         FromKernel::uses('fileManage.lib');
         claro_mkdir(get_path('rootSys') . 'platform/conf/extauth', CLARO_FILE_PERMISSIONS, true);
     }
     if (get_conf('claro_authDriversAutoDiscovery', true)) {
         $driversToLoad = array();
         $it = new DirectoryIterator(get_path('rootSys') . 'platform/conf/extauth');
         foreach ($it as $file) {
             if ($file->isFile() && substr($file->getFilename(), -9) == '.conf.php') {
                 $driversToLoad[] = $file->getPathname();
             }
         }
         sort($driversToLoad);
         foreach ($driversToLoad as $driverFile) {
             self::loadDriver($driverFile);
         }
     } else {
         if (file_exists(get_path('rootSys') . 'platform/conf/extauth/drivers.list')) {
             $authDriverList = file(get_path('rootSys') . 'platform/conf/extauth/drivers.list');
             foreach ($authDriverList as $authDriver) {
                 $authDriver = trim($authDriver);
                 if (!empty($authDriver)) {
                     self::loadDriver(ltrim(rtrim(get_path('rootSys') . 'platform/conf/extauth/' . $authDriver)));
                 }
             }
         }
     }
 }