diff options
-rw-r--r-- | application/controllers/IndexController.php | 9 | ||||
-rw-r--r-- | application/modules/fbgui/controllers/IndexController.php | 5 | ||||
-rw-r--r-- | library/Pbs/Debug.php | 13 |
3 files changed, 21 insertions, 6 deletions
diff --git a/application/controllers/IndexController.php b/application/controllers/IndexController.php index 8fd9649..3818132 100644 --- a/application/controllers/IndexController.php +++ b/application/controllers/IndexController.php @@ -14,11 +14,10 @@ class IndexController extends Zend_Controller_Action if(!isset($_SESSION['postdata'])){ $_SESSION['postdata'] = $_POST; } - $path = "../resources/debugs/"; - @mkdir($path ,0777, true); - $fp = fopen($path.'lastsession.txt', "a"); - fputs ($fp,date("Y-m-d H:i:s",time())."\t".$_SERVER['REMOTE_ADDR']."\t".implode("\t",$_SESSION['postdata'])."\n"); - fclose ($fp); + + $d = new Pbs_Debug(); + $d->debug(array('MainIndexController',$_SERVER['REMOTE_ADDR'],implode("\t",$_SESSION['postdata']))); + $this->_redirect('/fbgui/index/index'); } diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php index 3853c26..57bc22c 100644 --- a/application/modules/fbgui/controllers/IndexController.php +++ b/application/modules/fbgui/controllers/IndexController.php @@ -26,7 +26,10 @@ class Fbgui_IndexController extends Zend_Controller_Action if(isset($_SESSION['postdata'])){ $_POST = $_SESSION['postdata']; } - print_a($_POST,$_SESSION); + + $d = new Pbs_Debug(); + $d->debug(array('FBGuiIndexController',$_SERVER['REMOTE_ADDR'],implode("\t",$_SESSION['postdata']))); + if(isset($_POST['bootisoID']) || isset($_POST['serialnumber'])){ // Create a session $n = new Pbs_Session(); diff --git a/library/Pbs/Debug.php b/library/Pbs/Debug.php new file mode 100644 index 0000000..23983a5 --- /dev/null +++ b/library/Pbs/Debug.php @@ -0,0 +1,13 @@ +<?php +class Pbs_Debug{ + + function debug($str){ + $path = "../resources/debugs/"; + @mkdir($path ,0777, true); + $fp = fopen($path.'lastsession.txt', "a"); + if(is_array($str)) + $str = implide("\n",$str); + fputs ($fp,date("Y-m-d H:i:s",time())."\t".$str."\n"); + fclose ($fp); + } +} |