[Tutos-commits] tutos/php admin_show.php, 1.127, 1.128 check.php, 1.58, 1.59 permission.p3, 1.194,
Projects / CRM / PLM / Calendar / Tasks / SCRUM / Test / Inventory
Brought to you by:
gokohnert
From: Gero K. <gok...@us...> - 2010-11-26 16:03:32
|
Update of /cvsroot/tutos/tutos/php In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16798 Modified Files: admin_show.php check.php permission.p3 Log Message: updates Index: check.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/check.php,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- check.php 23 Nov 2010 18:29:53 -0000 1.58 +++ check.php 26 Nov 2010 16:03:24 -0000 1.59 @@ -71,7 +71,7 @@ unset($x); } -if ( ($tutos[debug] == 1) && ($msg != "") ) { +if ( ($tutos[debug] == 1) && (trim($msg) != "") ) { echo $msg ."<br />"; echo "--> ". $current_user->getFullName() ."<br />"; } @@ -85,7 +85,8 @@ remove_debugfiles(); if (ob_get_length() > 0) { - error_log('check with output :'.ob_get_length()."\r\n",3,$tutos[errlog]); + error_log(Date("d.M.Y H:i:s T").':check with output :'.ob_get_length()."\r\n",3,$tutos[errlog]); + error_log(Date("d.M.Y H:i:s T").':'.$msg."\r\n",3,$tutos[errlog]); } ?> \ No newline at end of file Index: admin_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/admin_show.php,v retrieving revision 1.127 retrieving revision 1.128 diff -u -d -r1.127 -r1.128 --- admin_show.php 29 Oct 2010 14:03:26 -0000 1.127 +++ admin_show.php 26 Nov 2010 16:03:24 -0000 1.128 @@ -344,6 +344,10 @@ $r .= $this->error('Only real admins are allowed to see this'); return $r; } + if (!file_exists($tutos[errlog])) { + $r .= $this->error('no such file '.$tutos[errlog]); + return $r; + } $fd = fopen($tutos[errlog],"r"); if ($fd === false) return $r; $r .= '<pre>'; @@ -368,6 +372,10 @@ $r .= $this->error('Only real admins are allowed to see this'); return $r; } + if (!file_exists($tutos[errlog].'.log')) { + $r .= $this->error('no such file '.$tutos[errlog].'.log'); + return $r; + } $fd = fopen($tutos[errlog].'.log',"r"); if ($fd === false) return $r; Index: permission.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/permission.p3,v retrieving revision 1.194 retrieving revision 1.195 diff -u -d -r1.194 -r1.195 --- permission.p3 23 Nov 2010 18:29:53 -0000 1.194 +++ permission.p3 26 Nov 2010 16:03:24 -0000 1.195 @@ -517,41 +517,38 @@ }; /** - * short/cut debug files + * short/cut debug file */ -Function short_debugfiles () { - global $tutos; - - if (file_exists($tutos[errlog].'.log') && is_writeable($tutos[errlog].'.log')) { - @chmod ($tutos[errlog].'.log',0666); - if ( @filesize($tutos[errlog].'.log') > 512000) { - @rename($tutos[errlog].'.log',$tutos[errlog].'.log.'. Date("YmdHi")); - } - } - if (file_exists($tutos[errlog].'.sql') && is_writeable($tutos[errlog].'.sql')) { - @chmod ($tutos[errlog].'.sql',0666); - if ( @filesize($tutos[errlog].'.sql') > 512000) { - @rename($tutos[errlog].'.sql',$tutos[errlog].'.sql.'. Date("YmdHi")); - } - } - if (file_exists($tutos[errlog]) && is_writeable($tutos[errlog])) { - @chmod ($tutos[errlog],0666); - if ( @filesize($tutos[errlog]) > 512000) { - $fd = fopen($tutos[errlog],"a+"); +Function short_one_debugfile ($fn) { + if (file_exists($fn) && is_writeable($fn)) { + @chmod ($fn,0666); + if ( @filesize($fn) > 512000) { + $fd = fopen($fn,"a+"); if ($fd) { fwrite($fd,"--- END ---\r\n"); fclose($fd); } - @rename($tutos[errlog],$tutos[errlog] .'.'. Date("YmdHi") ); - if (file_exists($tutos[errlog])) { + @rename($fn,$fn.'.'.Date("YmdHi") ); + if (file_exists($fn)) { // rename failed -> delete file - @unlink($tutos[errlog]); + @unlink($fn); } } } } /** + * short/cut debug files + */ +Function short_debugfiles () { + global $tutos; + + short_one_debugfile($tutos[errlog].'.log'); + short_one_debugfile($tutos[errlog].'.sql'); + short_one_debugfile($tutos[errlog]); +} + +/** * remove old session files */ Function remove_sessionfiles () { |