Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dirk Dankhoff
ISPConfig 3
Commits
06d72f1c
Commit
06d72f1c
authored
May 02, 2011
by
LaKing
Browse files
Update on Sites, adding the logs tab to see error logs.
parent
de115b47
Changes
2
Show whitespace changes
Inline
Side-by-side
interface/web/sites/form/web_domain.tform.php
View file @
06d72f1c
...
...
@@ -395,6 +395,33 @@ $form["tabs"]['stats'] = array (
)
);
//* Logs
$form
[
"tabs"
][
'logs'
]
=
array
(
'title'
=>
"logs"
,
'width'
=>
100
,
'template'
=>
"templates/web_domain_logs.htm"
,
'readonly'
=>
true
,
'fields'
=>
array
(
##################################
# Begin Datatable fields
##################################
'logs'
=>
array
(
'datatype'
=>
'TEXT'
,
'formtype'
=>
'TEXTAREA'
,
'default'
=>
'DEFAULT'
,
'value'
=>
'VALUE'
,
'cols'
=>
'30'
,
'rows'
=>
'10'
)
##################################
# ENDE Datatable fields
##################################
)
);
if
(
$_SESSION
[
"s"
][
"user"
][
"typ"
]
==
'admin'
)
{
//* Backup
...
...
interface/web/sites/web_domain_edit.php
View file @
06d72f1c
...
...
@@ -262,6 +262,32 @@ class page_action extends tform_actions {
$app
->
tpl
->
setVar
(
"domain_option"
,
$domain_select
);
}
// Code to display the error log for the site.
// Query the logfile name
$tmp
=
$app
->
db
->
queryOneRecord
(
"SELECT document_root FROM web_domain WHERE domain_id = "
.
$this
->
id
);
$logfile
=
$tmp
[
"document_root"
]
.
"/log/error.log"
;
$lines
=
count
(
file
(
$logfile
));
// the "tail" function
$handle
=
@
fopen
(
$logfile
,
"r"
);
if
(
$handle
)
{
while
((
$buffer
=
fgets
(
$handle
))
!==
false
)
{
$lines
=
$lines
-
1
;
// this constant defines how many lines to display
if
(
$lines
<
60
)
$tail
.
=
$buffer
;
// TODO: We need a newline here.
}
if
(
!
feof
(
$handle
))
{
$tail
=
"Error."
;
}
fclose
(
$handle
);
}
// store the tail so it can be displayed in the interface
$app
->
db
->
query
(
"UPDATE web_domain SET logs = '
$tail
' WHERE domain_id = "
.
$this
->
id
);
parent
::
onShowEnd
();
}
...
...
Write
Preview
Supports
Markdown
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