-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage_start.php
executable file
·76 lines (66 loc) · 3.51 KB
/
page_start.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* My IPv4 or IPv6 REST Services API
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright Chronolabs Cooperative http://syd.au.snails.email
* @license ACADEMIC APL 2 (https://sourceforge.net/u/chronolabscoop/wiki/Academic%20Public%20License%2C%20version%202.0/)
* @license GNU GPL 3 (http://www.gnu.org/licenses/gpl.html)
* @package myip-api
* @since 1.0.1
* @author Dr. Simon Antony Roberts <[email protected]>
* @version 1.0.3
* @description A REST Services API that returns either or both or all IPv4, IPv6 addresses of a caller!
* @link http://internetfounder.wordpress.com
* @link https://github.com/Chronolabs-Cooperative/MyIP-API-PHP
* @link https://sourceforge.net/p/chronolabs-cooperative
* @link https://facebook.com/ChronolabsCoop
* @link https://twitter.com/ChronolabsCoop
*
*/
require_once './include/common.inc.php';
defined('API_INSTALL') || die('API Installation wizard die');
$pageHasForm = false;
$content = '';
include "./language/{$wizard->language}/welcome.php";
$writable = '<div class="alert alert-warning"><ul style="list-style: none;">';
foreach ($wizard->configs['writable'] as $key => $value) {
if (is_dir('../' . $value)) {
$writable .= '<li><span class="fa fa-fw fa-folder-open-o"></span> <strong>' . $value . '</strong></li>';
} else {
$writable .= '<li><span class="fa fa-fw fa-file-code-o"></span> <strong>' . $value . '</strong></li>';
}
}
$writable .= '</ul></div>';
$api_trust = '<div class="alert alert-warning"><ul style="list-style: none;">';
foreach ($wizard->configs['apiPathDefault'] as $key => $value) {
$api_trust .= '<li><span class="fa fa-fw fa-folder-open-o"></span> <strong>' . $value . '</strong></li>';
}
$api_trust .= '</ul></div>';
$writable_trust = '<div class="alert alert-warning"><ul style="list-style: none;">';
foreach ($wizard->configs['tmpPath'] as $key => $value) {
$writable_trust .= '<li><span class="fa fa-fw fa-folder-open-o"></span> <strong>' . $wizard->configs['apiPathDefault']['tmp'] . '/' . $key . '</strong></li>';
if (is_array($value)) {
foreach ($value as $key2 => $value2) {
$writable_trust .= '<li><span class="fa fa-fw fa-folder-open-o"></span> <strong>' . $wizard->configs['apiPathDefault']['tmp'] . '/' . $key . '/' . $value2 . '</strong></li>';
}
}
}
$writable_trust .= '</ul></div>';
$content = sprintf($content, $writable, $api_trust, $writable_trust);
include './include/install_tpl.php';
if (is_file(__DIR__ . DIRECTORY_SEPARATOR . 'sql' . DIRECTORY_SEPARATOR . 'dbreport.html'))
{
unlink(__DIR__ . DIRECTORY_SEPARATOR . 'sql' . DIRECTORY_SEPARATOR . 'dbreport.html');
require_once dirname(__DIR__) . '/class/apilists.php';
$files = APILists::getFileListAsArray(__DIR__ . DIRECTORY_SEPARATOR . 'sql');
foreach($files as $key => $file)
if (substr($file, strlen($file)-3,3) == 'ran')
rename(__DIR__ . DIRECTORY_SEPARATOR . 'sql' . DIRECTORY_SEPARATOR . $file, __DIR__ . DIRECTORY_SEPARATOR . 'sql' . DIRECTORY_SEPARATOR . substr($file,0,strlen($file)-4));
}