Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
32bb6035
Commit
32bb6035
authored
Apr 04, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
logs: pretty up captive portal logs
parent
4dbdf8e3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
16 deletions
+31
-16
diag_logs.php
src/www/diag_logs.php
+16
-9
diag_logs_auth.php
src/www/diag_logs_auth.php
+15
-7
No files found.
src/www/diag_logs.php
View file @
32bb6035
<?php
<?php
/*
/*
Copyright (C) 2014 Deciso B.V.
Copyright (C) 2014 Deciso B.V.
Copyright (C) 2004-2009 Scott Ullrich
Copyright (C) 2004-2009 Scott Ullrich
...
@@ -29,23 +30,28 @@
...
@@ -29,23 +30,28 @@
require_once
(
"guiconfig.inc"
);
require_once
(
"guiconfig.inc"
);
$system_logfile
=
"
{
$g
[
'varlog_path'
]
}
/system.log"
;
$system_logfile
=
'/var/log/system.log'
;
$nentries
=
$config
[
'syslog'
][
'nentries'
];
$nentries
=
$config
[
'syslog'
][
'nentries'
];
if
(
!
$nentries
)
if
(
!
$nentries
)
{
$nentries
=
50
;
$nentries
=
50
;
}
if
(
$_POST
[
'clear'
])
if
(
$_POST
[
'clear'
])
{
clear_log_file
(
$system_logfile
);
clear_log_file
(
$system_logfile
);
}
if
(
$_GET
[
'filtertext'
])
if
(
$_GET
[
'filtertext'
])
{
$filtertext
=
htmlspecialchars
(
$_GET
[
'filtertext'
]);
$filtertext
=
htmlspecialchars
(
$_GET
[
'filtertext'
]);
}
if
(
$_POST
[
'filtertext'
])
if
(
$_POST
[
'filtertext'
])
{
$filtertext
=
htmlspecialchars
(
$_POST
[
'filtertext'
]);
$filtertext
=
htmlspecialchars
(
$_POST
[
'filtertext'
]);
}
if
(
$filtertext
)
if
(
$filtertext
)
{
$filtertextmeta
=
"?filtertext=
$filtertext
"
;
$filtertextmeta
=
"?filtertext=
{
$filtertext
}
"
;
}
$pgtitle
=
array
(
gettext
(
"Status"
),
gettext
(
"System logs"
),
gettext
(
"General"
));
$pgtitle
=
array
(
gettext
(
"Status"
),
gettext
(
"System logs"
),
gettext
(
"General"
));
include
(
"head.inc"
);
include
(
"head.inc"
);
...
@@ -76,10 +82,11 @@ include("head.inc");
...
@@ -76,10 +82,11 @@ include("head.inc");
<div
class=
"table-responsive"
>
<div
class=
"table-responsive"
>
<table
class=
"table table-striped table-sort"
>
<table
class=
"table table-striped table-sort"
>
<?php
<?php
if
(
$filtertext
)
if
(
$filtertext
)
{
dump_clog
(
$system_logfile
,
$nentries
,
true
,
array
(
"
$filtertext
"
),
array
(
"ppp"
));
dump_clog
(
$system_logfile
,
$nentries
,
true
,
array
(
"
$filtertext
"
),
array
(
"ppp"
));
else
}
else
{
dump_clog
(
$system_logfile
,
$nentries
,
true
,
array
(),
array
(
"ppp"
));
dump_clog
(
$system_logfile
,
$nentries
,
true
,
array
(),
array
(
"ppp"
));
}
?>
?>
</table>
</table>
</div>
</div>
...
...
src/www/diag_logs_auth.php
View file @
32bb6035
<?php
<?php
/*
/*
Copyright (C) 2014 Deciso B.V.
Copyright (C) 2014 Deciso B.V.
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
...
@@ -28,14 +29,16 @@
...
@@ -28,14 +29,16 @@
require_once
(
"guiconfig.inc"
);
require_once
(
"guiconfig.inc"
);
$portal_logfile
=
"
{
$g
[
'varlog_path'
]
}
/portalauth.log"
;
$portal_logfile
=
'/var/log/portalauth.log'
;
$nentries
=
$config
[
'syslog'
][
'nentries'
];
$nentries
=
$config
[
'syslog'
][
'nentries'
];
if
(
!
$nentries
)
if
(
!
$nentries
)
{
$nentries
=
50
;
$nentries
=
50
;
}
if
(
$_POST
[
'clear'
])
if
(
$_POST
[
'clear'
])
{
clear_log_file
(
$portal_logfile
);
clear_log_file
(
$portal_logfile
);
}
$pgtitle
=
array
(
gettext
(
"Status"
),
gettext
(
"System logs"
),
gettext
(
"Portal Auth"
));
$pgtitle
=
array
(
gettext
(
"Status"
),
gettext
(
"System logs"
),
gettext
(
"Portal Auth"
));
$shortcut_section
=
"captiveportal"
;
$shortcut_section
=
"captiveportal"
;
...
@@ -61,10 +64,15 @@ include("head.inc");
...
@@ -61,10 +64,15 @@ include("head.inc");
<div
class=
"tab-content content-box col-xs-12"
>
<div
class=
"tab-content content-box col-xs-12"
>
<div
class=
"container-fluid"
>
<div
class=
"container-fluid"
>
<?php
printf
(
gettext
(
'Last %s Portal Auth log entries'
),
$nentries
);
?>
</div>
<div
class=
"table-responsive"
>
<table
class=
"table table-striped table-sort"
>
<?php
dump_clog
(
$portal_logfile
,
$nentries
,
true
);
?>
</table>
</div>
<p>
<?php
printf
(
gettext
(
"Last %s Portal Auth log entries"
),
$nentries
);
?>
</p>
<div
class=
"container-fluid"
>
<pre>
<?php
dump_clog
(
$portal_logfile
,
$nentries
,
true
);
?>
</pre>
<form
action=
"diag_logs_auth.php"
method=
"post"
>
<form
action=
"diag_logs_auth.php"
method=
"post"
>
<input
name=
"clear"
type=
"submit"
class=
"btn"
value=
"
<?=
gettext
(
"Clear log"
);
?>
"
/>
<input
name=
"clear"
type=
"submit"
class=
"btn"
value=
"
<?=
gettext
(
"Clear log"
);
?>
"
/>
</form>
</form>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment