ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjAuthSettingsGUI Class Reference

Class ilObjAuthSettingsGUI. More...

+ Inheritance diagram for ilObjAuthSettingsGUI:
+ Collaboration diagram for ilObjAuthSettingsGUI:

Public Member Functions

 ilObjAuthSettingsGUI ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor public. More...
 
 viewObject ()
 
 authSettingsObject ()
 display settings menu More...
 
 loginInfoObject ()
 displays login information of all installed languages More...
 
 cancelObject ()
 
 setAuthModeObject ()
 
 editSOAPObject ()
 Configure soap settings. More...
 
 testSoapAuthConnectionObject ()
 
 saveSOAPObject ()
 validates all input data, save them to database if correct and active chosen auth mode More...
 
 editScriptObject ()
 Configure Custom settings. More...
 
 saveScriptObject ()
 validates all input data, save them to database if correct and active chosen auth mode More...
 
 getAuthModeTitle ()
 get the title of auth mode More...
 
 updateAuthRolesObject ()
 
 updateAuthModeDeterminationObject ()
 update auth mode determination More...
 
 executeCommand ()
 Execute command. More...
 
 getAdminTabs (&$tabs_gui)
 
 getTabs (&$tabs_gui)
 get tabs public More...
 
 setSubTabs ($a_tab)
 set sub tabs More...
 
 apacheAuthSettingsObject ($form=false)
 
 saveApacheSettingsObject ()
 
 getApacheAuthSettingsForm ()
 
 addToExternalSettingsForm ($a_form_id)
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public. More...
 
executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Protected Member Functions

 initAuthModeDetermination ()
 init auth mode determinitation form More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Private Member Functions

 validateApacheAuthAllowedDomains ($text)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

Detailed Description

Member Function Documentation

◆ addToExternalSettingsForm()

ilObjAuthSettingsGUI::addToExternalSettingsForm (   $a_form_id)
Parameters
string$a_form_id
Returns
array

Definition at line 1206 of file class.ilObjAuthSettingsGUI.php.

References ilAdministrationSettingsFormHandler\FORM_ACCESSIBILITY, and ilAdministrationSettingsFormHandler\VALUE_BOOL.

1207  {
1208  switch($a_form_id)
1209  {
1211  require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
1212  $fields = array(
1213  'adm_captcha_anonymous_short' => array(ilCaptchaUtil::isActiveForLogin(), ilAdministrationSettingsFormHandler::VALUE_BOOL),
1214  );
1215 
1216  return array('authentication_settings' => array('authSettings', $fields));
1217  }
1218  }

◆ apacheAuthSettingsObject()

ilObjAuthSettingsGUI::apacheAuthSettingsObject (   $form = false)

Definition at line 1014 of file class.ilObjAuthSettingsGUI.php.

References $path, ilObjectGUI\$tpl, and getApacheAuthSettingsForm().

Referenced by saveApacheSettingsObject().

1015  {
1016  global $tpl;
1017 
1018  $this->tabs_gui->setTabActive("apache_auth_settings");
1019 
1020  if (!$form)
1021  {
1022  $form = $this->getApacheAuthSettingsForm();
1023 
1024  $settings = new ilSetting('apache_auth');
1025  $settingsMap = $settings->getAll();
1026 
1027  $path = ILIAS_DATA_DIR . '/' . CLIENT_ID . '/apache_auth_allowed_domains.txt';
1028  if (file_exists($path) && is_readable($path)) {
1029  $settingsMap['apache_auth_domains'] = file_get_contents($path);
1030  }
1031 
1032  $form->setValuesByArray($settingsMap);
1033  }
1034  $tpl->setVariable('ADM_CONTENT', $form->getHtml());
1035  }
ILIAS Setting Class.
$path
Definition: index.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ authSettingsObject()

ilObjAuthSettingsGUI::authSettingsObject ( )

display settings menu

public

Definition at line 50 of file class.ilObjAuthSettingsGUI.php.

References $ilSetting, $server, ilAuthUtils\_getActiveAuthModes(), ilAuthUtils\_getAllAuthModes(), ilAuthUtils\_getAuthModeName(), ilObjUser\_getNumberOfUsersPerAuthMode(), ilObjRole\_lookupRegisterAllowed(), AUTH_APACHE, AUTH_CAS, AUTH_LDAP, AUTH_LOCAL, AUTH_RADIUS, AUTH_SHIBBOLETH, ilLDAPServer\getInstanceByServerId(), ilLDAPServer\getServerIdByAuthMode(), initAuthModeDetermination(), ilLDAPServer\isAuthModeLDAP(), and setSubTabs().

Referenced by updateAuthModeDeterminationObject(), and viewObject().

