$externalSAMLForm->registerRule('checkParameter', 'callback', 'eF_checkParameter'); $externalSAMLForm->addElement("advcheckbox", "saml_enabled", _ACTIVATESAML, null, 'class = "inputCheckBox"', array(0, 1)); $externalSAMLForm->addElement("text", "saml_provider", _IDENTITYPROVIDER, 'class = "inputText"'); $externalSAMLForm->addElement("text", "saml_sign_in", _SIGNINURL, 'class = "inputText"'); $externalSAMLForm->addElement("text", "saml_sign_out", _SIGNOUTURL, 'class = "inputText"'); $externalSAMLForm->addElement("text", "saml_fingerprint", _CERTIFICATEFINGERPRINT, 'class = "inputText"'); $externalSAMLForm->addElement("text", "saml_targeted_id", "Targeted id", 'class = "inputText"'); $externalSAMLForm->addElement("text", "saml_first_name", _FIRSTNAME, 'class = "inputText"'); $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); }
$generalPHPForm->addElement("static", "sidenote", 'M'); $generalPHPForm->addElement("text", "memory_limit", _MEMORYLIMIT, 'class = "inputText" style = "width:35px"'); $generalPHPForm->addElement("static", "sidenote", _SECONDS); $generalPHPForm->addElement("text", "max_execution_time", _MAXEXECUTIONTIME, 'class = "inputText" style = "width:35px"'); $generalPHPForm->addElement("static", "", _LEAVEBLANKTOUSEPHPINI); $generalPHPForm->addElement("advcheckbox", "gz_handler", _GZHANDLER, null, 'class = "inputCheckBox"', array(0, 1)); $generalPHPForm->addElement("advcheckbox", "compress_tests", _COMPRESSTESTS, null, 'class = "inputCheckBox"', array(0, 1)); $generalPHPForm->addElement("text", "max_file_size", _MAXFILESIZE, 'class = "inputText"'); $generalPHPForm->addElement("static", "", _MAXFILEISAFFECTEDANDIS . ' <b>' . FileSystemTree::getUploadMaxSize() . '</b> ' . _KB); $generalPHPForm->addElement("text", "debug_mode", _DEBUGMODE, null, 'class = "inputText"'); $generalPHPForm->addElement("static", "", _COMMASEPARATEDLISTOFUSERSOR1FORALL); $generalPHPForm->addRule('memory_limit', _INVALIDFIELDDATA, 'checkParameter', 'id'); $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']);
try { $file = new EfrontFile($configuration['site_logo']); $appearanceLogoForm->addElement("static", "formelement", '<img src = "' . G_DEFAULTTHEMEURL . 'images/logo/' . $file['name'] . '" alt = "' . _SITELOGO . '" title = "' . _SITELOGO . '"/>'); } catch (Exception $e) { } $appearanceLogoForm->addElement('file', 'site_logo', _UPLOADSITELOGO); $appearanceLogoForm->addElement("static", "", _EACHFILESIZEMUSTBESMALLERTHAN . ' <b>' . FileSystemTree::getUploadMaxSize() . '</b> ' . _KB); //Don't show normalization if GD isn't set. if (extension_loaded('gd') || extension_loaded('gd2')) { $smarty->assign("T_GD_LOADED", true); $appearanceLogoForm->addElement("text", "logo_max_width", _LOGOWIDTH, 'size = "5"'); $appearanceLogoForm->addElement("text", "logo_max_height", _LOGOHEIGHT, 'size = "5"'); $appearanceLogoForm->addRule('logo_max_width', _LOGODIMENSIONSMUSTBEPOSITIVE, 'callback', create_function('$a', 'return ($a > 0);')); $appearanceLogoForm->addRule('logo_max_height', _LOGODIMENSIONSMUSTBEPOSITIVE, 'callback', create_function('$a', 'return ($a > 0);')); $appearanceLogoForm->addElement("advcheckbox", "normalize_dimensions", _NORMALIZEDIMENSIONS, null, 'class = "inputCheckBox"', array(0, 1)); $appearanceLogoForm->setDefaults(array('normalize_dimensions' => 1)); } $appearanceLogoForm->addElement("select", "use_logo", _USELOGO, array(0 => _DEFAULTLOGO, 1 => _SITELOGO, 2 => _THEMELOGO)); $appearanceLogoForm->setMaxFileSize(FileSystemTree::getUploadMaxSize() * 1024); try { // Get current dimensions list($width, $height) = getimagesize($GLOBALS['logoFile']['path']); $appearanceLogoForm->setDefaults(array('logo_max_width' => $width, 'logo_max_height' => $height)); } catch (EfrontFileException $e) { $appearanceLogoForm->setDefaults(array('logo_max_width' => 200, 'logo_max_height' => 150)); } $appearanceLogoForm->setDefaults($GLOBALS['configuration']); if (isset($currentUser->coreAccess['configuration']) && $currentUser->coreAccess['configuration'] != 'change') { $appearanceLogoForm->freeze(); } else { $appearanceLogoForm->addElement("submit", "submit", _SAVE, 'class = "flatButton"');
$externalLDAPForm->addElement("advcheckbox", "activate_ldap", _ACTIVATELDAP, null, 'class = "inputCheckBox"', array(0, 1)); $externalLDAPForm->addElement("advcheckbox", "only_ldap", _SUPPORTONLYLDAP, null, 'class = "inputCheckBox"', array(0, 1)); $externalLDAPForm->addElement("text", "ldap_server", _LDAPSERVER, 'class = "inputText"'); $externalLDAPForm->addElement("text", "ldap_port", _LDAPPORT, 'class = "inputText"'); $externalLDAPForm->addElement("text", "ldap_binddn", _LDAPBINDDN, 'class = "inputText"'); $externalLDAPForm->addElement("password", "ldap_password", _LDAPPASSWORD, 'class = "inputText"'); $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 {