ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCASSettingsGUI Class Reference
+ Collaboration diagram for ilCASSettingsGUI:

Public Member Functions

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

Data Fields

const SYNC_DISABLED = 0
const SYNC_CAS = 1
const SYNC_LDAP = 2

Protected Member Functions

 getSettings ()
 initFormSettings ()
 Init cas settings.

Private Member Functions

 prepareRoleSelection ()

Private Attributes

 $settings
 $ref_id

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

ilCASSettingsGUI:

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

Constructor & Destructor Documentation

ilCASSettingsGUI::__construct (   $a_auth_ref_id)

Constructor.

public

Parameters
intobject auth ref_id

Definition at line 32 of file class.ilCASSettingsGUI.php.

References $ilCtrl, $lng, $tpl, ilCASSettings\getInstance(), and settings().

{
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;
}

+ Here is the call graph for this function:

Member Function Documentation

ilCASSettingsGUI::executeCommand ( )

Execute command.

public

Parameters

Definition at line 64 of file class.ilCASSettingsGUI.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:

ilCASSettingsGUI::getSettings ( )
protected
Returns
ilCASSettings

Definition at line 52 of file class.ilCASSettingsGUI.php.

References $settings.

Referenced by initFormSettings(), and save().

{
}

+ Here is the caller graph for this function:

ilCASSettingsGUI::initFormSettings ( )
protected

Init cas settings.

Definition at line 101 of file class.ilCASSettingsGUI.php.

References AUTH_CAS, ilLDAPServer\getAvailableDataSources(), getSettings(), ilLDAPServer\isDataSourceActive(), prepareRoleSelection(), ilCheckboxInputGUI\setChecked(), ilTextAreaInputGUI\setCols(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), ilTextInputGUI\setValue(), ilNumberInputGUI\setValue(), ilCASSettings\SYNC_CAS, SYNC_CAS, ilCASSettings\SYNC_DISABLED, SYNC_DISABLED, and SYNC_LDAP.

Referenced by save(), and settings().

{
$this->lng->loadLanguageModule('auth');
$this->lng->loadLanguageModule('radius');
include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt('auth_cas_auth'));
$form->setDescription($this->lng->txt("auth_cas_auth_desc"));
// Form checkbox
$check = new ilCheckboxInputGUI($this->lng->txt("active"),'active');
$check->setChecked($this->getSettings()->isActive() ? true : false);
$check->setValue(1);
$form->addItem($check);
$text = new ilTextInputGUI($this->lng->txt('server'),'server');
$text->setValue($this->getSettings()->getServer());
$text->setRequired(true);
$text->setInfo($this->lng->txt('auth_cas_server_desc'));
$text->setSize(64);
$text->setMaxLength(255);
$form->addItem($text);
$port = new ilNumberInputGUI($this->lng->txt("port"), 'port');
$port->setValue($this->getSettings()->getPort());
$port->setRequired(true);
$port->setMinValue(0);
$port->setMaxValue(65535);
$port->setSize(5);
$port->setMaxLength(5);
$port->setInfo($this->lng->txt('auth_cas_port_desc'));
$form->addItem($port);
$text = new ilTextInputGUI($this->lng->txt('uri'), 'uri');
$text->setValue($this->getSettings()->getUri());
$text->setRequired(true);
$text->setInfo($this->lng->txt('auth_cas_uri_desc'));
$text->setSize(64);
$text->setMaxLength(255);
$form->addItem($text);
// User synchronization
// 0: Disabled
// 1: CAS
// 2: LDAP
$sync = new ilRadioGroupInputGUI($this->lng->txt('auth_sync'), 'sync');
$sync->setRequired(true);
#$sync->setInfo($this->lng->txt('auth_radius_sync_info'));
$form->addItem($sync);
// Disabled
$dis = new ilRadioOption(
$this->lng->txt('disabled'),
''
);
#$dis->setInfo($this->lng->txt('auth_radius_sync_disabled_info'));
$sync->addOption($dis);
// CAS
$rad = new ilRadioOption(
$this->lng->txt('auth_sync_cas'),
''
);
$rad->setInfo($this->lng->txt('auth_sync_cas_info'));
$sync->addOption($rad);
$select = new ilSelectInputGUI($this->lng->txt('auth_user_default_role'),'role');
$select->setOptions($this->prepareRoleSelection());
$select->setValue($this->getSettings()->getDefaultRole());
$rad->addSubItem($select);
// LDAP
include_once './Services/LDAP/classes/class.ilLDAPServer.php';
if(count($server_ids))
{
$ldap = new ilRadioOption(
$this->lng->txt('auth_radius_ldap'),
''
);
$ldap->setInfo($this->lng->txt('auth_radius_ldap_info'));
$sync->addOption($ldap);
// TODO Handle more than one LDAP configuration
}
{
$sync->setValue(self::SYNC_LDAP);
}
else
{
$sync->setValue(
$this->getSettings()->isUserCreationEnabled() ?
);
}
$instruction = new ilTextAreaInputGUI($this->lng->txt('auth_login_instructions'), 'instruction');
$instruction->setCols(80);
$instruction->setRows(6);
$instruction->setValue($this->getSettings()->getLoginInstruction());
$form->addItem($instruction);
$create = new ilCheckboxInputGUI($this->lng->txt('auth_allow_local'), 'local');
$create->setInfo($this->lng->txt('auth_cas_allow_local_desc'));
$create->setChecked($this->getSettings()->isLocalAuthenticationEnabled() ? true : false);
$create->setValue(1);
$form->addItem($create);
$form->addCommandButton('save',$this->lng->txt('save'));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCASSettingsGUI::prepareRoleSelection ( )
private

