aboutsummaryrefslogtreecommitdiffstats
path: root/mod/admin.php
diff options
context:
space:
mode:
authorMichael <icarus@dabo.de>2012-02-19 20:09:42 +0100
committerMichael <icarus@dabo.de>2012-02-19 20:09:42 +0100
commitcafd4003522a472d2709569ea5eb5f80b817af23 (patch)
treebbd512126515afc929de06dce79ba847b9681092 /mod/admin.php
parent73e0e4d78341cb96ef9665a0ee4fb7e7ee2a701f (diff)
parenta9ed5915cebcf51347acaad51d0c252e57bceaff (diff)
downloadvolse-hubzilla-cafd4003522a472d2709569ea5eb5f80b817af23.tar.gz
volse-hubzilla-cafd4003522a472d2709569ea5eb5f80b817af23.tar.bz2
volse-hubzilla-cafd4003522a472d2709569ea5eb5f80b817af23.zip
Merge remote branch 'upstream/master'
Conflicts: view/theme/vier/style.css
Diffstat (limited to 'mod/admin.php')
-rwxr-xr-xmod/admin.php48
1 files changed, 34 insertions, 14 deletions
diff --git a/mod/admin.php b/mod/admin.php
index e44404097..028ed8624 100755
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -9,6 +9,10 @@ function admin_post(&$a){
if(!is_site_admin()) {
return;
}
+
+
+ if(x($_SESSION,'submanage') && intval($_SESSION['submanage']))
+ return;
// urls
if ($a->argc > 1){
@@ -50,6 +54,9 @@ function admin_content(&$a) {
return login(false);
}
+ if(x($_SESSION,'submanage') && intval($_SESSION['submanage']))
+ return;
+
/**
* Side bar links
*/
@@ -628,23 +635,36 @@ function admin_page_logs(&$a){
$t = get_markup_template("admin_logs.tpl");
$f = get_config('system','logfile');
- $size = filesize($f);
- if($size > 5000000 || $size < 0)
- $size = 5000000;
$data = '';
- $fp = fopen($f,'r');
- if($fp) {
- $seek = fseek($fp,0-$size,SEEK_END);
- if($seek === 0) {
- fgets($fp); // throw away the first partial line
- $data = escape_tags(fread($fp,$size));
- while(! feof($fp))
- $data .= escape_tags(fread($fp,4096));
- }
- fclose($fp);
- }
+ if(!file_exists($f)) {
+ $data = t("Error trying to open <strong>$f</strong> log file.\r\n<br/>Check to see if file $f exist and is
+readable.");
+ }
+ else {
+ $fp = fopen($f, 'r');
+ if(!$fp) {
+ $data = t("Couldn't open <strong>$f</strong> log file.\r\n<br/>Check to see if file $f is readable.");
+ }
+ else {
+ $fstat = fstat($fp);
+ $size = $fstat['size'];
+ if($size != 0)
+ {
+ if($size > 5000000 || $size < 0)
+ $size = 5000000;
+ $seek = fseek($fp,0-$size,SEEK_END);
+ if($seek === 0) {
+ fgets($fp); // throw away the first partial line
+ $data = escape_tags(fread($fp,$size));
+ while(! feof($fp))
+ $data .= escape_tags(fread($fp,4096));
+ }
+ }
+ fclose($fp);
+ }
+ }
return replace_macros($t, array(
'$title' => t('Administration'),