ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilRadiusSettingsGUI Class Reference
+ Collaboration diagram for ilRadiusSettingsGUI:

Public Member Functions

 __construct ($a_auth_ref_id)
 Constructor.
 executeCommand ()
 Execute command.
 settings ()
 Show settings.
 save ()
 Save.

Private Member Functions

 initSettings ()
 Init Server settings.
 prepareRoleSelection ()
 prepareCharsetSelection ()
 Get charset options.

Private Attributes

 $ref_id

Detailed Description

Definition at line 13 of file class.ilRadiusSettingsGUI.php.

Constructor & Destructor Documentation

ilRadiusSettingsGUI::__construct (   $a_auth_ref_id)

Constructor.

public

Parameters
intobject auth ref_id

Definition at line 24 of file class.ilRadiusSettingsGUI.php.

References $ilCtrl, $lng, $tpl, and initSettings().

{
global $lng,$ilCtrl,$tpl,$ilTabs;
$this->ctrl = $ilCtrl;
$this->tabs_gui = $ilTabs;
$this->lng = $lng;
$this->lng->loadLanguageModule('registration');
$this->lng->loadLanguageModule('auth');
$this->tpl = $tpl;
$this->ref_id = $a_auth_ref_id;
$this->initSettings();
}

+ Here is the call graph for this function:

Member Function Documentation

ilRadiusSettingsGUI::executeCommand ( )

Execute command.

public

Parameters

Definition at line 47 of file class.ilRadiusSettingsGUI.php.

References $cmd, $ilCtrl, $ilErr, and ilUtil\sendFailure().