Definition at line 290 of file class.ilCASSettingsGUI.php.

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

Referenced by initFormSettings().

{
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:

ilCASSettingsGUI::save ( )

Save.

public

Definition at line 246 of file class.ilCASSettingsGUI.php.

References AUTH_CAS, getSettings(), initFormSettings(), ilUtil\sendFailure(), ilUtil\sendSuccess(), ilCASSettings\SYNC_CAS, ilCASSettings\SYNC_DISABLED, ilCASSettings\SYNC_LDAP, and ilLDAPServer\toggleDataSource().

{
$form = $this->initFormSettings();
if($form->checkInput())
{
$this->getSettings()->setActive($form->getInput('active'));
$this->getSettings()->setServer($form->getInput('server'));
$this->getSettings()->setPort($form->getInput('port'));
$this->getSettings()->setUri($form->getInput('uri'));
$this->getSettings()->setDefaultRole($form->getInput('role'));
$this->getSettings()->enableLocalAuthentication($form->getInput('local'));
$this->getSettings()->setLoginInstruction($form->getInput('instruction'));
$this->getSettings()->enableUserCreation($form->getInput('sync') == ilCASSettings::SYNC_CAS ? true : false);
$this->getSettings()->save();
include_once './Services/LDAP/classes/class.ilLDAPServer.php';
switch((int) $form->getInput('sync'))
{
break;
break;
// TODO: handle multiple ldap configurations
break;
}
ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
$this->ctrl->redirect($this,'settings');
}
$form->setValuesByPost();
ilUtil::sendFailure($this->lng->txt('err_ceck_input'));
$this->tpl->setContent($form->getHTML());
}

+ Here is the call graph for this function:

ilCASSettingsGUI::settings ( )

Show settings.

public

Parameters

Definition at line 233 of file class.ilCASSettingsGUI.php.

References initFormSettings().

Referenced by __construct().

{
$form = $this->initFormSettings();
$this->tpl->setContent($form->getHTML());
return;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilCASSettingsGUI::$ref_id
private

Definition at line 23 of file class.ilCASSettingsGUI.php.

ilCASSettingsGUI::$settings
private

Definition at line 21 of file class.ilCASSettingsGUI.php.

Referenced by getSettings().

const ilCASSettingsGUI::SYNC_CAS = 1

Definition at line 18 of file class.ilCASSettingsGUI.php.

Referenced by initFormSettings().

const ilCASSettingsGUI::SYNC_DISABLED = 0

Definition at line 17 of file class.ilCASSettingsGUI.php.

Referenced by initFormSettings().

const ilCASSettingsGUI::SYNC_LDAP = 2

Definition at line 19 of file class.ilCASSettingsGUI.php.

Referenced by initFormSettings().


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