51  {
52  global $rbacsystem, $ilSetting;
53 
54  if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
55  {
56  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
57  }
58 
59  $this->tabs_gui->setTabActive('authentication_settings');
60  $this->setSubTabs('authSettings');
61  $this->tabs_gui->setSubTabActive("auth_settings");
62 
63  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.auth_general.html",
64  "Services/Authentication");
65 
66  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
67  $this->tpl->setVariable("TXT_AUTH_TITLE", $this->lng->txt("auth_select"));
68 
69  $this->tpl->setVariable("TXT_AUTH_MODE", $this->lng->txt("auth_mode"));
70  $this->tpl->setVariable("TXT_AUTH_DEFAULT", $this->lng->txt("default"));
71  $this->tpl->setVariable("TXT_AUTH_ACTIVE", $this->lng->txt("active"));
72  $this->tpl->setVariable("TXT_AUTH_NUM_USERS", $this->lng->txt("num_users"));
73 
74  $this->tpl->setVariable("TXT_LOCAL", $this->lng->txt("auth_local"));
75  $this->tpl->setVariable("TXT_LDAP", $this->lng->txt("auth_ldap"));
76  $this->tpl->setVariable("TXT_SHIB", $this->lng->txt("auth_shib"));
77 
78  $this->tpl->setVariable("TXT_CAS", $this->lng->txt("auth_cas"));
79 
80  $this->tpl->setVariable("TXT_RADIUS", $this->lng->txt("auth_radius"));
81  $this->tpl->setVariable("TXT_SCRIPT", $this->lng->txt("auth_script"));
82 
83  $this->tpl->setVariable("TXT_APACHE", $this->lng->txt("auth_apache"));
84 
86  $auth_modes = ilAuthUtils::_getAllAuthModes();
88  include_once('Services/LDAP/classes/class.ilLDAPServer.php');
89  // icon handlers
90  $icon_ok = "<img src=\"".ilUtil::getImagePath("icon_ok.svg")."\" alt=\"".$this->lng->txt("enabled")."\" title=\"".$this->lng->txt("enabled")."\" border=\"0\" vspace=\"0\"/>";
91  $icon_not_ok = "<img src=\"".ilUtil::getImagePath("icon_not_ok.svg")."\" alt=\"".$this->lng->txt("disabled")."\" title=\"".$this->lng->txt("disabled")."\" border=\"0\" vspace=\"0\"/>";
92 
93 
94  foreach($auth_modes as $mode => $mode_name)
95  {
96  if(!in_array($mode,$valid_modes) && !ilLDAPServer::isAuthModeLDAP($mode))
97  {
98  continue;
99  }
100 
101  $this->tpl->setCurrentBlock('auth_mode');
102 
104  {
106  $this->tpl->setVariable("AUTH_NAME", $server->getName());
107  $this->tpl->setVariable('AUTH_ACTIVE',$server->isActive() ? $icon_ok : $icon_not_ok);
108  }
109  else
110  {
111  $this->tpl->setVariable("AUTH_NAME", $this->lng->txt("auth_" . $mode_name));
112  $this->tpl->setVariable('AUTH_ACTIVE',$this->ilias->getSetting($mode_name . '_active') || $mode == AUTH_LOCAL ? $icon_ok : $icon_not_ok);
113  }
114 
115  if ($ilSetting->get('auth_mode') == $mode)
116  {
117  $this->tpl->setVariable("AUTH_CHECKED","checked=\"checked\"");
118 
119  $this->tpl->setVariable("AUTH_USER_NUM",
120  ((int) $auth_cnt[$mode_name] + $auth_cnt["default"])." (".$this->lng->txt("auth_per_default").
121  ": ".$auth_cnt["default"].")");
122  }
123  else
124  {
125  $this->tpl->setVariable("AUTH_USER_NUM",
126  (int) $auth_cnt[$mode_name]);
127  }
128  $this->tpl->setVariable("AUTH_ID",$mode_name);
129  $this->tpl->setVariable("AUTH_VAL",$mode);
130  $this->tpl->parseCurrentBlock();
131  }
132 
133  $this->tpl->setVariable("TXT_CONFIGURE", $this->lng->txt("auth_configure"));
134  $this->tpl->setVariable("TXT_AUTH_REMARK", $this->lng->txt("auth_remark_non_local_auth"));
135  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
136  $this->tpl->setVariable("CMD_SUBMIT", "setAuthMode");
137 
138  // auth mode determinitation
139  if($this->initAuthModeDetermination())
140  {
141  $this->tpl->setVariable('TABLE_AUTH_DETERMINATION',$this->form->getHTML());
142  }
143 
144  // roles table
145  $this->tpl->setVariable("FORMACTION_ROLES",
146  $this->ctrl->getFormAction($this));
147  $this->tpl->setVariable("TXT_AUTH_ROLES", $this->lng->txt("auth_active_roles"));
148  $this->tpl->setVariable("TXT_ROLE", $this->lng->txt("obj_role"));
149  $this->tpl->setVariable("TXT_ROLE_AUTH_MODE", $this->lng->txt("auth_role_auth_mode"));
150  $this->tpl->setVariable("CMD_SUBMIT_ROLES", "updateAuthRoles");
151 
152  include_once("./Services/AccessControl/classes/class.ilObjRole.php");
153  $reg_roles = ilObjRole::_lookupRegisterAllowed();
154 
155  // auth mode selection
156  include_once('./Services/Authentication/classes/class.ilAuthUtils.php');
157  $active_auth_modes = ilAuthUtils::_getActiveAuthModes();
158 
159  foreach ($reg_roles as $role)
160  {
161  foreach ($active_auth_modes as $auth_name => $auth_key)
162  {
163  // do not list auth modes with external login screen
164  // even not default, because it can easily be set to
165  // a non-working auth mode
166  if ($auth_name == "default" || $auth_name == "cas"
167  || $auth_name == "shibboleth" || $auth_name == 'ldap'
168  || $auth_name == 'apache' || $auth_name == "ecs"
169  || $auth_name == "openid")
170  {
171  continue;
172  }
173 
174  $this->tpl->setCurrentBlock("auth_mode_selection");
175 
176  if ($auth_name == 'default')
177  {
178  $name = $this->lng->txt('auth_'.$auth_name)." (".$this->lng->txt('auth_'.ilAuthUtils::_getAuthModeName($auth_key)).")";
179  }
180  else if($id = ilLDAPServer::getServerIdByAuthMode($auth_key))
181  {
183  $name = $server->getName();
184  }
185  else
186  {
187  $name = $this->lng->txt('auth_'.$auth_name);
188  }
189 
190  $this->tpl->setVariable("AUTH_MODE_NAME", $name);
191 
192  $this->tpl->setVariable("AUTH_MODE", $auth_name);
193 
194  if ($role['auth_mode'] == $auth_name)
195  {
196  $this->tpl->setVariable("SELECTED_AUTH_MODE", "selected=\"selected\"");
197  }
198 
199  $this->tpl->parseCurrentBlock();
200  } // END auth_mode selection
201 
202  $this->tpl->setCurrentBlock("roles");
203  $this->tpl->setVariable("ROLE", $role['title']);
204  $this->tpl->setVariable("ROLE_ID", $role['id']);
205  $this->tpl->parseCurrentBlock();
206  }
207  }
static isAuthModeLDAP($a_auth_mode)
Check if user auth mode is LDAP.
const AUTH_LDAP
const AUTH_CAS
const AUTH_SHIBBOLETH
const AUTH_APACHE
static _getAuthModeName($a_auth_key)
static getInstanceByServerId($a_server_id)
Get instance by server id.
_getNumberOfUsersPerAuthMode()
get number of users per auth mode
initAuthModeDetermination()
init auth mode determinitation form
redirection script todo: (a better solution should control the processing via a xml file) ...
const AUTH_LOCAL
static getServerIdByAuthMode($a_auth_mode)
Get auth id by auth mode.
_lookupRegisterAllowed()
get all roles that are activated in user registration
$server
global $ilSetting
Definition: privfeed.php:40
const AUTH_RADIUS
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancelObject()

ilObjAuthSettingsGUI::cancelObject ( )

Definition at line 242 of file class.ilObjAuthSettingsGUI.php.

243  {
244  $this->ctrl->redirect($this, "authSettings");
245  }

◆ editScriptObject()

ilObjAuthSettingsGUI::editScriptObject ( )

Configure Custom settings.

public

Definition at line 553 of file class.ilObjAuthSettingsGUI.php.

References $_SESSION.

554  {
555  global $rbacsystem;
556 
557  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
558  {
559  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
560  }
561 
562  if ($_SESSION["error_post_vars"])
563  {
564  $this->tpl->setVariable("AUTH_SCRIPT_NAME", $_SESSION["error_post_vars"]["auth_script"]["name"]);
565  }
566  else
567  {
568  // set already saved data
569  $settings = $this->ilias->getAllSettings();
570 
571  $this->tpl->setVariable("AUTH_SCRIPT_NAME", $settings["auth_script_name"]);
572  }
573 
574  $this->tabs_gui->setTabActive('auth_script');
575 
576  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.auth_script.html",
577  "Services/Authentication");
578 
579  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
580  $this->tpl->setVariable("COLSPAN", 3);
581  $this->tpl->setVariable("TXT_AUTH_SCRIPT_TITLE", $this->lng->txt("auth_script_configure"));
582  $this->tpl->setVariable("TXT_OPTIONS", $this->lng->txt("options"));
583  $this->tpl->setVariable("TXT_AUTH_SCRIPT_NAME", $this->lng->txt("auth_script_name"));
584 
585  $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
586  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
587  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
588  $this->tpl->setVariable("CMD_SUBMIT", "saveScript");
589  }
$_SESSION["AccountId"]
redirection script todo: (a better solution should control the processing via a xml file) ...

◆ editSOAPObject()

ilObjAuthSettingsGUI::editSOAPObject ( )

Configure soap settings.

public

Definition at line 316 of file class.ilObjAuthSettingsGUI.php.

