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

Public Member Functions

 __construct ($a_auth_ref_id)
 executeCommand ()
 Execute Command.
 settings ()
 save ()
 addRoleAutoCompleteObject ()
 Add Member for autoComplete.

Protected Member Functions

 roleAssignment ()
 parseRulesTable ()
 confirmDeleteRules ()
 Confirm delete rules.
 deleteRules ()
 delete role assignment rule
 initFormRoleAssignment ($a_mode= 'default')
 addRoleAssignmentRule ()
 editRoleAssignment ()
 Edit Role Assignment.
 updateRoleAssignmentRule ()
 chooseRole ()
 saveRoleSelection ()
 setSubTabs ()

Private Member Functions

 loadRule ($a_rule_id=0)
 getRuleValues ()
 checkInput ($a_rule_id=0)
 showLocalRoleSelection ()
 hasActiveRoleAssignmentPlugins ()
 Check if plugin is active.
 prepareRoleSelect ($a_as_select=true)

Private Attributes

 $ctrl
 $ilias
 $tabs_gui
 $lng
 $tpl
 $ref_id

Detailed Description

Constructor & Destructor Documentation

ilAuthShibbolethSettingsGUI::__construct (   $a_auth_ref_id)
Parameters
@return

Definition at line 29 of file class.ilAuthShibbolethSettingsGUI.php.

References $ilCtrl, $ilias, $lng, $tpl, and ilObject\_lookupObjId().

{
global $lng,$ilCtrl,$tpl,$ilTabs,$ilias;
$this->ctrl = $ilCtrl;
$this->tabs_gui = $ilTabs;
$this->lng = $lng;
$this->lng->loadLanguageModule('shib');
$this->ilias = $ilias;
$this->tpl = $tpl;
$this->ref_id = $a_auth_ref_id;
$this->obj_id = ilObject::_lookupObjId($this->ref_id);
}

+ Here is the call graph for this function:

Member Function Documentation

ilAuthShibbolethSettingsGUI::addRoleAssignmentRule ( )
protected

Definition at line 513 of file class.ilAuthShibbolethSettingsGUI.php.

