Exemplo n.º 1
0
    die;
}
$dbUser = $_SESSION["hvzmsql"]["user"];
$dbPass = $_SESSION["hvzmsql"]["pass"];
$dbLink = @mysqli_connect($dbHost, $dbUser, $dbPass);
if (!$dbLink) {
    print ERRORBOX_SORRY_NO_DB_SERVER;
    require_once './page_footer.inc.php';
    die;
}
@mysqli_set_charset($dbLink, "utf8");
// ------------------------------------------
// Display logout button
// ------------------------------------------
if (isset($_SESSION["hvzmsql"])) {
    print output_db_logout_form($dbName, $dbUser);
}
// ------------------------------------------
// Output list of databses, links to actions and results
// ------------------------------------------
//old_style_create_db($dbLink,$dbHost,$dbName,$dbUser);
print new_style_create_db_and_tables($dbLink, $dbHost, $dbName, $dbUser, $dbPass);
// ------------------------------------------
// CLose db connection
// ------------------------------------------
if ($dbLink) {
    @mysqli_close($dbLink);
}
// ------------------------------------------
require_once './page_footer.inc.php';
// ------------------------------------------
Exemplo n.º 2
0
// If logged in earlier, reconnect ot database
// ------------------------------------------
if (!isset($_SESSION["hvzmsql"])) {
    print_db_login_form($error);
    require_once './page_footer.inc.php';
    die;
}
$mysql_admin_user = $_SESSION["hvzmsql"]["user"];
$mysql_admin_pass = $_SESSION["hvzmsql"]["pass"];
$dblink = @mysqli_connect($dbhost, $mysql_admin_user, $mysql_admin_pass);
@mysqli_set_charset($dblink, "utf8");
// ------------------------------------------
// Display in left column - logout button
// ------------------------------------------
if (isset($_SESSION["hvzmsql"])) {
    $leftbox .= output_db_logout_form($dbname, $mysql_admin_user);
}
// ------------------------------------------
// List Web Applications that need database support
// ------------------------------------------
ksort($GLOBALS["DBS"]);
$leftbox .= "  <h3>List of Applications on the Nordita Webs</h3>\r\n" . "  <ul>\r\n";
foreach ($GLOBALS["DBS"] as $label => $array) {
    $lock = isset($array["lock"]) && $array["lock"] ? 1 : 0;
    $leftbox .= "    <li style='margin-bottom:1em'>\r\n" . "      <p style='margin:0'>" . "<strong style='font-size:1.2em'>&quot;" . $label . "&quot;</strong>" . (strtolower($array["host"]) != "localhost" ? " [connect on <a href='" . $_SERVER["PHP_SELF"] . "?label=" . $label . "&amp;localhost=1'><strong>localhost</strong></a> instead]" : "") . "</p>\r\n" . "      <p style='margin:0'>" . check_connection($array["host"], $array["user"], $array["pass"], $array["name"], $lock) . "</p>\r\n" . "</li>\r\n";
}
$leftbox .= "  </ul>\r\n";
/*
  // ------------------------------------------
  //
  // ------------------------------------------