References $_POST, $_SESSION, $https, $ilCtrl, $ilSetting, ilObjectGUI\$lng, $namespace, $ret, $server, and ilUtil\stripSlashes().

Referenced by testSoapAuthConnectionObject().

317  {
318  global $rbacsystem, $rbacreview, $ilSetting, $ilCtrl, $lng;
319 
320  if (!$rbacsystem->checkAccess("read",$this->object->getRefId()))
321  {
322  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
323  }
324 
325  $this->tabs_gui->setTabActive('auth_soap');
326 
327  //set Template
328  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.auth_soap.html','Services/Authentication');
329 
330  // compose role list
331  $role_list = $rbacreview->getRolesByFilter(2,$this->object->getId());
332  $roles = array();
333 
334  foreach ($role_list as $role)
335  {
336  $roles[$role['obj_id']] = $role['title'];
337  }
338 
339  //set property form gui
340  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
341 
342  $soap_config = new ilPropertyFormGUI();
343  $soap_config->setTitle($this->lng->txt("auth_soap_auth"));
344  $soap_config->setDescription($this->lng->txt("auth_soap_auth_desc"));
345  $soap_config->setFormAction($this->ctrl->getFormAction($this, "editSOAP"));
346  $soap_config->addCommandButton("saveSOAP", $this->lng->txt("save"));
347  $soap_config->addCommandButton("editSOAP", $this->lng->txt("cancel"));
348 
349  //set activ
350  $active = new ilCheckboxInputGUI();
351  $active->setTitle($this->lng->txt("active"));
352  $active->setPostVar("soap[active]");
353 
354  //set server
355  $server = new ilTextInputGUI();
356  $server->setTitle($this->lng->txt("server"));
357  $server->setInfo($this->lng->txt("auth_soap_server_desc"));
358  $server->setPostVar("soap[server]");
359  $server->setSize(50);
360  $server->setMaxLength(256);
361  $server->setRequired(true);
362 
363  //set port
364  $port = new ilTextInputGUI();
365  $port->setTitle($this->lng->txt("port"));
366  $port->setInfo($this->lng->txt("auth_soap_port_desc"));
367  $port->setPostVar("soap[port]");
368  $port->setSize(7);
369  $port->setMaxLength(5);
370 
371  //set https
372  $https = new ilCheckboxInputGUI();
373  $https->setTitle($this->lng->txt("auth_soap_use_https"));
374  $https->setPostVar("soap[use_https]");
375 
376  //set uri
377  $uri = new ilTextInputGUI();
378  $uri->setTitle($this->lng->txt("uri"));
379  $uri->setInfo($this->lng->txt("auth_soap_uri_desc"));
380  $uri->setPostVar("soap[uri]");
381  $uri->setSize(50);
382  $uri->setMaxLength(256);
383 
384  //set namespace
385  $namespace = new ilTextInputGUI();
386  $namespace->setTitle($this->lng->txt("auth_soap_namespace"));
387  $namespace->setInfo($this->lng->txt("auth_soap_namespace_desc"));
388  $namespace->setPostVar("soap[namespace]");
389  $namespace->setSize(50);
390  $namespace->setMaxLength(256);
391 
392  //set dotnet
393  $dotnet = new ilCheckboxInputGUI();
394  $dotnet->setTitle($this->lng->txt("auth_soap_use_dotnet"));
395  $dotnet->setPostVar("soap[use_dotnet]");
396 
397  //set create users
398  $createuser = new ilCheckboxInputGUI();
399  $createuser->setTitle($this->lng->txt("auth_create_users"));
400  $createuser->setInfo($this->lng->txt("auth_soap_create_users_desc"));
401  $createuser->setPostVar("soap[create_users]");
402 
403  //set account mail
404  $sendmail = new ilCheckboxInputGUI();
405  $sendmail->setTitle($this->lng->txt("user_send_new_account_mail"));
406  $sendmail->setInfo($this->lng->txt("auth_new_account_mail_desc"));
407  $sendmail->setPostVar("soap[account_mail]");
408 
409  //set user default role
410  $defaultrole = new ilSelectInputGUI();
411  $defaultrole->setTitle($this->lng->txt("auth_user_default_role"));
412  $defaultrole->setInfo($this->lng->txt("auth_soap_user_default_role_desc"));
413  $defaultrole->setPostVar("soap[user_default_role]");
414  $defaultrole->setOptions($roles);
415 
416  //set allow local authentication
417  $allowlocal = new ilCheckboxInputGUI();
418  $allowlocal->setTitle($this->lng->txt("auth_allow_local"));
419  $allowlocal->setInfo($this->lng->txt("auth_soap_allow_local_desc"));
420  $allowlocal->setPostVar("soap[allow_local]");
421 
422  // get all settings
423  $settings = $ilSetting->getAll();
424 
425  // get values in error case
426  if ($_SESSION["error_post_vars"])
427  {
428  $active ->setChecked($_SESSION["error_post_vars"]["soap"]["active"]);
429  $server ->setValue($_SESSION["error_post_vars"]["soap"]["server"]);
430  $port ->setValue($_SESSION["error_post_vars"]["soap"]["port"]);
431  $https ->setChecked($_SESSION["error_post_vars"]["soap"]["use_https"]);
432  $uri ->setValue($_SESSION["error_post_vars"]["soap"]["uri"]);
433  $namespace ->setValue($_SESSION["error_post_vars"]["soap"]["namespace"]);
434  $dotnet ->setChecked($_SESSION["error_post_vars"]["soap"]["use_dotnet"]);
435  $createuser ->setChecked($_SESSION["error_post_vars"]["soap"]["create_users"]);
436  $allowlocal ->setChecked($_SESSION["error_post_vars"]["soap"]["allow_local"]);
437  $defaultrole->setValue($_SESSION["error_post_vars"]["soap"]["user_default_role"]);
438  $sendmail ->setChecked($_SESSION["error_post_vars"]["soap"]["account_mail"]);
439  }
440  else
441  {
442  $active ->setChecked($settings["soap_auth_active"]);
443  $server ->setValue($settings["soap_auth_server"]);
444  $port ->setValue($settings["soap_auth_port"]);
445  $https ->setChecked($settings["soap_auth_use_https"]);
446  $uri ->setValue($settings["soap_auth_uri"]);
447  $namespace ->setValue($settings["soap_auth_namespace"]);
448  $dotnet ->setChecked($settings["soap_auth_use_dotnet"]);
449  $createuser ->setChecked($settings["soap_auth_create_users"]);
450  $allowlocal ->setChecked($settings["soap_auth_allow_local"]);
451  $defaultrole->setValue($settings["soap_auth_user_default_role"]);
452  $sendmail ->setChecked($settings["soap_auth_account_mail"]);
453  }
454 
455  if (!$defaultrole->getValue())
456  {
457  $defaultrole->setValue(4);
458  }
459 
460  //add Items to property gui
461  $soap_config->addItem($active);
462  $soap_config->addItem($server);
463  $soap_config->addItem($port);
464  $soap_config->addItem($https);
465  $soap_config->addItem($uri);
466  $soap_config->addItem($namespace);
467  $soap_config->addItem($dotnet);
468  $soap_config->addItem($createuser);
469  $soap_config->addItem($sendmail);
470  $soap_config->addItem($defaultrole);
471  $soap_config->addItem($allowlocal);
472 
473  $this->tpl->setVariable("CONFIG_FORM", $soap_config->getHTML());
474 
475  // test form
476  $form = new ilPropertyFormGUI();
477  $form->setFormAction($ilCtrl->getFormAction($this));
478  $form->setTitle("Test Request");
479  $text_prop = new ilTextInputGUI("ext_uid", "ext_uid");
480  $form->addItem($text_prop);
481  $text_prop2 = new ilTextInputGUI("soap_pw", "soap_pw");
482  $form->addItem($text_prop2);
483  $cb = new ilCheckboxInputGUI("new_user", "new_user");
484  $form->addItem($cb);
485 
486  $form->addCommandButton("testSoapAuthConnection",
487  "Send");
488 
489  if ($ilCtrl->getCmd() == "testSoapAuthConnection")
490  {
491  include_once("./Services/SOAPAuth/classes/class.ilSOAPAuth.php");
492  $ret = "<br />".ilSOAPAuth::testConnection(
493  ilUtil::stripSlashes($_POST["ext_uid"]),
494  ilUtil::stripSlashes($_POST["soap_pw"]),
495  (boolean) $_POST["new_user"]
496  );
497  }
498  $this->tpl->setVariable("TEST_FORM", $form->getHTML().$ret);
499  }
if($err=$client->getError()) $namespace
$_POST['username']
Definition: cron.php:12
$_SESSION["AccountId"]
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a checkbox property in a property form.
global $ilCtrl
Definition: ilias.php:18
global $https
Definition: imgupload.php:15
This class represents a text property in a property form.
redirection script todo: (a better solution should control the processing via a xml file) ...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$server
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjAuthSettingsGUI::executeCommand ( )

