From 0500fc2826e01d0570139fe5218f223d3a918970 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 16 Feb 2012 23:50:57 -0800 Subject: do not under any circumstances allow a delegated forum admin to access the site admin page. --- mod/admin.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mod/admin.php') diff --git a/mod/admin.php b/mod/admin.php index e44404097..c79af8d5b 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 */ -- cgit v1.2.3 From dedfc300a050f3d72840ca02515d483e90965a58 Mon Sep 17 00:00:00 2001 From: "Abinoam P. Marques Jr" Date: Sat, 18 Feb 2012 14:19:35 -0800 Subject: Fixed log file issues on a freshly installed Friendica. * Check to see if log file exists. * After trying to open it, check to see if it went ok. * So, check to see if the file size != 0 (fread error with size = 0) --- mod/admin.php | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'mod/admin.php') diff --git a/mod/admin.php b/mod/admin.php index c79af8d5b..028ed8624 100755 --- a/mod/admin.php +++ b/mod/admin.php @@ -635,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 $f log file.\r\n
Check to see if file $f exist and is +readable."); + } + else { + $fp = fopen($f, 'r'); + if(!$fp) { + $data = t("Couldn't open $f log file.\r\n
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'), -- cgit v1.2.3