示例#1
0
        $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
示例#2
0
$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 {
                    EfrontConfiguration::deleteValue($key);
                }
示例#3
0
$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"');
    if ($appearanceLogoForm->isSubmitted() && $appearanceLogoForm->validate()) {
        try {
            $values = $appearanceLogoForm->exportValues();
            unset($values['MAX_FILE_SIZE']);
            unset($values['submit']);
            unset($values['logo']);
            //This is set separately, otherwise settings replace its value
            foreach ($values as $key => $value) {
                $result = EfrontConfiguration::setValue($key, $value);
            }
            if ($values['use_logo'] == 0) {
                EfrontConfiguration::setValue('logo', '');
            } elseif ($values['use_logo'] == 1) {
                EfrontConfiguration::setValue('logo', $GLOBALS['configuration']['site_logo']);
            } elseif ($values['use_logo'] == 2) {
                EfrontConfiguration::setValue('logo', 'images/logo/logo.png');
            }
            $logoDirectory = new EfrontDirectory(G_LOGOPATH);
示例#4
0
 $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';
             } else {
                 ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, $values['ldap_protocol']);