Execute command.

Called from control class ilAccessHandler $ilAccess ilErrorHandling $ilErr

Returns
void

Definition at line 816 of file class.ilObjAuthSettingsGUI.php.

References $cmd, $ilErr, $ret, ilObjectGUI\prepareOutput(), and setSubTabs().

817  {
818  global $ilAccess,$ilErr;
819 
820  $next_class = $this->ctrl->getNextClass($this);
821  $cmd = $this->ctrl->getCmd();
822  $this->prepareOutput();
823 
824 
825  if(!$ilAccess->checkAccess('read','',$this->object->getRefId()))
826  {
827  $ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$ilErr->WARNING);
828  }
829 
830  switch($next_class)
831  {
832  case 'ilregistrationsettingsgui':
833 
834  include_once './Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
835 
836  // Enable tabs
837  $this->tabs_gui->setTabActive('registration_settings');
838  $registration_gui =& new ilRegistrationSettingsGUI();
839  $this->ctrl->forwardCommand($registration_gui);
840  break;
841 
842  case 'ilpermissiongui':
843 
844  // Enable tabs
845  $this->tabs_gui->setTabActive('perm_settings');
846 
847  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
848  $perm_gui =& new ilPermissionGUI($this);
849  $ret =& $this->ctrl->forwardCommand($perm_gui);
850  break;
851 
852  case 'illdapsettingsgui':
853 
854  // Enable Tabs
855  $this->tabs_gui->setTabActive('auth_ldap');
856 
857  include_once './Services/LDAP/classes/class.ilLDAPSettingsGUI.php';
858  $ldap_settings_gui = new ilLDAPSettingsGUI($this->object->getRefId());
859  $this->ctrl->forwardCommand($ldap_settings_gui);
860  break;
861 
862  case 'ilauthshibbolethsettingsgui':
863 
864  $this->tabs_gui->setTabActive('auth_shib');
865  include_once('./Services/AuthShibboleth/classes/class.ilAuthShibbolethSettingsGUI.php');
866  $shib_settings_gui = new ilAuthShibbolethSettingsGUI($this->object->getRefId());
867  $this->ctrl->forwardCommand($shib_settings_gui);
868  break;
869 
870  case 'ilcassettingsgui':
871 
872  $this->tabs_gui->setTabActive('auth_cas');
873  include_once './Services/CAS/classes/class.ilCASSettingsGUI.php';
874  $cas_settings = new ilCASSettingsGUI($this->object->getRefId());
875  $this->ctrl->forwardCommand($cas_settings);
876  break;
877 
878  case 'ilradiussettingsgui':
879 
880  $this->tabs_gui->setTabActive('auth_radius');
881  include_once './Services/Radius/classes/class.ilRadiusSettingsGUI.php';
882  $radius_settings_gui = new ilRadiusSettingsGUI($this->object->getRefId());
883  $this->ctrl->forwardCommand($radius_settings_gui);
884  break;
885 
886  case 'ilopenidsettingsgui':
887 
888  $this->tabs_gui->setTabActive('auth_openid');
889 
890  include_once './Services/OpenId/classes/class.ilOpenIdSettingsGUI.php';
891  $os = new ilOpenIdSettingsGUI($this->object->getRefId());
892  $this->ctrl->forwardCommand($os);
893  break;
894 
895  case 'ilauthloginpageeditorgui':
896 
897  $this->setSubTabs("authSettings");
898  $this->tabs_gui->setTabActive('authentication_settings');
899  $this->tabs_gui->setSubTabActive("auth_login_editor");
900 
901  include_once './Services/Authentication/classes/class.ilAuthLoginPageEditorGUI.php';
902  $lpe = new ilAuthLoginPageEditorGUI($this->object->getRefId());
903  $this->ctrl->forwardCommand($lpe);
904  break;
905 
906  default:
907  if(!$cmd)
908  {
909  $cmd = "authSettings";
910  }
911  $cmd .= "Object";
912  $this->$cmd();
913 
914  break;
915  }
916  return true;
917  }
Login page editor settings GUI ILIAS page editor or richtext editor.
Class ilAuthShibbolethSettingsGUI.
$cmd
Definition: sahs_server.php:35
Class ilRegistrationSettingsGUI.
prepareOutput()
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjAuthSettingsGUI::getAdminTabs ( $tabs_gui)

Definition at line 919 of file class.ilObjAuthSettingsGUI.php.

References getTabs().

920  {
921  $this->getTabs($tabs_gui);
922  }
getTabs(&$tabs_gui)
get tabs public
+ Here is the call graph for this function:

◆ getApacheAuthSettingsForm()

ilObjAuthSettingsGUI::getApacheAuthSettingsForm ( )

Definition at line 1086 of file class.ilObjAuthSettingsGUI.php.

References $GLOBALS, $options, $txt, ilObject\_lookupTitle(), ilSubEnabledFormPropertyGUI\addSubItem(), AUTH_APACHE, ilLDAPServer\getDataSource(), ilLDAPServer\getServerIds(), ilRadioOption\setDisabled(), ilFormPropertyGUI\setInfo(), and ilSelectInputGUI\setOptions().

Referenced by apacheAuthSettingsObject(), and saveApacheSettingsObject().

