Ejemplo n.º 1
0
}
$set_admin_pass = trim(assign($_REQUEST['set_admin_pass'])) == '1';
if (!$all_tables_exist && $set_admin_pass) {
    $admin_login = trim(assign($_REQUEST['login']));
    $admin_pass = trim(assign($_REQUEST['password']));
    $admin_pass_verify = trim(assign($_REQUEST['confirm_password']));
    if (!$admin_login) {
        die("Empty login names are now allowed!<br /><a href=\"" . $_SERVER['SCRIPT_NAME'] . "\">Go back and try again</a>.");
    }
    if (!$admin_pass) {
        die("Empty passwords are now allowed!<br /><a href=\"" . $_SERVER['SCRIPT_NAME'] . "\">Go back and try again</a>.");
    }
    if ($admin_pass != $admin_pass_verify) {
        die("Admin and confirm passwords mismatch!<br /><a href=\"" . $_SERVER['SCRIPT_NAME'] . "\">Go back and try again</a>.");
    }
    if ($pony_db->create_tables() && $pony_db->add_user($admin_login, $admin_pass, 'admin_all')) {
        echo "Installation complete!<br />";
        echo "<a href=\"" . htmlspecialchars(str_replace("setup", "admin", $_SERVER['SCRIPT_NAME']), ENT_QUOTES) . "\">Proceed to administration panel</a>.";
    } else {
        die("Installation failed: `<b>" . mysql_error() . "</b>`");
    }
    die;
}
if (!$all_tables_exist) {
    if ($some_tables_exist && trim(assign($_REQUEST['delete_tables']) == '1')) {
        $pony_db->delete_tables();
        $some_tables_exist = $pony_db->some_tables_exist();
    }
    if ($some_tables_exist) {
        echo '<h4><font color="#b72525">Error! Server configuration problem!</font></h4>';
        echo '<div style="border:#ee0000 solid 1px;	background-color:#f6adad; color:#000000; width:500px; margin-bottom:20px">';