Subversion Repositories oidplus

Rev

Rev 1050 | Rev 1056 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1050 Rev 1055
Line 22... Line 22...
22
use ViaThinkSoft\OIDplus\OIDplusSqlSlangPlugin;
22
use ViaThinkSoft\OIDplus\OIDplusSqlSlangPlugin;
23
use ViaThinkSoft\OIDplus\OIDplusCaptchaPlugin;
23
use ViaThinkSoft\OIDplus\OIDplusCaptchaPlugin;
24
 
24
 
25
require_once __DIR__ . '/../includes/oidplus.inc.php';
25
require_once __DIR__ . '/../includes/oidplus.inc.php';
26
 
26
 
-
 
27
define('BASECONFIG_FILE_OLD', 'includes/config.inc.php');
27
define('BASECONFIG_FILE', 'userdata/baseconfig/config.inc.php');
28
define('BASECONFIG_FILE_NEW', 'userdata/baseconfig/config.inc.php');
-
 
29
$existing_config = '';
-
 
30
if (file_exists(__DIR__.'/../'.BASECONFIG_FILE_OLD)) $existing_config = BASECONFIG_FILE_OLD;
-
 
31
if (file_exists(__DIR__.'/../'.BASECONFIG_FILE_NEW)) $existing_config = BASECONFIG_FILE_NEW;
28
$already_setup = file_exists(__DIR__.'/../'.BASECONFIG_FILE);
32
$already_setup = $existing_config != '';
29
 
33
 
30
OIDplus::handleLangArgument();
34
OIDplus::handleLangArgument();
31
 
35
 
32
echo '<!DOCTYPE html>';
-
 
33
echo '<html lang="'.substr(OIDplus::getCurrentLang(),0,2).'">';
-
 
34
 
-
 
35
echo '<head>';
36
ob_start();
36
echo '  <title>'._L('OIDplus Setup').'</title>';
-
 
37
echo '  <meta name="robots" content="noindex">';
-
 
38
echo '  <meta name="viewport" content="width=device-width, initial-scale=1.0">';
-
 
39
echo '  <link rel="stylesheet" href="setup.min.css.php">';
-
 
40
echo '  <link rel="shortcut icon" type="image/x-icon" href="../favicon.ico.php">';
-
 
41
echo '  <script src="setup.min.js.php" type="text/javascript"></script>';
-
 
42
echo '</head>';
-
 
43
 
-
 
44
echo '<body>';
-
 
45
 
-
 
46
echo '<h1>'._L('OIDplus Setup - Configuration File Generator').'</h1>';
-
 
47
 
37
 
48
echo '<noscript>';
38
echo '<noscript>';
49
echo '<h2>'._L('Please enable JavaScript in order to use setup!').'</h2>';
39
echo '<h2>'._L('Please enable JavaScript in order to use setup!').'</h2>';
50
echo '</noscript>';
40
echo '</noscript>';
51
 
41
 
52
echo '<span id="setupPageContent" style="display:None">';
42
echo '<span id="setupPageContent" style="display:None">';
53
 
43
 
54
echo OIDplus::gui()->getLanguageBox(null, false);
-
 
55
 
-
 
