35        $this->ctrl = $this->dic->ctrl();
 
   36        $this->tabs_gui = $this->dic->tabs();
 
   37        $this->lng = $this->dic->language();
 
   38        $this->lng->loadLanguageModule(
'registration');
 
   39        $this->lng->loadLanguageModule(
'auth');
 
   41        $this->tpl = $this->dic[
'tpl'];
 
   42        $this->ref_id = $a_auth_ref_id;
 
   58        $next_class = $this->ctrl->getNextClass($this);
 
   59        $cmd = $this->ctrl->getCmd(
"settings");
 
   61        if (!$this->dic->rbac()->system()->checkAccess(
"visible,read", $this->ref_id)) {
 
   62            $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'), 
$ilErr->WARNING);
 
   63            $this->dic->ctrl()->redirect($this, 
"settings");
 
   66        switch ($next_class) {
 
   86        include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
   88        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.settings.html', 
'Services/Radius');
 
   90        $this->lng->loadLanguageModule(
'auth');
 
   93        $form->setFormAction($this->ctrl->getFormAction($this));
 
   94        $form->setTitle($this->lng->txt(
'auth_radius_configure'));
 
   98        $check->setChecked($this->
settings->isActive() ? 1 : 0);
 
  100        $form->addItem($check);
 
  102        $text = 
new ilTextInputGUI($this->lng->txt(
'auth_radius_name'), 
'name');
 
  103        $text->setRequired(
true);
 
  104        $text->setInfo($this->lng->txt(
'auth_radius_name_desc'));
 
  105        $text->setValue($this->
settings->getName());
 
  107        $text->setMaxLength(64);
 
  108        $form->addItem($text);
 
  110        $text = 
new ilTextInputGUI($this->lng->txt(
'auth_radius_server'), 
'servers');
 
  111        $text->setRequired(
true);
 
  112        $text->setInfo($this->lng->txt(
'auth_radius_server_desc'));
 
  113        $text->setValue($this->
settings->getServersAsString());
 
  115        $text->setMaxLength(255);
 
  116        $form->addItem($text);
 
  119        $text = 
new ilTextInputGUI($this->lng->txt(
'auth_radius_port'), 
'port');
 
  120        $text->setRequired(
true);
 
  121        $text->setValue($this->
settings->getPort());
 
  123        $text->setMaxLength(5);
 
  124        $form->addItem($text);
 
  126        $text = 
new ilTextInputGUI($this->lng->txt(
'auth_radius_shared_secret'), 
'secret');
 
  127        $text->setRequired(
true);
 
  128        $text->setValue($this->
settings->getSecret());
 
  130        $text->setMaxLength(32);
 
  131        $form->addItem($text);
 
  133        $encoding = 
new ilSelectInputGUI($this->lng->txt(
'auth_radius_charset'), 
'charset');
 
  134        $encoding->setRequired(
true);
 
  136        $encoding->setValue($this->
settings->getCharset());
 
  137        $encoding->setInfo($this->lng->txt(
'auth_radius_charset_info'));
 
  138        $form->addItem($encoding);
 
  145        $sync->setRequired(
true);
 
  146        #$sync->setInfo($this->lng->txt('auth_radius_sync_info')); 
  147        $form->addItem($sync);
 
  151            $this->lng->txt(
'disabled'),
 
  155        #$dis->setInfo($this->lng->txt('auth_radius_sync_disabled_info')); 
  156        $sync->addOption($dis);
 
  160            $this->lng->txt(
'auth_radius_sync_rad'),
 
  164        $rad->setInfo($this->lng->txt(
'auth_radius_sync_rad_info'));
 
  165        $sync->addOption($rad);
 
  167        $select = 
new ilSelectInputGUI($this->lng->txt(
'auth_radius_role_select'), 
'role');
 
  169        $select->setValue($this->
settings->getDefaultRole());
 
  170        $rad->addSubItem($select);
 
  173        $migr->setInfo($this->lng->txt(
'auth_rad_migration_info'));
 
  174        $migr->setChecked($this->
settings->isAccountMigrationEnabled() ? 1 : 0);
 
  176        $rad->addSubItem($migr);
 
  179        include_once 
'./Services/LDAP/classes/class.ilLDAPServer.php';
 
  182        if (count($server_ids)) {
 
  184                $this->lng->txt(
'auth_radius_ldap'),
 
  188            $ldap->setInfo($this->lng->txt(
'auth_radius_ldap_info'));
 
  189            $sync->addOption($ldap);
 
  191            $ldap_server_select = 
new ilSelectInputGUI($this->lng->txt(
'auth_ldap_server_ds'), 
'ldap_sid');
 
  192            $options[0] = $this->lng->txt(
'select_one');
 
  193            foreach ($server_ids as $ldap_sid) {
 
  195                $options[$ldap_sid] = $ldap_server->getName();
 
  197            $ldap_server_select->setOptions($options);
 
  198            $ldap_server_select->setRequired(
true);
 
  200            $ldap_server_select->setValue($ds);
 
  202            $ldap->addSubItem($ldap_server_select);
 
  209                $this->
settings->enabledCreation() ?
 
  215        if ($this->dic->rbac()->system()->checkAccess(
'write', $this->ref_id)) {
 
  216            $form->addCommandButton(
'save', $this->lng->txt(
'save'));
 
  218        $this->tpl->setVariable(
'SETTINGS_TABLE', $form->getHTML());
 
  234        $this->
settings->setDefaultRole((
int) $_POST[
'role']);
 
  235        $this->
settings->enableAccountMigration((
int) $_POST[
'migration']);
 
  236        $this->
settings->setCharset((
int) $_POST[
'charset']);
 
  239        if (!$this->
settings->validateRequired()) {
 
  244        if (!$this->
settings->validatePort()) {
 
  249        if (!$this->
settings->validateServers()) {
 
  255        include_once 
'./Services/LDAP/classes/class.ilLDAPServer.php';
 
  256        switch ((
int) 
$_POST[
'sync']) {
 
  266                if (!(
int) $_REQUEST[
'ldap_sid']) {
 
  277        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
 
  291        include_once(
'Services/Radius/classes/class.ilRadiusSettings.php');
 
  297        global $rbacreview,$ilObjDataCache;
 
  300            $rbacreview->getGlobalRoles(),
 
  306        $select[0] = $this->lng->txt(
'links_select_one');
 
  307        foreach ($global_roles as $role_id) {
 
An exception for terminatinating execution or to throw for unit testing.
static getDataSource($a_auth_mode)
static disableDataSourceForAuthMode($a_authmode)
Disable data source.
static isDataSourceActive($a_auth_mode)
Check if a data source is active for a specific auth mode @global ilDB $ilDB.
static toggleDataSource($a_ldap_server_id, $a_auth_mode, $a_status)
Toggle Data Source.
static getAvailableDataSources($a_auth_mode)
static _lookupTitle($a_id)
lookup object title
This class represents an option in a radio group.
__construct($a_auth_ref_id)
Constructor.
prepareCharsetSelection()
Get charset options.
initSettings()
Init Server settings.
executeCommand()
Execute command.
const RADIUS_CHARSET_UTF8
static _getInstance()
singleton get instance
const RADIUS_CHARSET_LATIN1
This class represents a text property in a property form.
static _sortIds($a_ids, $a_table, $a_field, $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled