/** * */ public function __construct() { global $ilLog; $this->log = $ilLog; $this->settings = ilOpenIdSettings::getInstance(); include_once './Services/Xml/classes/class.ilXmlWriter.php'; $this->writer = new ilXmlWriter(); }
/** * Constructor */ public function __construct($a_ref_id) { $this->ref_id = $a_ref_id; $this->ctrl = $GLOBALS['ilCtrl']; $this->lng = $GLOBALS['lng']; $this->tpl = $GLOBALS['tpl']; $this->lng->loadLanguageModule('auth'); $this->settings = ilOpenIdSettings::getInstance(); }
/** * Return the default provider, if there is only one. * Otherwise return "0" for --select one -- * * @return int */ public function getSelectedProvider() { include_once './Services/OpenId/classes/class.ilOpenIdSettings.php'; if (count($this->getProvider()) != 1 or !ilOpenIdSettings::getInstance()->forcedProviderSelection()) { return 0; } foreach ($this->getProvider() as $pro) { return $pro->getId(); } return 0; }
/** * Show openid login if enabled * @return */ protected function showOpenIdLoginForm($page_editor_html) { global $lng, $tpl; include_once './Services/OpenId/classes/class.ilOpenIdSettings.php'; if (!ilOpenIdSettings::getInstance()->isActive()) { return $page_editor_html; } $lng->loadLanguageModule('auth'); include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); //$form->setTableWidth('500'); $form->setShowTopButtons(false); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($lng->txt('login_to_ilias_via_openid')); $openid = new ilTextInputGUI($lng->txt('auth_openid_login'), 'oid_username'); $openid->setSize(18); $openid->setMaxLength(255); $openid->setRequired(true); $openid->setCssClass('ilOpenIDBox'); $openid->setInfo($lng->txt('auth_openid_login_info_a')); $form->addItem($openid); include_once './Services/OpenId/classes/class.ilOpenIdProviders.php'; $pro = new ilSelectInputGUI($lng->txt('auth_openid_provider'), 'oid_provider'); $pro->setOptions(ilOpenIdProviders::getInstance()->getProviderSelection()); $pro->setValue(ilOpenIdProviders::getInstance()->getSelectedProvider()); $form->addItem($pro); $form->addCommandButton("showLogin", $lng->txt("log_in")); return $this->substituteLoginPageElements($tpl, $page_editor_html, $form->getHTML(), '[list-openid-login-form]', 'OID_LOGIN_FORM'); }
/** * Init open id settings * @return */ protected function initSettings() { include_once './Services/OpenId/classes/class.ilOpenIdSettings.php'; $this->settings = ilOpenIdSettings::getInstance(); $this->settings->initConsumer(); }
/** * Check if an external account name is required. * That's the case if Radius,LDAP, CAS or SOAP is active * * @access public * @static * * @param */ public static function _isExternalAccountEnabled() { global $ilSetting; if ($ilSetting->get("cas_active")) { return true; } if ($ilSetting->get("soap_auth_active")) { return true; } if ($ilSetting->get("shib_active")) { return true; } if ($ilSetting->get('radius_active')) { return true; } include_once 'Services/LDAP/classes/class.ilLDAPServer.php'; if (count(ilLDAPServer::_getActiveServerList())) { return true; } include_once './Services/OpenId/classes/class.ilOpenIdSettings.php'; if (ilOpenIdSettings::getInstance()->isActive()) { return true; } return false; }
/** * Check if an external account name is required. * That's the case if Radius,LDAP, CAS or SOAP is active * * @access public * @static * * @param */ public static function _isExternalAccountEnabled() { global $ilSetting; if ($ilSetting->get("cas_active")) { return true; } if ($ilSetting->get("soap_auth_active")) { return true; } if ($ilSetting->get("shib_active")) { return true; } if ($ilSetting->get('radius_active')) { return true; } include_once 'Services/LDAP/classes/class.ilLDAPServer.php'; if (count(ilLDAPServer::_getActiveServerList())) { return true; } include_once './Services/OpenId/classes/class.ilOpenIdSettings.php'; if (ilOpenIdSettings::getInstance()->isActive()) { return true; } // begin-path auth_plugin foreach (self::getAuthPlugins() as $pl) { foreach ($pl->getAuthIds() as $auth_id) { if ($pl->isAuthActive($auth_id) and $pl->isExternalAccountNameRequired($auth_id)) { return true; } } } // end-path auth_plugin return false; }