Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
$j + 1 &&
$line{$j}.$line{$j+1} == '*/' ) {
$mode = '';
$j++;
}
break;
case 'D':
// Delimiter detect
switch ( $line{$j} ) {
case '"':
case "'":
// Double quote string
$delimiter = $value = $line{$j};
$mode = 'S';
break;
case ' ':
// Nothing yet
break;
default:
if ( strtoupper( substr( $line, $j, 4 ) ) == 'TRUE' ) {
// Boolean TRUE
$newcfg{$key} = 'TRUE';
$key = '';
$mode = ';';
} else if ( strtoupper( substr( $line, $j, 5 ) ) == 'FALSE' ) {
$newcfg{$key} = 'FALSE';
$key = '';
$mode = ';';
} else {
// Number or function call
$mode = 'N';
$value = $line{$j};
}
}
break;
default:
if ( $line{$j} == '$' ) {
// We must detect $key name
$mode = 'K';
$key = '$';
} else if ( $s < $j + 2 ) {
} else if ( strtoupper( substr( $line, $j, 7 ) ) == 'GLOBAL ' ) {
// Skip untill next ;
$mode = ';';
$j += 6;
} else if ( $line{$j}.$line{$j+1} == '/*' ) {
$mode = 'C';
$j++;
} else if ( $line{$j} == '#' || $line{$j}.$line{$j+1} == '//' ) {
// Delete till the end of the line
$j = $s;
}
}
}
}
}
/**
* Change paths containing SM_PATH to admin-friendly paths
* relative to the config dir, i.e.:
* '' -->
* SM_PATH . 'images/logo.gif' --> ../images/logo.gif
* '/absolute/path/logo.gif' --> /absolute/path/logo.gif
* 'http://whatever/' --> http://whatever
* Note removal of quotes in returned value
*
* @param string $old_path path that has to be converted
* @return string new path
* @access private
*/
function change_to_rel_path($old_path) {
$new_path = str_replace("SM_PATH . '", "../", $old_path);
$new_path = str_replace("../config/","", $new_path);
$new_path = str_replace("'","", $new_path);
return $new_path;
}
/**
* Change relative path (relative to config dir) to
* internal SM_PATH, i.e.:
* empty_string --> ''
* ../images/logo.gif --> SM_PATH . 'images/logo.gif'
* images/logo.gif --> SM_PATH . 'config/images/logo.gif'
* /absolute/path/logo.gif --> '/absolute/path/logo.gif'
* C:/absolute/win/path --> 'C:/absolute/win/path'
* http://whatever/ --> 'http://whatever'
*
* @param string $old_path path that has to be converted
* @return string new path
* @access private
*/
function change_to_sm_path($old_path) {
if ( $old_path === '' || $old_path == "''" ) {
return "''";
} elseif ( preg_match("/^(\/|http)/", $old_path) ||
substr($old_path,1,2) == ':/' ) {
return "'" . $old_path . "'";
} elseif ( preg_match("/^(\$|SM_PATH)/", $old_path) ) {
return $old_path;
}
$new_path = '';
$rel_path = explode("../", $old_path);
if ( count($rel_path) > 2 ) {
// Since we're relative to the config dir,
// more than 1 ../ puts us OUTSIDE the SM tree.
// get full path to config.php, then pop the filename
$abs_path = explode('/', realpath (SM_PATH . 'config/config.php'));
array_pop ($abs_path);
foreach ( $rel_path as $subdir ) {
if ( $subdir === '' ) {
array_pop ($abs_path);
} else {
array_push($abs_path, $subdir);
}
}
foreach ($abs_path as $subdir) {
$new_path .= $subdir . '/';
}
$new_path = "'$new_path'";
} elseif ( count($rel_path) > 1 ) {
// we're within the SM tree, prepend SM_PATH
$new_path = str_replace('../',"SM_PATH . '", $old_path . "'");
} else {
// Last, if it's a relative path without a .. prefix,
// we're somewhere within the config dir, so prepend
// SM_PATH . 'config/
$new_path = "SM_PATH . 'config/" . $old_path . "'";
}
return $new_path;
}
/* ---------------------- main -------------------------- */
/** @ignore */
define('SM_PATH','../../');
/* SquirrelMail required files. */
require_once(SM_PATH . 'include/validate.php');
require_once(SM_PATH . 'plugins/administrator/defines.php');
require_once(SM_PATH . 'plugins/administrator/auth.php');
global $data_dir, $username;
if ( !adm_check_user() ) {
header('Location: ' . SM_PATH . 'src/options.php') ;
exit;
}
displayPageHeader($color, 'None');
$newcfg = array( );
foreach ( $defcfg as $key => $def ) {
$newcfg[$key] = '';
}
$cfgfile = SM_PATH . 'config/config.php';
parseConfig( SM_PATH . 'config/config_default.php' );
parseConfig( $cfgfile );
$colapse = array( 'Titles' => 'off',
'Group1' => getPref($data_dir, $username, 'adm_Group1', 'off' ),
'Group2' => getPref($data_dir, $username, 'adm_Group2', 'on' ),
'Group3' => getPref($data_dir, $username, 'adm_Group3', 'on' ),
'Group4' => getPref($data_dir, $username, 'adm_Group4', 'on' ),
'Group5' => getPref($data_dir, $username, 'adm_Group5', 'on' ),
'Group6' => getPref($data_dir, $username, 'adm_Group6', 'on' ),
'Group7' => getPref($data_dir, $username, 'adm_Group7', 'on' ),
'Group8' => getPref($data_dir, $username, 'adm_Group8', 'on' ),
'Group9' => getPref($data_dir, $username, 'adm_Group9', 'on' ),
'Group10' => getPref($data_dir, $username, 'adm_Group10', 'on' ) );
/* look in $_GET array for 'switch' */
if ( sqgetGlobalVar('switch', $switch, SQ_GET) ) {
if ( $colapse[$switch] == 'on' ) {
$colapse[$switch] = 'off';
} else {
$colapse[$switch] = 'on';
}
setPref($data_dir, $username, "adm_$switch", $colapse[$switch] );
}
echo '';
/*
Write the options to the file.
*/
if ( $fp = @fopen( $cfgfile, 'w' ) ) {
fwrite( $fp, " $v ) {
if ( $k{0} == '$' && $v <> '' || is_int($v)) {
if ( substr( $k, 1, 11 ) == 'ldap_server' ) {
$v = substr( $v, 0, strlen( $v ) - 1 ) . "\n)";
$v = str_replace( 'array(', "array(\n\t", $v );
$v = str_replace( "',", "',\n\t", $v );
}
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 );
} else {
echo '
'.
_("Config file can't be opened. Please check config.php.").
'