56
echo '<p>';
44
echo '<p>';
57
if ($already_setup) {
45
if ($already_setup) {
58
        echo _L('This assistant will help you updating the file <b>%1</b>.',BASECONFIG_FILE);
46
        echo _L('This assistant will help you updating the file <b>%1</b>.',$existing_config);
59
} else {
47
} else {
60
        echo _L('Thank you very much for choosing OIDplus!');
48
        echo _L('Thank you very much for choosing OIDplus!');
61
        echo ' ';
49
        echo ' ';
62
        echo _L('This setup assistant will help you creating the file <b>%1</b>.',BASECONFIG_FILE);
50
        echo _L('This setup assistant will help you creating the file <b>%1</b>.',$existing_config);
63
}
51
}
64
echo ' ';
52
echo ' ';
65
echo _L('This assistant does not automatically write to this file. Instead, you need to copy-paste the contents into the file.');
53
echo _L('This assistant does not automatically write to this file. Instead, you need to copy-paste the contents into the file.');
66
echo ' ';
54
echo ' ';
67
if ($already_setup) {
55
if ($already_setup) {
Line 212... Line 200...
212
echo '</div>';
200
echo '</div>';
213
 
201
 
214
// ----------------------------------------
202
// ----------------------------------------
215
 
203
 
216
echo '<div id="step3">';
204
echo '<div id="step3">';
217
echo '<h2>'._L('Step %1: Save %2 file',3,BASECONFIG_FILE).'</h2>';
205
echo '<h2>'._L('Step %1: Save %2 file',3,$existing_config).'</h2>';
218
echo '<p>'._L('Save following contents into the file <b>%1</b>',BASECONFIG_FILE).'</p>';
206
echo '<p>'._L('Save following contents into the file <b>%1</b>',$existing_config).'</p>';
219
echo '<code><font color="darkblue"><div id="config"></div></font></code>';
207
echo '<code><font color="darkblue"><div id="config"></div></font></code>';
220
echo '<p><input type="button" value="'._L('Copy to clipboard').'" onClick="copyToClipboard(config)"></p>';
208
echo '<p><input type="button" value="'._L('Copy to clipboard').'" onClick="copyToClipboard(config)"></p>';
221
echo '</div>';
209
echo '</div>';
222
 
210
 
223
// ----------------------------------------
211
// ----------------------------------------
224
 
212
 
225
echo '<div id="step4">';
213
echo '<div id="step4">';
-
 
214
echo '<h2>'._L('Step %1: After you have updated the file...',4).'</h2>';
-
 
215
if (is_dir(__DIR__.'/../plugins/viathinksoft/adminPages/050_oobe/')) {
226
if ($already_setup) {
216
        if ($already_setup) {
-
 
217
                echo '<p><input type="button" onclick="window.location.href=\'../plugins/viathinksoft/adminPages/050_oobe/oobe.php\'" value="'._L('Check connection and modify initial settings').'"></p>';
227
        echo '<h2>'._L('Step %1: Start OIDplus',4).'</h2>';
218
                echo '<p><input type="button" onclick="window.location.href=\'../\'" value="'._L('Check connection and start OIDplus').'"></p>';
228
} else {
219
        } else {
-
 
220
                echo '<p><input type="button" onclick="window.location.href=\'../plugins/viathinksoft/adminPages/050_oobe/oobe.php\'" value="'._L('Check connection and go to initial settings').'"></p>';
-
 
221
        }
-
 
222
} else {
229
        echo '<h2>'._L('Step %1: Continue to next step',4).'</h2>';
223
        echo '<p><input type="button" onclick="window.location.href=\'../\'" value="'._L('Check connection and start OIDplus').'"></p>';
230
}
224
}
231
echo '<p><input type="button" onclick="window.location.href=\'../\'" value="'._L('Continue').'"></p>';
-
 
232
echo '</div>';
225
echo '</div>';
233
 
226
 
234
echo '<br><br><br>'; // because of iPhone Safari
227
echo '<br><br>'; // because of iPhone Safari
235
 
228
 
236
echo '</span>';
229
echo '</span>';
237
echo '<script> $("#setupPageContent")[0].style.display = "Block"; </script>';
230
echo '<script> $("#setupPageContent")[0].style.display = "Block"; </script>';
238
 
231
 
-
 
232
# ---
-
 
233
 
-
 
234
$page_title_1 = _L('OIDplus Setup');
-
 
235
$page_title_2 = _L('Configuration File Generator');
-
 
236
$static_icon = 'img/main_icon.png';
-
 
237
$static_content = ob_get_contents();
239
echo '</body>';
238
$extra_head_tags = array();
-
 
239
$extra_head_tags[] = '<meta name="robots" content="noindex">';
-
 
240
$extra_head_tags[] = '<link rel="stylesheet" href="setup.min.css.php">';
-
 
241
$extra_head_tags[] = '<script src="setup.min.js.php" type="text/javascript"></script>';
240
echo '</html>';
242
ob_end_clean();
-
 
243
 
-
 
244
OIDplus::invoke_shutdown();
-
 
245
 
-
 
246
OIDplus::gui()->showSimplePage($page_title_1, $page_title_2, $static_icon, $static_content, $extra_head_tags);