[2] | 1 | <?php |
---|
| 2 | /**************************************************************************\ |
---|
| 3 | * eGroupWare - Administration * |
---|
| 4 | * http://www.egroupware.org * |
---|
| 5 | * -------------------------------------------- * |
---|
| 6 | * This program is free software; you can redistribute it and/or modify it * |
---|
| 7 | * under the terms of the GNU General Public License as published by the * |
---|
| 8 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
| 9 | * option) any later version. * |
---|
| 10 | \**************************************************************************/ |
---|
| 11 | |
---|
| 12 | |
---|
| 13 | class boaccess_history |
---|
| 14 | { |
---|
| 15 | function boaccess_history() |
---|
| 16 | { |
---|
| 17 | $this->so = createobject('admin.soaccess_history'); |
---|
| 18 | } |
---|
| 19 | |
---|
| 20 | function list_history($account_id,$start,$order,$sort) |
---|
| 21 | { |
---|
| 22 | $records = $this->so->list_history($account_id,$start,$order,$sort); |
---|
| 23 | while (is_array($records) && list(,$record) = each($records)) |
---|
| 24 | { |
---|
| 25 | if ($record['li'] && $record['lo']) |
---|
| 26 | { |
---|
| 27 | $total = ($record['lo'] - $record['li']); |
---|
| 28 | if ($total > 86400 && $total > 172800) |
---|
| 29 | { |
---|
| 30 | $total = gmdate('z \d\a\y\s - G:i:s',$total); |
---|
| 31 | } |
---|
| 32 | else if ($total > 172800) |
---|
| 33 | { |
---|
| 34 | $total = gmdate('z \d\a\y - G:i:s',$total); |
---|
| 35 | } |
---|
| 36 | else |
---|
| 37 | { |
---|
| 38 | $total = gmdate('G:i:s',$total); |
---|
| 39 | } |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | if ($record['li']) |
---|
| 43 | { |
---|
| 44 | $record['li'] = $GLOBALS['phpgw']->common->show_date($record['li']); |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | if ($record['lo']) |
---|
| 48 | { |
---|
| 49 | $record['lo'] = $GLOBALS['phpgw']->common->show_date($record['lo']); |
---|
| 50 | } |
---|
| 51 | else |
---|
| 52 | { |
---|
| 53 | $record['lo'] = ''; // dont show a 0 for not loged out |
---|
| 54 | } |
---|
| 55 | |
---|
[5912] | 56 | if (preg_match('/@/',$record['loginid'])) |
---|
[2] | 57 | { |
---|
[6057] | 58 | $t = preg_split('/@/',$record['loginid']); |
---|
[2] | 59 | $record['loginid'] = $t[0]; |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | $_records[] = array( |
---|
| 63 | 'loginid' => $record['loginid'], |
---|
| 64 | 'ip' => $record['ip'], |
---|
| 65 | 'li' => $record['li'], |
---|
| 66 | 'lo' => $record['lo'], |
---|
| 67 | 'account_id' => $record['account_id'], |
---|
| 68 | 'sessionid' => $record['sessionid'], |
---|
| 69 | 'total' => $total |
---|
| 70 | ); |
---|
| 71 | } |
---|
| 72 | return $_records; |
---|
| 73 | } |
---|
| 74 | |
---|
| 75 | function total($account_id) |
---|
| 76 | { |
---|
| 77 | return $this->so->total($account_id); |
---|
| 78 | } |
---|
| 79 | |
---|
| 80 | function return_logged_out($account_id) |
---|
| 81 | { |
---|
| 82 | return $this->so->return_logged_out($account_id); |
---|
| 83 | } |
---|
| 84 | } |
---|