1 | <?php |
---|
2 | /***************************************************************************\ |
---|
3 | * eGroupWare - log * |
---|
4 | * http://www.egroupware.org * |
---|
5 | * Written by : Jerry Westrick [jerry@westrick.com] * |
---|
6 | * ------------------------------------------------- * |
---|
7 | * This program is free software; you can redistribute it and/or modify it * |
---|
8 | * under the terms of the GNU General Public License as published by the * |
---|
9 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
10 | * option) any later version. * |
---|
11 | \***************************************************************************/ |
---|
12 | |
---|
13 | |
---|
14 | class bolog |
---|
15 | { |
---|
16 | var $public_functions = array |
---|
17 | ( |
---|
18 | 'read_log' => True |
---|
19 | ); |
---|
20 | |
---|
21 | function bolog($session=False) |
---|
22 | { |
---|
23 | $this->so = CreateObject('admin.solog'); |
---|
24 | } |
---|
25 | |
---|
26 | function get_error_cols() |
---|
27 | { |
---|
28 | $fields = $this->so->get_error_cols(); |
---|
29 | // boAccounts |
---|
30 | $fields['account_pwd']['include'] = false; |
---|
31 | return $fields; |
---|
32 | } |
---|
33 | |
---|
34 | function get_error_cols_e() |
---|
35 | { |
---|
36 | $fields = $this->so->get_error_cols_e(); |
---|
37 | $fields['log_date_e'] = array(); |
---|
38 | $fields['log_msg_date_e'] = array(); |
---|
39 | $fields['log_full_name'] = array(); |
---|
40 | // boAccounts |
---|
41 | $fields['account_pwd']['include'] = false; |
---|
42 | $fields['account_lastlogin_e'] = array(); |
---|
43 | $fields['account_lastloginfrom_e'] = array(); |
---|
44 | $fields['account_lastpwd_change_e'] = array(); |
---|
45 | return $fields; |
---|
46 | } |
---|
47 | |
---|
48 | function get_error($values='') |
---|
49 | { |
---|
50 | $rows = $this->so->get_error($values); |
---|
51 | // should remove the accounts_pwd |
---|
52 | return $rows; |
---|
53 | } |
---|
54 | |
---|
55 | function get_no_errors() |
---|
56 | { |
---|
57 | $rows = $this->so->get_no_errors(); |
---|
58 | return $rows; |
---|
59 | } |
---|
60 | |
---|
61 | function get_error_e($values='') |
---|
62 | { |
---|
63 | $rows = $this->so->get_error_e($values); |
---|
64 | |
---|
65 | // Enhance the fields |
---|
66 | reset($rows); |
---|
67 | while(list($rno,$r)=each($rows)) |
---|
68 | { |
---|
69 | unset($r['acount_pwd']); // remove the accounts_pwd |
---|
70 | $r['log_date_e']['value'] = $GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->from_timestamp($r['log_date']['value'])); |
---|
71 | $r['log_msg_date_e']['value'] = $GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->from_timestamp($r['log_msg_date']['value'])); |
---|
72 | $r['log_full_name']['value'] = $r['account_lastname']['value'] . ', ' .$r['account_firstname']['value']; |
---|
73 | $r['account_lastlogin_e']['value'] = $GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->from_timestamp($r['account_lastlogin']['value'])); |
---|
74 | $r['account_lastpwd_change_e']['value'] = $GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->from_timestamp($r['account_lastpwd_change']['value'])); |
---|
75 | $r['account_lastloginfrom_e']['value'] = 'www.nowhere.com'; |
---|
76 | |
---|
77 | $r['log_msg_text']['value'] = lang($r['log_msg_msg']['value'],explode('|',$r['log_msg_parms']['value'])); |
---|
78 | |
---|
79 | $rows[$rno]=$r; |
---|
80 | } |
---|
81 | return $rows; |
---|
82 | } |
---|
83 | } |
---|
84 | ?> |
---|