Completed
Pull Request — master (#532)
06:37
created
app/dashboard/widgets/requests.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -2,12 +2,12 @@  discard block
 block discarded – undo
2 2
 
3 3
 # required functions
4 4
 if(!is_object(@$User)) {
5
-	require( dirname(__FILE__) . '/../../../functions/functions.php' );
6
-	# classes
7
-	$Database	= new Database_PDO;
8
-	$User 		= new User ($Database);
9
-	$Tools 		= new Tools ($Database);
10
-	$Subnets 	= new Subnets ($Database);
5
+    require( dirname(__FILE__) . '/../../../functions/functions.php' );
6
+    # classes
7
+    $Database	= new Database_PDO;
8
+    $User 		= new User ($Database);
9
+    $Tools 		= new Tools ($Database);
10
+    $Subnets 	= new Subnets ($Database);
11 11
 }
12 12
 
13 13
 # user must be authenticated
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 # if direct request that redirect to tools page
17 17
 if($_SERVER['HTTP_X_REQUESTED_WITH']!="XMLHttpRequest")	{
18
-	header("Location: ".create_link("administration","requests"));
18
+    header("Location: ".create_link("administration","requests"));
19 19
 }
20 20
 
21 21
 # fetch all requests
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 
27 27
 <?php
28 28
 if(!$requests) {
29
-	print "<blockquote style='margin-top:20px;margin-left:20px;'>";
30
-	print "<small>"._("No IP address requests available")."!</small><br>";
31
-	print "</blockquote>";
29
+    print "<blockquote style='margin-top:20px;margin-left:20px;'>";
30
+    print "<small>"._("No IP address requests available")."!</small><br>";
31
+    print "</blockquote>";
32 32
 }
33 33
 # print
34 34
 else {
@@ -46,21 +46,21 @@  discard block
 block discarded – undo
46 46
 </tr>
47 47
 
48 48
 <?php
49
-	# print requests
50
-	foreach($requests as $request) {
51
-		# cast
52
-		$request = (array) $request;
53
-		# get subnet details
54
-		$subnet = $Subnets->fetch_subnet ("id", $request['subnetId']);
49
+    # print requests
50
+    foreach($requests as $request) {
51
+        # cast
52
+        $request = (array) $request;
53
+        # get subnet details
54
+        $subnet = $Subnets->fetch_subnet ("id", $request['subnetId']);
55 55
 
56
-		print '<tr>'. "\n";
57
-		print "	<td><button class='btn btn-xs btn-default' data-requestid='$request[id]'><i class='fa fa-pencil'></i></button></td>";
58
-		print '	<td>'. $subnet->ip .'/'. $subnet->mask .' ('. $subnet->description .')</td>'. "\n";
59
-		print '	<td>'. $request['dns_name'] .'</td>'. "\n";
60
-		print '	<td>'. $request['description'] .'</td>'. "\n";
61
-		print '	<td>'. $request['requester'] .'</td>'. "\n";
62
-		print '</tr>'. "\n";
63
-	}
56
+        print '<tr>'. "\n";
57
+        print "	<td><button class='btn btn-xs btn-default' data-requestid='$request[id]'><i class='fa fa-pencil'></i></button></td>";
58
+        print '	<td>'. $subnet->ip .'/'. $subnet->mask .' ('. $subnet->description .')</td>'. "\n";
59
+        print '	<td>'. $request['dns_name'] .'</td>'. "\n";
60
+        print '	<td>'. $request['description'] .'</td>'. "\n";
61
+        print '	<td>'. $request['requester'] .'</td>'. "\n";
62
+        print '</tr>'. "\n";
63
+    }
64 64
 ?>
65 65
 
66 66
 </table>
Please login to merge, or discard this patch.
app/dashboard/widgets/error_logs.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -2,13 +2,13 @@  discard block
 block discarded – undo
2 2
 
3 3
 # required functions
4 4
 if(!is_object(@$User)) {
5
-	require( dirname(__FILE__) . '/../../../functions/functions.php' );
6
-	# classes
7
-	$Database	= new Database_PDO;
8
-	$User 		= new User ($Database);
9
-	$Tools 		= new Tools ($Database);
10
-	$Log		= new Logging ($Database);
11
-	$Result		= new Result ();
5
+    require( dirname(__FILE__) . '/../../../functions/functions.php' );
6
+    # classes
7
+    $Database	= new Database_PDO;
8
+    $User 		= new User ($Database);
9
+    $Tools 		= new Tools ($Database);
10
+    $Log		= new Logging ($Database);
11
+    $Result		= new Result ();
12 12
 }
13 13
 
14 14
 # user must be authenticated
@@ -16,52 +16,52 @@  discard block
 block discarded – undo
16 16
 
17 17
 # if direct request that redirect to tools page
18 18
 if($_SERVER['HTTP_X_REQUESTED_WITH']!="XMLHttpRequest")	{
19
-	header("Location: ".create_link("tools","logs"));
19
+    header("Location: ".create_link("tools","logs"));
20 20
 }
21 21
 
22 22
 # if syslog print
23 23
 if ($User->settings->log=="syslog") {
24
-	$Result->show("warning", _("Log files are sent to syslog"));
24
+    $Result->show("warning", _("Log files are sent to syslog"));
25 25
 }
26 26
 else {
27
-	# print last 5 access logs
28
-	$logs = $Log->fetch_logs(5, NULL, NULL, NULL, 1, 2, 2);
27
+    # print last 5 access logs
28
+    $logs = $Log->fetch_logs(5, NULL, NULL, NULL, 1, 2, 2);
29 29
 
30
-	print "<table class='table table-condensed table-hover table-top'>";
30
+    print "<table class='table table-condensed table-hover table-top'>";
31 31
 
32
-	# headers
33
-	print "<tr>";
34
-	print "	<th>"._('Severity')."</th>";
35
-	print "	<th>"._('Command')."</th>";
36
-	print "	<th>"._('Date')."</th>";
37
-	print "	<th>"._('Username')."</th>";
38
-	print "</tr>";
32
+    # headers
33
+    print "<tr>";
34
+    print "	<th>"._('Severity')."</th>";
35
+    print "	<th>"._('Command')."</th>";
36
+    print "	<th>"._('Date')."</th>";
37
+    print "	<th>"._('Username')."</th>";
38
+    print "</tr>";
39 39
 
40
-	# logs
41
-	foreach($logs as $log) {
42
-		# cast
43
-		$log = (array) $log;
44
-		# reformat severity
45
-		if($log['severity'] == 0)		{ $log['severityText'] = _("Info"); }
46
-		else if($log['severity'] == 1)	{ $log['severityText'] = _("Warn"); }
47
-		else if($log['severity'] == 2)	{ $log['severityText'] = _("Err"); }
40
+    # logs
41
+    foreach($logs as $log) {
42
+        # cast
43
+        $log = (array) $log;
44
+        # reformat severity
45
+        if($log['severity'] == 0)		{ $log['severityText'] = _("Info"); }
46
+        else if($log['severity'] == 1)	{ $log['severityText'] = _("Warn"); }
47
+        else if($log['severity'] == 2)	{ $log['severityText'] = _("Err"); }
48 48
 
49
-		print "<tr>";
50
-		print "	<td><span class='severity$log[severity]'>$log[severityText]</span></td>";
51
-		print "	<td><a class='openLogDetail' data-logid='$log[id]'>$log[command]</a></td>";
52
-		print "	<td>$log[date]</td>";
53
-		print "	<td>$log[username]</td>";
49
+        print "<tr>";
50
+        print "	<td><span class='severity$log[severity]'>$log[severityText]</span></td>";
51
+        print "	<td><a class='openLogDetail' data-logid='$log[id]'>$log[command]</a></td>";
52
+        print "	<td>$log[date]</td>";
53
+        print "	<td>$log[username]</td>";
54 54
 
55
-		print "</tr>";
56
-	}
55
+        print "</tr>";
56
+    }
57 57
 
58
-	print "</table>";
58
+    print "</table>";
59 59
 
60
-	# print if none
61
-	if(sizeof($logs) == 0) {
62
-		print "<blockquote style='margin-top:20px;margin-left:20px;'>";
63
-		print "<p>"._("No logs available")."</p>";
64
-		print "</blockquote>";
65
-	}
60
+    # print if none
61
+    if(sizeof($logs) == 0) {
62
+        print "<blockquote style='margin-top:20px;margin-left:20px;'>";
63
+        print "<p>"._("No logs available")."</p>";
64
+        print "</blockquote>";
65
+    }
66 66
 }
67 67
 ?>
68 68
\ No newline at end of file
Please login to merge, or discard this patch.
app/dashboard/widgets/access_logs.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -2,13 +2,13 @@  discard block
 block discarded – undo
2 2
 
3 3
 # required functions
4 4
 if(!is_object(@$User)) {
5
-	require( dirname(__FILE__) . '/../../../functions/functions.php' );
6
-	# classes
7
-	$Database	= new Database_PDO;
8
-	$User 		= new User ($Database);
9
-	$Tools 		= new Tools ($Database);
10
-	$Log		= new Logging ($Database);
11
-	$Result		= new Result ();
5
+    require( dirname(__FILE__) . '/../../../functions/functions.php' );
6
+    # classes
7
+    $Database	= new Database_PDO;
8
+    $User 		= new User ($Database);
9
+    $Tools 		= new Tools ($Database);
10
+    $Log		= new Logging ($Database);
11
+    $Result		= new Result ();
12 12
 }
13 13
 
14 14
 # user must be authenticated
@@ -16,52 +16,52 @@  discard block
 block discarded – undo
16 16
 
17 17
 # if direct request that redirect to tools page
18 18
 if($_SERVER['HTTP_X_REQUESTED_WITH']!="XMLHttpRequest")	{
19
-	header("Location: ".create_link("tools","logs"));
19
+    header("Location: ".create_link("tools","logs"));
20 20
 }
21 21
 
22 22
 # if syslog print
23 23
 if ($User->settings->log=="syslog") {
24
-	$Result->show("warning", _("Log files are sent to syslog"));
24
+    $Result->show("warning", _("Log files are sent to syslog"));
25 25
 }
26 26
 else {
27
-	# print last 5 access logs
28
-	$logs = $Log->fetch_logs(5, NULL, NULL, NULL, 0, 0, 0);
27
+    # print last 5 access logs
28
+    $logs = $Log->fetch_logs(5, NULL, NULL, NULL, 0, 0, 0);
29 29
 
30
-	print "<table class='table table-condensed table-hover table-top'>";
30
+    print "<table class='table table-condensed table-hover table-top'>";
31 31
 
32
-	# headers
33
-	print "<tr>";
34
-	print "	<th>"._('Severity')."</th>";
35
-	print "	<th>"._('Command')."</th>";
36
-	print "	<th>"._('Date')."</th>";
37
-	print "	<th>"._('Username')."</th>";
38
-	print "</tr>";
32
+    # headers
33
+    print "<tr>";
34
+    print "	<th>"._('Severity')."</th>";
35
+    print "	<th>"._('Command')."</th>";
36
+    print "	<th>"._('Date')."</th>";
37
+    print "	<th>"._('Username')."</th>";
38
+    print "</tr>";
39 39
 
40
-	# logs
41
-	foreach($logs as $log) {
42
-		# cast
43
-		$log = (array) $log;
44
-		# reformat severity
45
-		if($log['severity'] == 0)		{ $log['severityText'] = _("Info"); }
46
-		else if($log['severity'] == 1)	{ $log['severityText'] = _("Warn"); }
47
-		else if($log['severity'] == 2)	{ $log['severityText'] = _("Err"); }
40
+    # logs
41
+    foreach($logs as $log) {
42
+        # cast
43
+        $log = (array) $log;
44
+        # reformat severity
45
+        if($log['severity'] == 0)		{ $log['severityText'] = _("Info"); }
46
+        else if($log['severity'] == 1)	{ $log['severityText'] = _("Warn"); }
47
+        else if($log['severity'] == 2)	{ $log['severityText'] = _("Err"); }
48 48
 
49
-		print "<tr>";
50
-		print "	<td><span class='severity$log[severity]'>$log[severityText]</span></td>";
51
-		print "	<td><a class='openLogDetail' data-logid='$log[id]'>$log[command]</a></td>";
52
-		print "	<td>$log[date]</td>";
53
-		print "	<td>$log[username]</td>";
49
+        print "<tr>";
50
+        print "	<td><span class='severity$log[severity]'>$log[severityText]</span></td>";
51
+        print "	<td><a class='openLogDetail' data-logid='$log[id]'>$log[command]</a></td>";
52
+        print "	<td>$log[date]</td>";
53
+        print "	<td>$log[username]</td>";
54 54
 
55
-		print "</tr>";
56
-	}
55
+        print "</tr>";
56
+    }
57 57
 
58
-	print "</table>";
58
+    print "</table>";
59 59
 
60
-	# print if none
61
-	if(sizeof($logs) == 0) {
62
-		print "<blockquote style='margin-top:20px;margin-left:20px;'>";
63
-		print "<p>"._("No logs available")."</p>";
64
-		print "</blockquote>";
65
-	}
60
+    # print if none
61
+    if(sizeof($logs) == 0) {
62
+        print "<blockquote style='margin-top:20px;margin-left:20px;'>";
63
+        print "<p>"._("No logs available")."</p>";
64
+        print "</blockquote>";
65
+    }
66 66
 }
67 67
 ?>
68 68
\ No newline at end of file
Please login to merge, or discard this patch.
app/dashboard/widget-popup.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -28,26 +28,26 @@
 block discarded – undo
28 28
 <!-- content -->
29 29
 <div class="pContent">
30 30
 	<?php
31
-	print "<ul id='sortablePopup' class='sortable'>";
32
-	# print widghets that are not yet selected
33
-	$m = 0;
34
-	foreach($widgets as $k=>$w) {
35
-		if(!in_array($k, $uwidgets))	{
36
-			$wtmp = (array) $widgets[$k];
37
-			# size fix
38
-			if(strlen($wtmp['wsize'])==0)	{ $wtmp['wsize']=6; }
39
-			print "<li id='$k'>";
40
-			print "	<a href='' class='btn btn-xs fa-marg-right  btn-default widget-add' id='w-$wtmp[wfile]' data-size='$wtmp[wsize]' data-htitle='$wtmp[wtitle]'><i class='fa fa-plus'></i></a>"._($wtmp['wtitle']);
41
-			print "	<div class='muted' style='margin-left:27px;'>"._($wtmp['wdescription'])."</div>";
42
-			print "</li>";
43
-			$m++;
44
-		}
45
-	}
46
-	print "</ul>";
47
-
48
-	# print empty
49
-	if($m==0)	{ $Result->show("info", _("All available widgets are already on dashboard"), false); }
50
-	?>
31
+    print "<ul id='sortablePopup' class='sortable'>";
32
+    # print widghets that are not yet selected
33
+    $m = 0;
34
+    foreach($widgets as $k=>$w) {
35
+        if(!in_array($k, $uwidgets))	{
36
+            $wtmp = (array) $widgets[$k];
37
+            # size fix
38
+            if(strlen($wtmp['wsize'])==0)	{ $wtmp['wsize']=6; }
39
+            print "<li id='$k'>";
40
+            print "	<a href='' class='btn btn-xs fa-marg-right  btn-default widget-add' id='w-$wtmp[wfile]' data-size='$wtmp[wsize]' data-htitle='$wtmp[wtitle]'><i class='fa fa-plus'></i></a>"._($wtmp['wtitle']);
41
+            print "	<div class='muted' style='margin-left:27px;'>"._($wtmp['wdescription'])."</div>";
42
+            print "</li>";
43
+            $m++;
44
+        }
45
+    }
46
+    print "</ul>";
47
+
48
+    # print empty
49
+    if($m==0)	{ $Result->show("info", _("All available widgets are already on dashboard"), false); }
50
+    ?>
51 51
 </div>
52 52
 
53 53
 <!-- footer -->
Please login to merge, or discard this patch.
app/dashboard/index.php 1 patch
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -94,20 +94,20 @@  discard block
 block discarded – undo
94 94
 
95 95
 # if user has no groups and is not admin print warning
96 96
 if ($User->isadmin!==true && (strlen($User->user->groups)==0 || $User->user->groups==="null") ) {
97
-	print '<div class="row-fluid">';
98
-	print "	<div class='col-xs-12 col-sm-12 col-md-12 col-lg-12' style='min-height:10px'>";
99
-	print "	<div class='inner' style='min-height:10px'>";
100
-	print " <h4>"._("No groups")."</h4>";
101
-	print "	<div class='hContent'>";
102
-	print "		<div class='alert alert-info' style='margin:10px;'>"._("You are not member of any group. Please contact system administrator!")."</div>";
103
-	print "	</div>";
104
-	print "	</div>";
105
-	print "	</div>";
106
-	print "</div>";
107
-	print "<div class='clearfix'></div>";
108
-
109
-	// reset uwidgets
110
-	$uwidgets = array("tools", "ipcalc");
97
+    print '<div class="row-fluid">';
98
+    print "	<div class='col-xs-12 col-sm-12 col-md-12 col-lg-12' style='min-height:10px'>";
99
+    print "	<div class='inner' style='min-height:10px'>";
100
+    print " <h4>"._("No groups")."</h4>";
101
+    print "	<div class='hContent'>";
102
+    print "		<div class='alert alert-info' style='margin:10px;'>"._("You are not member of any group. Please contact system administrator!")."</div>";
103
+    print "	</div>";
104
+    print "	</div>";
105
+    print "	</div>";
106
+    print "</div>";
107
+    print "<div class='clearfix'></div>";
108
+
109
+    // reset uwidgets
110
+    $uwidgets = array("tools", "ipcalc");
111 111
 }
112 112
 
113 113
 # split widgets to rows (chunks)
@@ -115,22 +115,22 @@  discard block
 block discarded – undo
115 115
 $m=0;							//to calculate chunk index
116 116
 
117 117
 foreach($uwidgets as $uk=>$uv) {
118
-	//get fetails
119
-	$wdet = (array) $widgets[$uv];
120
-	if(strlen($wdet['wsize'])==0)	{ $wsize = 6; }
121
-	else							{ $wsize = $wdet['wsize']; }
122
-
123
-	//calculate current size
124
-	$currSize = $currSize + $wsize;
125
-
126
-	//ok, we have sizes, we need to split them into chunks of 12
127
-	if($currSize > 12) {
128
-		$m++; 					//new index
129
-		$currSize = $wsize; 	//reset size
130
-	}
131
-
132
-	//add to array
133
-	$uwidgetschunk[$m][] = $uv;
118
+    //get fetails
119
+    $wdet = (array) $widgets[$uv];
120
+    if(strlen($wdet['wsize'])==0)	{ $wsize = 6; }
121
+    else							{ $wsize = $wdet['wsize']; }
122
+
123
+    //calculate current size
124
+    $currSize = $currSize + $wsize;
125
+
126
+    //ok, we have sizes, we need to split them into chunks of 12
127
+    if($currSize > 12) {
128
+        $m++; 					//new index
129
+        $currSize = $wsize; 	//reset size
130
+    }
131
+
132
+    //add to array
133
+    $uwidgetschunk[$m][] = $uv;
134 134
 }
135 135
 
136 136
 # print
@@ -140,46 +140,46 @@  discard block
 block discarded – undo
140 140
 
141 141
 if(sizeof($uwidgets)>1) {
142 142
 
143
-	print '<div class="row-fluid">';
144
-
145
-	foreach($uwidgetschunk as $w) {
146
-		# print itams in a row
147
-		foreach($w as $c) {
148
-
149
-			/* print items */
150
-			$wdet = (array) $widgets[$c];
151
-			if(array_key_exists($c, $widgets)) {
152
-				//reset size if not set
153
-				if(strlen($wdet['wsize'])==0)	{ $wdet['wsize'] = 6; }
154
-
155
-				print "	<div class='col-xs-12 col-sm-12 col-md-12 col-lg-$wdet[wsize] widget-dash' id='w-$wdet[wfile]'>";
156
-				print "	<div class='inner'><i class='fa fa-times remove-widget icon-action fa-gray pull-right'></i>";
157
-				// href?
158
-				if($wdet['whref']=="yes")	{ print "<a href='".create_link("widgets",$wdet['wfile'])."'> <h4>"._($wdet['wtitle'])."<i class='fa fa-external-link fa-gray pull-right'></i></h4></a>"; }
159
-				else						{ print "<h4>"._($wdet['wtitle'])."</h4>"; }
160
-				print "		<div class='hContent'>";
161
-				print "			<div style='text-align:center;padding-top:50px;'><strong>"._('Loading statistics')."</strong><br><i class='fa fa-spinner fa-spin'></i></div>";
162
-				print "		</div>";
163
-				print "	</div>";
164
-				print "	</div>";
165
-
166
-			}
167
-			# invalid widget
168
-			else {
169
-				print "	<div class='col-xs-12 col-sm-12 col-md-12 col-lg-6' id='w-$c'>";
170
-				print "	<div class='inner'>";
171
-				print "		<blockquote style='margin-top:20px;margin-left:20px;'><p>Invalid widget $c</p></blockquote>";
172
-				print "	</div>";
173
-				print "	</div>";
174
-			}
175
-
176
-		}
177
-	}
178
-	print "</div>";
143
+    print '<div class="row-fluid">';
144
+
145
+    foreach($uwidgetschunk as $w) {
146
+        # print itams in a row
147
+        foreach($w as $c) {
148
+
149
+            /* print items */
150
+            $wdet = (array) $widgets[$c];
151
+            if(array_key_exists($c, $widgets)) {
152
+                //reset size if not set
153
+                if(strlen($wdet['wsize'])==0)	{ $wdet['wsize'] = 6; }
154
+
155
+                print "	<div class='col-xs-12 col-sm-12 col-md-12 col-lg-$wdet[wsize] widget-dash' id='w-$wdet[wfile]'>";
156
+                print "	<div class='inner'><i class='fa fa-times remove-widget icon-action fa-gray pull-right'></i>";
157
+                // href?
158
+                if($wdet['whref']=="yes")	{ print "<a href='".create_link("widgets",$wdet['wfile'])."'> <h4>"._($wdet['wtitle'])."<i class='fa fa-external-link fa-gray pull-right'></i></h4></a>"; }
159
+                else						{ print "<h4>"._($wdet['wtitle'])."</h4>"; }
160
+                print "		<div class='hContent'>";
161
+                print "			<div style='text-align:center;padding-top:50px;'><strong>"._('Loading statistics')."</strong><br><i class='fa fa-spinner fa-spin'></i></div>";
162
+                print "		</div>";
163
+                print "	</div>";
164
+                print "	</div>";
165
+
166
+            }
167
+            # invalid widget
168
+            else {
169
+                print "	<div class='col-xs-12 col-sm-12 col-md-12 col-lg-6' id='w-$c'>";
170
+                print "	<div class='inner'>";
171
+                print "		<blockquote style='margin-top:20px;margin-left:20px;'><p>Invalid widget $c</p></blockquote>";
172
+                print "	</div>";
173
+                print "	</div>";
174
+            }
175
+
176
+        }
177
+    }
178
+    print "</div>";
179 179
 }
180 180
 # empty
181 181
 else {
182
-	print "<br><div class='alert alert-warning'><strong>"._('No widgets selected')."!</strong> <hr>"._('Please select widgets to be displayed on dashboard on user menu page')."!</div>";
182
+    print "<br><div class='alert alert-warning'><strong>"._('No widgets selected')."!</strong> <hr>"._('Please select widgets to be displayed on dashboard on user menu page')."!</div>";
183 183
 }
184 184
 ?>
185 185
 <hr>
186 186
\ No newline at end of file
Please login to merge, or discard this patch.
app/install/postinstall_configure.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -10,40 +10,40 @@
 block discarded – undo
10 10
 		<hr>
11 11
 
12 12
 		<?php
13
-		# lets verify database
14
-		$errors = $Tools->verify_database ();
15
-
16
-		/* print result */
17
-		if( (isset($errors['tableError'])) || (isset($errors['fieldError'])) ) {
18
-
19
-			print "<div class='alert alert-danger alert-block'>";
20
-			print "<strong>Some tables or fields are missing in database:</strong><hr>";
21
-
22
-			//tables
23
-			if (isset($errors['tableError'])) {
24
-				print '<b>Missing tables:</b>'. "\n";
25
-				print '<ul class="fix-table">'. "\n";
26
-				foreach ($errors['tableError'] as $table) {
27
-					print "<li>$table</li>";
28
-				}
29
-				print '</ul>'. "\n";
30
-			}
31
-			//fields
32
-			if (isset($errors['fieldError'])) {
33
-				print '<b>Missing fields:</b>'. "\n";
34
-				print '<ul class="fix-field">'. "\n";
35
-				foreach ($errors['fieldError'] as $table=>$field) {
36
-					print '<li>';
37
-					print 'Table `'. $table .'`: missing field `'. $field .'`;';
38
-					print '</li>'. "\n";
39
-				}
40
-				print '</ul>'. "\n";
41
-			}
42
-			print "</div>";
43
-		}
44
-		# no db errors, lets configure !
45
-		else {
46
-		?>
13
+        # lets verify database
14
+        $errors = $Tools->verify_database ();
15
+
16
+        /* print result */
17
+        if( (isset($errors['tableError'])) || (isset($errors['fieldError'])) ) {
18
+
19
+            print "<div class='alert alert-danger alert-block'>";
20
+            print "<strong>Some tables or fields are missing in database:</strong><hr>";
21
+
22
+            //tables
23
+            if (isset($errors['tableError'])) {
24
+                print '<b>Missing tables:</b>'. "\n";
25
+                print '<ul class="fix-table">'. "\n";
26
+                foreach ($errors['tableError'] as $table) {
27
+                    print "<li>$table</li>";
28
+                }
29
+                print '</ul>'. "\n";
30
+            }
31
+            //fields
32
+            if (isset($errors['fieldError'])) {
33
+                print '<b>Missing fields:</b>'. "\n";
34
+                print '<ul class="fix-field">'. "\n";
35
+                foreach ($errors['fieldError'] as $table=>$field) {
36
+                    print '<li>';
37
+                    print 'Table `'. $table .'`: missing field `'. $field .'`;';
38
+                    print '</li>'. "\n";
39
+                }
40
+                print '</ul>'. "\n";
41
+            }
42
+            print "</div>";
43
+        }
44
+        # no db errors, lets configure !
45
+        else {
46
+        ?>
47 47
 
48 48
 
49 49
 		<form name="postinstall" id="postinstall" class="form-inline" method="post">
Please login to merge, or discard this patch.
app/install/postinstall_submit.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -17,23 +17,23 @@
 block discarded – undo
17 17
 # only permit if Admin user has default pass !!!
18 18
 $admin = $Admin->fetch_object ("users","username","Admin");
19 19
 if($admin->password!='$6$rounds=3000$JQEE6dL9NpvjeFs4$RK5X3oa28.Uzt/h5VAfdrsvlVe.7HgQUYKMXTJUsud8dmWfPzZQPbRbk8xJn1Kyyt4.dWm4nJIYhAV2mbOZ3g.') {
20
-	$Result->show("danger", "Not allowed!", true);
20
+    $Result->show("danger", "Not allowed!", true);
21 21
 }
22 22
 # update
23 23
 else {
24
-	# check lenghts
25
-	if(strlen($_POST['password1'])<8)				{ $Result->show("danger", _("Password must be at least 8 characters long!"), true); }
26
-	if(strlen($_POST['password2'])<8)				{ $Result->show("danger", _("Password must be at least 8 characters long!"), true); }
24
+    # check lenghts
25
+    if(strlen($_POST['password1'])<8)				{ $Result->show("danger", _("Password must be at least 8 characters long!"), true); }
26
+    if(strlen($_POST['password2'])<8)				{ $Result->show("danger", _("Password must be at least 8 characters long!"), true); }
27 27
 
28
-	# check password match
29
-	if($_POST['password1']!=$_POST['password2'])	{ $Result->show("danger", _("Passwords do not match"), true); }
28
+    # check password match
29
+    if($_POST['password1']!=$_POST['password2'])	{ $Result->show("danger", _("Passwords do not match"), true); }
30 30
 
31
-	# Crypt password
32
-	$_POST['password1'] = $User->crypt_user_pass ($_POST['password1']);
31
+    # Crypt password
32
+    $_POST['password1'] = $User->crypt_user_pass ($_POST['password1']);
33 33
 
34
-	# all good, update password!
35
-	$Install->postauth_update($_POST['password1'], $_POST['siteTitle'], $_POST['siteURL']);
36
-	# ok
37
-													{ $Result->show("success", "Settings updated, installation complete!<hr><a class='btn btn-sm btn-default' href='".create_link("login")."'>Proceed to login</a>", false); }
34
+    # all good, update password!
35
+    $Install->postauth_update($_POST['password1'], $_POST['siteTitle'], $_POST['siteURL']);
36
+    # ok
37
+                                                    { $Result->show("success", "Settings updated, installation complete!<hr><a class='btn btn-sm btn-default' href='".create_link("login")."'>Proceed to login</a>", false); }
38 38
 }
39 39
 ?>
40 40
\ No newline at end of file
Please login to merge, or discard this patch.
app/install/index.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -17,19 +17,19 @@  discard block
 block discarded – undo
17 17
 
18 18
 # If User is not available create fake user object for create_link!
19 19
 if(!is_object(@$User)) {
20
-	$User = new StdClass ();
21
-	@$User->settings->prettyLinks = "No";
20
+    $User = new StdClass ();
21
+    @$User->settings->prettyLinks = "No";
22 22
 }
23 23
 
24 24
 # if already installed than redirect !
25 25
 if($Install->check_db_connection(false) && $Install->check_table("vrf", false)) {
26 26
 
27
-	# check if installation parts 2 and 3 are running, otherwise die!
28
-	$admin = $Tools->fetch_object ("users", "id", 1);
29
-	if($admin->password!='$6$rounds=3000$JQEE6dL9NpvjeFs4$RK5X3oa28.Uzt/h5VAfdrsvlVe.7HgQUYKMXTJUsud8dmWfPzZQPbRbk8xJn1Kyyt4.dWm4nJIYhAV2mbOZ3g.') {
30
-		header("Location: ".create_link("dashboard"));
31
-		die();
32
-	}
27
+    # check if installation parts 2 and 3 are running, otherwise die!
28
+    $admin = $Tools->fetch_object ("users", "id", 1);
29
+    if($admin->password!='$6$rounds=3000$JQEE6dL9NpvjeFs4$RK5X3oa28.Uzt/h5VAfdrsvlVe.7HgQUYKMXTJUsud8dmWfPzZQPbRbk8xJn1Kyyt4.dWm4nJIYhAV2mbOZ3g.') {
30
+        header("Location: ".create_link("dashboard"));
31
+        die();
32
+    }
33 33
 }
34 34
 # printout
35 35
 ?>
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
 if(!isset($_GET['section']))										{ include("select_install_type.php"); }
114 114
 # open subpage
115 115
 else {
116
-	//check if subnetId == configure than already installed
117
-	if(@$_GET['subnetId']=="configure")								{ include(dirname(__FILE__)."/postinstall_configure.php"); }
118
-	else {
119
-		// verify that page exists
120
-		if(!file_exists(dirname(__FILE__)."/$_GET[section].php"))	{ include("invalid_install_type.php"); }
121
-		else														{ include(dirname(__FILE__)."/$_GET[section].php"); }
122
-	}
116
+    //check if subnetId == configure than already installed
117
+    if(@$_GET['subnetId']=="configure")								{ include(dirname(__FILE__)."/postinstall_configure.php"); }
118
+    else {
119
+        // verify that page exists
120
+        if(!file_exists(dirname(__FILE__)."/$_GET[section].php"))	{ include("invalid_install_type.php"); }
121
+        else														{ include(dirname(__FILE__)."/$_GET[section].php"); }
122
+    }
123 123
 }
124 124
 ?>
125 125
 
Please login to merge, or discard this patch.
app/install/install-execute.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 
19 19
 # if already installed ignore!
20 20
 if($Install->check_table ("widgets", false) && @$_POST['dropdb']!="on") {
21
-	# check for possible errors
22
-	if(sizeof($errors = $Tools->verify_database())>0) 						{ }
23
-	else 																	{ $Result->show("danger", _("Database already installed"), true);}
21
+    # check for possible errors
22
+    if(sizeof($errors = $Tools->verify_database())>0) 						{ }
23
+    else 																	{ $Result->show("danger", _("Database already installed"), true);}
24 24
 }
25 25
 
26 26
 # get possible advanced options
@@ -30,6 +30,6 @@  discard block
 block discarded – undo
30 30
 
31 31
 # try to install new database */
32 32
 if($Install->install_database ($_POST['mysqlrootuser'], $_POST['mysqlrootpass'], $dropdb, $createdb, $creategrants)) {
33
- 	$Result->show("success alert-block", 'Database installed successfully! <a href="?page=install&section=install_automatic&subnetId=configure" class="btn btn-sm btn-default">Continue</a>', true);
33
+        $Result->show("success alert-block", 'Database installed successfully! <a href="?page=install&section=install_automatic&subnetId=configure" class="btn btn-sm btn-default">Continue</a>', true);
34 34
 }
35 35
 ?>
36 36
\ No newline at end of file
Please login to merge, or discard this patch.