From 5ba884f4a60b94a916687b1ae5b523f65c044ff9 Mon Sep 17 00:00:00 2001
From: Ralf Becker
Date: Sat, 5 Jul 2014 08:54:36 +0000
Subject: [PATCH] * Admin/API: remove old database based error-log
---
admin/inc/class.bolog.inc.php | 85 ----
admin/inc/class.html_tables.inc.php | 541 -----------------------
admin/inc/class.solog.inc.php | 173 --------
admin/inc/class.uilog.inc.php | 304 -------------
phpgwapi/inc/class.auth_ldap.inc.php | 4 -
phpgwapi/inc/class.egw.inc.php | 2 +-
phpgwapi/inc/class.egw_session.inc.php | 54 ---
phpgwapi/inc/class.error.inc.php | 114 -----
phpgwapi/inc/class.errorlog.inc.php | 196 --------
phpgwapi/inc/class.ldap.inc.php | 20 +-
phpgwapi/setup/setup.inc.php | 2 -
phpgwapi/setup/tables_current.inc.php | 32 --
phpgwapi/setup/tables_update_1_8.inc.php | 4 +
13 files changed, 6 insertions(+), 1525 deletions(-)
delete mode 100755 admin/inc/class.bolog.inc.php
delete mode 100644 admin/inc/class.html_tables.inc.php
delete mode 100755 admin/inc/class.solog.inc.php
delete mode 100644 admin/inc/class.uilog.inc.php
delete mode 100755 phpgwapi/inc/class.error.inc.php
delete mode 100644 phpgwapi/inc/class.errorlog.inc.php
diff --git a/admin/inc/class.bolog.inc.php b/admin/inc/class.bolog.inc.php
deleted file mode 100755
index 5271920605..0000000000
--- a/admin/inc/class.bolog.inc.php
+++ /dev/null
@@ -1,85 +0,0 @@
- True
- );
-
- function bolog($session=False)
- {
- $this->so =& CreateObject('admin.solog');
- }
-
- function get_error_cols()
- {
- $fields = $this->so->get_error_cols();
- // boAccounts
- $fields['account_pwd']['include'] = false;
- return $fields;
- }
-
- function get_error_cols_e()
- {
- $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;
- }
-
- function get_error($values='')
- {
- $rows = $this->so->get_error($values);
- // should remove the accounts_pwd
- return $rows;
- }
-
- function get_no_errors()
- {
- $rows = $this->so->get_no_errors();
- return $rows;
- }
-
- 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['egw']->common->show_date($GLOBALS['egw']->db->from_timestamp($r['log_date']['value']));
- $r['log_msg_date_e']['value'] = $GLOBALS['egw']->common->show_date($GLOBALS['egw']->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['egw']->common->show_date($GLOBALS['egw']->db->from_timestamp($r['account_lastlogin']['value']));
- $r['account_lastpwd_change_e']['value'] = $GLOBALS['egw']->common->show_date($GLOBALS['egw']->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;
- }
- }
-?>
diff --git a/admin/inc/class.html_tables.inc.php b/admin/inc/class.html_tables.inc.php
deleted file mode 100644
index bad5773617..0000000000
--- a/admin/inc/class.html_tables.inc.php
+++ /dev/null
@@ -1,541 +0,0 @@
- *
- * -------------------------------------------- *
- * 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$ */
-
- class html_tables
- {
- function hash_table($rows,$head='',$obj, $frtn)
- {
- $start = $_POST['start'] ? $_POST['start'] : $_GET['start'];
-
- $html = '';
- $edittable = $head['_edittable'];
- if(isset($edittable))
- {
- if($edittable)
- {
- // Generate the customization table...
- return $this->edit_table($rows,$head,$obj,$frtn);
- }
- else
- {
- //$bo =& CreateObject('admin.bolog',True);
- if(!isset($start))
- {
- $start = 0;
- }
- $num_rows = $GLOBALS['egw_info']['user']['preferences']['common']['maxmatchs'];
- $stop = $start + $num_rows;
- if($stop > count($rows))
- {
- $stop = count($rows);
- }
- $nextmatchs =& CreateObject('phpgwapi.nextmatchs');
- $total_records = count($rows);//$bo->get_no_errors();
- $left = $nextmatchs->left('/index.php',$start,$total_records,'menuaction=admin.uilog.list_log');
- $right = $nextmatchs->right('/index.php',$start,$total_records,'menuaction=admin.uilog.list_log');
- $hits = $nextmatchs->show_hits($total_records,$start);
-
- $html .= '';
- }
- }
-
- if($head == '')
- {
- $frow = $rows[0];
- $cnam = $this->arr_keys($frow);
- while(list(,$fn)=each($cnam))
- {
- $head[$fn] = array();
- }
- }
-
- if(@is_null($head['_cols']))
- {
- $cols = $this->arr_keys($rows[0]);
- }
- else
- {
- $cols = $head['_cols'];
- }
-
- // Build Header Row...
-
- // First Get the layout arrays...
- $layout = $head['#layout'];
- if(!is_array($layout))
- {
- $layout = $this->arr_keys($cols);
- }
-
- // printlist, a list of all columns in a logical row,
- // with Row/ColSpawn values, in print order...
-
- $printlist = $this->make_printlist($layout,$cols);
-
- // $table contains data for header row....
- $table = $this->make_tblhead($printlist,$head);
-
- // get GroupBy
- $groupby = $head['_groupby'];
- $supres = $head['_supres'];
- $lastgroup = '';
-
- // build actual Rows...
- $rparms = array();
- $mrow = $stop;
- for($rno=0;$rno<$mrow;$rno++)
- {
- // Build GroupKey
- if(isset($groupby))
- {
- $gkey = '';
- reset($groupby);
- while(list($gname,)=each($groupby))
- {
- $gkey .= $rows[$rno][$gname]['value'];
- }
- $rows[$rno]['#gkey'] = $gkey;
- }
-
- reset($printlist);
- while(list($pc,$pcol)=each($printlist))
- {
- $cname = $pcol['#name'];
- $cparms = $this->arr_merge($head[$cname],$pcol,array('bgcolor'=>'#FFFFFF'),$rows[$rno][$cname]);
- $rows[$rno][$cname] = $cparms;
- }
- }
-
- // Grouping Suppression
-
- if(isset($groupby))
- {
- $grno = $start;
- $gkey = $rows[$start]['#gkey'];
- for($rno=$start+1;$rno<$stop;$rno++)
- {
- $rowspan = 1;
- $rkey = $rows[$rno]['#gkey'];
-
- while( $gkey == $rkey)
- {
- //echo "grno:$grno ($gkey) rno:$rno ($rkey) are equal
";
- $rowspan = $rowspan + 1;
- $row = $rows[$rno];
-
- for($pc=0;$pcgrno:$grno ($gkey) rno:$rno ($rkey) are not equal
";
- $grno=$rno;
- $gkey=$rkey;
- }
- }
- /*
- ** Now Generate the Html For the Table Header
- */
- //print_r($table);
-
- $html .= $this->html_head($head,$table,$printlist);
- /*
- ** Now (finally) Generate the Html For the Table
- */
- //print_r($rows);
- for($rno=$start;$rno<$stop;$rno++)
- {
- // let user have a hack at the row...
- $row = $obj->$frtn($rno,$rows[$rno]);
- // $row = $rows[$rno];
-
- // $rp = $this->makeparms($row[$rno]['#row_parms']);
- $rp = '';
- $gkey = $row['#gkey'];
- // $html .= "\t \n";
- $html .= "\t \n";
- reset($printlist);
- while(list($pc,$pcol)=each($printlist))
- {
- $cname = $pcol['#name'];
-
- $cp = $this->makeparms($row[$cname]);
- if($row[$cname]['#supres'] != 'yes')
- {
- $html .= "\t\t".$row[$cname]['value']." | \n";
- }
- if($pcol['#eor']=='1')
- {
- $html .= "\t
\n"; // \t\n
- }
- }
- }
- $html .= "\n";
- #$html .= "";
- return $html;
- }
-
- function makeparms($parmlist)
- {
- $html = '';
- $comma = ' ';
- if(!is_array($parmlist))
- {
- return '';
- }
- reset($parmlist);
- while(list($pname,$pvalue)=each($parmlist))
- {
- switch($pname)
- {
- case 'value':
- break;
- case 'colspan':
- case 'rowspan':
- if($pvalue != 1)
- {
- $html .= $comma . $pname . '="' . $pvalue . '"';
- #$comma = ', ';
- $comma = ' ';
- };
- break;
- default:
- if(substr($pname,0,1) != '#')
- {
- $html .= $comma . $pname . '="' . $pvalue . '"';
- #$comma = ', ';
- $comma = ' ';
- }
- }
- }
- return $html;
- }
-
- function edit_table($rows,$head='',$obj, $frtn)
- {
- $nocols = $_POST['nocols'];
- $noflds = $_POST['noflds'];
- $norows = $_POST['norows'];
- $layout = $_POST['layout'];
- $_cols = $_POST['_cols'];
-
- $html = '';
- $html .= '