$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
$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 { EfrontConfiguration::deleteValue($key); } } else { if ($key == 'memory_limit' || $key == 'max_execution_time') { //You can't set these values below the php.ini setting ini_restore($key); EfrontConfiguration::setValue($key, $value); } else { EfrontConfiguration::setValue($key, $value); } } } eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=system_config&op=general&tab=php&message=" . urlencode(_SUCCESFULLYUPDATECONFIGURATION) . "&message_type=success"); } } $smarty->assign("T_GENERAL_PHP_FORM", $generalPHPForm->toArray());
} 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) { if ($e->getCode() != UPLOAD_ERR_NO_FILE) { throw $e; } } } eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=system_config&op=appearance&tab=favicon&message=" . urlencode(_SUCCESFULLYUPDATECONFIGURATION) . "&message_type=success"); } catch (Exception $e) { handleNormalFlowExceptions($e); } } } $smarty->assign("T_APPEARANCE_FAVICON_FORM", $appearanceFaviconForm->toArray());
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'; } else { ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, $values['ldap_protocol']); //ldap_set_option($ds, LDAP_, $values['ldap_protocol']); if (!($bind = ldap_bind($ds, $values['ldap_binddn'], $values['ldap_password']))) { $message = _CANNOTBINDLDAPSERVER; $message_type = 'failure'; } else { $message = _SUCESSFULLYCONNECTEDTOLDAPSERVER; $message_type = 'success'; } //debug(false); } } } } $smarty->assign("T_EXTERNAL_LDAP_FORM", $externalLDAPForm->toArray()); } else { $smarty->assign("T_EXTENSION_MISSING", 'ldap'); } } #cpp#endif } #cpp#endif