phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] admin/inc/class.bolog.inc.php, 1.8


From: nomail
Subject: [Phpgroupware-cvs] admin/inc/class.bolog.inc.php, 1.8
Date: Thu, 30 Dec 2004 08:38:14 +0100

Update of /admin/inc
Modified Files:
        Branch: 
          class.bolog.inc.php

date: 2004/12/30 07:38:14;  author: skwashd;  state: Exp;  lines: +52 -64

Log Message:
new HEAD admin - sans GIFs
=====================================================================
Index: admin/inc/class.bolog.inc.php
diff -u admin/inc/class.bolog.inc.php:1.7 admin/inc/class.bolog.inc.php:1.8
--- admin/inc/class.bolog.inc.php:1.7   Tue Dec 18 05:58:11 2001
+++ admin/inc/class.bolog.inc.php       Thu Dec 30 07:38:14 2004
@@ -1,14 +1,13 @@
 <?php
-       
/***************************************************************************\
-       * phpGroupWare - log                                                    
    *
-       * http://www.phpgroupware.org                                           
    *
-       * Written by : Jerry Westrick address@hidden                          *
-       * -------------------------------------------------                     
    *
-       * This program is free software; you can redistribute it and/or modify 
it   *
-       * under the terms of the GNU General Public License as published by the 
    *
-       * Free Software Foundation; either version 2 of the License, or (at 
your    *
-       * option) any later version.                                            
    *
-       
\***************************************************************************/
+       
/**************************************************************************\
+       * phpGroupWare - Administration                                         
   *
+       * http://www.phpgroupware.org                                           
   *
+       * --------------------------------------------                          
   *
+       *  This program is free software; you can redistribute it and/or modify 
it *
+       *  under the terms of the GNU General Public License as published by 
the   *
+       *  Free Software Foundation; either version 2 of the License, or (at 
your  *
+       *  option) any later version.                                           
   *
+       
\**************************************************************************/
 
        /* $Id$ */
 
@@ -16,70 +15,59 @@
        {
                var $public_functions = array
                (
-                       'read_log' => True
+                       'list_log'              => True,
+                       'purge_log'             => True
                );
-
-               function bolog($session=False)
-               {
-                       $this->so = CreateObject('admin.solog');
-               }
-
-               function get_error_cols()
+               
+               function bolog()
                {
-                       $fields = $this->so->get_error_cols();
-                       // boAccounts
-                       $fields['account_pwd']['include'] = false; 
-                       return $fields;
+                       $this->so       = createobject('admin.solog');
                }
 
-               function get_error_cols_e()
+               function list_log($account_id,$start,$order,$sort)
                {
-                       $fields = $this->so->get_error_cols_e();
-                       $fields['log_date_e']     = array();
-                       $fields['log_msg_date_e'] = array();
-                       $fields['log_full_name']  = array(); 
-                       // boAccounts
-                       $fields['account_pwd']['include']   = false; 
-                       $fields['account_lastlogin_e']      = array(); 
-                       $fields['account_lastloginfrom_e']  = array(); 
-                       $fields['account_lastpwd_change_e'] = array(); 
-                       return $fields;
+                       if 
($GLOBALS['phpgw']->acl->check('error_log_access',1,'admin'))
+                       {
+                               return false;
+                       }
+                       
+                       $records = 
$this->so->list_log($account_id,$start,$order,$sort);
+                       while (is_array($records) && list(,$record) = 
each($records))
+                       {
+                               // build and pass the format by hand as we want 
to show the seconds
+                               $record['log_date'] = 
$GLOBALS['phpgw']->common->show_date(
+                                       
$GLOBALS['phpgw']->db->from_timestamp($record['log_date']), 
+                                       
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'] . ' - 
H:i:s');
+
+                               if (ereg('@',$record['log_account_lid']))
+                               {
+                                       $t = 
split('@',$record['log_account_lid']);
+                                       $record['log_account_lid'] = $t[0];
+                               }
+                               
+                               $record['log_severity'] = 
lang($GLOBALS['phpgw']->log->get_level_name($record['log_severity']));
+
+                               $_records[] = array(
+                                       'log_date'              => 
$record['log_date'],
+                                       'log_account_lid'   => 
$record['log_account_lid'],
+                                       'log_app'               => 
$record['log_app'],
+                                       'log_severity'      => 
$record['log_severity'],
+                                       'log_file'                      => 
$record['log_file'],
+                                       'log_line'              => 
$record['log_line'],     
+                                       'log_msg'                       => 
$record['log_msg']  
+                               );
+                       }
+                       return $_records;
                }
 
-               function get_error($values='')
+               function purge_log($account_id) 
                {
-                       $rows = $this->so->get_error($values);
-                       // should remove the accounts_pwd
-                       return $rows;
+                       return $this->so->purge_log($account_id);
                }
 
-               function get_no_errors()
+               function total($account_id)
                {
-                       $rows = $this->so->get_no_errors();
-                       return $rows;
+                       return $this->so->total($account_id);
                }
 
-               function get_error_e($values='')
-               {
-                       $rows = $this->so->get_error_e($values);
-
-                       // Enhance the fields
-                       reset($rows);
-                       while(list($rno,$r)=each($rows))
-                       {
-                               unset($r['acount_pwd']);        // remove the 
accounts_pwd
-                               $r['log_date_e']['value']               = 
$GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->from_timestamp($r['log_date']['value']));
-                               $r['log_msg_date_e']['value']           = 
$GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->from_timestamp($r['log_msg_date']['value']));
-                               $r['log_full_name']['value']            = 
$r['account_lastname']['value'] . ', ' .$r['account_firstname']['value'];
-                               $r['account_lastlogin_e']['value']      = 
$GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->from_timestamp($r['account_lastlogin']['value']));
-                               $r['account_lastpwd_change_e']['value'] = 
$GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->from_timestamp($r['account_lastpwd_change']['value']));
-                               $r['account_lastloginfrom_e']['value']  = 
'www.nowhere.com'; 
-
-                               $r['log_msg_text']['value'] = 
lang($r['log_msg_msg']['value'],explode('|',$r['log_msg_parms']['value']));
-
-                               $rows[$rno]=$r;
-                       }
-                       return $rows;
-               }
        }
-?>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]