/
_install.php
executable file
·47 lines (45 loc) · 1.44 KB
/
_install.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
error_reporting(E_ALL);
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">
</head>
<body>
<img src="graphics/plogger.gif" alt="Plogger">
<?php
if (empty($_POST['proceed'])) {
do_install($_POST);
} else {
require(PLOGGER_DIR . 'lib/plogger/form_setup_complete.php');
};
?>
</body>
</html>