';' && $i < $j ); $i--; if ( $l <> '' ) { if ( $cm ) { if( substr( $l, -2 ) == '*/' ) { $l = ''; $cm = FALSE; } else if( $k = strpos( $l, '*/' ) ) { $l = substr( $l, $k ); $cm = FALSE; } else { $l = ''; } } else { if( $l{0}.$l{1} == '/*' ) { $l = ''; $cm = TRUE; } else if ( $k = strpos( $l, '/*' ) ) { $l = substr( $l, 0, $k ); $cm = TRUE; } } if ( $k = strpos( $l, '=' ) ) { $key = trim( substr( $l, 0, $k - 1 ) ); $val = str_replace( ';', '', trim( substr( $l, $k + 1 ) ) ); $newcfg[$key] = $val; } } } } /* ---------------------- main -------------------------- */ chdir('..'); require_once('../src/validate.php'); require_once('../functions/page_header.php'); require_once('../functions/imap.php'); require_once('../src/load_prefs.php'); require_once('../plugins/administrator/defines.php'); $auth = FALSE; if ( $adm_id = fileowner('../config/config.php') ) { $adm = posix_getpwuid( $adm_id ); if ( $username == $adm['name'] ) { $auth = TRUE; } } if ( !auth ) { header("Location: ../../src/options.php") ; exit; } displayPageHeader($color, 'None'); $newcfg = array( ); foreach ( $defcfg as $key => $def ) { $newcfg[$key] = ''; } $cfgfile = '../config/config.php'; parseConfig( '../config/config_default.php' ); parseConfig( $cfgfile ); echo "
'; /* Write the options to the file. */ $fp = fopen( $cfgfile, 'w' ); fwrite( $fp, " $v ) { if ( $k{0} == '$' ) { if( $i = strpos( $k, '[' ) ) { if( strpos( $k, '[0]' ) ) { if( $not_first ) { fwrite( $fp, ', ' ); } fwrite( $fp, substr( $k, 0, $i) ); $not_first = TRUE; } } else { if( $not_first ) { fwrite( $fp, ', ' ); } fwrite( $fp, $k ); $not_first = TRUE; } } } fwrite( $fp, ";\n" ); foreach ( $newcfg as $k => $v ) { if ( $k{0} == '$' ) { fwrite( $fp, "$k = $v;\n" ); } } fwrite( $fp, '?>' ); fclose( $fp ); ?>