1087  {
1088  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1089 
1090  $form = new ilPropertyFormGUI();
1091  $form->setFormAction($this->ctrl->getFormAction($this));
1092  $form->setTitle($this->lng->txt('apache_settings'));
1093 
1094  $chb_enabled = new ilCheckboxInputGUI($this->lng->txt('apache_enable_auth'), 'apache_enable_auth');
1095  $form->addItem($chb_enabled);
1096 
1097  $chb_local_create_account = new ilCheckboxInputGUI($this->lng->txt('apache_autocreate'), 'apache_local_autocreate');
1098  $chb_enabled->addSubitem($chb_local_create_account);
1099 
1100  global $rbacreview;
1101  $roles = $rbacreview->getGlobalRolesArray();
1102  $select = new ilSelectInputGUI($this->lng->txt('apache_default_role'), 'apache_default_role');
1103  $roleOptions = array();
1104  foreach($roles as $role) {
1105  $roleOptions[$role['obj_id']] = ilObject::_lookupTitle($role['obj_id']);
1106  }
1107  $select->setOptions($roleOptions);
1108  $select->setValue(4);
1109 
1110  $chb_local_create_account->addSubitem($select);
1111 
1112  $chb_local = new ilCheckboxInputGUI($this->lng->txt('apache_enable_local'), 'apache_enable_local');
1113  $form->addItem($chb_local);
1114 
1115  $chb_ldap = new ilCheckboxInputGUI($this->lng->txt('apache_enable_ldap'), 'apache_enable_ldap');
1116  $chb_ldap->setInfo($this->lng->txt('apache_ldap_hint_ldap_must_be_configured'));
1117 
1118  $GLOBALS['lng']->loadLanguageModule('auth');
1119  include_once './Services/LDAP/classes/class.ilLDAPServer.php';
1120  $servers = ilLDAPServer::getServerIds();
1121  if(count($servers))
1122  {
1123  $ldap_server_select = new ilSelectInputGUI($this->lng->txt('auth_ldap_server_ds'), 'apache_ldap_sid');
1124  $options[0] = $this->lng->txt('select_one');
1125  foreach($servers as $server_id)
1126  {
1127  $ldap_server = new ilLDAPServer($server_id);
1128  $options[$server_id] = $ldap_server->getName();
1129  }
1130  $ldap_server_select->setOptions($options);
1131  $ldap_server_select->setRequired(true);
1132 
1134  $ldap_server_select->setValue($ds);
1135 
1136  $chb_ldap->addSubItem($ldap_server_select);
1137  }
1138  $form->addItem($chb_ldap);
1139 
1140  $txt = new ilTextInputGUI($this->lng->txt('apache_auth_indicator_name'), 'apache_auth_indicator_name');
1141  $txt->setRequired(true);
1142  $form->addItem($txt);
1143 
1144  $txt = new ilTextInputGUI($this->lng->txt('apache_auth_indicator_value'), 'apache_auth_indicator_value');
1145  $txt->setRequired(true);
1146  $form->addItem($txt);
1147 
1148 
1149  $chb = new ilCheckboxInputGUI($this->lng->txt('apache_auth_enable_override_login'), 'apache_auth_enable_override_login_page');
1150  $form->addItem($chb);
1151 
1152  $txt = new ilTextInputGUI($this->lng->txt('apache_auth_target_override_login'), 'apache_auth_target_override_login_page');
1153  $txt->setRequired(true);
1154  $chb->addSubItem($txt);
1155 
1156  $chb = new ilCheckboxInputGUI($this->lng->txt('apache_auth_authenticate_on_login_page'), 'apache_auth_authenticate_on_login_page');
1157  $form->addItem($chb);
1158 
1159  $sec = new ilFormSectionHeaderGUI();
1160  $sec->setTitle($this->lng->txt('apache_auth_username_config'));
1161  $form->addItem($sec);
1162 
1163  $rag = new ilRadioGroupInputGUI($this->lng->txt('apache_auth_username_config_type'), 'apache_auth_username_config_type');
1164  $form->addItem($rag);
1165 
1166  $rao = new ilRadioOption($this->lng->txt('apache_auth_username_direct_mapping'), 1);
1167  $rag->addOption($rao);
1168 
1169  $txt = new ilTextInputGUI($this->lng->txt('apache_auth_username_direct_mapping_fieldname'), 'apache_auth_username_direct_mapping_fieldname');
1170  //$txt->setRequired(true);
1171  $rao->addSubItem($txt);
1172 
1173  $rao = new ilRadioOption($this->lng->txt('apache_auth_username_extended_mapping'), 2);
1174  $rao->setDisabled(true);
1175  $rag->addOption($rao);
1176 
1177  $rao = new ilRadioOption($this->lng->txt('apache_auth_username_by_function'), 3);
1178  $rag->addOption($rao);
1179 
1180 /* $txt = new ilTextInputGUI($this->lng->txt('apache_auth_username_by_function_functionname'), 'apache_auth_username_by_function_functionname');
1181  $rao->addSubItem($txt);*/
1182 
1183  $sec = new ilFormSectionHeaderGUI();
1184  $sec->setTitle($this->lng->txt('apache_auth_security'));
1185  $form->addItem($sec);
1186 
1187  $txt = new ilTextAreaInputGUI($this->lng->txt('apache_auth_domains'), 'apache_auth_domains');
1188  $txt->setInfo($this->lng->txt('apache_auth_domains_description'));
1189 
1190  $form->addItem($txt);
1191 
1192  $form->addCommandButton('saveApacheSettings',$this->lng->txt('save'));
1193  $form->addCommandButton('cancel',$this->lng->txt('cancel'));
1194 
1195  return $form;
1196  }
This class represents an option in a radio group.
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
static _lookupTitle($a_id)
lookup object title
const AUTH_APACHE
setInfo($a_info)
Set Information Text.
This class represents a property in a property form.
static getServerIds()
Get all server ids ilDB $ilDB.
if(!is_array($argv)) $options
This class represents a text property in a property form.
static getDataSource($a_auth_mode)
setOptions($a_options)
Set Options.
$txt
Definition: error.php:12
This class represents a text area property in a property form.
setDisabled($a_disabled)
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAuthModeTitle()

ilObjAuthSettingsGUI::getAuthModeTitle ( )

get the title of auth mode

public

Returns
string language dependent title of auth mode

Definition at line 628 of file class.ilObjAuthSettingsGUI.php.

References AUTH_APACHE, AUTH_LDAP, AUTH_LOCAL, AUTH_RADIUS, AUTH_SCRIPT, and AUTH_SHIBBOLETH.

Referenced by saveScriptObject(), and setAuthModeObject().

629  {
630  switch ($this->ilias->getSetting("auth_mode"))
631  {
632  case AUTH_LOCAL:
633  return $this->lng->txt("auth_local");
634  break;
635 
636  case AUTH_LDAP:
637  return $this->lng->txt("auth_ldap");
638  break;
639 
640  case AUTH_SHIBBOLETH:
641  return $this->lng->txt("auth_shib");
642  break;
643 
644  case AUTH_RADIUS:
645  return $this->lng->txt("auth_radius");
646  break;
647 
648  case AUTH_SCRIPT:
649  return $this->lng->txt("auth_script");
650  break;
651 
652  case AUTH_APACHE:
653  return $this->lng->txt("auth_apache");
654  break;
655 
656  default:
657  return $this->lng->txt("unknown");
658  break;
659  }
660  }
const AUTH_LDAP
const AUTH_SHIBBOLETH
const AUTH_APACHE
const AUTH_SCRIPT
redirection script todo: (a better solution should control the processing via a xml file) ...
const AUTH_LOCAL
const AUTH_RADIUS
+ Here is the caller graph for this function:

◆ getTabs()

ilObjAuthSettingsGUI::getTabs ( $tabs_gui)

get tabs public

Parameters
objecttabs gui object

Definition at line 929 of file class.ilObjAuthSettingsGUI.php.

Referenced by getAdminTabs().