References $ilErr, checkInput(), initFormRoleAssignment(), parseRulesTable(), roleAssignment(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and showLocalRoleSelection().

{
global $ilAccess,$ilErr;
if(!$ilAccess->checkAccess('write','',$this->ref_id))
{
ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
$this->roleAssignment();
return false;
}
if(!$this->form->checkInput() or ($err = $this->checkInput()))
{
if($err)
{
ilUtil::sendFailure($this->lng->txt($err));
}
$this->tabs_gui->setSubTabActive('shib_role_assignment');
$this->form->setValuesByPost();
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.shib_role_assignment.html','Services/AuthShibboleth');
$this->tpl->setVariable('NEW_RULE_TABLE',$this->form->getHTML());
if(strlen($html = $this->parseRulesTable()))
{
$this->tpl->setVariable('RULE_TABLE',$html);
}
return true;
}
// Redirects if required
$this->rule->add();
ilUtil::sendSuccess($this->lng->txt('settings_saved'));
$this->roleAssignment();
return true;
}

+ Here is the call graph for this function:

ilAuthShibbolethSettingsGUI::addRoleAutoCompleteObject ( )

Add Member for autoComplete.

Definition at line 506 of file class.ilAuthShibbolethSettingsGUI.php.

References ilRoleAutoCompleteInputGUI\echoAutoCompleteList().

{
include_once("./Services/Form/classes/class.ilRoleAutoCompleteInputGUI.php");
}

+ Here is the call graph for this function:

ilAuthShibbolethSettingsGUI::checkInput (   $a_rule_id = 0)
private

Definition at line 694 of file class.ilAuthShibbolethSettingsGUI.php.

References loadRule().

Referenced by addRoleAssignmentRule(), and updateRoleAssignmentRule().

{
$this->loadRule($a_rule_id);
return $this->rule->validate();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAuthShibbolethSettingsGUI::chooseRole ( )
protected

Definition at line 719 of file class.ilAuthShibbolethSettingsGUI.php.

References $_SESSION, $res, and QP_COMBINATION_AND.

{
$this->tabs_gui->setSubTabActive('shib_role_assignment');
include_once './Services/Search/classes/class.ilQueryParser.php';
$parser = new ilQueryParser($_SESSION['shib_role_ass']['search']);
$parser->setMinWordLength(1,true);
$parser->setCombination(QP_COMBINATION_AND);
$parser->parse();
include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
$object_search = new ilLikeObjectSearch($parser);
$object_search->setFilter(array('role'));
$res = $object_search->performSearch();
$entries = $res->getEntries();
include_once './Services/AccessControl/classes/class.ilRoleSelectionTableGUI.php';
$table = new ilRoleSelectionTableGUI($this,'chooseRole');
$table->setTitle($this->lng->txt('shib_role_selection'));
$table->addMultiCommand('saveRoleSelection',$this->lng->txt('shib_choose_role'));
$table->addCommandButton('roleAssignment',$this->lng->txt('cancel'));
$table->parse($entries);
$this->tpl->setContent($table->getHTML());
return true;
}
ilAuthShibbolethSettingsGUI::confirmDeleteRules ( )
protected

Confirm delete rules.

public

Parameters

Definition at line 346 of file class.ilAuthShibbolethSettingsGUI.php.

References $_POST, ilObject\_lookupTitle(), roleAssignment(), and ilUtil\sendFailure().

{
if(!is_array($_POST['rule_ids']))
{
ilUtil::sendFailure($this->lng->txt('select_one'));
$this->roleAssignment();
return false;
}
$this->tabs_gui->setSubTabActive('shib_role_assignment');
include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
$c_gui = new ilConfirmationGUI();
// set confirm/cancel commands
$c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteRules"));
$c_gui->setHeaderText($this->lng->txt("shib_confirm_del_role_ass"));
$c_gui->setCancel($this->lng->txt("cancel"), "roleAssignment");
$c_gui->setConfirm($this->lng->txt("confirm"), "deleteRules");
// add items to delete
include_once('Services/AuthShibboleth/classes/class.ilShibbolethRoleAssignmentRule.php');
foreach($_POST["rule_ids"] as $rule_id)
{
$rule = new ilShibbolethRoleAssignmentRule($rule_id);
$info = ilObject::_lookupTitle($rule->getRoleId());
$info .= " (";
$info .= $rule->conditionToString();
$info .= ')';
$c_gui->addItem('rule_ids[]',$rule_id,$info);
}
$this->tpl->setContent($c_gui->getHTML());
}

+ Here is the call graph for this function:

ilAuthShibbolethSettingsGUI::deleteRules ( )
protected

delete role assignment rule

public

Definition at line 386 of file class.ilAuthShibbolethSettingsGUI.php.

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

{
if(!is_array($_POST['rule_ids']))
{
ilUtil::sendFailure($this->lng->txt('select_once'));
$this->roleAssignment();
return false;
}
include_once('Services/AuthShibboleth/classes/class.ilShibbolethRoleAssignmentRule.php');
foreach($_POST["rule_ids"] as $rule_id)
{
$rule = new ilShibbolethRoleAssignmentRule($rule_id);
$rule->delete();
}
ilUtil::sendSuccess($this->lng->txt('shib_deleted_rule'));
$this->roleAssignment();
return true;
}

+ Here is the call graph for this function:

ilAuthShibbolethSettingsGUI::editRoleAssignment ( )
protected

Edit Role Assignment.

Returns

Definition at line 560 of file class.ilAuthShibbolethSettingsGUI.php.

References $_GET, getRuleValues(), and initFormRoleAssignment().

{
$this->ctrl->setParameter($this,'rule_id',(int) $_GET['rule_id']);
$this->tabs_gui->setSubTabActive('shib_role_assignment');
$this->initFormRoleAssignment('update');
$this->getRuleValues();
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.shib_role_assignment.html','Services/AuthShibboleth');
$this->tpl->setVariable('NEW_RULE_TABLE',$this->form->getHTML());
return true;
}

+ Here is the call graph for this function:

ilAuthShibbolethSettingsGUI::executeCommand ( )

Execute Command.

Returns
void

Definition at line 49 of file class.ilAuthShibbolethSettingsGUI.php.

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

{
global $ilAccess,$ilErr, $ilCtrl;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
if(!$ilAccess->checkAccess('read','',$this->ref_id))
{
$ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$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");
}
$this->setSubTabs();
switch($next_class)
{
default:
if(!$cmd)
{
$cmd = "settings";
}
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilAuthShibbolethSettingsGUI::getRuleValues ( )
private

Definition at line 656 of file class.ilAuthShibbolethSettingsGUI.php.

References $_GET, and ilObject\_lookupTitle().

Referenced by editRoleAssignment().

{
global $rbacreview;
include_once './Services/AuthShibboleth/classes/class.ilShibbolethRoleAssignmentRule.php';
$rule = new ilShibbolethRoleAssignmentRule((int) $_GET['rule_id']);
$role = $rule->getRoleId();
if($rbacreview->isGlobalRole($role))
{
$values['role_name'] = 0;
$values['role_id'] = $role;
}
else
{
$values['role_name'] = 1;
$values['role_search'] = ilObject::_lookupTitle($role);
}
$values['add_missing'] = (int) $rule->isAddOnUpdateEnabled();
$values['remove_deprecated'] = (int) $rule->isRemoveOnUpdateEnabled();
$values['attr_name'] = $rule->getName();
$values['attr_value'] = $rule->getValue();
if(!$rule->isPluginActive())
{
$values['kind'] = 1;
}
else
{
$values['kind'] = 2;
$values['plugin_id'] = $rule->getPluginId();
}
$this->form->setValuesByArray($values);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAuthShibbolethSettingsGUI::hasActiveRoleAssignmentPlugins ( )
private

Check if plugin is active.

Returns

Definition at line 777 of file class.ilAuthShibbolethSettingsGUI.php.

References IL_COMP_SERVICE.

Referenced by initFormRoleAssignment().

{
global $ilPluginAdmin;
return count($ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE,'AuthShibboleth','shibhk'));
}

+ Here is the caller graph for this function:

ilAuthShibbolethSettingsGUI::initFormRoleAssignment (   $a_mode = 'default')
protected

Definition at line 407 of file class.ilAuthShibbolethSettingsGUI.php.

References hasActiveRoleAssignmentPlugins(), prepareRoleSelect(), ilFormPropertyGUI\setDisabled(), ilRadioOption\setInfo(), ilFormPropertyGUI\setRequired(), ilTextInputGUI\setSize(), ilRadioGroupInputGUI\setValue(), and ilNonEditableValueGUI\setValue().

Referenced by addRoleAssignmentRule(), editRoleAssignment(), roleAssignment(), and updateRoleAssignmentRule().

{
include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this,'cancel'));
$this->form->setTitle($this->lng->txt('shib_role_ass_table'));
if($a_mode == 'default')
{
$this->form->setTitle($this->lng->txt('shib_role_ass_table'));
$this->form->addCommandButton('addRoleAssignmentRule',$this->lng->txt('shib_new_rule'));
$this->form->addCommandButton('settings',$this->lng->txt('cancel'));
}
else
{
$this->form->setTitle($this->lng->txt('shib_update_role_ass_table'));
$this->form->addCommandButton('updateRoleAssignmentRule',$this->lng->txt('save'));
$this->form->addCommandButton('roleAssignment',$this->lng->txt('cancel'));
}
// Role selection
$role = new ilRadioGroupInputGUI($this->lng->txt('shib_role_name'),'role_name');
$role->setRequired(true);
$global = new ilRadioOption($this->lng->txt('shib_global_role'),0);
$role->addOption($global);
$role_select = new ilSelectInputGUI('','role_id');
$role_select->setOptions($this->prepareRoleSelect());
$global->addSubItem($role_select);
$local = new ilRadioOption($this->lng->txt('shib_local_role'),1);
$role->addOption($local);
include_once './Services/Form/classes/class.ilRoleAutoCompleteInputGUI.php';
$role_search = new ilRoleAutoCompleteInputGUI('','role_search',$this,'addRoleAutoCompleteObject');
$role_search->setSize(40);
$local->addSubItem($role_search);
include_once './Services/AccessControl/classes/class.ilRoleAutoComplete.php';
$role->setInfo($this->lng->txt('shib_role_name_info'));
$this->form->addItem($role);
// Update options
$update = new ilNonEditableValueGUI($this->lng->txt('shib_update_roles'),'update_roles');
$update->setValue($this->lng->txt('shib_check_role_assignment'));
$add = new ilCheckboxInputGUI('','add_missing');
$add->setOptionTitle($this->lng->txt('shib_add_missing'));
$add->setValue(1);
$update->addSubItem($add);
$remove = new ilCheckboxInputGUI('','remove_deprecated');
$remove->setOptionTitle($this->lng->txt('shib_remove_deprecated'));
$remove->setValue(1);
$update->addSubItem($remove);
$this->form->addItem($update);
// Assignment type
$kind = new ilRadioGroupInputGUI($this->lng->txt('shib_assignment_type'),'kind');
$kind->setValue(1);
$kind->setRequired(true);
$attr = new ilRadioOption($this->lng->txt('shib_attribute'),1);
$attr->setInfo($this->lng->txt('shib_attr_info'));
$name = new ilTextInputGUI($this->lng->txt('shib_attribute_name'),'attr_name');
$name->setSize(32);
$attr->addSubItem($name);
$value = new ilTextInputGUI($this->lng->txt('shib_attribute_value'),'attr_value');
$value->setSize(32);
$attr->addSubItem($value);
$kind->addOption($attr);
$pl_active = (bool) $this->hasActiveRoleAssignmentPlugins();
$pl = new ilRadioOption($this->lng->txt('shib_plugin'),2);
$pl->setInfo($this->lng->txt('shib_plugin_info'));
$pl->setDisabled(!$pl_active);
$id = new ilNumberInputGUI($this->lng->txt('shib_plugin_id'),'plugin_id');
$id->setDisabled(!$pl_active);
$id->setSize(3);
$id->setMaxLength(3);
$id->setMaxValue(999);
$id->setMinValue(1);
$pl->addSubItem($id);
$kind->addOption($pl);
$this->form->addItem($kind);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAuthShibbolethSettingsGUI::loadRule (   $a_rule_id = 0)
private

Definition at line 609 of file class.ilAuthShibbolethSettingsGUI.php.

References $res, QP_COMBINATION_AND, and ilQueryParser\setMinWordLength().

Referenced by checkInput().

{
include_once('./Services/AuthShibboleth/classes/class.ilShibbolethRoleAssignmentRule.php');
$this->rule = new ilShibbolethRoleAssignmentRule($a_rule_id);
if($this->form->getInput('role_name') == 0)
{
$this->rule->setRoleId($this->form->getInput('role_id'));
}
elseif($this->form->getInput('role_search'))
{
// Search role
include_once './Services/Search/classes/class.ilQueryParser.php';
$parser = new ilQueryParser($this->form->getInput('role_search'));
// TODO: Handle minWordLength
$parser->setMinWordLength(1,true);
$parser->setCombination(QP_COMBINATION_AND);
$parser->parse();
include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
$object_search = new ilLikeObjectSearch($parser);
$object_search->setFilter(array('role'));
$res = $object_search->performSearch();
$entries = $res->getEntries();
if(count($entries) == 1)
{
$role = current($entries);
$this->rule->setRoleId($role['obj_id']);
}
elseif(count($entries) > 1)
{
$this->rule->setRoleId(-1);
}
}
$this->rule->setName($this->form->getInput('attr_name'));
$this->rule->setValue($this->form->getInput('attr_value'));
$this->rule->enableAddOnUpdate($this->form->getInput('add_missing'));
$this->rule->enableRemoveOnUpdate($this->form->getInput('remove_deprecated'));
$this->rule->enablePlugin($this->form->getInput('kind') == 2);
$this->rule->setPluginId($this->form->getInput('plugin_id'));
return $this->rule;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAuthShibbolethSettingsGUI::parseRulesTable ( )
protected

Definition at line 322 of file class.ilAuthShibbolethSettingsGUI.php.

References ilShibbolethRoleAssignmentRules\getAllRules(), and ilShibbolethRoleAssignmentRules\getCountRules().

Referenced by addRoleAssignmentRule(), and roleAssignment().

{
include_once('./Services/AuthShibboleth/classes/class.ilShibbolethRoleAssignmentRules.php');
{
return '';
}
include_once('./Services/AuthShibboleth/classes/class.ilShibbolethRoleAssignmentTableGUI.php');
$rules_table = new ilShibbolethRoleAssignmentTableGUI($this,'roleAssignment');
$rules_table->setTitle($this->lng->txt('shib_rules_tables'));
$rules_table->addMultiCommand("confirmDeleteRules", $this->lng->txt("delete"));
$rules_table->setSelectAllCheckbox("rule_id");
return $rules_table->getHTML();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAuthShibbolethSettingsGUI::prepareRoleSelect (   $a_as_select = true)
private

Definition at line 786 of file class.ilAuthShibbolethSettingsGUI.php.

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

Referenced by initFormRoleAssignment().

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

ilAuthShibbolethSettingsGUI::roleAssignment ( )
protected

Definition at line 305 of file class.ilAuthShibbolethSettingsGUI.php.

References initFormRoleAssignment(), and parseRulesTable().

Referenced by addRoleAssignmentRule(), confirmDeleteRules(), deleteRules(), saveRoleSelection(), and updateRoleAssignmentRule().

{
$this->tabs_gui->setSubTabActive('shib_role_assignment');
$this->initFormRoleAssignment('default');
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.shib_role_assignment.html','Services/AuthShibboleth');
$this->tpl->setVariable('NEW_RULE_TABLE',$this->form->getHTML());
if(strlen($html = $this->parseRulesTable()))
{
$this->tpl->setVariable('RULE_TABLE',$html);
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAuthShibbolethSettingsGUI::save ( )

Definition at line 226 of file class.ilAuthShibbolethSettingsGUI.php.

References $_POST, and ilUtil\sendSuccess().

{
global $ilUser;
// validate required data
if (
!$_POST["shib"]["login"]
or !$_POST["shib"]["hos_type"]
or !$_POST["shib"]["firstname"]
or !$_POST["shib"]["lastname"]
or !$_POST["shib"]["email"]
or !$_POST["shib"]["user_default_role"]
or !$_POST["shib"]["federation_name"]
)
{
$this->ilias->raiseError($this->lng->txt("fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
}
// validate api
if (
$_POST["shib"]["data_conv"]
and $_POST["shib"]["data_conv"] != ''
and !is_readable($_POST["shib"]["data_conv"]) )
{
$this->ilias->raiseError($this->lng->txt("shib_data_conv_warning"),$this->ilias->error_obj->MESSAGE);
}
// all ok. save settings
$shib_settings = array(
'shib_login',
'shib_title',
'shib_firstname',
'shib_lastname',
'shib_email',
'shib_gender',
'shib_institution',
'shib_department',
'shib_zipcode',
'shib_city',
'shib_country',
'shib_street',
'shib_phone_office',
'shib_phone_home',
'shib_phone_mobile',
'shib_language'
);
foreach ($shib_settings as $setting)
{
$field = ereg_replace('shib_','',$setting);
if ($_POST["shib"]["update_".$field] != "1")
$_POST["shib"]["update_".$field] = "0";
$this->ilias->setSetting($setting, trim($_POST["shib"][$field]));
$this->ilias->setSetting("shib_update_".$field, $_POST["shib"]["update_".$field]);
}
if ($_POST["shib"]["active"] != "1")
{
$this->ilias->setSetting("shib_active", "0");
}
else
{
$this->ilias->setSetting("shib_active", "1");
}
$this->ilias->setSetting("shib_user_default_role", $_POST["shib"]["user_default_role"]);
$this->ilias->setSetting("shib_hos_type", $_POST["shib"]["hos_type"]);
$this->ilias->setSetting("shib_federation_name", $_POST["shib"]["federation_name"]);
$this->ilias->setSetting("shib_idp_list", $_POST["shib"]["idp_list"]);
$this->ilias->setSetting("shib_login_instructions", $_POST["shib"]["login_instructions"]);
$this->ilias->setSetting("shib_login_button", $_POST["shib"]["login_button"]);
$this->ilias->setSetting("shib_data_conv", $_POST["shib"]["data_conv"]);
$this->ilias->setSetting("shib_auth_allow_local", ($_POST['shib']['auth_allow_local']=='1') ? '1' : '0');
ilUtil::sendSuccess($this->lng->txt("shib_settings_saved"),true);
$this->ctrl->redirect($this,'settings');
}

+ Here is the call graph for this function:

ilAuthShibbolethSettingsGUI::saveRoleSelection ( )
protected

Definition at line 747 of file class.ilAuthShibbolethSettingsGUI.php.

References $_POST, $_SESSION, roleAssignment(), and ilUtil\sendSuccess().

{
$rule = new ilShibbolethRoleAssignmentRule($_SESSION['shib_role_ass']['rule_id']);
$rule->setRoleId((int) $_POST['role_id']);
$rule->setName($_SESSION['shib_role_ass']['name']);
$rule->setValue($_SESSION['shib_role_ass']['value']);
$rule->enablePlugin($_SESSION['shib_role_ass']['plugin']);
$rule->setPluginId($_SESSION['shib_role_ass']['plugin_id']);
$rule->enableAddOnUpdate($_SESSION['shib_role_ass']['add_on_update']);
$rule->enableRemoveOnUpdate($_SESSION['shib_role_ass']['remove_on_update']);
if($rule->getRuleId())
{
$rule->update();
}
else
{
$rule->add();
}
ilUtil::sendSuccess($this->lng->txt('settings_saved'));
unset($_SESSION['shib_role_ass']);
$this->roleAssignment();
}

+ Here is the call graph for this function:

ilAuthShibbolethSettingsGUI::setSubTabs ( )
protected

Definition at line 805 of file class.ilAuthShibbolethSettingsGUI.php.

References $ilSetting, and ilShibbolethRoleAssignmentRules\getCountRules().

Referenced by executeCommand().

{
global $ilSetting;
include_once './Services/AuthShibboleth/classes/class.ilShibbolethRoleAssignmentRules.php';
if($ilSetting->get('shib_active') == 0 and ilShibbolethRoleAssignmentRules::getCountRules() == 0)
{
return false;
}
// DONE: show sub tabs if there is any role assignment rule
$this->tabs_gui->addSubTabTarget('shib_settings',
$this->ctrl->getLinkTarget($this,'settings'));
$this->tabs_gui->addSubTabTarget('shib_role_assignment',
$this->ctrl->getLinkTarget($this,'roleAssignment'));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAuthShibbolethSettingsGUI::settings ( )

Definition at line 83 of file class.ilAuthShibbolethSettingsGUI.php.

{
global $rbacsystem, $rbacreview;
$this->tabs_gui->setSubTabActive('shib_settings');
// set already saved data or default value for port
$settings = $this->ilias->getAllSettings();
// Compose role list
$role_list = $rbacreview->getRolesByFilter(2);
$selectElement = '<select name="shib[user_default_role]">';
if (!isset($settings["shib_user_default_role"]))
{
$settings["shib_user_default_role"] = 4;
}
foreach ($role_list as $role)
{
$selectElement .= '<option value="'.$role['obj_id'].'"';
if ($settings["shib_user_default_role"] == $role['obj_id'])
$selectElement .= 'selected="selected"';
$selectElement .= '>'.$role['title'].'</option>';
}
$selectElement .= '</select>';
// Set text field content
$shib_settings = array(
'shib_login',
'shib_title',
'shib_firstname',
'shib_lastname',
'shib_email',
'shib_gender',
'shib_institution',
'shib_department',
'shib_zipcode',
'shib_city',
'shib_country',
'shib_street',
'shib_phone_office',
'shib_phone_home',
'shib_phone_mobile',
'shib_language'
);
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.auth_shib.html');
foreach ($shib_settings as $setting)
{
$field = ereg_replace('shib_','',$setting);
$this->tpl->setVariable(strtoupper($setting), $settings[$setting]);
$this->tpl->setVariable('SHIB_UPDATE_'.strtoupper($field), $settings["shib_update_".$field]);
if ($settings["shib_update_".$field]) {
$this->tpl->setVariable('CHK_SHIB_UPDATE_'.strtoupper($field), 'checked="checked"');
}
}
// Set some default values
if (!isset($settings["shib_login_button"]) || $settings["shib_login_button"] == ''){
$this->tpl->setVariable("SHIB_LOGIN_BUTTON", "templates/default/images/shib_login_button.png");
}
if (isset($settings["shib_active"]) && $settings["shib_active"])
{
$this->tpl->setVariable("chk_shib_active", 'checked="checked"');
}
if ($settings['shib_auth_allow_local'] == '1')
{
$this->tpl->setVariable('CHK_SHIB_AUTH_ALLOW_LOCAL', 'checked="checked"');
}
if (
!isset($settings["shib_hos_type"])
|| $settings["shib_hos_type"] == ''
|| $settings["shib_hos_type"] == 'internal_wayf'
)
{
$this->tpl->setVariable("CHK_SHIB_LOGIN_INTERNAL_WAYF", 'checked="checked"');
$this->tpl->setVariable("CHK_SHIB_LOGIN_EXTERNAL_WAYF", '');
$this->tpl->setVariable("CHK_SHIB_LOGIN_EMBEDDED_WAYF", '');
} elseif($settings["shib_hos_type"] == 'embedded_wayf'){
$this->tpl->setVariable("CHK_SHIB_LOGIN_INTERNAL_WAYF", '');
$this->tpl->setVariable("CHK_SHIB_LOGIN_EXTERNAL_WAYF", '');
$this->tpl->setVariable("CHK_SHIB_LOGIN_EMBEDDED_WAYF", 'checked="checked"');
} else {
$this->tpl->setVariable("CHK_SHIB_LOGIN_INTERNAL_WAYF", '');
$this->tpl->setVariable("CHK_SHIB_LOGIN_EXTERNAL_WAYF", 'checked="checked"');
$this->tpl->setVariable("CHK_SHIB_LOGIN_EMBEDDED_WAYF", '');
}
if (!isset($settings["shib_idp_list"]) || $settings["shib_idp_list"] == '')
{
$this->tpl->setVariable("SHIB_IDP_LIST", "urn:mace:organization1:providerID, Example Organization 1\nurn:mace:organization2:providerID, Example Organization 2, /Shibboleth.sso/WAYF/SWITCHaai");
} else {
$this->tpl->setVariable("SHIB_IDP_LIST", stripslashes($settings["shib_idp_list"]));
}
$this->tpl->setVariable("SHIB_USER_DEFAULT_ROLE", $selectElement);
$this->tpl->setVariable("SHIB_LOGIN_BUTTON", $settings["shib_login_button"]);
$this->tpl->setVariable("SHIB_LOGIN_INSTRUCTIONS", stripslashes($settings["shib_login_instructions"]));
$this->tpl->setVariable("SHIB_FEDERATION_NAME", stripslashes($settings["shib_federation_name"]));
$this->tpl->setVariable("SHIB_DATA_CONV", $settings["shib_data_conv"]);
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("COLSPAN", 3);
$this->tpl->setVariable("TXT_SHIB_INSTRUCTIONS",
$this->lng->txt("auth_shib_instructions"));
$this->tpl->setVariable("LINK_SHIB_INSTRUCTIONS",
"./Services/AuthShibboleth/README.SHIBBOLETH.txt");
$this->tpl->setVariable("TXT_SHIB", $this->lng->txt("shib"));
$this->tpl->setVariable("TXT_OPTIONS", $this->lng->txt("options"));
$this->tpl->setVariable("TXT_SHIB_UPDATE", $this->lng->txt("shib_update"));
$this->tpl->setVariable("TXT_SHIB_ACTIVE", $this->lng->txt("shib_active"));
$this->tpl->setVariable("TXT_SHIB_USER_DEFAULT_ROLE", $this->lng->txt("shib_user_default_role"));
$this->tpl->setVariable("TXT_SHIB_LOGIN_BUTTON", $this->lng->txt("shib_login_button"));
$this->tpl->setVariable("TXT_SHIB_LOGIN_TYPE", $this->lng->txt("shib_login_type"));
$this->tpl->setVariable("TXT_SHIB_LOGIN_INTERNAL_WAYF", $this->lng->txt("shib_login_internal_wayf"));
$this->tpl->setVariable("TXT_SHIB_LOGIN_EXTERNAL_WAYF", $this->lng->txt("shib_login_external_wayf"));
$this->tpl->setVariable("TXT_SHIB_IDP_LIST", $this->lng->txt("shib_idp_list"));
$this->tpl->setVariable("TXT_SHIB_FEDERATION_NAME", $this->lng->txt("shib_federation_name"));
$this->tpl->setVariable("TXT_SHIB_LOGIN_EMBEDDED_WAYF", $this->lng->txt("shib_login_embedded_wayf"));
$this->tpl->setVariable("TXT_SHIB_LOGIN_EMBEDDED_WAYF_DESCRIPTION", $this->lng->txt("shib_login_embedded_wayf_description"));
$this->tpl->setVariable("TXT_SHIB_LOGIN_INSTRUCTIONS", $this->lng->txt("auth_login_instructions"));
$this->tpl->setVariable("TXT_SHIB_DATA_CONV", $this->lng->txt("shib_data_conv"));
$this->tpl->setVariable("TXT_SHIB_AUTH_ALLOW_LOCAL", $this->lng->txt("auth_allow_local"));
foreach ($shib_settings as $setting)
{
$this->tpl->setVariable("TXT_".strtoupper($setting), $this->lng->txt($setting));
}
$this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
$this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
$this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
$this->tpl->setVariable("CMD_SUBMIT", "save");
}
ilAuthShibbolethSettingsGUI::showLocalRoleSelection ( )
private

Definition at line 700 of file class.ilAuthShibbolethSettingsGUI.php.

References $_REQUEST, and $_SESSION.

Referenced by addRoleAssignmentRule(), and updateRoleAssignmentRule().

{
if($this->rule->getRoleId() > 0)
{
return false;
}
$_SESSION['shib_role_ass']['rule_id'] = $_REQUEST['rule_id'] ? $_REQUEST['rule_id'] : 0;
$_SESSION['shib_role_ass']['search'] = $this->form->getInput('role_search');
$_SESSION['shib_role_ass']['add_on_update'] = $this->rule->isAddOnUpdateEnabled();
$_SESSION['shib_role_ass']['remove_on_update'] = $this->rule->isRemoveOnUpdateEnabled();
$_SESSION['shib_role_ass']['name'] = $this->rule->getName();
$_SESSION['shib_role_ass']['value'] = $this->rule->getValue();
$_SESSION['shib_role_ass']['plugin'] = $this->rule->isPluginActive();
$_SESSION['shib_role_ass']['plugin_id'] = $this->rule->getPluginId();
$this->ctrl->redirect($this,'chooseRole');
}

+ Here is the caller graph for this function:

ilAuthShibbolethSettingsGUI::updateRoleAssignmentRule ( )
protected

Definition at line 574 of file class.ilAuthShibbolethSettingsGUI.php.

References $_REQUEST, $ilErr, checkInput(), initFormRoleAssignment(), roleAssignment(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and showLocalRoleSelection().

{
global $ilAccess,$ilErr;
if(!$ilAccess->checkAccess('write','',$this->ref_id))
{
ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
$this->roleAssignment();
return false;
}
if(!$this->form->checkInput() or ($err = $this->checkInput((int) $_REQUEST['rule_id'])))
{
if($err)
{
ilUtil::sendFailure($this->lng->txt($err));
}
$this->tabs_gui->setSubTabActive('shib_role_assignment');
$this->form->setValuesByPost();
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.shib_role_assignment.html','Services/AuthShibboleth');
$this->tpl->setVariable('NEW_RULE_TABLE',$this->form->getHTML());
return true;
}
$this->showLocalRoleSelection('update');
$this->rule->update();
ilUtil::sendSuccess($this->lng->txt('settings_saved'));
$this->roleAssignment();
return true;
}

+ Here is the call graph for this function:

Field Documentation

ilAuthShibbolethSettingsGUI::$ctrl
private

Definition at line 16 of file class.ilAuthShibbolethSettingsGUI.php.

ilAuthShibbolethSettingsGUI::$ilias
private

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

Referenced by __construct().

ilAuthShibbolethSettingsGUI::$lng
private

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

Referenced by __construct().

ilAuthShibbolethSettingsGUI::$ref_id
private

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

ilAuthShibbolethSettingsGUI::$tabs_gui
private

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

ilAuthShibbolethSettingsGUI::$tpl
private

Definition at line 20 of file class.ilAuthShibbolethSettingsGUI.php.

Referenced by __construct().


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