http://www.fsf.org/ or write * to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. * */ function check_facility($config_file) { // Checking if we can write to $config_file //$fhandle is the configuration file handler //@chmod ($config_file, 0666); $fhandle = @fopen($config_file, "a+"); // file opend in append mode if ($fhandle === false) { // Problem open configuration file for writing @fclose($fhandle); return true; } else { @fclose($fhandle); return false; } return true; } function start_facility($fhandle) { // Begin file //$fhandle is the configuration file handler @fwrite ($fhandle, ' never use LDAP, only use the DB for users login, groups, ecc...' . "\n"); @fwrite ($fhandle, ' // 1 -> always use LDAP, don\'t use DB for users operations: login, groups...' . "\n"); @fwrite ($fhandle, ' // 2 -> first use LDAP, if the user is not present in LDAP or the credentials are not ok then use the DB' . "\n"); @fwrite ($fhandle, ' $LDAP_servername = "' . $LDAP_servername . "\"; // LDAP server name (\"\" for no LDAP use)\n"); @fwrite ($fhandle, ' $LDAP_basedn = "' . $LDAP_basedn . "\"; // LDAP base DN, the ldap base branch to search from\n"); @fwrite ($fhandle, ' $LDAP_filter = "' . $LDAP_filter . "\"; // LDAP filter to check if a user entry is valid\n"); @fwrite ($fhandle, ' $LDAP_rootdn = "' . $LDAP_rootdn . "\"; // LDAP administrator DN, \"\" for anonymous (recommended)\n"); @fwrite ($fhandle, ' $LDAP_rootdnpass = "' . $LDAP_rootdnpass . "\"; // LDAP administrator password\n"); @fwrite ($fhandle, ' $LDAP_groupbasedn = "' . $LDAP_groupbasedn . "\"; // LDAP groups base DN. Each entry in this DN is\n"); @fwrite ($fhandle, ' // a group for cmsdam, and must contain every user DN for that group.' . "\n"); @fwrite ($fhandle, ' $LDAP_groupfilter = "' . $LDAP_groupfilter . "\"; // LDAP filter to check if a group entry is valid\n"); @fwrite ($fhandle, ' $LDAP_groupstag = "' . $LDAP_groupstag . "\"; // LDAP attribute to identify group entities\n"); @fwrite ($fhandle, ' $LDAP_groupsuserstag = "' . $LDAP_groupsuserstag . "\"; // LDAP attribute to identify groups user DNs\n"); @fwrite ($fhandle, ' // END of LDAP Configuration directives *************************************' . "\n"); @fwrite ($fhandle, "\n"); } // SERVER CACHING ************************************* function servercache_facility($fhandle) { //$fhandle is the configuration file handler global $use_memcached; global $memcached_servers; global $memcached_port; global $memcached_compress_threshold; global $memcached_persistant; if ($use_memcached == "0") { // Don't use memcached daemon $use_memcached = "NO"; } else { // Use memcached daemon $use_memcached = "YES"; } if ($memcached_port == "") { $memcached_port = "11211"; } $memcached_servers = "array ('$memcached_servers:$memcached_port')"; @fwrite ($fhandle, ' // SERVER CACHING *************************************' . "\n"); @fwrite ($fhandle, ' $use_memcached = "' . $use_memcached . "\"; // Boost up things activating cmsdam output/variables caching\n"); @fwrite ($fhandle, ' $memcached_servers = ' . $memcached_servers . "; // memcached servers name and port\n"); @fwrite ($fhandle, ' $memcached_compress_threshold = "' . $memcached_compress_threshold . "\"; // at how many bytes should we compress?\n"); @fwrite ($fhandle, ' $memcached_persistant = "' . $memcached_persistant . "\"; // are we using persistant links?\n"); @fwrite ($fhandle, ' // END of SERVER CACHING *************************************' . "\n"); @fwrite ($fhandle, "\n"); } // GENERAL Site Configuration *********************************** function general_facility($fhandle) { //$fhandle is the configuration file handler global $Administrator; global $Administrator_Password; global $Administrator_Group; global $PHPWarn_on_sectioninclude; global $site_title; global $HTML_Meta_description; global $HTML_Meta_keywords; global $HTML_Meta_author; global $HTML_Meta_revisit; global $HTTP_maxage; global $HTTP_contenttype; global $HTTP_charset; global $cmsdam_admin_email; global $PHP_time_limit; global $parsetimecomment; @fwrite ($fhandle, ' // GENERAL *************************************' . "\n"); @fwrite ($fhandle, ' /* Super Administration User name - It is only used for Site Administration */' . "\n"); @fwrite ($fhandle, ' $Administrator = "' . $Administrator . "\"; \n"); @fwrite ($fhandle, ' /* Super Administrator Password - It is only used for Site Administration */' . "\n"); @fwrite ($fhandle, ' $Administrator_Password = "' . $Administrator_Password . "\";\n"); @fwrite ($fhandle, ' /* Administration Group - It is used for Site Administration */' . "\n"); @fwrite ($fhandle, ' /* WARNING: All people in this group will be cmsdAm administrators!! So pay attention! */' . "\n"); @fwrite ($fhandle, ' $Administrator_Group = "' . $Administrator_Group . "\";\n"); @fwrite ($fhandle, ' /* PHP Warnings and comments on section include. You may want to disable it in production sites */' . "\n"); @fwrite ($fhandle, ' $PHPWarn_on_sectioninclude = "' . $PHPWarn_on_sectioninclude . "\";\n"); @fwrite ($fhandle, ' /* This is the default site title (<?=$site_title?>) */' . "\n"); @fwrite ($fhandle, ' $site_title = "' . $site_title . "\";\n"); @fwrite ($fhandle, ' /* HTML META DESCRIPTION () */' . "\n"); @fwrite ($fhandle, ' $HTML_Meta_description = "' . $HTML_Meta_description . "\";\n"); @fwrite ($fhandle, ' /* HTML META KEYWORDS () */' . "\n"); @fwrite ($fhandle, ' $HTML_Meta_keywords = "' . $HTML_Meta_keywords . "\";\n"); @fwrite ($fhandle, ' /* HTML META AUTHOR () */' . "\n"); @fwrite ($fhandle, ' $HTML_Meta_author = "' . $HTML_Meta_author . "\";\n"); @fwrite ($fhandle, ' /* HTML META revisit-after time period in days for robots like search engines. 0 to disable */' . "\n"); @fwrite ($fhandle, ' $HTML_Meta_revisit = "' . $HTML_Meta_revisit . "\";\n"); @fwrite ($fhandle, ' /* HTTP max-age (HTTP cache mechanism, page max age in seconds) */' . "\n"); @fwrite ($fhandle, ' $HTTP_maxage = "' . $HTTP_maxage . "\";\n"); @fwrite ($fhandle, ' /* HTTP content type (text formatting) */' . "\n"); @fwrite ($fhandle, ' $HTTP_contenttype = "' . $HTTP_contenttype . "\";\n"); @fwrite ($fhandle, ' /* HTTP charset (text formatting) */' . "\n"); @fwrite ($fhandle, ' $HTTP_charset = "' . $HTTP_charset . "\";\n"); @fwrite ($fhandle, ' /* CMS mail administrator, default "From: " address for mails from cmsdam */' . "\n"); @fwrite ($fhandle, ' $cmsdam_admin_email = "' . $cmsdam_admin_email . "\";\n"); @fwrite ($fhandle, ' /* Total PHP Timeout (PHP time_limit) in seconds. 0 for infinite */' . "\n"); @fwrite ($fhandle, ' $PHP_time_limit = "' . $PHP_time_limit . "\";\n"); @fwrite ($fhandle, ' /* If you want cmsdam print parsing time HTML comments at the bottom of the page say YES here. */' . "\n"); @fwrite ($fhandle, ' $parsetimecomment = "' . $parsetimecomment . "\";\n"); @fwrite ($fhandle, ' // END of GENERAL *************************************' . "\n"); @fwrite ($fhandle, "\n"); } // ERROR Configuration directives ************************************* function error_facility($fhandle) { //$fhandle is the configuration file handler global $filecontainer_basedir; global $LOG_debug; global $LOG_path; global $LOG_file; global $LOG_level; global $LOG_debuglevel; global $ERROR_reporting_cmsdAm; global $ERROR_reporting_sections; @fwrite ($fhandle, ' // Error and Logging Configuration directives *************************************' . "\n"); @fwrite ($fhandle, ' /* cmsdAm relative base directory that contains file contents */' . "\n"); @fwrite ($fhandle, ' $filecontainer_basedir = "' . "filestorage" . "\";\n"); @fwrite ($fhandle, ' $LOG_debug = "' . $LOG_debug . "\"; // Debug is active? [YES|NO]\n"); @fwrite ($fhandle, ' $LOG_path = "' . $LOG_path . "\"; // Relative or absolute logging path\n"); @fwrite ($fhandle, ' $LOG_file = "' . $LOG_file . "\"; // cmsdam $LOG_path relative filename\n"); @fwrite ($fhandle, ' /* Don\'t set this too high in production environment!! Logfile will grow very quickly and could */' . "\n"); @fwrite ($fhandle, ' /* bring down performance on sites with large users */' . "\n"); @fwrite ($fhandle, ' $LOG_level = "' . $LOG_level . "\"; // Logging level, from 0 (no logging) to 10 (high logging)\n"); @fwrite ($fhandle, ' $LOG_debuglevel = "' . $LOG_debuglevel . "\"; // Debuging level, from 0 (no debuging) to 10 (high debuging)\n"); @fwrite ($fhandle, ' $ERROR_reporting_cmsdAm = ' . $ERROR_reporting_cmsdAm . "; // Here you can set cmsdAm related errors\n"); @fwrite ($fhandle, ' $ERROR_reporting_sections = ' . $ERROR_reporting_sections . "; // Here you can set sections related errors\n"); @fwrite ($fhandle, ' // END of Error and Logging Configuration directives *************************************' . "\n"); @fwrite ($fhandle, "\n"); } // END of ERROR Configuration directives ****************************** /* TODO: SONO ARRIVATO QUI fino ad ora // PUBLISHING Site Configuration $publish_var_prefix $max_section_versions $max_section_vers_autoclean // END OF PUBLISHING */ ?>