示例#1
0
     echo "\n\t" . '<h1>' . plog_tr('Plogger Configuration Complete') . '</h1>';
     echo "\n\n\t" . '<form action="_install.php" method="post">';
     echo "\n\n\t\t" . '<p>' . plog_tr('Configuration setup is now complete.') . '</p>';
     echo "\n\n\t\t" . '<p>' . plog_tr('Click <strong>Install</strong> to complete the installation.') . '</p>';
     if (!empty($_SESSION['plogger_config'])) {
         echo "\n\n\t\t" . '<p>' . sprintf(plog_tr('Before you can proceed, please %s to download configuration file for your gallery, then upload it to your webhost (into the same directory where you installed Plogger itself).'), '<input type="submit" class="submit-inline" name="dlconfig" value="' . plog_tr('click here') . '" />') . '</p>';
     }
     echo "\n\n\t\t" . '<p><input type="submit" class="submit" name="proceed" id="proceed" value="' . plog_tr('Install') . '" /></p>';
     echo "\n\n\t" . '</form>' . "\n";
     // Otherwise, do the install
 } else {
     $errors = array();
     $mysql = check_mysql(PLOGGER_DB_HOST, PLOGGER_DB_USER, PLOGGER_DB_PW, PLOGGER_DB_NAME);
     if (empty($mysql)) {
         create_tables();
         configure_plogger($_SESSION['install_values']);
         // undefined index install_values
         include_once PLOGGER_DIR . 'plog-load-config.php';
         // If open permissions, have Plogger fix them
         if (isset($_SESSION['plogger_close_perms'])) {
             fix_open_perms($_SESSION['plogger_close_perms'], 'delete');
         }
         $col = add_collection(plog_tr('Plogger Test Collection'), plog_tr('Feel free to delete it'));
         // Only attempt to create an album if the collection was created - sloppy fix for multiple installs
         if (!empty($col['id'])) {
             $alb = add_album(plog_tr('Plogger Test Album'), plog_tr('Feel free to delete it'), $col['id']);
         }
     } else {
         echo plog_tr('There was an error with the MySQL connection') . '!';
     }
     // If no errors, tell the user their login and password and link them to the login
示例#2
0
require dirname(__FILE__) . '/plog-globals.php';
require PLOGGER_DIR . 'plog-functions.php';
require PLOGGER_DIR . 'lib/plogger/install_functions.php';
// serve the config file
if (!empty($_POST['dlconfig']) && !empty($_SESSION['plogger_config'])) {
    header('Content-type: application/octet-stream');
    header('Content-Disposition: attachment; filename="plog-config.php"');
    print $_SESSION['plogger_config'];
    die;
}
// try to proceed to the admin interface. Only succeeds if the configuration is set
if (!empty($_POST['proceed']) && defined('PLOGGER_DB_HOST')) {
    $mysql = check_mysql(PLOGGER_DB_HOST, PLOGGER_DB_USER, PLOGGER_DB_PW, PLOGGER_DB_NAME);
    if (empty($mysql)) {
        create_tables();
        configure_plogger($_SESSION["install_values"]);
        require "plog-load_config.php";
        connect_db();
        $col = add_collection("Plogger test collection", "feel free to delete it");
        $alb = add_album("Plogger test album", "feel free to delete it", $col["id"]);
        unset($_SESSION["plogger_config"]);
        unset($_SESSION["install_values"]);
        header("Location: admin/index.php");
        exit;
    }
}
?>
<html>
	<head>
		<title>Install Plogger</title>
		<link rel="stylesheet" type="text/css" href="css/admin.css">