include_once 'ressources/class.ini.inc'; include_once 'ressources/class.computers.inc'; include_once 'ressources/class.mysql-server.inc'; include_once 'ressources/class.mysql-multi.inc'; $user = new usersMenus(); if (!$GLOBALS["EXECUTED_AS_ROOT"]) { if ($user->AsSystemAdministrator == false or $user->AsSambaAdministrator == false) { $tpl = new templates(); $text = $tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}'); $text = replace_accents(html_entity_decode($text)); echo "alert('{$text}');"; exit; } } if (isset($_GET["mysql-check"])) { mysqlcheck(); exit; } if (isset($_GET["popup"])) { popup(); exit; } if (isset($_GET["database"])) { database_table_list(); exit; } if (isset($_GET["databases-list"])) { databases_list_json(); exit; } if (isset($_GET["tables-list"])) {
die; } if ($argv[1] == '--imapsync') { rebuild_imapsync(); die; } if ($argv[1] == '--rebuild-zarafa') { rebuild_zarafa(); die; } if ($argv[1] == '--squid-events-purge') { squid_events_purge(); die; } if ($argv[1] == '--mysqlcheck') { mysqlcheck($argv[2], $argv[3]); die; } $sock = new sockets(); $q = new mysqlserver(); $MysqlConfigLevel = $sock->GET_INFO("MysqlConfigLevel"); if (!is_numeric($MysqlConfigLevel)) { $MysqlConfigLevel = 0; } $EnableZarafaTuning = $sock->GET_INFO("EnableZarafaTuning"); if (!is_numeric($EnableZarafaTuning)) { $EnableZarafaTuning = 0; } $users = new usersMenus(); if ($users->ZARAFA_INSTALLED) { if ($EnableZarafaTuning == 1) {
if($argv[1]=='--GetAsSQLText'){GetAsSQLText($argv[2]);die();} if($argv[1]=='--backup'){Backup($argv[2]);die();} if($argv[1]=='--checks'){checks();die();} if($argv[1]=='--maintenance'){maintenance();die();} if(!Build_pid_func(__FILE__,"MAIN")){ writelogs(basename(__FILE__).":Already executed.. aborting the process",basename(__FILE__),__FILE__,__LINE__); die(); } if($argv[1]=='--tables'){$mysql=new mysql();$mysql->BuildTables();die();} if($argv[1]=='--imapsync'){rebuild_imapsync();die();} if($argv[1]=='--rebuild-zarafa'){rebuild_zarafa();die();} if($argv[1]=='--squid-events-purge'){squid_events_purge();die();} if($argv[1]=='--mysqlcheck'){mysqlcheck($argv[2],$argv[3]);die();} $q=new mysqlserver(); $unix=new unix(); $mem=$unix->TOTAL_MEMORY_MB(); echo "\n"; echo "Starting......: Mysql my.cnf........: Total memory {$mem}MB\n"; if($mem<550){ echo "Starting......:Mysql my.cnf........: SWITCH TO LOWER CONFIG.\n"; $datas=$q->Mysql_low_config();
<?php include_once('ressources/class.templates.inc'); include_once('ressources/class.ldap.inc'); include_once('ressources/class.users.menus.inc'); include_once('ressources/class.ini.inc'); include_once('ressources/class.computers.inc'); $user=new usersMenus(); if(($user->AsSystemAdministrator==false) OR ($user->AsSambaAdministrator==false)) { $tpl=new templates(); $text=$tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}'); $text=replace_accents(html_entity_decode($text)); echo "alert('$text');"; exit; } if(isset($_GET["mysql-check"])){mysqlcheck();exit;} if(isset($_GET["popup"])){popup();exit;} if(isset($_GET["database"])){database_infos();exit;} js(); function js(){ $page=CurrentPageName(); $tpl=new templates(); $title=$tpl->_ENGINE_parse_body('{browse_mysql_server}',"mysql.index.php"); $tables_list=$tpl->_ENGINE_parse_body('{tables_list}',"mysql.index.php"); $uid=$_GET["uid"]; $prefix=str_replace(".","_",$page); $html="
/** * 保存config表配置 * @param array $config 需要保存的配置的Name数组 * @param array $config 需要保存的配置的value数组,键值为Name * @param array $config 需要保存的配置的语言 */ function configsave($config, $have = '', $lang = '') { global $_M; if ($lang == '') { $lang = $_M['lang']; } if ($have == '') { $have = $_M['form']; } $c = copykey($have, $config); foreach ($c as $key => $val) { $value = mysqlcheck($have[$key]); if ($key == 'flash_10001' && $have['mobile'] == '1') { if (isset($_M['config'][$key]) && $value != $_M['config'][$key] && (isset($have[$key]) or isset($have[$key]) && !$have[$key])) { $query = "update {$_M[table][config]} SET mobile_value = '{$value}' WHERE name = '{$key}' and (lang='{$_M[lang]}' or lang='metinfo')"; DB::query($query); } } else { if (isset($_M['config'][$key]) && $value != $_M['config'][$key] && (isset($have[$key]) or isset($have[$key]) && !$have[$key])) { $query = "update {$_M[table][config]} SET value = '{$value}' WHERE name = '{$key}' and (lang='{$_M[lang]}' or lang='metinfo')"; DB::query($query); } } } }
function tminisave($inc) { global $_M; $langtext = $this->tminiget('all'); foreach ($langtext as $key => $val) { $namelist = $val[name] . "_metinfo"; $namemetinfo = $inc[$namelist]; if ($val['value'] != $namemetinfo && $val['type'] != 1) { $namemetinfo = mysqlcheck($namemetinfo); $query = "UPDATE {$_M['table']['templates']} SET value='{$namemetinfo}' WHERE no='{$this->no}' AND name='{$val[name]}' AND lang='{$this->lang}'"; DB::query($query); } } }