Subversion Repositories oidplus

Rev

Rev 135 | Rev 154 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
82 daniel-mar 1
<?php
2
 
3
$own_dir = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://" . $_SERVER["HTTP_HOST"] . $_SERVER['REQUEST_URI'];
4
 
5
?><!DOCTYPE html>
2 daniel-mar 6
<html lang="en">
7
 
8
<head>
76 daniel-mar 9
        <title>OIDplus setup</title>
104 daniel-mar 10
        <meta name="robots" content="noindex">
2 daniel-mar 11
        <link rel="stylesheet" href="setup.css">
12
        <script src="../3p/sha3_js/sha3.js"></script><!-- https://github.com/emn178/js-sha3 -->
13
        <script src="setup.js"></script>
14
</head>
15
 
104 daniel-mar 16
<body onload="rebuild()">
2 daniel-mar 17
 
76 daniel-mar 18
<h1>OIDplus setup - Database connectivity</h1>
2 daniel-mar 19
 
20
<div id="step1">
21
<h2>Step 1: Enter setup information</h2>
22
<form id="step1_form">
104 daniel-mar 23
<p>Which admin password do you want?<br><input id="admin_password" type="password" autocomplete="new-password" onkeypress="rebuild()" onkeyup="rebuild()"> <span id="password_warn"></span></p>
24
<p>Please repeat the password input:<br><input id="admin_password2" type="password" autocomplete="new-password" onkeypress="rebuild()" onkeyup="rebuild()"> <span id="password_warn2"></span></p>
2 daniel-mar 25
<p>---</p>
150 daniel-mar 26
 
27
 
28
Database plugin: <select name="db_plugin" onChange="dbplugin_changed()" id="db_plugin">
29
<option value="MySQL" selected="true">MySQL</option>
30
<option value="PDO">PDO</option>
31
<option value="ODBC">ODBC</option>
32
</select>
33
 
34
<script>
35
 
36
owndir = '<?php echo $own_dir; ?>';
37
rebuild_callbacks = [];
38
rebuild_config_callbacks = [];
39
plugin_combobox_change_callbacks = [];
40
 
41
function dbplugin_changed() {
42
        var e = document.getElementById("db_plugin");
43
        var strPlugin = e.options[e.selectedIndex].value;
44
 
45
        for (var i = 0; i < plugin_combobox_change_callbacks.length; i++) {
46
                var f = plugin_combobox_change_callbacks[i];
47
                f(strPlugin);
48
        }
49
 
50
        rebuild();
51
}
52
 
53
</script>
54
 
55
<div style="margin-left:50px">
56
 
57
<?php
58
 
59
$files = glob(__DIR__.'/../plugins/database/*/setup.part.html');
60
foreach ($files as $file) {
61
        echo file_get_contents($file);
62
}
63
if (count($files) == 0) {
64
        echo '<p><font color="red">ATTENTION: No database plugins found!</font></p>';
65
}
66
 
67
?>
68
 
69
</div>
70
 
71
<script>
72
dbplugin_changed();
73
</script>
74
 
104 daniel-mar 75
<p>Tablename prefix (e.g. <b>oidplus_</b>):<br><input id="tablename_prefix" type="text" value="oidplus_" onkeypress="rebuild()" onkeyup="rebuild()"></p>
2 daniel-mar 76
<p>---</p>
104 daniel-mar 77
<p><input id="recaptcha_enabled" type="checkbox" onclick="rebuild()"> <label for="recaptcha_enabled">RECAPTCHA Enabled</label></p>
78
<p>RECAPTCHA Public key<br><input id="recaptcha_public" type="text" onkeypress="rebuild()" onkeyup="rebuild()"></p>
79
<p>RECAPTCHA Private key<br><input id="recaptcha_private" type="text" onkeypress="rebuild()" onkeyup="rebuild()"></p>
80 daniel-mar 80
<p>---</p>
104 daniel-mar 81
<p>SSL enforcement<br><select name="enforce_ssl" id="enforce_ssl" onclick="rebuild()">
80 daniel-mar 82
<option value="0">No SSL available (don't redirect)</option>
83
<option value="1">Enforce SSL (always redirect)</option>
82 daniel-mar 84
<option value="2" selected>Intelligent SSL detection (redirect if port 443 is open)</option>
80 daniel-mar 85
</select></p>
2 daniel-mar 86
</form>
87
</div>
88
 
89
<div id="step2">
90
<h2>Step 2: Import data</h2>
150 daniel-mar 91
<p><b>If you already have an OIDplus database and just want to rebuild the config file, please skip this step.</b></p>
81 daniel-mar 92
<p>Otherwise, import one of the following MySQL dumps in your database:</p>
2 daniel-mar 93
<p><ul>
150 daniel-mar 94
        <li><a href="struct_empty.sql.php" id="struct_1" target="_blank">Empty OIDplus database without example data</a><span id="struct_cli_1"></span><br><br></li>
95
        <li><a href="struct_with_examples.sql.php" id="struct_2" target="_blank">OIDplus database with example data</a><span id="struct_cli_2"></span><br><br></li>
96
 
2 daniel-mar 97
</ul></p>
150 daniel-mar 98
<p><font color="red">Warning: All data from the previous OIDplus instance will be deleted during the import.<br>If you already have an OIDplus database, skip to Step 3.</font></p>
80 daniel-mar 99
 
2 daniel-mar 100
</div>
101
 
102
<div id="step3">
103
<h2>Step 3: Save config.inc.php file</h2>
104
<p>Save following contents into the file <b>includes/config.inc.php</b>:</p>
105
<code><font color="darkblue"><div id="config"></div></font></code>
106
</div>
107
 
108
<div id="step4">
80 daniel-mar 109
<h2>Step 4: Continue to next step</h2>
110
<p><input type="button" onclick="document.location='../'" value="Continue"></p>
111
<!-- <p><a href="../">Run the OIDplus system</a></p> -->
2 daniel-mar 112
</div>
113
 
114
</body>
115
</html>