/** * Init configuration form. * * @return object form object */ public function initConfigurationForm() { global $lng, $ilCtrl, $ilDB; $pl = $this->getPluginObject(); $this->getPluginObject()->includeClass('class.ilOpenmeetingsConfig.php'); $this->object = ilOpenmeetingsConfig::getInstance(); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setTitle($pl->txt("openmeetings_plugin_configuration")); $this->form->setFormAction($ilCtrl->getFormAction($this)); $this->form->addCommandButton("save", $lng->txt("save")); // url (text) $ti = new ilTextInputGUI($pl->txt("url"), "frmurl"); $ti->setRequired(true); $ti->setMaxLength(256); $ti->setSize(60); $this->form->addItem($ti); // port (text) $ti = new ilTextInputGUI($pl->txt("port"), "frmport"); $ti->setRequired(true); $ti->setMaxLength(10); $ti->setSize(10); $this->form->addItem($ti); // appname $ti = new ilTextInputGUI($pl->txt("appname"), "frmappname"); $ti->setRequired(true); $ti->setMaxLength(32); $ti->setSize(20); $this->form->addItem($ti); // username (text) $ti = new ilTextInputGUI($pl->txt("username"), "frmusername"); $ti->setRequired(true); $ti->setMaxLength(256); $ti->setSize(20); $this->form->addItem($ti); // password (text) $ti = new ilPasswordInputGUI($pl->txt("password"), "frmpassword"); $ti->setRequired(true); $ti->setMaxLength(256); $ti->setSize(20); $ti->setRetype(false); $this->form->addItem($ti); foreach ($this->fields as $key => $item) { $field = new $item["type"]($this->plugin_object->txt('conf_' . $key), $key); $field->setInfo($this->plugin_object->txt($item["info"])); if (is_array($item["subelements"])) { foreach ($item["subelements"] as $subkey => $subitem) { $subfield = new $subitem["type"]($this->plugin_object->txt('conf_' . $key . "_" . $subkey), $subkey); $subfield->setInfo($this->plugin_object->txt($subitem["info"])); $field->addSubItem($subfield); } } $this->form->addItem($field); } return $this->form; }
private function showPasswordFormCmd() { require_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; require_once 'Services/Form/classes/class.ilPasswordInputGUI.php'; $form = new ilPropertyFormGUI(); $form->setTitle($this->lng->txt("tst_password_form")); $form->setDescription($this->lng->txt("tst_password_introduction")); $form->setFormAction($this->ctrl->getFormAction($this)); $form->addCommandButton(self::CMD_SAVE_ENTERED_PASSWORD, $this->lng->txt("submit")); $form->addCommandButton(self::CMD_BACK_TO_INFO_SCREEN, $this->lng->txt("cancel")); $inp = new ilPasswordInputGUI($this->lng->txt("tst_password"), 'password'); $inp->setRequired(true); $inp->setRetype(false); $form->addItem($inp); $this->tpl->setVariable($this->parentGUI->getContentBlockName(), $this->ctrl->getHTML($form)); }
protected function initPasswordForm() { global $ilCtrl, $lng, $ilUser, $ilTabs; if ($this->node_id) { include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php"; $object_data = ilWorkspaceAccessHandler::getObjectDataFromNode($this->node_id); } else { $object_data["title"] = ilObject::_lookupTitle($this->portfolio_id); } include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this, "checkPassword")); $form->setTitle($lng->txt("wsp_password_for") . ": " . $object_data["title"]); $password = new ilPasswordInputGUI($lng->txt("password"), "password"); $password->setRetype(false); $password->setRequired(true); $form->addItem($password); $form->addCommandButton("checkPassword", $lng->txt("submit")); if ($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID) { $ilTabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, "cancelPassword")); $form->addCommandButton("cancelPassword", $lng->txt("cancel")); } return $form; }
protected function initPasswordForm($a_node_id) { global $ilCtrl, $lng; $this->ctrl->setParameter($this, "item_ref_id", $a_node_id); $object_data = $this->getAccessHandler()->getObjectDataFromNode($a_node_id); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this, "checkPassword")); $form->setTitle($lng->txt("wsp_password_for") . ": " . $object_data["title"]); $password = new ilPasswordInputGUI($lng->txt("password"), "password"); $password->setRetype(false); $password->setRequired(true); $password->setSkipSyntaxCheck(true); $form->addItem($password); $form->addCommandButton("checkPassword", $lng->txt("submit")); $form->addCommandButton("share", $lng->txt("cancel")); return $form; }
/** * init settings form * * @access protected */ protected function initSettingsForm($a_mode = 'update') { if (is_object($this->form)) { return true; } include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this, 'settings')); $this->form->setTitle($this->lng->txt('ecs_connection_settings')); $ena = new ilCheckboxInputGUI($this->lng->txt('ecs_active'), 'active'); $ena->setChecked($this->settings->isEnabled()); $ena->setValue(1); $this->form->addItem($ena); $ser = new ilTextInputGUI($this->lng->txt('ecs_server_url'), 'server'); $ser->setValue((string) $this->settings->getServer()); $ser->setRequired(true); $this->form->addItem($ser); $pro = new ilSelectInputGUI($this->lng->txt('ecs_protocol'), 'protocol'); // fixed to https #$pro->setOptions(array(ilECSSetting::PROTOCOL_HTTP => $this->lng->txt('http'), # ilECSSetting::PROTOCOL_HTTPS => $this->lng->txt('https'))); $pro->setOptions(array(ilECSSetting::PROTOCOL_HTTPS => 'HTTPS')); $pro->setValue($this->settings->getProtocol()); $pro->setRequired(true); $this->form->addItem($pro); $por = new ilTextInputGUI($this->lng->txt('ecs_port'), 'port'); $por->setSize(5); $por->setMaxLength(5); $por->setValue((string) $this->settings->getPort()); $por->setRequired(true); $this->form->addItem($por); $tcer = new ilRadioGroupInputGUI($this->lng->txt('ecs_auth_type'), 'auth_type'); $tcer->setValue($this->settings->getAuthType()); $this->form->addItem($tcer); // Certificate based authentication $cert_based = new ilRadioOption($this->lng->txt('ecs_auth_type_cert'), ilECSSetting::AUTH_CERTIFICATE); $tcer->addOption($cert_based); $cli = new ilTextInputGUI($this->lng->txt('ecs_client_cert'), 'client_cert'); $cli->setSize(60); $cli->setValue((string) $this->settings->getClientCertPath()); $cli->setRequired(true); $cert_based->addSubItem($cli); $key = new ilTextInputGUI($this->lng->txt('ecs_cert_key'), 'key_path'); $key->setSize(60); $key->setValue((string) $this->settings->getKeyPath()); $key->setRequired(true); $cert_based->addSubItem($key); $cerp = new ilTextInputGUI($this->lng->txt('ecs_key_password'), 'key_password'); $cerp->setSize(12); $cerp->setValue((string) $this->settings->getKeyPassword()); $cerp->setInputType('password'); $cerp->setRequired(true); $cert_based->addSubItem($cerp); $cer = new ilTextInputGUI($this->lng->txt('ecs_ca_cert'), 'ca_cert'); $cer->setSize(60); $cer->setValue((string) $this->settings->getCACertPath()); $cer->setRequired(true); $cert_based->addSubItem($cer); // Apache auth $apa_based = new ilRadioOption($this->lng->txt('ecs_auth_type_apache'), ilECSSetting::AUTH_APACHE); $tcer->addOption($apa_based); $user = new ilTextInputGUI($this->lng->txt('ecs_apache_user'), 'auth_user'); $user->setSize(32); $user->setValue((string) $this->settings->getAuthUser()); $user->setRequired(true); $apa_based->addSubItem($user); $pass = new ilPasswordInputGUI($this->lng->txt('ecs_apache_pass'), 'auth_pass'); $pass->setRetype(false); $pass->setSize(16); $pass->setMaxLength(32); $pass->setValue((string) $this->settings->getAuthPass()); $pass->setRequired(true); $apa_based->addSubItem($pass); $ser = new ilNonEditableValueGUI($this->lng->txt('cert_serial')); $ser->setValue($this->settings->getCertSerialNumber() ? $this->settings->getCertSerialNumber() : $this->lng->txt('ecs_no_value')); $cert_based->addSubItem($ser); $loc = new ilFormSectionHeaderGUI(); $loc->setTitle($this->lng->txt('ecs_local_settings')); $this->form->addItem($loc); $pol = new ilDurationInputGUI($this->lng->txt('ecs_polling'), 'polling'); $pol->setShowDays(false); $pol->setShowHours(false); $pol->setShowMinutes(true); $pol->setShowSeconds(true); $pol->setSeconds($this->settings->getPollingTimeSeconds()); $pol->setMinutes($this->settings->getPollingTimeMinutes()); $pol->setRequired(true); $pol->setInfo($this->lng->txt('ecs_polling_info')); $this->form->addItem($pol); $imp = new ilCustomInputGUI($this->lng->txt('ecs_import_id')); $imp->setRequired(true); $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS'); $tpl->setVariable('SIZE', 5); $tpl->setVariable('MAXLENGTH', 11); $tpl->setVariable('POST_VAR', 'import_id'); $tpl->setVariable('PROPERTY_VALUE', $this->settings->getImportId()); if ($this->settings->getImportId()) { $tpl->setVariable('COMPLETE_PATH', $this->buildPath($this->settings->getImportId())); } $imp->setHTML($tpl->get()); $imp->setInfo($this->lng->txt('ecs_import_id_info')); $this->form->addItem($imp); $loc = new ilFormSectionHeaderGUI(); $loc->setTitle($this->lng->txt('ecs_remote_user_settings')); $this->form->addItem($loc); $role = new ilSelectInputGUI($this->lng->txt('ecs_role'), 'global_role'); $role->setOptions($this->prepareRoleSelect()); $role->setValue($this->settings->getGlobalRole()); $role->setInfo($this->lng->txt('ecs_global_role_info')); $role->setRequired(true); $this->form->addItem($role); $duration = new ilDurationInputGUI($this->lng->txt('ecs_account_duration'), 'duration'); $duration->setInfo($this->lng->txt('ecs_account_duration_info')); $duration->setMonths($this->settings->getDuration()); $duration->setShowSeconds(false); $duration->setShowMinutes(false); $duration->setShowHours(false); $duration->setShowDays(false); $duration->setShowMonths(true); $duration->setRequired(true); $this->form->addItem($duration); // Email recipients $loc = new ilFormSectionHeaderGUI(); $loc->setTitle($this->lng->txt('ecs_notifications')); $this->form->addItem($loc); $rcp_user = new ilTextInputGUI($this->lng->txt('ecs_user_rcp'), 'user_recipients'); $rcp_user->setValue((string) $this->settings->getUserRecipientsAsString()); $rcp_user->setInfo($this->lng->txt('ecs_user_rcp_info')); $this->form->addItem($rcp_user); $rcp_econ = new ilTextInputGUI($this->lng->txt('ecs_econ_rcp'), 'econtent_recipients'); $rcp_econ->setValue((string) $this->settings->getEContentRecipientsAsString()); $rcp_econ->setInfo($this->lng->txt('ecs_econ_rcp_info')); $this->form->addItem($rcp_econ); $rcp_app = new ilTextInputGUI($this->lng->txt('ecs_approval_rcp'), 'approval_recipients'); $rcp_app->setValue((string) $this->settings->getApprovalRecipientsAsString()); $rcp_app->setInfo($this->lng->txt('ecs_approval_rcp_info')); $this->form->addItem($rcp_app); if ($a_mode == 'update') { $this->form->addCommandButton('update', $this->lng->txt('save')); } else { $this->form->addCommandButton('save', $this->lng->txt('save')); } $this->form->addCommandButton('overview', $this->lng->txt('cancel')); }
protected function initPasswordForm() { include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->lng->txt("wsp_set_permission_all_password")); $password = new ilPasswordInputGUI($this->lng->txt("password"), "password"); $password->setRequired(true); $form->addItem($password); $form->addCommandButton('savepasswordform', $this->lng->txt("save")); $form->addCommandButton('share', $this->lng->txt("cancel")); return $form; }
/** * Add standard fields to form */ function addStandardFieldsToForm($a_form, $a_user = NULL, array $custom_fields = NULL) { global $ilSetting, $lng, $rbacreview, $ilias; // custom registration settings if (self::$mode == self::MODE_REGISTRATION) { include_once 'Services/Registration/classes/class.ilRegistrationSettings.php'; $registration_settings = new ilRegistrationSettings(); self::$user_field["username"]["group"] = "login_data"; self::$user_field["password"]["group"] = "login_data"; self::$user_field["language"]["default"] = $lng->lang_key; // different position for role $roles = self::$user_field["roles"]; unset(self::$user_field["roles"]); self::$user_field["roles"] = $roles; self::$user_field["roles"]["group"] = "settings"; } $fields = $this->getStandardFields(); $current_group = ""; $custom_fields_done = false; foreach ($fields as $f => $p) { // next group? -> diplay subheader if ($p["group"] != $current_group && ilUserProfile::userSettingVisible($f)) { if (is_array($custom_fields) && !$custom_fields_done) { // should be appended to "other" or at least before "settings" if ($current_group == "other" || $p["group"] == "settings") { // add "other" subheader if ($current_group != "other") { $sh = new ilFormSectionHeaderGUI(); $sh->setTitle($lng->txt("other")); $a_form->addItem($sh); } foreach ($custom_fields as $custom_field) { $a_form->addItem($custom_field); } $custom_fields_done = true; } } $sh = new ilFormSectionHeaderGUI(); $sh->setTitle($lng->txt($p["group"])); $a_form->addItem($sh); $current_group = $p["group"]; } $m = ""; if (isset($p["method"])) { $m = $p["method"]; } $lv = isset($p["lang_var"]) && $p["lang_var"] != "" ? $p["lang_var"] : $f; switch ($p["input"]) { case "login": if ((int) $ilSetting->get('allow_change_loginname') || self::$mode == self::MODE_REGISTRATION) { $val = new ilTextInputGUI($lng->txt('username'), 'username'); if ($a_user) { $val->setValue($a_user->getLogin()); } $val->setMaxLength(32); $val->setSize(40); $val->setRequired(true); } else { // user account name $val = new ilNonEditableValueGUI($lng->txt("username"), 'ne_un'); if ($a_user) { $val->setValue($a_user->getLogin()); } } $a_form->addItem($val); break; case "text": if (ilUserProfile::userSettingVisible($f)) { $ti = new ilTextInputGUI($lng->txt($lv), "usr_" . $f); if ($a_user) { $ti->setValue($a_user->{$m}()); } $ti->setMaxLength($p["maxlength"]); $ti->setSize($p["size"]); $ti->setRequired($ilSetting->get("require_" . $f)); if (!$ti->getRequired() || $ti->getValue()) { $ti->setDisabled($ilSetting->get("usr_settings_disable_" . $f)); } $a_form->addItem($ti); } break; case "sel_country": if (ilUserProfile::userSettingVisible($f)) { include_once "./Services/Form/classes/class.ilCountrySelectInputGUI.php"; $ci = new ilCountrySelectInputGUI($lng->txt($lv), "usr_" . $f); if ($a_user) { $ci->setValue($a_user->{$m}()); } $ci->setRequired($ilSetting->get("require_" . $f)); if (!$ci->getRequired() || $ci->getValue()) { $ci->setDisabled($ilSetting->get("usr_settings_disable_" . $f)); } $a_form->addItem($ci); } break; case "birthday": if (ilUserProfile::userSettingVisible($f)) { $bi = new ilBirthdayInputGUI($lng->txt($lv), "usr_" . $f); include_once "./Services/Calendar/classes/class.ilDateTime.php"; $date = null; if ($a_user && strlen($a_user->{$m}())) { $date = new ilDateTime($a_user->{$m}(), IL_CAL_DATE); $bi->setDate($date); } $bi->setShowEmpty(true); $bi->setStartYear(1900); $bi->setRequired($ilSetting->get("require_" . $f)); if (!$bi->getRequired() || $date) { $bi->setDisabled($ilSetting->get("usr_settings_disable_" . $f)); } $a_form->addItem($bi); } break; case "radio": if (ilUserProfile::userSettingVisible($f)) { $rg = new ilRadioGroupInputGUI($lng->txt($lv), "usr_" . $f); if ($a_user) { $rg->setValue($a_user->{$m}()); } foreach ($p["values"] as $k => $v) { $op = new ilRadioOption($lng->txt($v), $k); $rg->addOption($op); } $rg->setRequired($ilSetting->get("require_" . $f)); if (!$rg->getRequired() || $rg->getValue()) { $rg->setDisabled($ilSetting->get("usr_settings_disable_" . $f)); } $a_form->addItem($rg); } break; case "picture": if (ilUserProfile::userSettingVisible("upload") && $a_user) { $ii = new ilImageFileInputGUI($lng->txt("personal_picture"), "userfile"); $ii->setDisabled($ilSetting->get("usr_settings_disable_upload")); $upload = $a_form->getFileUpload("userfile"); if ($upload["name"]) { $ii->setPending($upload["name"]); } else { $im = ilObjUser::_getPersonalPicturePath($a_user->getId(), "small", true, true); if ($im != "") { $ii->setImage($im); $ii->setAlt($lng->txt("personal_picture")); } } // ilinc link as info if (ilUserProfile::userSettingVisible("upload") and $ilSetting->get("ilinc_active")) { include_once './Modules/ILinc/classes/class.ilObjiLincUser.php'; $ilinc_user = new ilObjiLincUser($a_user); if ($ilinc_user->id) { include_once './Modules/ILinc/classes/class.ilnetucateXMLAPI.php'; $ilincAPI = new ilnetucateXMLAPI(); $ilincAPI->uploadPicture($ilinc_user); $response = $ilincAPI->sendRequest("uploadPicture"); // return URL to user's personal page $url = trim($response->data['url']['cdata']); $desc = $lng->txt("ilinc_upload_pic_text") . " " . '<a href="' . $url . '">' . $lng->txt("ilinc_upload_pic_linktext") . '</a>'; $ii->setInfo($desc); } } $a_form->addItem($ii); } break; case "roles": if (self::$mode == self::MODE_DESKTOP) { if (ilUserProfile::userSettingVisible("roles")) { $global_roles = $rbacreview->getGlobalRoles(); foreach ($global_roles as $role_id) { if (in_array($role_id, $rbacreview->assignedRoles($a_user->getId()))) { $roleObj = $ilias->obj_factory->getInstanceByObjId($role_id); $role_names .= $roleObj->getTitle() . ", "; unset($roleObj); } } $dr = new ilNonEditableValueGUI($lng->txt("default_roles"), "ne_dr"); $dr->setValue(substr($role_names, 0, -2)); $a_form->addItem($dr); } } else { if (self::$mode == self::MODE_REGISTRATION) { if ($registration_settings->roleSelectionEnabled()) { include_once "./Services/AccessControl/classes/class.ilObjRole.php"; $options = array(); foreach (ilObjRole::_lookupRegisterAllowed() as $role) { $options[$role["id"]] = $role["title"]; } // registration form validation will take care of missing field / value if ($options) { if (sizeof($options) > 1) { $ta = new ilSelectInputGUI($lng->txt('default_role'), "usr_" . $f); $ta->setOptions($options); $ta->setRequired($ilSetting->get("require_" . $f)); if (!$ta->getRequired()) { $ta->setDisabled($ilSetting->get("usr_settings_disable_" . $f)); } } else { $ta = new ilHiddenInputGUI("usr_" . $f); $ta->setValue(array_shift(array_keys($options))); } $a_form->addItem($ta); } } } } break; case "email": if (ilUserProfile::userSettingVisible($f)) { $em = new ilEMailInputGUI($lng->txt($lv), "usr_" . $f); if ($a_user) { $em->setValue($a_user->{$m}()); } $em->setRequired($ilSetting->get("require_" . $f)); if (!$em->getRequired() || $em->getValue()) { $em->setDisabled($ilSetting->get("usr_settings_disable_" . $f)); } if (self::MODE_REGISTRATION == self::$mode) { $em->setRetype(true); } $a_form->addItem($em); } break; case "textarea": if (ilUserProfile::userSettingVisible($f)) { $ta = new ilTextAreaInputGUI($lng->txt($lv), "usr_" . $f); if ($a_user) { $ta->setValue($a_user->{$m}()); } $ta->setRows($p["rows"]); $ta->setCols($p["cols"]); $ta->setRequired($ilSetting->get("require_" . $f)); if (!$ta->getRequired() || $ta->getValue()) { $ta->setDisabled($ilSetting->get("usr_settings_disable_" . $f)); } $a_form->addItem($ta); } break; case "messenger": if (ilUserProfile::userSettingVisible("instant_messengers")) { $im_arr = $p["types"]; foreach ($im_arr as $im_name) { $im = new ilTextInputGUI($lng->txt("im_" . $im_name), "usr_im_" . $im_name); if ($a_user) { $im->setValue($a_user->getInstantMessengerId($im_name)); } $im->setMaxLength($p["maxlength"]); $im->setSize($p["size"]); $im->setRequired($ilSetting->get("require_" . "instant_messengers")); if (!$im->getRequired() || $im->getValue()) { $im->setDisabled($ilSetting->get("usr_settings_disable_" . "instant_messengers")); } $a_form->addItem($im); } } break; case "password": if (self::$mode == self::MODE_REGISTRATION) { if (!$registration_settings->passwordGenerationEnabled()) { $ta = new ilPasswordInputGUI($lng->txt($lv), "usr_" . $f); $ta->setRequired(true); // $ta->setDisabled($ilSetting->get("usr_settings_disable_".$f)); } else { $ta = new ilNonEditableValueGUI($lng->txt($lv)); $ta->setValue($lng->txt("reg_passwd_via_mail")); } $a_form->addItem($ta); } break; case "language": if (ilUserProfile::userSettingVisible($f)) { $ta = new ilSelectInputGUI($lng->txt($lv), "usr_" . $f); if ($a_user) { $ta->setValue($a_user->{$m}()); } $options = array(); $lng->loadLanguageModule("meta"); foreach ($lng->getInstalledLanguages() as $lang_key) { $options[$lang_key] = $lng->txt("meta_l_" . $lang_key); } asort($options); // #9728 $ta->setOptions($options); $ta->setRequired($ilSetting->get("require_" . $f)); if (!$ta->getRequired() || $ta->getValue()) { $ta->setDisabled($ilSetting->get("usr_settings_disable_" . $f)); } $a_form->addItem($ta); } break; case "multitext": if (ilUserProfile::userSettingVisible($f)) { $ti = new ilTextInputGUI($lng->txt($lv), "usr_" . $f); $ti->setMulti(true); if ($a_user) { $ti->setValue($a_user->{$m}()); } $ti->setMaxLength($p["maxlength"]); $ti->setSize($p["size"]); $ti->setRequired($ilSetting->get("require_" . $f)); if (!$ti->getRequired() || $ti->getValue()) { $ti->setDisabled($ilSetting->get("usr_settings_disable_" . $f)); } if ($this->ajax_href) { // add field to ajax call $ti->setDataSource($this->ajax_href . "&f=" . $f); } $a_form->addItem($ti); } break; } } // append custom fields as "other" if (is_array($custom_fields) && !$custom_fields_done) { // add "other" subheader if ($current_group != "other") { $sh = new ilFormSectionHeaderGUI(); $sh->setTitle($lng->txt("other")); $a_form->addItem($sh); } foreach ($custom_fields as $custom_field) { $a_form->addItem($custom_field); } } }
/** * Init basic settings form. */ public function initBasicSettingsForm($a_install = false) { global $lng, $ilCtrl; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); // webspace dir $ne = new ilNonEditableValueGUI($lng->txt("data_directory_in_ws"), "webspace_dir"); if ($a_install) { $ne->setInfo($this->lng->txt("data_directory_in_ws_info")); } $cwd = ilUtil::isWindows() ? str_replace("\\", "/", getcwd()) : getcwd(); $ne->setValue($cwd . "/data"); $this->form->addItem($ne); // data dir if ($a_install) { $ti = new ilTextInputGUI($lng->txt("data_directory_outside_ws"), "datadir_path"); $ti->setInfo($lng->txt("data_directory_info")); $ti->setRequired(true); $this->form->addItem($ti); } else { $ne = new ilNonEditableValueGUI($lng->txt("data_directory_outside_ws"), "data_dir"); $this->form->addItem($ne); } $lvext = ilUtil::isWindows() ? "_win" : ""; // logging $sh = new ilFormSectionHeaderGUI(); $sh->setTitle($lng->txt("logging")); $this->form->addItem($sh); // path to log file $ti = new ilTextInputGUI($lng->txt("log_path"), "log_path"); $ti->setInfo($lng->txt("log_path_comment" . $lvext)); $this->form->addItem($ti); // disable logging $cb = new ilCheckboxInputGUI($lng->txt("disable_logging"), "chk_log_status"); $this->form->addItem($cb); // server settings $sh = new ilFormSectionHeaderGUI(); $sh->setTitle($lng->txt("server_settings")); $this->form->addItem($sh); // time zone include_once "./Services/Calendar/classes/class.ilCalendarUtil.php"; $si = new ilSelectInputGUI($lng->txt("time_zone"), "time_zone"); $si->setOptions(array_merge(array("" => "-- " . $lng->txt("please_select") . " --"), ilCalendarUtil::_getShortTimeZoneList())); $si->setRequired(true); $this->form->addItem($si); // required 3rd party tools $sh = new ilFormSectionHeaderGUI(); $sh->setTitle($lng->txt("3rd_party_software_req")); $this->form->addItem($sh); // convert path $ti = new ilTextInputGUI($lng->txt("convert_path"), "convert_path"); $ti->setInfo($lng->txt("convert_path_comment" . $lvext)); $ti->setRequired(true); $this->form->addItem($ti); // zip path $ti = new ilTextInputGUI($lng->txt("zip_path"), "zip_path"); $ti->setInfo($lng->txt("zip_path_comment" . $lvext)); $ti->setRequired(true); $this->form->addItem($ti); // unzip path $ti = new ilTextInputGUI($lng->txt("unzip_path"), "unzip_path"); $ti->setInfo($lng->txt("unzip_path_comment" . $lvext)); $ti->setRequired(true); $this->form->addItem($ti); // optional 3rd party tools $sh = new ilFormSectionHeaderGUI(); $sh->setTitle($lng->txt("3rd_party_software_opt")); $this->form->addItem($sh); // ghostscript path $ti = new ilTextInputGUI($lng->txt("ghostscript_path"), "ghostscript_path"); $ti->setInfo($lng->txt("ghostscript_path_comment" . $lvext)); $this->form->addItem($ti); // java path $ti = new ilTextInputGUI($lng->txt("java_path"), "java_path"); $ti->setInfo($lng->txt("java_path_comment" . $lvext)); $this->form->addItem($ti); // htmldoc path $ti = new ilTextInputGUI($lng->txt("htmldoc_path"), "htmldoc_path"); $ti->setInfo($lng->txt("htmldoc_path_comment" . $lvext)); $this->form->addItem($ti); // ffmpeg path $ti = new ilTextInputGUI($lng->txt("ffmpeg_path"), "ffmpeg_path"); $ti->setInfo($lng->txt("ffmpeg_path_comment")); $this->form->addItem($ti); // latex $ti = new ilTextInputGUI($lng->txt("url_to_latex"), "latex_url"); $ti->setInfo($lng->txt("latex_url_comment")); $this->form->addItem($ti); // virus scanner $options = array("none" => $lng->txt("none"), "sophos" => $lng->txt("sophos"), "antivir" => $lng->txt("antivir"), "clamav" => $lng->txt("clamav")); $si = new ilSelectInputGUI($lng->txt("virus_scanner"), "vscanner_type"); $si->setOptions($options); $this->form->addItem($si); // scan command $ti = new ilTextInputGUI($lng->txt("scan_command"), "scan_command"); $this->form->addItem($ti); // clean command $ti = new ilTextInputGUI($lng->txt("clean_command"), "clean_command"); $this->form->addItem($ti); if ($a_install) { $sh = new ilFormSectionHeaderGUI(); $sh->setTitle($lng->txt("master_password")); $this->form->addItem($sh); // password $pi = new ilPasswordInputGUI($lng->txt("password"), "password"); $pi->setRequired(true); $pi->setSkipSyntaxCheck(true); $pi->setInfo($lng->txt("password_info")); $this->form->addItem($pi); } if ($a_install) { $this->form->addCommandButton("saveBasicSettings", $lng->txt("save")); } else { $this->form->addCommandButton("updateBasicSettings", $lng->txt("save")); $this->form->addCommandButton("determineToolsPath", $lng->txt("determine_tools_paths")); } $this->form->setTitle($lng->txt("data_directories")); $this->form->setFormAction("setup.php?cmd=gateway"); if ($a_install) { $det = $this->determineTools(); $this->form->setValuesByArray($det); } }
/** * Show account migration screen * @param string $a_message */ public function showAccountMigration($a_message = '') { /** * @var $tpl ilTemplate * @var $lng ilLanguage */ global $tpl, $lng; $lng->loadLanguageModule('auth'); self::initStartUpTemplate('tpl.login_account_migration.html'); include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, 'migrateAccount')); $form->setTitle($lng->txt('auth_account_migration')); $form->addCommandButton('migrateAccount', $lng->txt('save')); $form->addCommandButton('showLogin', $lng->txt('cancel')); $rad = new ilRadioGroupInputGUI($lng->txt('auth_account_migration_name'), 'account_migration'); $rad->setValue(1); $keep = new ilRadioOption($lng->txt('auth_account_migration_keep'), 1, $lng->txt('auth_info_migrate')); $user = new ilTextInputGUI($lng->txt('login'), 'mig_username'); $user->setRequired(true); $user->setValue(ilUtil::prepareFormOutput($_POST['mig_username'])); $user->setSize(32); $user->setMaxLength(128); $keep->addSubItem($user); $pass = new ilPasswordInputGUI($lng->txt('password'), 'mig_password'); $pass->setRetype(false); $pass->setRequired(true); $pass->setValue(ilUtil::prepareFormOutput($_POST['mig_password'])); $pass->setSize(12); $pass->setMaxLength(128); $keep->addSubItem($pass); $rad->addOption($keep); $new = new ilRadioOption($lng->txt('auth_account_migration_new'), 2, $lng->txt('auth_info_add')); $rad->addOption($new); $form->addItem($rad); $tpl->setVariable('MIG_FORM', $form->getHTML()); if (strlen($a_message)) { ilUtil::sendFailure($a_message); } $tpl->show('DEFAULT'); }
/** * Init password form. * * @param int $a_mode Edit Mode */ public function initPasswordForm() { global $lng, $ilUser, $ilSetting; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); // Check whether password change is allowed if ($this->allowPasswordChange()) { // The current password needs to be checked for verification // unless the user uses Shibboleth authentication with additional // local authentication for WebDAV. //if ( // ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || !$ilSetting->get("shib_auth_allow_local")) //) if ($ilUser->getAuthMode(true) == AUTH_LOCAL) { // current password $cpass = new ilPasswordInputGUI($lng->txt("current_password"), "current_password"); $cpass->setRetype(false); $cpass->setSkipSyntaxCheck(true); // only if a password exists. if ($ilUser->getPasswd()) { $cpass->setRequired(true); } $this->form->addItem($cpass); } // new password $ipass = new ilPasswordInputGUI($lng->txt("desired_password"), "new_password"); $ipass->setRequired(true); $ipass->setInfo(ilUtil::getPasswordRequirementsInfo()); if ($ilSetting->get("passwd_auto_generate") == 1) { $ipass->setPreSelection(true); $this->form->addItem($ipass); $this->form->addCommandButton("savePassword", $lng->txt("save")); $this->form->addCommandButton("showPassword", $lng->txt("new_list_password")); } else { $this->form->addItem($ipass); $this->form->addCommandButton("savePassword", $lng->txt("save")); } switch ($ilUser->getAuthMode(true)) { case AUTH_LOCAL: $this->form->setTitle($lng->txt("chg_password")); break; case AUTH_SHIBBOLETH: case AUTH_CAS: require_once 'Services/WebDAV/classes/class.ilDAVServer.php'; if (ilDAVServer::_isActive()) { $this->form->setTitle($lng->txt("chg_ilias_and_webfolder_password")); } else { $this->form->setTitle($lng->txt("chg_ilias_password")); } break; default: $this->form->setTitle($lng->txt("chg_ilias_password")); break; } $this->form->setFormAction($this->ctrl->getFormAction($this)); } }
/** * Init password form * @return */ protected function initFormPasswordInstruction() { include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); // new password $ipass = new ilPasswordInputGUI($this->lng->txt("desired_password"), "new_password"); $ipass->setRequired(true); $this->form->addItem($ipass); $this->form->addCommandButton("savePassword", $this->lng->txt("save")); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); $this->form->setTitle($this->lng->txt("chg_ilias_and_webfolder_password")); $this->form->setFormAction($this->ctrl->getFormAction($this)); return $this->form; }
/** * add type specific input fields to a form * * @param object form, property or radio option * @param array (assoc) input values * @param string configuration level ("type" or "object") * @param string parent field value * @param string parent option value * @param int maximum recursion depth */ function addFormElements($a_object, $a_values = array(), $a_level = "object", $a_parentfield = '', $a_parentvalue = '', $a_maxdepth = "3") { // recursion end if ($a_maxdepth == 0) { return; } foreach ($this->getInputFields($a_level, $a_parentfield, $a_parentvalue) as $field) { $value = $a_values['field_' . $field->field_name]; $value = $value ? $value : $field->default; switch ($field->field_type) { case self::FIELDTYPE_HEADER: $item = new ilFormSectionHeaderGUI(); $item->setTitle($field->title); break; case self::FIELDTYPE_DESCRIPTION: $item = new ilCustomInputGUI($field->title); $item->setHtml(nl2br($field->description)); break; case self::FIELDTYPE_TEXT: $item = new ilTextInputGUI($field->title, 'field_' . $field->field_name); $item->setInfo($field->description); $item->setRequired($field->required ? true : false); $item->setSize($field->size); $item->setValue($value); break; case self::FIELDTYPE_TEXTAREA: $item = new ilTextAreaInputGUI($field->title, 'field_' . $field->field_name); $item->setInfo($field->description); $item->setRequired($field->required ? true : false); $item->setUseRte($field->richtext ? true : false); $item->setRows($field->rows); $item->setCols($field->cols); $item->setValue($value); break; case self::FIELDTYPE_PASSWORD: $item = new ilPasswordInputGUI($field->title, 'field_' . $field->field_name); $item->setInfo($field->description); $item->setRequired($field->required ? true : false); $item->setValue($value); break; case self::FIELDTYPE_CHECKBOX: $item = new ilCheckboxInputGUI($field->title, 'field_' . $field->field_name); $item->setInfo($field->description); if ($value) { $item->setChecked(true); } break; case self::FIELDTYPE_RADIO: $item = new ilRadioGroupInputGUI($field->title, 'field_' . $field->field_name); $item->setInfo($field->description); $item->setValue($value); foreach ($field->options as $option) { $ropt = new ilRadioOption($option->title, $option->value); $ropt->setInfo($option->description); // add the sub items to the option $item->addOption($ropt); $this->addFormElements($ropt, $a_values, $a_level, $field->field_name, $option->value, $a_maxdepth - 1); } break; default: continue 2; } // add the item to the form or to the parent item if (is_a($a_object, 'ilPropertyFormGUI')) { $a_object->addItem($item); } else { $a_object->addSubItem($item); } // add the sub items to the item if (is_a($item, 'ilSubEnabledFormPropertyGUI')) { $this->addFormElements($item, $a_level, $a_values, $field->field_name, '', $a_maxdepth - 1); } } }
protected function initPrivateSettingsForm() { global $ilCtrl, $lng, $ilUser; include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $feed_form = new ilPropertyFormGUI(); $feed_form->setFormAction($ilCtrl->getFormaction($this)); $feed_form->setTitle($lng->txt("priv_feed_settings")); $feed_form->setTableWidth("100%"); $enable_private_feed = new ilCheckboxInputGUI($lng->txt("news_enable_private_feed"), "enable_private_feed"); $enable_private_feed->setChecked($ilUser->_getFeedPass($ilUser->getId())); $feed_form->addItem($enable_private_feed); $passwd = new ilPasswordInputGUI($lng->txt("password"), "desired_password"); $passwd->setRequired(true); $passwd->setInfo(ilUtil::getPasswordRequirementsInfo()); $enable_private_feed->addSubItem($passwd); $feed_form->addCommandButton("changeFeedSettings", $lng->txt("save")); $feed_form->addCommandButton("cancelSettings", $lng->txt("cancel")); return $feed_form; }
/** * @param string $pwassist_id * @return ilPropertyFormGUI */ protected function getAssignPasswordForm($pwassist_id) { require_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, 'submitAssignPasswordForm')); $form->setTarget('_parent'); $username = new ilTextInputGUI($this->lng->txt('username'), 'username'); $username->setRequired(true); $form->addItem($username); $password = new ilPasswordInputGUI($this->lng->txt('password'), 'password'); $password->setRequired(true); $form->addItem($password); $key = new ilHiddenInputGUI('key'); $key->setValue($pwassist_id); $form->addItem($key); $form->addCommandButton('submitAssignPasswordForm', $this->lng->txt('submit')); return $form; }
/** * ilPropertyFormGUI initialisation * * @access private */ private function initAdobeSettingsForm() { /** * @var $ilCtrl ilCtrl * @var $lng $lng */ global $lng, $ilCtrl; include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; require_once './Services/Authentication/classes/class.ilAuthUtils.php'; $this->tabs->setTabActive('editAdobeSettings'); $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($ilCtrl->getFormAction($this, 'saveAdobeSettings')); $this->form->setTitle($this->getPluginObject()->txt('adobe_settings')); $this->form->addCommandButton('saveAdobeSettings', $lng->txt('save')); $this->form->addCommandButton('cancelAdobeSettings', $lng->txt('cancel')); $form_server = new ilTextInputGUI($lng->txt('server'), 'server'); $form_server->setRequired(true); $form_server->setInfo($this->getPluginObject()->txt('xavc_host_info')); $this->form->addItem($form_server); $form_port = new ilNumberInputGUI($lng->txt('port'), 'port'); $form_port->setSize(5); $form_port->setMaxLength(5); $form_port->setInfo($this->getPluginObject()->txt('xavc_port_info')); $this->form->addItem($form_port); $form_login = new ilTextInputGUI($lng->txt('login'), 'login'); $form_login->setRequired(true); $this->form->addItem($form_login); $form_passwd = new ilPasswordInputGUI($lng->txt('password'), 'password'); $form_passwd->setRequired(true); $form_passwd->setRetype(false); $this->form->addItem($form_passwd); //Address to SWITCH Cave Server $form_cave = new ilTextInputGUI($this->getPluginObject()->txt('cave'), 'cave'); $form_cave->setRequired(true); // you can choose the mode for the creation of user-accounts at AdobeServer: the AC-Loginname could be the users-email-address or the ilias-loginname $radio_group = new ilRadioGroupInputGUI($this->getPluginObject()->txt('user_assignment_mode'), 'user_assignment_mode'); $radio_option_1 = new ilRadioOption($this->getPluginObject()->txt('assign_users_with_email'), 'assign_user_email'); $radio_group->addOption($radio_option_1); $radio_option_2 = new ilRadioOption($this->getPluginObject()->txt('assign_users_with_ilias_login'), 'assign_ilias_login'); $radio_group->addOption($radio_option_2); $radio_option_3 = new ilRadioOption($this->getPluginObject()->txt('assign_users_with_switch_aai_login'), 'assign_breezeSession'); $radio_option_3->addSubItem($form_cave); $radio_group->addOption($radio_option_3); $radio_group->setInfo($this->getPluginObject()->txt('assignment_info')); $radio_option_4 = new ilRadioOption($this->getPluginObject()->txt('assign_users_with_email_dfn'), 'assign_dfn_email'); $radio_group->addOption($radio_option_4); if (ilAdobeConnectServer::getSetting('user_assignment_mode') != NULL) { $radio_group->setDisabled(true); } $this->form->addItem($radio_group); $auth_radio_grp = new ilRadioGroupInputGUI($this->getPluginObject()->txt('auth_mode'), 'auth_mode'); $auth_radio_opt_1 = new ilRadioOption($this->getPluginObject()->txt('auth_mode_password'), 'auth_mode_password'); $auth_radio_grp->addOption($auth_radio_opt_1); $auth_radio_opt_2 = new ilRadioOption($this->getPluginObject()->txt('auth_mode_header'), 'auth_mode_header'); $form_x_user_id = new ilTextInputGUI($this->getPluginObject()->txt('x_user_id_header_var'), 'x_user_id'); $form_x_user_id->setInfo($this->getPluginObject()->txt('xavc_x_user_id_info')); $auth_radio_opt_2->addSubItem($form_x_user_id); $auth_radio_grp->addOption($auth_radio_opt_2); $auth_radio_opt_3 = new ilRadioOption($this->getPluginObject()->txt('auth_mode_switchaai'), 'auth_mode_switchaai'); $switchaai_checkbox_grp = new ilCheckboxGroupInputGUI($this->getPluginObject()->txt('auth_mode_switchaai_accounts'), 'auth_mode_switchaai_account_type'); $switchaai_checkbox_grp->addOption(new ilCheckboxOption($this->getPluginObject()->txt('auth_mode_switchaai_local'), AUTH_LOCAL)); $switchaai_checkbox_grp->addOption(new ilCheckboxOption($this->getPluginObject()->txt('auth_mode_switchaai_ldap'), AUTH_LDAP)); $auth_radio_opt_3->addSubItem($switchaai_checkbox_grp); $auth_radio_grp->addOption($auth_radio_opt_3); $form_auth_mode_dfn = new ilRadioOption($this->getPluginObject()->txt('auth_mode_dfn'), 'auth_mode_dfn'); $auth_radio_grp->addOption($form_auth_mode_dfn); $auth_radio_grp->setInfo($this->getPluginObject()->txt('authentification_mode_info')); $this->form->addItem($auth_radio_grp); $form_lead_time = new ilNumberInputGUI($this->getPluginObject()->txt('schedule_lead_time'), 'schedule_lead_time'); $form_lead_time->setDecimals(0); $form_lead_time->setMinValue(0); $form_lead_time->setRequired(true); $form_lead_time->setSize(5); $form_lead_time->setInfo($this->getPluginObject()->txt('schedule_lead_time_info')); $this->form->addItem($form_lead_time); $head_line = new ilFormSectionHeaderGUI(); $head_line->setTitle($this->getPluginObject()->txt('presentation_server_settings')); $this->form->addItem($head_line); $form_fe_server = new ilTextInputGUI($this->getPluginObject()->txt('presentation_server'), 'presentation_server'); $form_fe_server->setRequired(true); $form_fe_server->setInfo($this->getPluginObject()->txt('xavc_presentation_host_info')); $this->form->addItem($form_fe_server); $form_fe_port = new ilNumberInputGUI($this->getPluginObject()->txt('presentation_port'), 'presentation_port'); $form_fe_port->setSize(5); $form_fe_port->setMaxLength(5); $form_fe_port->setInfo($this->getPluginObject()->txt('xavc_presentation_port_info')); $this->form->addItem($form_fe_port); }
/** * @return ilPropertyFormGUI */ public function getClientSettingsForm() { /** * @var $lng ilLanguage */ global $lng; $form = new ilPropertyFormGUI(); $cb = new ilCheckboxInputGUI($lng->txt('chat_enabled'), 'chat_enabled'); $form->addItem($cb); $cb = new ilCheckboxInputGUI($lng->txt('enable_osd'), 'enable_osd'); $cb->setInfo($lng->txt('hint_osd')); $form->addItem($cb); $txt = new ilNumberInputGUI($lng->txt('osd_intervall'), 'osd_intervall'); $txt->setMinValue(1); $txt->setRequired(true); $txt->setInfo($lng->txt('hint_osd_interval')); $cb->addSubItem($txt); $cb1 = new ilCheckboxInputGUI($lng->txt('play_invitation_sound'), 'play_invitation_sound'); $cb1->setInfo($lng->txt('play_invitation_sound')); $cb->addSubItem($cb1); $cb = new ilCheckboxInputGUI($lng->txt('enable_smilies'), 'enable_smilies'); $cb->setInfo($lng->txt('hint_enable_smilies')); $form->addItem($cb); $name = new ilTextInputGUI($lng->txt('instance_name'), 'name'); $name->setRequired(true); $name->setValidationRegexp('/^[a-z0-9_-]+$/i'); $name->setInfo($lng->txt('hint_unique_name')); $form->addItem($name); $url = new ilTextInputGUI($lng->txt('ilias_url'), 'url'); $url->setRequired(true); $form->addItem($url); $user = new ilTextInputGUI($lng->txt('soap_user'), 'user'); $user->setInfo($lng->txt('soap_user_hint')); $user->setRequired(true); $form->addItem($user); $password = new ilPasswordInputGUI($lng->txt('soap_user_password'), 'password'); $password->setRequired(true); $form->addItem($password); return $form; }