Current File : //etc/sentora/panel/etc/apps/phpmyadmin/config.inc.php |
<?php
session_start();
//if(!isset($_SESSION)){
// echo "session not working";
//exit;
//}
//else{
//echo "session is working";
//exit;
//}
/*if(isset($_SESSION['zpuid']) )
{
include_once("/etc/sentora/panel/cnf/db.php");
if($_SESSION['zpuid']==1)
{
include_once("/etc/sentora/panel/cnf/db.php");
}
else
{
$conn = new mysqli("localhost", $user, $pass, "sentora_core");
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * from x_user_info where web_username=(select ac_user_vc from x_accounts where ac_id_pk='".$_SESSION['zpuid']."')";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
if(strlen($row["web_username"])>=15)
$user=substr($row["web_username"],0,14);
else
$user=$row["web_username"];
$pass=$row["web_password"];
}
else {
echo "Config error:".$sql;
exit;
}
$conn->close();
}
}
*/
$user="";
$pass="";
if(isset($_SESSION['cgs_user']) && isset($_SESSION['cgs_pass']) && isset($_SESSION['cgs_id']) && array_key_exists("cgs_user",$_SESSION) && array_key_exists("cgs_id",$_SESSION) && array_key_exists("cgs_pass",$_SESSION))
{
if($_SESSION['zpuid']==1){
include_once("/etc/sentora/panel/cnf/db.php");
}
else {
$user = $_SESSION['cgs_user'];
$pass = $_SESSION['cgs_pass'];
}
$cfg['blowfish_secret'] = 'F9fnDXWjY4PJ0wm3';
$i = 0;
$i++;
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user']=$user;
$cfg['Servers'][$i]['password']=$pass;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['UploadDir'] = '/var/sentora/temp/';
$cfg['SaveDir'] = '/var/sentora/temp/';
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';
$cfg['ShowCreateDb'] = false;
$cfg['ShowChgPassword'] = false;
$cfg['AllowUserDropDatabase'] = false;
$cfg['SuhosinDisableWarning'] = true;
$cfg['PmaNoRelation_DisableWarning'] = true;
$cfg['ShowServerInfo'] = false;
//exit;
$cfg['Servers'][$i]['hide_db'] = '^(^(information_schema|performance_schema|sentora_core|mysql|sentora_postfix|sentora_proftpd|sentora_roundcube)$|performance_schema|sentora_core|mysql|sentora_postfix|sentora_proftpd|sentora_roundcube)$';
}
else
{
echo "<div style=\"width:100%,height:40px;color:#FF0000;text-align:center;\" >Phpmyadmin session has expired .Please go to phpmyadmin module to access phpmyadmin</div>";
exit;
}
?>