From c1049928146f44b3cabc02c425d858313c0c6970 Mon Sep 17 00:00:00 2001 From: andi Date: Fri, 18 Feb 2005 13:48:09 +0100 Subject: check for changes.log #136 darcs-hash:20050218124809-9977f-3622ad862b92942942f4f6b36eabb7ace2fa49c2.gz --- inc/common.php | 19 ++++++++++++++++++- style.css | 6 +++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/inc/common.php b/inc/common.php index afff702d2..2e146d485 100644 --- a/inc/common.php +++ b/inc/common.php @@ -662,13 +662,20 @@ function dbg($msg,$hidden=false){ */ function addLogEntry($date,$id,$summary=""){ global $conf; - $id = cleanID($id); + $id = cleanID($id);//FIXME not needed anymore? + + if(!@is_writable($conf['changelog'])){ + msg($conf['changelog'].' is not writable!',-1); + return; + } + if(!$date) $date = time(); //use current time if none supplied $remote = $_SERVER['REMOTE_ADDR']; $user = $_SERVER['REMOTE_USER']; $logline = join("\t",array($date,$remote,$id,$user,$summary))."\n"; + //FIXME: use adjusted io_saveFile instead $fh = fopen($conf['changelog'],'a'); if($fh){ fwrite($fh,$logline); @@ -687,6 +694,11 @@ function getRecents($num=0,$incdel=false){ $recent = array(); if(!$num) $num = $conf['recent']; + if(!@is_readable($conf['changelog'])){ + msg($conf['changelog'].' is not readable',-1); + return $recent; + } + $loglines = file($conf['changelog']); rsort($loglines); //reverse sort on timestamp @@ -720,6 +732,11 @@ function getRecents($num=0,$incdel=false){ */ function getRevisionInfo($id,$rev){ global $conf; + $info = array(); + if(!@is_readable($conf['changelog'])){ + msg($conf['changelog'].' is not readable',-1); + return $recent; + } $loglines = file($conf['changelog']); $loglines = preg_grep("/$rev\t\d+\.\d+\.\d+\.\d+\t$id\t/",$loglines); rsort($loglines); //reverse sort on timestamp (shouldn't be needed) diff --git a/style.css b/style.css index 8c3dc02f9..516328c50 100644 --- a/style.css +++ b/style.css @@ -165,21 +165,21 @@ span.user{ } div.error{ - background: #ff6666; url(images/error.png) 0.5em 0px no-repeat; + background: #ff6666 url(images/error.png) 0.5em 0px no-repeat; font-size: 90%; margin: 0px; padding-left: 3em; } div.info{ - background: #ffff66; url(images/info.png) 0.5em 0px no-repeat; + background: #ffff66 url(images/info.png) 0.5em 0px no-repeat; font-size: 90%; margin: 0; padding-left: 3em; } div.success{ - background: #66ff66; url(images/thumbup.gif) 0.5em 0px no-repeat; + background: #66ff66 url(images/thumbup.gif) 0.5em 0px no-repeat; font-size: 90%; margin: 0; padding-left: 3em; -- cgit v1.2.3