-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.phtml
91 lines (80 loc) · 2.28 KB
/
index.phtml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
$errorReporting = (E_ALL & ~E_NOTICE);
$errorReporting = 1; // comment this out to enable PHP warnings
error_reporting($errorReporting);
include '/etc/cdrtool/global.inc';
if ($DATASOURCES) {
page_open(
array(
"sess" => "CDRTool_Session",
"auth" => "CDRTool_Auth",
"perm" => "CDRTool_Perm"
)
);
$loginname = $auth->auth["uname"];
$title = "Legal notice";
$db = new DB_CDRTool();
$query = sprintf(
"select * from settings
where billing_party = '%s'
and var_module= 'login'
and var_name = 'I_agree_with_license'",
addslashes($loginname)
);
if ($db->query($query)) {
if ($db->num_rows()) {
$refreshURL = 'callsearch.phtml';
$refreshTime = 0;
}
}
if (is_readable("/etc/cdrtool/local/header.phtml")) {
include_once '/etc/cdrtool/local/header.phtml';
} else {
include_once 'header.phtml';
}
$layout = new pageLayoutLocal();
$layout->showHeader();
$layout->showLegalNotice();
$layout->showFooter();
page_close();
} else {
$Setup = new SETUP ();
$Setup->showIntro();
}
class SETUP {
function showIntro() {
print "
<html>
<head>
<title>CDRTool setup</title>
</head>
<body>
<h2>CDRTool setup</h2>
CDRTool has not been setup on this machine yet.
<p>
You must first setup php, apache and to create the cdrtool database.
Detailed installation instructions are available in <a href=doc/INSTALL.txt>doc/INSTALL.txt</a>
<p>
Once the database is available, create the cdrtool configuration
file by copying the sample configuration file:
<p>
cp setup/global.inc.simple.sample /etc/cdrtool/global.inc
<p>
Then edit the configuration file global.inc to reflect your platform setup.
This is the content of the current sample configuration file:
";
print "<pre>";
$fp = fopen("setup/global.inc.simple.sample",r);
while ($buffer = fgets($fp,1024)) {
if (!preg_match("/(<\?)|(\?>)/",$buffer)) {
print "$buffer";
}
}
print "</pre>";
}
}
print "
</body>
</html>
";
?>