X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Fadministrator%2Foptions.php;h=15a1c4b2dafd346641eba6774e3e39ea7731f1ee;hb=8ab3c1bd38409d09e1c336107ebee474b5a7dd39;hp=af2da68200bd5ad207e0e57db69453c747779bab;hpb=f8a1ed5aa365d515e4e2ac3602f900bfb9447fce;p=squirrelmail.git diff --git a/plugins/administrator/options.php b/plugins/administrator/options.php index af2da682..15a1c4b2 100644 --- a/plugins/administrator/options.php +++ b/plugins/administrator/options.php @@ -6,10 +6,10 @@ * This script creates separate page, that allows to review and modify * SquirrelMail configuration file. * - * @version $Id$ * @author Philippe Mingo - * @copyright (c) 1999-2005 The SquirrelMail Project Team + * @copyright © 1999-2007 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ * @package plugins * @subpackage administrator */ @@ -219,15 +219,12 @@ function change_to_sm_path($old_path) { /* ---------------------- main -------------------------- */ - -/** @ignore */ -define('SM_PATH','../../'); - -/* SquirrelMail required files. */ -require_once(SM_PATH . 'include/validate.php'); -require_once(SM_PATH . 'functions/imap.php'); -require_once(SM_PATH . 'plugins/administrator/defines.php'); -require_once(SM_PATH . 'plugins/administrator/auth.php'); +/** main SquirrelMail include */ +require('../../include/init.php'); +/* configuration definitions */ +include_once(SM_PATH . 'plugins/administrator/defines.php'); +/* additional functions */ +include_once(SM_PATH . 'plugins/administrator/auth.php'); global $data_dir, $username; @@ -272,7 +269,7 @@ if ( sqgetGlobalVar('switch', $switch, SQ_GET) ) { } echo '
' . - '
'. + '
'. ''. ''. @@ -320,12 +317,16 @@ foreach ( $newcfg as $k => $v ) { $type = SMOPT_TYPE_PLUGINS; } else if ( substr( $k, 0, 13 ) == '$ldap_server[' ) { $type = SMOPT_TYPE_LDAP; + } else if ( substr( $k, 0, 9 ) == '$fontsets' || + substr( $k, 0, 13 ) == '$aTemplateSet' ) { + $type = SMOPT_TYPE_CUSTOM; } if ( $type == SMOPT_TYPE_TITLE || $colapse[$act_grp] == 'off' ) { switch ( $type ) { case SMOPT_TYPE_LDAP: + case SMOPT_TYPE_CUSTOM: case SMOPT_TYPE_PLUGINS: case SMOPT_TYPE_THEME: case SMOPT_TYPE_HIDDEN: @@ -412,11 +413,13 @@ foreach ( $newcfg as $k => $v ) { case SMOPT_TYPE_TEXTAREA: if ( sqgetGlobalVar($e, $new_v, SQ_POST) ) { - $v = '"' . $new_v . '"'; + $v = '"' . addslashes($new_v) . '"'; $newcfg[$k] = str_replace( "\n", '', $v ); } - echo "'; } else { echo '\n". - '
'. _("Configuration Administrator").'
$name". - ""; + echo "
$name" + .""; if ( isset( $defcfg[$k]['comment'] ) ) { echo '   ' . $defcfg[$k]['comment']; } @@ -424,15 +427,17 @@ foreach ( $newcfg as $k => $v ) { break; case SMOPT_TYPE_STRING: if ( sqgetGlobalVar($e, $new_v, SQ_POST) ) { - $v = '"' . $new_v . '"'; + $v = '"' . addslashes($new_v) . '"'; $newcfg[$k] = $v; } if ( $v == '""' && isset( $defcfg[$k]['default'] ) ) { $v = "'" . $defcfg[$k]['default'] . "'"; $newcfg[$k] = $v; } - echo "
$name". - "'; + echo "
$name" + ."'; if ( isset( $defcfg[$k]['comment'] ) ) { echo '   ' . $defcfg[$k]['comment']; } @@ -577,7 +582,7 @@ if ( $colapse['Group8'] == 'off' ) { $i++; } } - echo '
'; + echo ''; + echo '
'; foreach ( $op_plugin as $plg ) { if ( in_array( $plg, $plugins ) ) { $sw = ' checked="checked"'; @@ -594,7 +599,7 @@ if ( $colapse['Group8'] == 'off' ) { "". "\n"; } - echo '
'. sprintf(_("Plugin directory could not be found: %s"), $plugpath). @@ -605,7 +610,7 @@ echo '

'. ''. _("Test Configuration")."
'; + '
'; /* Write the options to the file. @@ -631,8 +636,6 @@ if ( $fp = @fopen( $cfgfile, 'w' ) ) { fwrite( $fp, "$k = $v;\n" ); } } - // add local config support - fwrite( $fp, "@include SM_PATH . 'config/config_local.php';\n" ); // close php fwrite( $fp, '?>' ); fclose( $fp ); @@ -641,5 +644,6 @@ if ( $fp = @fopen( $cfgfile, 'w' ) ) { _("Config file can't be opened. Please check config.php."). '

'; } + ?> \ No newline at end of file