* SquirrelMail configuration file.
*
* @author Philippe Mingo
- * @copyright © 1999-2006 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
/* ---------------------- 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;
exit;
}
-displayPageHeader($color, 'None');
+displayPageHeader($color);
$newcfg = array( );
} else if ( substr( $k, 0, 13 ) == '$ldap_server[' ) {
$type = SMOPT_TYPE_LDAP;
} else if ( substr( $k, 0, 9 ) == '$fontsets' ||
- substr( $k, 0, 13 ) == '$aTemplateSet' ) {
+ substr( $k, 0, 13 ) == '$aTemplateSet' ) {
$type = SMOPT_TYPE_CUSTOM;
}
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 "<tr><td valign=\"top\">$name</td><td>".
- "<textarea cols=\"$size\" rows=\"4\" name=\"adm_$n\">" . substr( $v, 1, strlen( $v ) - 2 ) . "</textarea>";
+ echo "<tr><td valign=\"top\">$name</td><td>"
+ ."<textarea cols=\"$size\" rows=\"4\" name=\"adm_$n\">"
+ .htmlspecialchars(stripslashes(substr( $v, 1, strlen( $v ) - 2 )))
+ ."</textarea>";
if ( isset( $defcfg[$k]['comment'] ) ) {
echo ' ' . $defcfg[$k]['comment'];
}
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 "<tr><td>$name</td><td>".
- "<input size=\"$size\" name=\"adm_$n\" value=\"" . substr( $v, 1, strlen( $v ) - 2 ) . '" />';
+ echo "<tr><td>$name</td><td>"
+ ."<input size=\"$size\" name=\"adm_$n\" value=\""
+ .htmlspecialchars(stripslashes(substr( $v, 1, strlen( $v ) - 2 )))
+ .'" />';
if ( isset( $defcfg[$k]['comment'] ) ) {
echo ' ' . $defcfg[$k]['comment'];
}
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 );
_("Config file can't be opened. Please check config.php.").
'</big></p>';
}
+
?>
-</body></html>
\ No newline at end of file
+</body></html>