예제 #1
0
<?php

/*
 *	Script to upgrade database
 **************************************/
/* use required functions */
require_once '../../config.php';
require_once '../../functions/functions-install.php';
/* get root username and pass */
$root['user'] = $_POST['mysqlrootuser'];
$root['pass'] = $_POST['mysqlrootpass'];
/* try to install new database */
if (installDatabase($root)) {
    print '<div class="alert alert-block alert-success">Database installed successfully! <br> <a href="login/" class="btn btn-sm btn-default">Login to phpIPAM</a><hr>Default credentials are <strong>Admin/ipamadmin</strong></div>';
}
예제 #2
0
/**
 * Processes installation.
 *
 * @since 1.0
 * @package facileManager
 * @subpackage Installer
 */
function fmInstall($link, $database)
{
    global $fm_name, $branding_logo;
    printf('<form method="post" action="?step=3">
	<div id="fm-branding">
		<img src="%s" /><span>%s</span>
	</div>
	<div id="window">
<table class="form-table">' . "\n", $branding_logo, _('Install'));
    $retval = installDatabase($link, $database);
    echo "</table>\n";
    if ($retval) {
        echo '<p>' . _("Database setup is complete! Now let's create your administrative account.") . '</p><p class="step"><a href="?step=4" class="button">' . _('Continue') . '</a></p>';
    } else {
        echo '<p>' . _("Database setup failed. Please try again.") . '</p><p class="step"><a href="?step=3" class="button click_once">' . _('Try Again') . '</a></p>';
    }
    echo "</div></form>\n";
}
예제 #3
0
 public function activate()
 {
     // Activate the plugin
     include 'models/database.php';
     installDatabase();
 }
예제 #4
0
    $errors = verifyDatabase();
    if (isset($errors['tableError']) || isset($errors['fieldError'])) {
    } else {
        die("<div class='alert alert-danger'>Database already installed!</div>");
    }
}
# get privileged username and pass
$root['user'] = $_POST['mysqlrootuser'];
$root['pass'] = $_POST['mysqlrootpass'];
# get possible advanced
if (@$_POST['dropdb'] == "on") {
    $dropdb = true;
} else {
    $dropdb = false;
}
if (@$_POST['createdb'] == "on") {
    $createdb = true;
} else {
    $createdb = false;
}
if (@$_POST['creategrants'] == "on") {
    $creategrants = true;
} else {
    $creategrants = false;
}
/* try to install new database */
if (installDatabase($root['user'], $root['pass'], $dropdb, $createdb, $creategrants)) {
    print '<div class="alert alert-block alert-success">';
    print 'Database installed successfully! <a href="' . create_link("install", "install_automatic", "configure") . '" class="btn btn-sm btn-default">Continue</a>';
    print '</div>';
}