/**
  * init propertyformgui for Assignment of LDAP Attributes to ILIAS User Profile
  * @param string $command command methode
  * @return \ilPropertyFormGUI 
  */
 private function initRoleMappingForm($command)
 {
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->setSubTabs();
     $this->tabs_gui->setSubTabActive('ldap_role_mapping');
     if (isset($_GET["mapping_id"])) {
         $this->ctrl->setParameter($this, 'mapping_id', $_GET["mapping_id"]);
     }
     $propertie_form = new ilPropertyFormGUI();
     $propertie_form->setFormAction($this->ctrl->getFormAction($this, $command));
     $propertie_form->addCommandButton($command, $this->lng->txt('save'));
     $propertie_form->addCommandButton("roleMapping", $this->lng->txt('cancel'));
     $url = new ilTextInputGUI($this->lng->txt('ldap_server'));
     $url->setPostVar("url");
     $url->setSize(50);
     $url->setMaxLength(255);
     $url->setRequired(true);
     $group_dn = new ilTextInputGUI($this->lng->txt('ldap_group_dn'));
     $group_dn->setPostVar("dn");
     $group_dn->setSize(50);
     $group_dn->setMaxLength(255);
     $group_dn->setInfo($this->lng->txt('ldap_dn_info'));
     $group_dn->setRequired(true);
     $member = new ilTextInputGUI($this->lng->txt('ldap_group_member'));
     $member->setPostVar("member");
     $member->setSize(32);
     $member->setMaxLength(255);
     $member->setInfo($this->lng->txt('ldap_member_info'));
     $member->setRequired(true);
     $member_isdn = new ilCheckboxInputGUI("");
     $member_isdn->setPostVar("memberisdn");
     $member_isdn->setOptionTitle($this->lng->txt('ldap_memberisdn'));
     $role = new ilTextInputGUI($this->lng->txt('ldap_ilias_role'));
     $role->setPostVar("role");
     $role->setSize(32);
     $role->setMaxLength(255);
     $role->setInfo($this->lng->txt('ldap_role_info'));
     $role->setRequired(true);
     $info = new ilTextAreaInputGUI($this->lng->txt('ldap_info_text'));
     $info->setPostVar("info");
     $info->setCols(50);
     $info->setRows(3);
     $info->setInfo($this->lng->txt('ldap_info_text_info'));
     $info_type = new ilCheckboxInputGUI("");
     $info_type->setPostVar("info_type");
     $info_type->setOptionTitle($this->lng->txt('ldap_mapping_info_type'));
     $propertie_form->addItem($url);
     $propertie_form->addItem($group_dn);
     $propertie_form->addItem($member);
     $propertie_form->addItem($member_isdn);
     $propertie_form->addItem($role);
     $propertie_form->addItem($info);
     $propertie_form->addItem($info_type);
     return $propertie_form;
 }
 public function settings()
 {
     global $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);
     $role = array();
     if (!isset($settings["shib_user_default_role"])) {
         $settings["shib_user_default_role"] = 4;
     }
     if (!isset($settings["shib_idp_list"]) || $settings["shib_idp_list"] == '') {
         $settings["shib_idp_list"] = "urn:mace:organization1:providerID, Example Organization 1\nurn:mace:organization2:providerID, Example Organization 2, /Shibboleth.sso/WAYF/SWITCHaai";
     }
     if (!isset($settings["shib_login_button"]) || $settings["shib_login_button"] == '') {
         $settings["shib_login_button"] = "templates/default/images/shib_login_button.png";
     }
     if (!isset($settings["shib_hos_type"]) || $settings["shib_hos_type"] == '') {
         $settings["shib_hos_type"] = 'internal_wayf';
     }
     foreach ($role_list as $data) {
         $role[$data["obj_id"]] = $data["title"];
     }
     // 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', 'shib_matriculation');
     //set PropertyFormGUI
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $propertys = new ilPropertyFormGUI();
     $propertys->setTitle($this->lng->txt("shib"));
     $propertys->setFormAction($this->ctrl->getFormAction($this, "save"));
     $propertys->addCommandButton("save", $this->lng->txt("save"));
     $propertys->addCommandButton("settings", $this->lng->txt("cancel"));
     //set enable shibboleth support
     $enable = new ilCheckboxInputGUI();
     $enable->setTitle($this->lng->txt("shib_active"));
     $read_me_link = "./Services/AuthShibboleth/README.SHIBBOLETH.txt";
     $info = "<a href='" . $read_me_link . "' target='_blank'>" . $this->lng->txt("auth_shib_instructions") . "</a>";
     $enable->setInfo($info);
     $enable->setPostVar("shib[active]");
     $enable->setChecked($settings["shib_active"]);
     //set allow local authentication
     $local = new ilCheckboxInputGUI();
     $local->setTitle($this->lng->txt("auth_allow_local"));
     $local->setPostVar("shib[auth_allow_local]");
     $local->setChecked($settings['shib_auth_allow_local']);
     //set user default role
     $defaultrole = new ilSelectInputGUI();
     $defaultrole->setTitle($this->lng->txt("shib_user_default_role"));
     $defaultrole->setPostVar("shib[user_default_role]");
     $defaultrole->setOptions($role);
     $defaultrole->setRequired(true);
     $defaultrole->setValue($settings["shib_user_default_role"]);
     //set name of federation
     $name = new ilTextInputGUI();
     $name->setTitle($this->lng->txt("shib_federation_name"));
     $name->setPostVar("shib[federation_name]");
     $name->setSize(40);
     $name->setMaxLength(50);
     $name->setRequired(true);
     $name->setValue(stripslashes($settings["shib_federation_name"]));
     //set Organize selection group
     include_once "./Services/Form/classes/class.ilRadioGroupInputGUI.php";
     include_once "./Services/Form/classes/class.ilRadioOption.php";
     $organize = new ilRadioGroupInputGUI();
     $organize->setTitle($this->lng->txt("shib_login_type"));
     $organize->setPostVar("shib[hos_type]");
     $organize->setRequired(true);
     $organize->setValue($settings["shib_hos_type"]);
     //set 1. option internalwayf
     $internalwayf = new ilRadioOption();
     $internalwayf->setTitle($this->lng->txt("shib_login_internal_wayf"));
     $internalwayf->setValue("internal_wayf");
     //set 1. option internalwayf textbox idplist
     $idplist = new ilTextAreaInputGUI();
     $idplist->setInfo($this->lng->txt("shib_idp_list"));
     $idplist->setPostVar("shib[idp_list]");
     $idplist->setRows(3);
     $idplist->setCols(50);
     $idplist->setValue($settings["shib_idp_list"]);
     //set 2. Option externalwayf
     $externalwayf = new ilRadioOption();
     $externalwayf->setTitle($this->lng->txt("shib_login_external_wayf"));
     $externalwayf->setValue("external_wayf");
     //set 2. Option externalwayf textfield path to login button image
     $loginbutton = new ilTextInputGUI();
     $loginbutton->setInfo($this->lng->txt("shib_login_button"));
     $loginbutton->setPostVar("shib[login_button]");
     $loginbutton->setSize(50);
     $loginbutton->setMaxLength(255);
     $loginbutton->setValue($settings["shib_login_button"]);
     //set 3. Option embeddedwayf
     $embeddedwayf = new ilRadioOption();
     $embeddedwayf->setTitle($this->lng->txt("shib_login_embedded_wayf"));
     $embeddedwayf->setInfo($this->lng->txt("shib_login_embedded_wayf_description"));
     $embeddedwayf->setValue("embedded_wayf");
     //set login instructions
     $logininstruction = new ilTextAreaInputGUI();
     $logininstruction->setTitle($this->lng->txt("auth_login_instructions"));
     $logininstruction->setPostVar("shib[login_instructions]");
     $logininstruction->setRows(3);
     $logininstruction->setCols(50);
     $logininstruction->setValue(stripslashes($settings["shib_login_instructions"]));
     //set path to data manipulation API
     $dataconv = new ilTextInputGUI();
     $dataconv->setTitle($this->lng->txt("shib_data_conv"));
     $dataconv->setPostVar("shib[data_conv]");
     $dataconv->setSize(80);
     $dataconv->setMaxLength(512);
     $dataconv->setValue($settings["shib_data_conv"]);
     //field mappings
     $fields = array();
     foreach ($shib_settings as $setting) {
         $field = ereg_replace('shib_', '', $setting);
         $textinput = new ilTextInputGUI();
         $textinput->setTitle($this->lng->txt($setting));
         $textinput->setPostVar("shib[" . $field . "]");
         $textinput->setValue($settings[$setting]);
         $textinput->setSize(40);
         $textinput->setMaxLength(50);
         $checkinput = new ilCheckboxInputGUI("");
         $checkinput->setOptionTitle($this->lng->txt("shib_update"));
         $checkinput->setPostVar("shib[update_" . $field . "]");
         $checkinput->setChecked($settings["shib_update_" . $field]);
         if ($setting == 'shib_login' || $setting == 'shib_title' || $setting == 'shib_firstname' || $setting == 'shib_lastname' || $setting == 'shib_email') {
             $textinput->setRequired(true);
         }
         $fields[$setting] = array("text" => $textinput, "check" => $checkinput);
     }
     $propertys->addItem($enable);
     $propertys->addItem($local);
     $propertys->addItem($defaultrole);
     $propertys->addItem($name);
     $internalwayf->addSubItem($idplist);
     $organize->addOption($internalwayf);
     $externalwayf->addSubItem($loginbutton);
     $organize->addOption($externalwayf);
     $organize->addOption($embeddedwayf);
     $propertys->addItem($organize);
     $propertys->addItem($logininstruction);
     $propertys->addItem($dataconv);
     foreach ($shib_settings as $setting) {
         $propertys->addItem($fields[$setting]["text"]);
         if ($setting != "shib_login") {
             $propertys->addItem($fields[$setting]["check"]);
         }
     }
     $this->tpl->setContent($propertys->getHTML());
 }