930  {
931  global $rbacsystem;
932 
933  $this->ctrl->setParameter($this,"ref_id",$this->object->getRefId());
934 
935  if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
936  {
937  $tabs_gui->addTarget("authentication_settings", $this->ctrl->getLinkTarget($this, "authSettings"),
938  "", "", "");
939 
940  $tabs_gui->addTarget('registration_settings',
941  $this->ctrl->getLinkTargetByClass('ilregistrationsettingsgui','view'));
942 
943  $tabs_gui->addTarget("auth_ldap", $this->ctrl->getLinkTargetByClass('illdapsettingsgui','serverList'),
944  "", "", "");
945 
946 
947  #$tabs_gui->addTarget("auth_ldap", $this->ctrl->getLinkTarget($this, "editLDAP"),
948  # "", "", "");
949 
950  $tabs_gui->addTarget('auth_shib',$this->ctrl->getLinkTargetByClass('ilauthshibbolethsettingsgui','settings'));
951 
952  $tabs_gui->addTarget(
953  'auth_cas',
954  $this->ctrl->getLinkTargetByClass('ilcassettingsgui','settings')
955  );
956 
957  $tabs_gui->addTarget("auth_radius", $this->ctrl->getLinkTargetByClass('ilradiussettingsgui', "settings"),
958  "", "", "");
959 
960  $tabs_gui->addTarget("auth_soap", $this->ctrl->getLinkTarget($this, "editSOAP"),
961  "", "", "");
962 
963  $tabs_gui->addTarget(
964  'auth_openid',
965  $this->ctrl->getLinkTargetByClass('ilopenidsettingsgui','settings'),
966  '',
967  '',
968  ''
969  );
970 
971  $tabs_gui->addTarget("apache_auth_settings", $this->ctrl->getLinkTarget($this,'apacheAuthSettings'),
972  "", "", "");
973  }
974 
975  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
976  {
977  $tabs_gui->addTarget("perm_settings",
978  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
979  array("perm","info","owner"), 'ilpermissiongui');
980  }
981  }
+ Here is the caller graph for this function:

◆ ilObjAuthSettingsGUI()

ilObjAuthSettingsGUI::ilObjAuthSettingsGUI (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prepare_output = true 
)

Constructor public.

Definition at line 25 of file class.ilObjAuthSettingsGUI.php.

References ilObjectGUI\ilObjectGUI().

26  {
27  $this->type = "auth";
28  $this->ilObjectGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
29 
30  $this->lng->loadLanguageModule('registration');
31 
32  define('LDAP_DEFAULT_PORT',389);
33  define('RADIUS_DEFAULT_PORT',1812);
34 
35  }
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor public.
+ Here is the call graph for this function:

◆ initAuthModeDetermination()

ilObjAuthSettingsGUI::initAuthModeDetermination ( )
protected

init auth mode determinitation form

protected

Definition at line 683 of file class.ilObjAuthSettingsGUI.php.

References $header, $server, $text, ilAuthModeDetermination\_getInstance(), AUTH_APACHE, AUTH_LOCAL, AUTH_RADIUS, AUTH_SOAP, ilCaptchaUtil\checkFreetype(), ilAuthUtils\getAuthPlugins(), ilLDAPServer\getInstanceByServerId(), ilLDAPServer\getServerIdByAuthMode(), ilLDAPServer\isAuthModeLDAP(), and ilFormPropertyGUI\setInfo().

Referenced by authSettingsObject().

684  {
685  if(is_object($this->form))
686  {
687  return true;
688  }
689  // Are there any authentication methods that support automatic determination ?
690 
691  include_once('Services/Authentication/classes/class.ilAuthModeDetermination.php');
693  if($det->getCountActiveAuthModes() <= 1)
694  {
695  return false;
696  }
697 
698  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
699  $this->form = new ilPropertyFormGUI();
700  $this->form->setFormAction($this->ctrl->getFormAction($this));
701  $this->form->setTableWidth('100%');
702  $this->form->setTitle($this->lng->txt('auth_auth_settings'));
703  $this->form->addCommandButton('updateAuthModeDetermination',$this->lng->txt('save'));
704 
705  require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
706  $cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_anonymous_short'), 'activate_captcha_anonym');
707  $cap->setInfo($this->lng->txt('adm_captcha_anonymous_auth'));
708  $cap->setValue(1);
710  {
711  $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
712  }
713  $cap->setChecked(ilCaptchaUtil::isActiveForLogin());
714  $this->form->addItem($cap);
715 
717  $header->setTitle($this->lng->txt('auth_auth_mode_determination'));
718  $this->form->addItem($header);
719 
720  $kind = new ilRadioGroupInputGUI($this->lng->txt('auth_kind_determination'),'kind');
721  $kind->setInfo($this->lng->txt('auth_mode_determination_info'));
722  $kind->setValue($det->getKind());
723  $kind->setRequired(true);
724 
725  $option_user = new ilRadioOption($this->lng->txt('auth_by_user'),0);
726  $kind->addOption($option_user);
727 
728  $option_determination = new ilRadioOption($this->lng->txt('auth_automatic'),1);
729 
730  include_once('Services/Authentication/classes/class.ilAuthUtils.php');
731 
732  $auth_sequenced = $det->getAuthModeSequence();
733  $counter = 1;
734  foreach($auth_sequenced as $auth_mode)
735  {
736  switch($auth_mode)
737  {
738  // begin-patch ldap_multiple
739  case ilLDAPServer::isAuthModeLDAP($auth_mode):
740  $auth_id = ilLDAPServer::getServerIdByAuthMode($auth_mode);
742  $text = $server->getName();
743  // end-patch ldap_multiple
744  break;
745  case AUTH_RADIUS:
746  $text = $this->lng->txt('auth_radius');
747  break;
748  case AUTH_LOCAL:
749  $text = $this->lng->txt('auth_local');
750  break;
751  case AUTH_SOAP:
752  $text = $this->lng->txt('auth_soap');
753  break;
754  case AUTH_APACHE:
755  $text = $this->lng->txt('auth_apache');
756  break;
757  // begin-patch auth_plugin
758  default:
759  foreach(ilAuthUtils::getAuthPlugins() as $pl)
760  {
761  $option = $pl->getMultipleAuthModeOptions($auth_mode);
762  $text = $option[$auth_mode]['txt'];
763  }
764  break;
765  // end-patch auth_plugin
766  }
767 
768  $pos = new ilTextInputGUI($text,'position['.$auth_mode.']');
769  $pos->setValue($counter++);
770  $pos->setSize(1);
771  $pos->setMaxLength(1);
772  $option_determination->addSubItem($pos);
773  }
774  $kind->addOption($option_determination);
775  $this->form->addItem($kind);
776  return true;
777  }
This class represents an option in a radio group.
static isAuthModeLDAP($a_auth_mode)
Check if user auth mode is LDAP.
This class represents a property form user interface.
This class represents a section header in a property form.
static checkFreetype()
Check whether captcha support is active.
This class represents a checkbox property in a property form.
const AUTH_APACHE
static getInstanceByServerId($a_server_id)
Get instance by server id.
setInfo($a_info)
Set Information Text.
static getAuthPlugins()
Get active enabled auth plugins.
This class represents a property in a property form.
$header
This class represents a text property in a property form.
const AUTH_LOCAL
const AUTH_SOAP
$server
$text
const AUTH_RADIUS
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loginInfoObject()

