コード例 #1
0
ファイル: setup.php プロジェクト: sh1nu11bi/PonyBotnet_panel
    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">';
        echo 'Missing required MySQL tables. Please, delete Pony MySQL tables and try again.<br />';
        echo '</div>';
        echo '<a href="' . $_SERVER['SCRIPT_NAME'] . '?delete_tables=1">Delete Pony MySQL tables and restart installation process</a>.';
        die;
    }
    die("MySQL database installation. Please, provide administrator credentials:<table>" . "<form action=\"" . $_SERVER['SCRIPT_NAME'] . "\" method=\"post\">" . "<input type=\"hidden\" name=\"set_admin_pass\" value=\"1\">" . "<tr><td>Admin login: </td><td><input type=\"text\" name=\"login\"></td></tr>" . "<tr><td>Admin password: </td><td><input type=\"password\" name=\"password\"></td></tr>" . "<tr><td>Confirm password: </td><td><input type=\"password\" name=\"confirm_password\"></td></tr><br />" . "<tr><td colspan=2 align=right><input type=\"submit\" value=\"Install\"></td></tr>" . "</form>" . "</table>");
} else {
    die('Installation complete!<br />' . "<a href=\"" . htmlspecialchars(str_replace("setup", "admin", $_SERVER['SCRIPT_NAME']), ENT_QUOTES) . "\">Proceed to administration panel</a>." . '<br /><br />To restart installation process, please, delete MySQL tables.<br />');
}