$externalSAMLForm->addElement("text", "saml_last_name", _LASTNAME, 'class = "inputText"'); $externalSAMLForm->addElement("text", "saml_email", _EMAIL, 'class = "inputText"'); $externalSAMLForm->addElement("advcheckbox", "saml_bool_redirect_sign", null, _SIGNSAMLREQUESTS, 'class = "inputCheckBox"', array(0, 1)); $externalSAMLForm->addElement("advcheckbox", "saml_bool_redirect_validate", null, _VALIDATESAMLREQUESTS, 'class = "inputCheckBox"', array(0, 1)); $externalSAMLForm->addElement("text", "saml_foo1", "Assertion Consumer Service (ACS) URL", 'class = "inputText inactiveElement" disabled'); $externalSAMLForm->addElement("text", "saml_foo2", "Single Logout Service URL", 'class = "inputText inactiveElement" disabled'); $externalSAMLForm->addElement("text", "saml_foo3", "SP Metadata XML", 'class = "inputText inactiveElement" disabled'); $externalSAMLForm->setDefaults($GLOBALS['configuration']); $externalSAMLForm->setDefaults(array('saml_foo1' => G_SERVERNAME . "saml/module.php/saml/sp/saml2-acs.php/efront-sp")); $externalSAMLForm->setDefaults(array('saml_foo2' => G_SERVERNAME . "saml/module.php/saml/sp/saml2-logout.php/efront-sp")); $externalSAMLForm->setDefaults(array('saml_foo3' => G_SERVERNAME . "saml/module.php/saml/sp/metadata.php/efront-sp")); $externalSAMLForm->freeze(array('saml_foo1', 'saml_foo2', 'saml_foo3')); if (isset($currentUser->coreAccess['configuration']) && $currentUser->coreAccess['configuration'] != 'change') { $externalSAMLForm->freeze(); } else { $externalSAMLForm->addElement("submit", "submit", _SAVE, 'class = "flatButton"'); if ($externalSAMLForm->isSubmitted() && $externalSAMLForm->validate()) { //If the form is submitted and validated $values = $externalSAMLForm->exportValues(); unset($values['submit']); foreach ($values as $key => $value) { EfrontConfiguration::setValue($key, $value); } eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=system_config&op=external&tab=saml&message=" . urlencode(_SUCCESFULLYUPDATECONFIGURATION) . "&message_type=success"); } } $smarty->assign("T_EXTERNAL_SAML_FORM", $externalSAMLForm->toArray()); } #cpp#endif } #cpp#endif
$generalPHPForm->addRule('max_execution_time', _INVALIDFIELDDATA, 'checkParameter', 'id'); $generalPHPForm->addRule('max_file_size', _INVALIDFIELDDATA, 'checkParameter', 'id'); $generalPHPForm->addRule('max_file_size', _INVALIDFIELDDATAFORFIELD . ': "' . _MAXFILESIZE . '"', 'numeric', null, 'client'); $generalPHPForm->setDefaults($GLOBALS['configuration']); isset($configuration['memory_limit']) ? $generalPHPForm->setDefaults(array('memory_limit' => $configuration['memory_limit'])) : $generalPHPForm->setDefaults(array('memory_limit' => (int) ini_get('memory_limit'))); isset($configuration['max_execution_time']) ? $generalPHPForm->setDefaults(array('max_execution_time' => $configuration['max_execution_time'])) : $generalPHPForm->setDefaults(array('max_execution_time' => ini_get('max_execution_time'))); isset($configuration['gz_handler']) ? $generalPHPForm->setDefaults(array('gz_handler' => $configuration['gz_handler'])) : $generalPHPForm->setDefaults(array('gz_handler' => '')); // isset($configuration['display_errors']) ? $generalPHPForm -> setDefaults(array('display_errors' => $configuration['display_errors'])) : $generalPHPForm -> setDefaults(array('display_errors' => ini_get('display_errors'))); if ($GLOBALS['configuration']['version_hosted']) { $generalPHPForm->freeze(array('memory_limit', 'max_execution_time')); } if (isset($currentUser->coreAccess['configuration']) && $currentUser->coreAccess['configuration'] != 'change') { $generalPHPForm->freeze(); } else { $generalPHPForm->addElement("submit", "submit", _SAVE, 'class = "flatButton"'); if ($generalPHPForm->isSubmitted() && $generalPHPForm->validate()) { //If the form is submitted and validated $values = $generalPHPForm->exportValues(); unset($values['submit']); if ($GLOBALS['configuration']['version_hosted']) { unset($values['memory_limit']); unset($values['max_execution_time']); } foreach ($values as $key => $value) { if ($value == '') { if ($key == 'memory_limit' || $key == 'max_execution_time') { ini_restore($key); EfrontConfiguration::setValue($key, str_ireplace("M", "", ini_get($key))); } elseif ($key == 'max_file_size') { EfrontConfiguration::setValue($key, FileSystemTree::getUploadMaxSize()); } else {
handleNormalFlowExceptions($e); } } } $smarty->assign("T_APPEARANCE_LOGO_FORM", $appearanceLogoForm->toArray()); $appearanceFaviconForm = new Html_QuickForm("appearance_favicon_form", "post", basename($_SERVER['PHP_SELF']) . "?ctg=system_config&op=appearance&tab=favicon", "", null, true); $appearanceFaviconForm->registerRule('checkParameter', 'callback', 'eF_checkParameter'); $appearanceFaviconForm->addElement('file', 'favicon', _FILENAME); $appearanceFaviconForm->addElement("static", "", _EACHFILESIZEMUSTBESMALLERTHAN . ' <b>' . FileSystemTree::getUploadMaxSize() . '</b> ' . _KB); $appearanceFaviconForm->addElement("advcheckbox", "default_favicon", _USEDEFAULTFAVICON, null, 'class = "inputCheckBox" id = "set_default_favicon" onclick = "$(\'favicon_settings\').select(\'input\').each(function(s) {if (s.type != \'submit\' && s.id != \'set_default_favicon\') s.disabled ? s.disabled = \'\' : s.disabled = \'disabled\' })"', array(0, 1)); $appearanceFaviconForm->setMaxFileSize(FileSystemTree::getUploadMaxSize() * 1024); if (isset($currentUser->coreAccess['configuration']) && $currentUser->coreAccess['configuration'] != 'change') { $appearanceFaviconForm->freeze(); } else { $appearanceFaviconForm->addElement("submit", "submit", _SAVE, 'class = "flatButton"'); if ($appearanceFaviconForm->isSubmitted() && $appearanceFaviconForm->validate()) { try { //If the form is submitted and validated if ($appearanceFaviconForm->exportValue('default_favicon')) { EfrontConfiguration::setValue('favicon', ''); } else { $faviconDirectory = new EfrontDirectory(G_LOGOPATH); $filesystem = new FileSystemTree(G_LOGOPATH); try { $faviconFile = $filesystem->uploadFile('favicon', $logoDirectory); if (strpos($faviconFile['mime_type'], 'image') === false) { throw new EfrontFileException(_NOTANIMAGEFILE, EfrontFileException::NOT_APPROPRIATE_TYPE); } EfrontConfiguration::setValue('favicon', $faviconFile['id']); clearTemplatesCache(); } catch (Exception $e) {
$externalLDAPForm->addElement("text", "ldap_basedn", _LDAPBASEDN, 'class = "inputText"'); $externalLDAPForm->addElement("select", "ldap_protocol", _LDAPPROTOCOLVERSION, array('2' => '2', '3' => '3')); $externalLDAPForm->addElement("text", "ldap_uid", _LOGINATTRIBUTE, 'class = "inputText"'); $externalLDAPForm->addElement("text", "ldap_cn", _LDAPCOMMONNAME, 'class = "inputText"'); $externalLDAPForm->addElement("text", "ldap_postaladdress", _LDAPADDRESS, 'class = "inputText"'); $externalLDAPForm->addElement("text", "ldap_l", _LDAPLOCALITY, 'class = "inputText"'); $externalLDAPForm->addElement("text", "ldap_telephonenumber", _LDAPTELEPHONENUMBER, 'class = "inputText"'); $externalLDAPForm->addElement("text", "ldap_mail", _LDAPMAIL, 'class = "inputText"'); $externalLDAPForm->addElement("text", "ldap_preferredlanguage", _LDAPLANGUAGE, 'class = "inputText"'); $externalLDAPForm->setDefaults($GLOBALS['configuration']); if (isset($currentUser->coreAccess['configuration']) && $currentUser->coreAccess['configuration'] != 'change') { $externalLDAPForm->freeze(); } else { $externalLDAPForm->addElement("submit", "check_ldap", _CHECKSETTINGS, 'class = "flatButton"'); $externalLDAPForm->addElement("submit", "submit", _SAVE, 'class = "flatButton"'); if ($externalLDAPForm->isSubmitted() && $externalLDAPForm->validate()) { //If the form is submitted and validated $values = $externalLDAPForm->exportValues(); if (!isset($values['check_ldap'])) { unset($values['submit']); foreach ($values as $key => $value) { EfrontConfiguration::setValue($key, $value); } eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=system_config&op=external&tab=ldap&message=" . urlencode(_SUCCESFULLYUPDATECONFIGURATION) . "&message_type=success"); } else { //debug(); //ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7); //pr($values); if (!($ds = ldap_connect($values['ldap_server'], $values['ldap_port']))) { $message = _CANNOTCONNECTLDAPSERVER; $message_type = 'failure';