From d8a55d76008032b00c862dd802f77f26a64cb1d7 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 22 May 2007 13:34:10 +0000 Subject: [PATCH] Replaced gosa_log with new logging class git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6435 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/combine.php | 2 +- html/getFAIscript.php | 2 +- html/get_attachment.php | 2 +- html/getbin.php | 2 +- html/getfax.php | 12 ++++++------ html/getkiosk.php | 2 +- html/getldif.php | 2 +- html/getvcard.php | 2 +- html/getxls.php | 2 +- html/helpviewer.php | 2 +- html/index.php | 11 ++++++----- html/logout.php | 2 +- html/main.php | 12 ++++++------ 13 files changed, 28 insertions(+), 27 deletions(-) diff --git a/html/combine.php b/html/combine.php index b060ab9bc..2eadab8a9 100644 --- a/html/combine.php +++ b/html/combine.php @@ -26,7 +26,7 @@ session_start (); /* Logged in? Simple security check */ if (!isset($_SESSION['ui'])){ - gosa_log ("Error: combine.php called without session"); + new log("security","all/all","",array(),"Error: combine.php called without session") ; header ("Location: index.php"); exit; } diff --git a/html/getFAIscript.php b/html/getFAIscript.php index 60e53d56a..6c3cfeb37 100644 --- a/html/getFAIscript.php +++ b/html/getFAIscript.php @@ -67,7 +67,7 @@ session_start (); /* Logged in? Simple security check */ if (!isset($_SESSION['ui'])){ - gosa_log ("Error: getFAIScript.php called without session"); + new log("security","fai","",array(),"Error: getFAIScript.php called without session") ; header ("Location: index.php"); exit; } diff --git a/html/get_attachment.php b/html/get_attachment.php index 58bab226b..d853e5b9f 100644 --- a/html/get_attachment.php +++ b/html/get_attachment.php @@ -26,7 +26,7 @@ session_start (); /* Logged in? Simple security check */ if (!isset($_SESSION['ui'])){ - gosa_log ("Error: get_attachment.php called without session"); + new log("security","glpi/all","",array(),"Error: get_attachment.php called without session") ; header ("Location: index.php"); exit; } diff --git a/html/getbin.php b/html/getbin.php index 6ac56b437..1817439c4 100644 --- a/html/getbin.php +++ b/html/getbin.php @@ -26,7 +26,7 @@ session_start (); /* Logged in? Simple security check */ if (!isset($_SESSION['ui'])){ - gosa_log ("Error: getbin.php called without session"); + new log("security","unknown","",array(),"Error: getbin.php called without session") ; header ("Location: index.php"); exit; } diff --git a/html/getfax.php b/html/getfax.php index abf40da83..374b7e255 100644 --- a/html/getfax.php +++ b/html/getfax.php @@ -26,7 +26,7 @@ session_start (); /* Logged in? Simple security check */ if (!isset($_SESSION['ui'])){ - gosa_log ("Error: getfax.php called without session"); + new log("security","faxreport/faxreport","",array(),"Error: getfax.php called without session") ; header ("Location: index.php"); exit; } @@ -34,7 +34,7 @@ $ui= $_SESSION["ui"]; /* User object present? */ if (!isset($_SESSION['fuserfilter'])){ - gosa_log ("Error: getfax.php called without propper session data"); + new log("security","faxreport/faxreport","",array(),"getfax.php called without propper session data") ; header ("Location: index.php"); exit; } @@ -101,22 +101,22 @@ if (!isset($_GET['download'])){ /* Loading image */ if(!$handle = imagick_blob2image($data)) { - gosa_log("Can't Load image"); + new log("view","faxreport/faxreport","",array(),"Can't load fax image") ; } /* Converting image to PNG */ if(!imagick_convert($handle,"PNG")) { - gosa_log("Can't Convert to PNG"); + new log("view","faxreport/faxreport","",array(),"Can't convert fax image to png") ; } /* Resizing image to 420x594 and blur */ if(!imagick_resize($handle,420,594,IMAGICK_FILTER_GAUSSIAN,1)){ - gosa_log("imagick_resize failed"); + new log("view","faxreport/faxreport","",array(),"Can't resize fax image") ; } /* Creating binary Code for the Image */ if(!$data = imagick_image2blob($handle)){ - gosa_log("Can't create blob for image"); + new log("view","faxreport/faxreport","",array(),"Reading fax image image failed") ; } } diff --git a/html/getkiosk.php b/html/getkiosk.php index 1f8d59923..cde88c5a0 100644 --- a/html/getkiosk.php +++ b/html/getkiosk.php @@ -54,7 +54,7 @@ session_start (); /* Logged in? Simple security check */ if (!isset($_SESSION['ui'])){ - gosa_log ("Error: getkiosk.php called without session"); + new log("security","fai","",array(),"Error: getkiosk.php called without session") ; header ("Location: index.php"); exit; } diff --git a/html/getldif.php b/html/getldif.php index 0045c6757..6241d4fa7 100644 --- a/html/getldif.php +++ b/html/getldif.php @@ -65,7 +65,7 @@ session_start (); /* Logged in? Simple security check */ if (!isset($_SESSION['ui'])){ - gosa_log ("Error: getldif.php called without session"); + new log("security","all/all","",array(),"Error: getldif.php called without session") ; header ("Location: index.php"); exit; } diff --git a/html/getvcard.php b/html/getvcard.php index d17ff0ce3..a1c68bc82 100644 --- a/html/getvcard.php +++ b/html/getvcard.php @@ -26,7 +26,7 @@ session_start (); /* Logged in? Simple security check */ if (!isset($_SESSION['ui'])){ - gosa_log ("Error: getvcard.php called without session"); + new log("security","all/all","",array(),"Error: getvcard.php called without session") ; header ("Location: index.php"); exit; } diff --git a/html/getxls.php b/html/getxls.php index 34c9936ba..de3607c82 100644 --- a/html/getxls.php +++ b/html/getxls.php @@ -470,7 +470,7 @@ session_start (); /* Logged in? Simple security check */ if (!isset($_SESSION['ui'])){ - gosa_log ("Error: getxls.php called without session"); + new log("security","all/all","",array(),"Error: getxls.php called without session") ; header ("Location: index.php"); exit; } diff --git a/html/helpviewer.php b/html/helpviewer.php index d1828ac92..b07cfb551 100644 --- a/html/helpviewer.php +++ b/html/helpviewer.php @@ -33,7 +33,7 @@ $config= $_SESSION['config']; /* If no config object is found in the session, abort help */ if (!isset($_SESSION['config'])){ - gosa_log ("main.php called without session"); + new log("security","all/all","",array(),"Help viewer called without session") ; header ("Location: index.php"); exit; } diff --git a/html/index.php b/html/index.php index 5468b8d9a..e911823c5 100644 --- a/html/index.php +++ b/html/index.php @@ -21,6 +21,7 @@ /* Load required includes */ require_once ("../include/php_setup.inc"); require_once ("functions.inc"); +require_once ("class_log.inc"); header("Content-type: text/html; charset=UTF-8"); function displayLogin() @@ -264,7 +265,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])){ if ($ui === NULL || $ui == 0){ $message= _("Please check the username/password combination."); $smarty->assign ('nextfield', 'password'); - gosa_log ("Authentication failed for user \"$username\""); + new log("security","login","",array(),"Authentication failed for user \"$username\"") ; } else { /* Remove all locks of this user */ del_user_locks($ui->dn); @@ -293,13 +294,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])){ if ($expired == 1){ $message= _("Account locked. Please contact your system administrator."); $smarty->assign ('nextfield', 'password'); - gosa_log ("Account for user \"$username\" has expired"); + new log("security","login","",array(),"Account for user \"$username\" has expired") ; } elseif ($expired == 3){ $plist= new pluglist($config, $ui); foreach ($plist->dirlist as $key => $value){ if (preg_match("/\bpassword\b/i",$value)){ $plug=$key; - gosa_log ("User \"$username\" password forced to change"); + new log("security","login","",array(),"User \"$username\" password forced to change") ; header ("Location: main.php?plug=$plug&reset=1"); exit; } @@ -307,13 +308,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])){ } /* Not account expired or password forced change go to main page */ - gosa_log ("User \"$username\" logged in successfully"); + new log("security","login","",array(),"User \"$username\" logged in successfully") ; header ("Location: main.php?global_check=1"); exit; } else { /* Go to main page */ - gosa_log ("User \"$username\" logged in successfully"); + new log("security","login","",array(),"User \"$username\" logged in successfully") ; header ("Location: main.php?global_check=1"); exit; } diff --git a/html/logout.php b/html/logout.php index 6fb8bcc61..5421e0e17 100644 --- a/html/logout.php +++ b/html/logout.php @@ -39,7 +39,7 @@ if(isset($_SESSION['ui'])){ del_user_locks($ui->dn); /* Write something to log */ - gosa_log ("User \"".$ui->username."\" logged out"); + new log("security","logout","",array(),"User \"".$ui->username."\" logged out") ; } /* If GET request is posted, the logout was forced by pressing the link */ diff --git a/html/main.php b/html/main.php index ba5668e11..8a250fd0d 100644 --- a/html/main.php +++ b/html/main.php @@ -60,7 +60,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST"){ /* Logged in? Simple security check */ if (!isset($_SESSION['config'])){ - gosa_log ("main.php called without session - logging out"); + new log("security","login","",array(),"main.php called without session - logging out") ; header ("Location: logout.php"); exit; } @@ -73,7 +73,7 @@ $_SESSION['LastError'] = ""; /* Check for uniqe ip address */ $ui= $_SESSION["ui"]; if ($_SERVER['REMOTE_ADDR'] != $ui->ip){ - gosa_log ("main.php called with session which has a changed IP address.", 3); + new log("security","login","",array(),"main.php called with session which has a changed IP address.") ; header ("Location: logout.php"); exit; } @@ -99,7 +99,7 @@ if(empty($_SESSION['_LAST_PAGE_REQUEST'])){ */ if($request_time > $max_life){ session_unset(); - gosa_log ("main.php called without session - logging out"); + new log("security","login","",array(),"main.php called without session - logging out") ; header ("Location: logout.php"); exit; } @@ -170,7 +170,7 @@ $plist= $_SESSION['plist']; /* Check for register globals */ if (isset($global_check) && $config->data['MAIN']['FORCEGLOBALS'] == 'true'){ echo _("FATAL: Register globals is on. GOsa will refuse to login unless this is fixed by an administrator."); - gosa_log ("Register globals is on. For security reasons, this should be turned off."); + new log("security","login","",array(),"Register globals is on. For security reasons, this should be turned off.") ; session_destroy (); exit (); } @@ -186,7 +186,7 @@ if (isset($_GET['plug'])){ $plugin_dir= $plist->get_path($plug); $_SESSION['plugin_dir']= $plugin_dir; if ($plugin_dir == ""){ - gosa_log ("main.php called with invalid plug parameter \"$plug\"", 3); + new log("security","gosa","",array(),"main.php called with invalid plug parameter \"$plug\"") ; header ("Location: logout.php"); exit; } @@ -349,7 +349,7 @@ if((isset($config->data['MAIN']['ACCOUNT_EXPIRATION'])) && $expired= ldap_expired_account($config, $ui->dn, $ui->username); if ($expired == 2){ - gosa_log ("password for user \"$ui->username\" is about to expire"); + new log("security","gosa","",array(),"password for user \"$ui->username\" is about to expire") ; print_red(_("Your password is about to expire, please change your password")); } } -- 2.30.2