ilObjAuthSettingsGUI::loginInfoObject ( )

displays login information of all installed languages

public

Author
Michael Jansen

Definition at line 216 of file class.ilObjAuthSettingsGUI.php.

References $ilSetting, ilObjectGUI\$lng, and setSubTabs().

217  {
218  global $rbacsystem, $lng,$ilSetting;
219 
220  if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId()))
221  {
222  $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
223  }
224 
225  $this->tabs_gui->setTabActive("authentication_settings");
226  $this->setSubTabs("authSettings");
227  $this->tabs_gui->setSubTabActive("auth_login_editor");
228 
229  $lng->loadLanguageModule("meta");
230 
231  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.auth_login_messages.html",
232  "Services/Authentication");
233  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
234  $this->tpl->setVariable("TXT_HEADLINE", $this->lng->txt("login_information"));
235  $this->tpl->setVariable("TXT_DESCRIPTION", $this->lng->txt("login_information_desc"));
236  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
237  $this->initLoginForm();
238  $this->tpl->setVariable('LOGIN_INFO',$this->form->getHTML());
239  }
redirection script todo: (a better solution should control the processing via a xml file) ...
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ saveApacheSettingsObject()

ilObjAuthSettingsGUI::saveApacheSettingsObject ( )

Definition at line 1037 of file class.ilObjAuthSettingsGUI.php.

References $ilCtrl, $ilSetting, apacheAuthSettingsObject(), AUTH_APACHE, AUTH_LOCAL, getApacheAuthSettingsForm(), ilUtil\sendSuccess(), and validateApacheAuthAllowedDomains().