{
global $ilAccess,$ilErr,$ilCtrl;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd("settings");
if(!$ilAccess->checkAccess('read','',$this->ref_id))
{
$ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$ilErr->WARNING);
}
if(!$ilAccess->checkAccess('write','',$this->ref_id) && $cmd != "settings")
{
ilUtil::sendFailure($this->lng->txt('msg_no_perm_write'), true);
$ilCtrl->redirect($this, "settings");
}
switch($next_class)
{
default:
if(!$cmd)
{
$cmd = "settings";
}
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilRadiusSettingsGUI::initSettings ( )
private

Init Server settings.

private

Definition at line 213 of file class.ilRadiusSettingsGUI.php.

References ilRadiusSettings\_getInstance(), and settings().

Referenced by __construct().

{
include_once('Services/Radius/classes/class.ilRadiusSettings.php');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilRadiusSettingsGUI::prepareCharsetSelection ( )
private

Get charset options.

private

Definition at line 245 of file class.ilRadiusSettingsGUI.php.

References ilRadiusSettings\RADIUS_CHARSET_LATIN1, and ilRadiusSettings\RADIUS_CHARSET_UTF8.

Referenced by settings().

{
return $select = array(ilRadiusSettings::RADIUS_CHARSET_UTF8 => 'UTF-8',
}

+ Here is the caller graph for this function:

ilRadiusSettingsGUI::prepareRoleSelection ( )
private

Definition at line 221 of file class.ilRadiusSettingsGUI.php.

References ilObject\_lookupTitle(), and ilUtil\_sortIds().

Referenced by settings().

{
global $rbacreview,$ilObjDataCache;
$global_roles = ilUtil::_sortIds($rbacreview->getGlobalRoles(),
'object_data',
'title',
'obj_id');
$select[0] = $this->lng->txt('links_select_one');
foreach($global_roles as $role_id)
{
$select[$role_id] = ilObject::_lookupTitle($role_id);
}
return $select;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilRadiusSettingsGUI::save ( )

Save.

public

Definition at line 170 of file class.ilRadiusSettingsGUI.php.

References $_POST, ilUtil\sendFailure(), ilUtil\sendSuccess(), settings(), and ilUtil\stripSlashes().

{
$this->settings->setActive((int) $_POST['active']);
$this->settings->setName(ilUtil::stripSlashes($_POST['name']));
$this->settings->setPort(ilUtil::stripSlashes($_POST['port']));
$this->settings->setSecret(ilUtil::stripSlashes($_POST['secret']));
$this->settings->setServerString(ilUtil::stripSlashes($_POST['servers']));
$this->settings->setDefaultRole((int) $_POST['role']);
$this->settings->enableCreation((int) $_POST['sync']);
$this->settings->enableAccountMigration((int) $_POST['migration']);
$this->settings->setCharset((int) $_POST['charset']);
if(!$this->settings->validateRequired())
{
ilUtil::sendFailure($this->lng->txt("fill_out_all_required_fields"));
$this->settings();
return false;
}
if(!$this->settings->validatePort())
{
ilUtil::sendFailure($this->lng->txt("err_invalid_port"));
$this->settings();
return false;
}
if(!$this->settings->validateServers())
{
ilUtil::sendFailure($this->lng->txt("err_invalid_server"));
$this->settings();
return false;
}
$this->settings->save();
ilUtil::sendSuccess($this->lng->txt('settings_saved'));
$this->settings();
return true;
}

+ Here is the call graph for this function:

ilRadiusSettingsGUI::settings ( )

Show settings.

public

Parameters

Definition at line 87 of file class.ilRadiusSettingsGUI.php.

References prepareCharsetSelection(), prepareRoleSelection(), ilCheckboxInputGUI\setChecked(), ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), and ilFormPropertyGUI\setRequired().

Referenced by initSettings(), and save().

{
include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.settings.html','Services/Radius');
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt('auth_radius_configure'));
// Form checkbox
$check = new ilCheckboxInputGUI($this->lng->txt('auth_radius_enable'),'active');
$check->setChecked($this->settings->isActive() ? 1 : 0);
$check->setValue(1);
$form->addItem($check);
$text = new ilTextInputGUI($this->lng->txt('auth_radius_name'),'name');
$text->setRequired(true);
$text->setInfo($this->lng->txt('auth_radius_name_desc'));
$text->setValue($this->settings->getName());
$text->setSize(32);
$text->setMaxLength(64);
$form->addItem($text);
$text = new ilTextInputGUI($this->lng->txt('auth_radius_server'),'servers');
$text->setRequired(true);
$text->setInfo($this->lng->txt('auth_radius_server_desc'));
$text->setValue($this->settings->getServersAsString());
$text->setSize(64);
$text->setMaxLength(255);
$form->addItem($text);
$text = new ilTextInputGUI($this->lng->txt('auth_radius_port'),'port');
$text->setRequired(true);
$text->setValue($this->settings->getPort());
$text->setSize(5);
$text->setMaxLength(5);
$form->addItem($text);
$text = new ilTextInputGUI($this->lng->txt('auth_radius_shared_secret'),'secret');
$text->setRequired(true);
$text->setValue($this->settings->getSecret());
$text->setSize(16);
$text->setMaxLength(32);
$form->addItem($text);
$encoding = new ilSelectInputGUI($this->lng->txt('auth_radius_charset'),'charset');
$encoding->setRequired(true);
$encoding->setOptions($this->prepareCharsetSelection());
$encoding->setValue($this->settings->getCharset());
$encoding->setInfo($this->lng->txt('auth_radius_charset_info'));
$form->addItem($encoding);
$check = new ilCheckboxInputGUI($this->lng->txt('auth_radius_sync'),'sync');
$check->setInfo($this->lng->txt('auth_radius_sync_info'));
$check->setChecked($this->settings->enabledCreation() ? 1 : 0);
$check->setValue(1);
$select = new ilSelectInputGUI($this->lng->txt('auth_radius_role_select'),'role');
$select->setOptions($this->prepareRoleSelection());
$select->setValue($this->settings->getDefaultRole());
$check->addSubItem($select);
$migr = new ilCheckboxInputGUI($this->lng->txt('auth_rad_migration'),'migration');
$migr->setInfo($this->lng->txt('auth_rad_migration_info'));
$migr->setChecked($this->settings->isAccountMigrationEnabled() ? 1 : 0);
$migr->setValue(1);
$check->addSubItem($migr);
$form->addItem($check);
$form->addCommandButton('save',$this->lng->txt('save'));
$this->tpl->setVariable('SETTINGS_TABLE',$form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilRadiusSettingsGUI::$ref_id
private

Definition at line 15 of file class.ilRadiusSettingsGUI.php.


The documentation for this class was generated from the following file: