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 | |
Definition at line 33 of file class.ilRadiusSettingsGUI.php.
| ilRadiusSettingsGUI::__construct | ( | $ | a_auth_ref_id | ) |
Constructor.
public
| int | object auth ref_id |
Definition at line 44 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:| ilRadiusSettingsGUI::executeCommand | ( | ) |
Execute command.
public
Definition at line 67 of file class.ilRadiusSettingsGUI.php.
{
global $ilAccess,$ilErr;
if(!$ilAccess->checkAccess('write','',$this->ref_id))
{
$ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$ilErr->WARNING);
}
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
switch($next_class)
{
default:
if(!$cmd)
{
$cmd = "settings";
}
$this->$cmd();
break;
}
return true;
}
| ilRadiusSettingsGUI::initSettings | ( | ) | [private] |
Init Server settings.
private
Definition at line 229 of file class.ilRadiusSettingsGUI.php.
References ilRadiusSettings::_getInstance(), and settings().
Referenced by __construct().
{
include_once('Services/Radius/classes/class.ilRadiusSettings.php');
$this->settings = ilRadiusSettings::_getInstance();
}
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 261 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',
ilRadiusSettings::RADIUS_CHARSET_LATIN1 => 'ISO-8859-1');
}
Here is the caller graph for this function:| ilRadiusSettingsGUI::prepareRoleSelection | ( | ) | [private] |
Definition at line 237 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 186 of file class.ilRadiusSettingsGUI.php.
References ilUtil::sendInfo(), 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::sendInfo($this->lng->txt("fill_out_all_required_fields"));
$this->settings();
return false;
}
if(!$this->settings->validatePort())
{
ilUtil::sendInfo($this->lng->txt("err_invalid_port"));
$this->settings();
return false;
}
if(!$this->settings->validateServers())
{
ilUtil::sendInfo($this->lng->txt("err_invalid_server"));
$this->settings();
return false;
}
$this->settings->save();
ilUtil::sendInfo($this->lng->txt('settings_saved'));
$this->settings();
return true;
}
Here is the call graph for this function:| ilRadiusSettingsGUI::settings | ( | ) |
Show settings.
public
Definition at line 100 of file class.ilRadiusSettingsGUI.php.
References prepareCharsetSelection(), and prepareRoleSelection().
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'));
$form->addCommandButton('cancel',$this->lng->txt('cancel'));
$this->tpl->setVariable('SETTINGS_TABLE',$form->getHTML());
}
Here is the call graph for this function:
Here is the caller graph for this function:ilRadiusSettingsGUI::$ref_id [private] |
Definition at line 35 of file class.ilRadiusSettingsGUI.php.
1.7.1