1038  {
1039  global $ilCtrl;
1040  $form = $this->getApacheAuthSettingsForm();
1041  $form->setValuesByPost();
1042  /*$items = $form->getItems();
1043  foreach($items as $item)
1044  $item->validate();*/
1045  if ($form->checkInput())
1046  {
1047  $settings = new ilSetting('apache_auth');
1048  $fields = array
1049  (
1050  'apache_auth_indicator_name', 'apache_auth_indicator_value',
1051  'apache_enable_auth', 'apache_enable_local', 'apache_local_autocreate',
1052  'apache_enable_ldap', 'apache_auth_username_config_type',
1053  'apache_auth_username_direct_mapping_fieldname',
1054  'apache_default_role', 'apache_auth_target_override_login_page',
1055  'apache_auth_enable_override_login_page',
1056  'apache_auth_authenticate_on_login_page',
1057  'apache_ldap_sid'
1058 // 'apache_auth_username_by_function_functionname',
1059  );
1060 
1061  foreach($fields as $field)
1062  $settings->set($field, $form->getInput($field));
1063 
1064  if ($form->getInput('apache_enable_auth'))
1065  $this->ilias->setSetting('apache_active', true);
1066  else {
1067  $this->ilias->setSetting('apache_active', false);
1068  global $ilSetting;
1069  if ($ilSetting->get("auth_mode") == AUTH_APACHE) {
1070  $ilSetting->set("auth_mode", AUTH_LOCAL);
1071  }
1072  }
1073 
1074  $allowedDomains = $this->validateApacheAuthAllowedDomains($form->getInput('apache_auth_domains'));
1075  file_put_contents(ILIAS_DATA_DIR . '/' . CLIENT_ID . '/apache_auth_allowed_domains.txt', $allowedDomains);
1076 
1077  ilUtil::sendSuccess($this->lng->txt('apache_settings_changed_success'), true);
1078  $this->ctrl->redirect($this, 'apacheAuthSettings');
1079  }
1080  else
1081  {
1082  $this->apacheAuthSettingsObject($form);
1083  }
1084  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
ILIAS Setting Class.
const AUTH_APACHE
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
const AUTH_LOCAL
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ saveScriptObject()

ilObjAuthSettingsGUI::saveScriptObject ( )

validates all input data, save them to database if correct and active chosen auth mode

public

Definition at line 596 of file class.ilObjAuthSettingsGUI.php.

References $_POST, AUTH_SCRIPT, getAuthModeTitle(), and ilUtil\sendSuccess().

597  {
598  // validate required data
599  if (!$_POST["auth_script"]["name"])
600  {
601  $this->ilias->raiseError($this->lng->txt("fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
602  }
603 
604  // validate script url
605  /*
606  if (( TODO ,$_POST["ldap"]["server"])) == false)
607  {
608  $this->ilias->raiseError($this->lng->txt("err_invalid_server"),$this->ilias->error_obj->MESSAGE);
609  }*/
610 
611  // TODO: check connection to server
612 
613  // all ok. save settings and activate auth by external script
614  $this->ilias->setSetting("auth_script_name", $_POST["auth_script"]["name"]);
615  $this->ilias->setSetting("auth_mode", AUTH_SCRIPT);
616 
617  ilUtil::sendSuccess($this->lng->txt("auth_mode_changed_to")." ".$this->getAuthModeTitle(),true);
618  $this->ctrl->redirect($this,'editScript');
619  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
getAuthModeTitle()
get the title of auth mode
const AUTH_SCRIPT
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

◆ saveSOAPObject()

ilObjAuthSettingsGUI::saveSOAPObject ( )

validates all input data, save them to database if correct and active chosen auth mode

public

Definition at line 511 of file class.ilObjAuthSettingsGUI.php.

References $_POST, $ilSetting, $ilUser, and ilUtil\sendSuccess().

512  {
513  global $ilUser, $ilSetting, $rbacsystem;
514 
515  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
516  {
517  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
518  }
519 
520  // validate required data
521  if (!$_POST["soap"]["server"])
522  {
523  $this->ilias->raiseError($this->lng->txt("fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
524  }
525 
526  // validate port
527  if ($_POST["soap"]["server"] != "" && (preg_match("/^[0-9]{0,5}$/",$_POST["soap"]["port"])) == false)
528  {
529  $this->ilias->raiseError($this->lng->txt("err_invalid_port"),$this->ilias->error_obj->MESSAGE);
530  }
531 
532  $ilSetting->set("soap_auth_server", $_POST["soap"]["server"]);
533  $ilSetting->set("soap_auth_port", $_POST["soap"]["port"]);
534  $ilSetting->set("soap_auth_active", $_POST["soap"]["active"]);
535  $ilSetting->set("soap_auth_uri", $_POST["soap"]["uri"]);
536  $ilSetting->set("soap_auth_namespace", $_POST["soap"]["namespace"]);
537  $ilSetting->set("soap_auth_create_users", $_POST["soap"]["create_users"]);
538  $ilSetting->set("soap_auth_allow_local", $_POST["soap"]["allow_local"]);
539  $ilSetting->set("soap_auth_account_mail", $_POST["soap"]["account_mail"]);
540  $ilSetting->set("soap_auth_use_https", $_POST["soap"]["use_https"]);
541  $ilSetting->set("soap_auth_use_dotnet", $_POST["soap"]["use_dotnet"]);
542  $ilSetting->set("soap_auth_user_default_role", $_POST["soap"]["user_default_role"]);
543  ilUtil::sendSuccess($this->lng->txt("auth_soap_settings_saved"),true);
544 
545  $this->ctrl->redirect($this,'editSOAP');
546  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
redirection script todo: (a better solution should control the processing via a xml file) ...
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ setAuthModeObject()

ilObjAuthSettingsGUI::setAuthModeObject ( )

Definition at line 247 of file class.ilObjAuthSettingsGUI.php.

References $_POST, $ilSetting, AUTH_LDAP, AUTH_RADIUS, AUTH_SCRIPT, getAuthModeTitle(), ilObjectGUI\getReturnLocation(), ilUtil\redirect(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

248  {
249  global $rbacsystem,$ilSetting;
250 
251  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
252  {
253  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
254  }
255 
256  if (empty($_POST["auth_mode"]))
257  {
258  $this->ilias->raiseError($this->lng->txt("auth_err_no_mode_selected"),$this->ilias->error_obj->MESSAGE);
259  }
260 
261  if ($_POST["auth_mode"] == AUTH_DEFAULT)
262  {
263  ilUtil::sendInfo($this->lng->txt("auth_mode").": ".$this->getAuthModeTitle()." ".$this->lng->txt("auth_mode_not_changed"),true);
264  $this->ctrl->redirect($this,'authSettings');
265  }
266 
267  switch ($_POST["auth_mode"])
268  {
269  case AUTH_LDAP:
270 
271  /*
272  if ($this->object->checkAuthLDAP() !== true)
273  {
274  ilUtil::sendInfo($this->lng->txt("auth_ldap_not_configured"),true);
275  ilUtil::redirect($this->getReturnLocation("authSettings",$this->ctrl->getLinkTarget($this,"editLDAP", "", false, false)));
276  }
277  */
278  break;
279 
280  case AUTH_SHIB:
281  if ($this->object->checkAuthSHIB() !== true)
282  {
283  ilUtil::sendFailure($this->lng->txt("auth_shib_not_configured"),true);
284  ilUtil::redirect($this->getReturnLocation("authSettings",$this->ctrl->getLinkTarget($this,"editSHIB", "", false, false)));
285  }
286  break;
287 
288  case AUTH_RADIUS:
289  if ($this->object->checkAuthRADIUS() !== true)
290  {
291  ilUtil::sendFailure($this->lng->txt("auth_radius_not_configured"),true);
292  $this->ctrl->redirect($this,'editRADIUS');
293  }
294  break;
295 
296  case AUTH_SCRIPT:
297  if ($this->object->checkAuthScript() !== true)
298  {
299  ilUtil::sendFailure($this->lng->txt("auth_script_not_configured"),true);
300  ilUtil::redirect($this->getReturnLocation("authSettings",$this->ctrl->getLinkTarget($this,"editScript", "", false, false)));
301  }
302  break;
303  }
304 
305  $this->ilias->setSetting("auth_mode",$_POST["auth_mode"]);
306 
307  ilUtil::sendSuccess($this->lng->txt("auth_default_mode_changed_to")." ".$this->getAuthModeTitle(),true);
308  $this->ctrl->redirect($this,'authSettings');
309  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
getAuthModeTitle()
get the title of auth mode
const AUTH_LDAP
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
const AUTH_SCRIPT
redirection script todo: (a better solution should control the processing via a xml file) ...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $ilSetting
Definition: privfeed.php:40
static redirect($a_script)
http redirect to other script
getReturnLocation($a_cmd, $a_location="")
get return location for command (command is method name without "Object", e.g.
const AUTH_RADIUS
+ Here is the call graph for this function:

◆ setSubTabs()

ilObjAuthSettingsGUI::setSubTabs (   $a_tab)

set sub tabs

Definition at line 986 of file class.ilObjAuthSettingsGUI.php.

References $GLOBALS, and $ilUser.

Referenced by authSettingsObject(), executeCommand(), and loginInfoObject().

987  {
988  global $rbacsystem,$ilUser,$ilAccess;
989 
990  $GLOBALS['lng']->loadLanguageModule('auth');
991 
992  switch ($a_tab)
993  {
994  case 'authSettings':
995  if($ilAccess->checkAccess('write','',$this->object->getRefId()))
996  {
997  $this->tabs_gui->addSubTabTarget("auth_settings",
998  $this->ctrl->getLinkTarget($this,'authSettings'),
999  "");
1000  }
1001  if($ilAccess->checkAccess('write','',$this->object->getRefId()))
1002  {
1003  $this->tabs_gui->addSubTabTarget(
1004  'auth_login_editor',
1005  $this->ctrl->getLinkTargetByClass('ilauthloginpageeditorgui',''),
1006  ''
1007  );
1008  }
1009  break;
1010  }
1011  }
global $ilUser
Definition: imgupload.php:15
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
+ Here is the caller graph for this function:

◆ testSoapAuthConnectionObject()

ilObjAuthSettingsGUI::testSoapAuthConnectionObject ( )

Definition at line 501 of file class.ilObjAuthSettingsGUI.php.

References editSOAPObject().

502  {
503  $this->editSOAPObject();
504  }
editSOAPObject()
Configure soap settings.
+ Here is the call graph for this function:

◆ updateAuthModeDeterminationObject()

ilObjAuthSettingsGUI::updateAuthModeDeterminationObject ( )

update auth mode determination

public

Definition at line 785 of file class.ilObjAuthSettingsGUI.php.

References $_POST, ilAuthModeDetermination\_getInstance(), authSettingsObject(), and ilUtil\sendSuccess().

786  {
787  include_once('Services/Authentication/classes/class.ilAuthModeDetermination.php');
789 
790  $det->setKind((int) $_POST['kind']);
791 
792  $pos = $_POST['position'] ? $_POST['position'] : array();
793  asort($pos,SORT_NUMERIC);
794 
795  $counter = 0;
796  foreach($pos as $auth_mode => $dummy)
797  {
798  $position[$counter++] = $auth_mode;
799  }
800  $det->setAuthModeSequence($position ? $position : array());
801  $det->save();
802 
803  require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
804  ilCaptchaUtil::setActiveForLogin((bool)$_POST['activate_captcha_anonym']);
805 
806  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
807  $this->authSettingsObject();
808  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
authSettingsObject()
display settings menu
+ Here is the call graph for this function:

◆ updateAuthRolesObject()

ilObjAuthSettingsGUI::updateAuthRolesObject ( )

Definition at line 662 of file class.ilObjAuthSettingsGUI.php.

References $_POST, ilObjRole\_updateAuthMode(), and ilUtil\sendSuccess().

663  {
664  global $rbacsystem;
665 
666  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
667  {
668  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
669  }
670 
671  include_once('./Services/AccessControl/classes/class.ilObjRole.php');
673 
674  ilUtil::sendSuccess($this->lng->txt("auth_mode_roles_changed"),true);
675  $this->ctrl->redirect($this,'authSettings');
676  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
_updateAuthMode($a_roles)
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

◆ validateApacheAuthAllowedDomains()

ilObjAuthSettingsGUI::validateApacheAuthAllowedDomains (   $text)
private

Definition at line 1198 of file class.ilObjAuthSettingsGUI.php.

References $text.

Referenced by saveApacheSettingsObject().

1198  {
1199  return join("\n", preg_split("/[\r\n]+/", $text));
1200  }
$text
+ Here is the caller graph for this function:

◆ viewObject()

ilObjAuthSettingsGUI::viewObject ( )

Definition at line 39 of file class.ilObjAuthSettingsGUI.php.

References authSettingsObject().

40  {
41  return $this->authSettingsObject();
42  }
authSettingsObject()
display settings menu
+ Here is the call graph for this function:

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