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 .= ''; - $html .= $left; - $html .= ''; - $html .= ''; - $html .= $right; - $html .= '
' . $hits . ' link('/index.php','menuaction=admin.uilog.list_log&editable=true') .'> ' . lang('Edit Table format') . '
'; - } - } - - 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 .= '
' . "\n"; - - $params = $head['_table_parms']; - $frow = $rows[0]; - $cnam = $this->arr_keys($frow); - if($head == '') - { - while(list(,$fn)=each($cnam)) - { - $head[$fn] = array(); - } - } - - if(isset($_cols)) - { - $cols = $_cols; - } - else - { - if(@is_null($head['_cols'])) - { - $cols = $this->arr_keys($rows[0]); - } - else - { - $cols = $head['_cols']; - } - } - - if(!isset($noflds)) - { - $noflds = count($cols); - } - if(!isset($layout)) - { - $layout = $head['#layout']; - } - if(!isset($norows)) - { - $norows = count($layout); - } - if(!isset($nocols)) - { - $nocols = count($layout[0]); - } - // Table Excmple - - // Build Header Row... - $html .= "

Table Size

"; - // $html .= "

"; - $html .= "Rows: "; - $html .= ""; - $html .= "Columns: "; - $html .= ""; - $html .= "Fields: "; - $html .= ""; - // $html .= "\t "; - - // Column Defintions... - $html .= "

Column Definition

"; - $html .= "\n"; - $f = array(); - for($fno=0;$fno<$noflds;$fno++) - { - $f[]=$fno; - } - // Column Headings - $html .= "\t\n"; - for($cno=0;$cno<$nocols;$cno++) - { - $html .= "\t\t\n"; - } - $html .= "\t\n"; - for($rno=0;$rno<$norows;$rno++) - { - $html .= "\t\n"; - for($cno=0;$cno<$nocols;$cno++) - { - $c = $layout[$rno][$cno]; - $tname = "layout[$rno][]"; - $t = $this->DropDown($f,$tname,$c); - $html .= "\t\t\n"; - } - $html .= "\t\n"; - } - $html .= "
$cno
$t
\n"; - $html .= "

\n"; - - // Header of Table... - $printlist = $this->make_printlist($layout,$cols); - $table = $this->make_tblhead($printlist,$head); - $html .= $this->html_head($head,$table,$printlist); - $html .= "\n"; - - $html .= ""; - //Field Definitions - $html .= "

Field Definitions

"; - $html .= "\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\n"; - - // Add Table Rows... - reset($cols); - // while(list($cno,$name) = each($cols)) - for($fno=0;$fno<$noflds;$fno++) - { - $name = $cols[$fno]; - $values = $head[$name]; - $title = $values['title']; - if($title == '') - { - $title = $name; - } - $html .= "\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $value = $rows[0][$name]['value']; - $html .= "\t\t\n"; - $html .= "\t\n"; - } - $html .= "
NoDelFieldValue
$fno".$this->dropdown($cnam,'_cols[]',$name)."$value
\n"; - $html .= ""; - $html .= "
"; - return $html; - } - - function dropdown($opts,$name='',$sel='') - { - $items = $opts; - $html = '\n"; - return $html; - } - - function make_printlist($layout,$cols) - { - // Build Printlist... (Col and Row Spans...) - $tlayout = $layout; - $printlist = array(); - $mrows = count($tlayout); - $mcols = count($tlayout[0]); - for($pr=0;$pr<$mrows;$pr++) - { - for($pc=0;$pc<$mcols;$pc++) - { - if(isset($tlayout[$pr][$pc])) - { - $cno = $tlayout[$pr][$pc]; - $cname = $cols[$cno]; - $colspan=1; - $rowspan=1; - while(($pr + $rowspan < $mrows) && ($tlayout[$pr + $rowspan][$pc] == $cno)) - { - unset($tlayout[$pr + $rowspan][$pc]); - $rowspan++; - } - while(($pc + $colspan < $mcols) && ($tlayout[$pr][$pc+$colspan] == $cno)) - { - unset($tlayout[$pr][$pc+$colspan]); - $colspan++; - } - if($colspan > 1 && $rowspan > 1) - { - for($r=$pr+1;$r<$pr+$rowspan;$r++) - { - for($c=$pc+1;$c<$pc+$colspan;$c++) - { - unset($tlayout[$r][$c]); - } - } - } - $printlist[] = array( - '#name' =>$cname, - 'rowspan' =>$rowspan, - 'colspan' =>$colspan, - 'valign' =>'top', - '#colno' =>$cno, - '#eor' =>0 - ); - } - } - $printlist[count($printlist)-1]['#eor'] = '1'; - } - return $printlist; - } - - function make_tblhead($printlist,$head) - { - // Build Title Row - $table = array(); - reset($printlist); - while(list($pc,$pcol)=each($printlist)) - { - $cname = $pcol['#name']; - $values = $head[$cname]; - $title = $values['#title']; - if($title == '') - { - $title = $cname; - } - $cparms = $this->arr_merge($values['#parms_hdr'],$pcol); - $cparms['value']=$title; - $table[0][$pc] = $cparms; - } - return $table; - } - - function html_head($head,$table,$printlist) - { - $html = ''; - $tparams = $this->makeparms($head['#table_parms']); - $html .= "\n"; - $rp = $this->makeparms($head['#head_parms']); - // $html .= "\t\n"; - $html .= "\t \n"; - - $row = $table[0]; - reset($row); - $intr = true; - while(list(,$col)=each($row)) - { - if(!$intr) - { - $html .= "\t\n"; - $intr = true; - } - $cname = $col['#name']; - $cp = $this->makeparms($col); - $html .= "\t\t\n"; - if($col['#eor']=='1') - { - $html .= "\t\n"; - $intr = false; - } - } - return $html; - } - - function arr_merge($a1='',$a2='',$a3='',$a4='',$a5='',$a6='',$a7='',$a8='') - { - $out = array(); - $test = array($a1,$a2,$a3,$a4,$a5,$a6,$a7,$a8); - while(list(,$val) = each($test)) - { - if(is_array($val)) - { - $out += $val; - } - } - return $out; - } - - function arr_keys($fields,$array=True) - { - @reset($fields); - while(list($key,$val) = @each($fields)) - { - $fkeys .= $key . ','; - } - $fkeys = substr($fkeys,0,-1); - if($array) - { - $ex = explode(',',$fkeys); - return $ex; - } - else - { - return $fkeys; - } - } - } diff --git a/admin/inc/class.solog.inc.php b/admin/inc/class.solog.inc.php deleted file mode 100755 index a07609efea..0000000000 --- a/admin/inc/class.solog.inc.php +++ /dev/null @@ -1,173 +0,0 @@ - * - * -------------------------------------------- * - * Funding for this program was provided by http://www.checkwithmom.com * - * -------------------------------------------- * - * 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 solog - { - var $db; - var $accounts_table = 'egw_accounts'; - var $log_table = 'egw_log'; - var $msg_table = 'egw_log_msg'; - var $owner; - var $error_cols = ''; - var $error_cols_e = ''; - var $public_functions = array( - 'get_error_cols' => True, - 'get_error_cols_e' => True, - 'get_error' => True, - 'get_error_e' => True - ); - - function solog() - { - $this->db = clone($GLOBALS['egw']->db); - } - - function get_error_cols() - { - if ($this->error_cols == '') - { - $this->error_cols = array(); - - /* fields from log table */ - $clist = $this->db->metadata($this->log_table); - for ($i=0; $ierror_cols[$name] = array(); - } - - /* fields from msg table */ - $clist = $this->db->metadata($this->msg_table); - for ($i=0; $ierror_cols[$name] = array(); - } - } - return $this->error_cols; - } - - function get_error_cols_e() - { - if ($this->task_cols_e == '') - { - /* Get Columns for Errors */ - $this->error_cols_e = $this->get_error_cols(); - - /* Enhance with Columns from accounts-table */ - $clist = $this->db->metadata($this->accounts_table); - for ($i=0; $ierror_cols_e[$name] = array(); - } - } - return $this->error_cols_e; - } - - function get_error_e($parms) - { - - /* Fixed From */ - if (!isset($parms['from'])) - { - $parms['from'] = array($this->accounts_table); - } - else - { - $parms['from'][] = $this->accounts_table; - } - - /* Fix Where */ - if (!isset($parms['where'])) - { - $parms['where'] = array("$this->log_table.log_user = $this->accounts_table.account_id"); - } - else - { - $parms['where'][] = "$this->log_table.log_user = $this->accounts_table.account_id"; - } - - /* Fix Default Fields */ - if (!isset($parms['fields'])) - { - $parms['fields'] = $this->get_error_cols_e(); - } - - return $this->get_error($parms); - } - - function get_no_errors() - { - /* Get max ErrorId */ - $this->db->query("select count(*) as max_id from $this->log_table, $this->msg_table WHERE $this->log_table.log_id = $this->msg_table.log_msg_log_id",__LINE__,__FILE__); - - return $this->db->next_record() ? $this->db->f('max_id') : 0; - } - - function get_error($parms) - { - /* Get parameter values */ - $from = $parms['from']; - $where = $parms['where']; - $orderby = $parms['orderby']; - $fields = $parms['fields']; - - /* Build From_Clause */ - $from_clause = "FROM $this->log_table , $this->msg_table "; - if (isset($from)) - { - $from[] = $this->log_table; - $from[] = $this->msg_table; - $from_clause = 'FROM '.implode(', ' , $from).' '; - } - - /* Build Where_Clause */ - $where_clause = "WHERE $this->log_table.log_id = $this->msg_table.log_msg_log_id "; - if (isset($where)) - { - $where[] = "$this->log_table.log_id = $this->msg_table.log_msg_log_id"; - $where_clause = 'WHERE ' . implode(' AND ',$where) . ' '; - } - - /* Build Order_By_Clause */ - $orderby_clause = "ORDER BY $this->log_table.log_id, $this->msg_table.log_msg_seq_no "; - if (isset($orderby)) - { - $orderby_clause = 'ORDER BY ' . implode(', ',$orderby); - } - - /* If no Fields specified default to * */ - if (!isset($fields)) - { - $fields = $this->get_error_cols(); - } - - $rows = array(); - - $select = 'SELECT ' . implode(',',array_keys($fields)) . ' ' . $from_clause . $where_clause . $orderby_clause; - $this->db->query($select,__LINE__,__FILE__); - while($this->db->next_record()) - { - foreach($fields as $fname => $fopt) - { - $this_row[$fname]['value'] = $this->db->f($fname); - } - $rows[] = $this_row; - } - return $rows; - } - } diff --git a/admin/inc/class.uilog.inc.php b/admin/inc/class.uilog.inc.php deleted file mode 100644 index a10eaa5a89..0000000000 --- a/admin/inc/class.uilog.inc.php +++ /dev/null @@ -1,304 +0,0 @@ - True - ); - - function uilog() - { - if ($GLOBALS['egw']->acl->check('error_log_access',1,'admin')) - { - $GLOBALS['egw']->redirect_link('/index.php'); - } - - $_cols = $_POST['_cols']; - $nocols = $_POST['nocols']; - $_delcol = $_POST['_delcol']; - $layout = $_POST['layout']; - $editable = $_GET['editable']; - $modifytable = $_GET['modifytable'] ? $_GET['modifytable'] : $_POST['modifytable']; - - $this->bolog =& CreateObject('admin.bolog',True); - $this->html =& CreateObject('admin.html_tables'); - $this->t =& CreateObject('phpgwapi.Template',$GLOBALS['egw']->common->get_tpl_dir('admin')); - $this->lastid = ''; - $this->editmode = False; - - // Handle the Edit Table Button - if (isset($editable)) - { - $this->editmode = $editable; - } - - // Handle return from Modify Table form... - if ($modifytable) - { - // the delete column must not be empty - if (!isset($_delcol)) - { - $_delcol = array(); - } - - // Build New fields_inc array... - if (isset($_cols)) - { - $c = array(); - for ($i=0;$ifields_inc = $c; - } - - // Reset Mode to display... - $this->editmode = False; - $this->layout = $layout; - - // Save the fields_inc values in Session and User Preferences... - $data = array('fields_inc'=>$this->fields_inc,'layout'=>$layout); - $GLOBALS['egw']->session->appsession('session_data','log',$data); - $GLOBALS['egw']->preferences->read_repository(); - $GLOBALS['egw']->preferences->delete('log','fields_inc'); - $GLOBALS['egw']->preferences->add('log','fields_inc',$this->fields_inc); - $GLOBALS['egw']->preferences->delete('log','layout'); - $GLOBALS['egw']->preferences->add('log','layout',$this->layout); - $GLOBALS['egw']->preferences->save_repository(); - } - - // Make sure that $this->fields_inc is filled - if ( !isset($this->field_inc)) - { - // Need to fill from Session Data... - $data = $GLOBALS['egw']->session->appsession('session_data','log'); - if (isset($data) && isset($data['fields_inc'])) - { - $this->fields_inc = $data['fields_inc']; - $this->layout = $data['layout']; - } - else - { - $GLOBALS['egw']->preferences->read_repository(); - // Get From User Profile... - if (@$GLOBALS['egw_info']['user']['preferences']['log']['fields_inc']) - { - $fields_inc = $GLOBALS['egw_info']['user']['preferences']['log']['fields_inc']; - $this->fields_inc = $fields_inc; - $layout = $GLOBALS['egw_info']['user']['preferences']['log']['layout']; - $this->layout = $layout; - $GLOBALS['egw']->session->appsession('session_data','log',array('fields_inc'=>$fields_inc,'layout'=>$layout)); - } - else - { - // Use defaults... - $this->fields_inc = array( - 'log_severity', - 'log_id', - 'log_date_e', - 'log_app', - 'log_full_name', - 'log_msg_seq_no', - 'log_msg_date_e', - 'log_msg_severity', - 'log_msg_code', - 'log_msg_text', - 'log_msg_file', - 'log_msg_line' - ); - $this->layout[]= array(0,1,2,3,4,5,6,7,8,9); - $this->layout[]= array(0,1,2,3,4,5,6,7,10,11); - - // Store defaults in session data... - $GLOBALS['egw']->session->appsession( - 'session_data', - 'log', - array( - 'fields_inc'=>$this->fields_inc, - 'layout'=>$this->layout - ) - ); - } - } - - } // Values already filled... - reset($this->fields_inc); - while(list($cno,$cname)=each($this->fields_inc)) - { - $this->column[$cname]=$cno; - } - } - - function list_log() - { - if (False) // add some errors to the log... - { - // Test 1: single Error line immedeately to errorlog - // (could be type Debug, Info, Warning, or Error) - $GLOBALS['egw']->log->write(array('text'=>'I-TestWrite, write: %1','p1'=>'This message should appear in log','file'=>__FILE__,'line'=>__LINE__)); - - // Test 2: A message should appear in log even if clearstack is called - $GLOBALS['egw']->log->message(array('text'=>'I-TestMsg, msg: %1','p1'=>'This message should appear in log','file'=>__FILE__,'line'=>__LINE__)); - $GLOBALS['egw']->log->error(array('text'=>'I-TestInfo, info: %1','p1'=>'This Informational should not be in log','file'=>__FILE__,'line'=>__LINE__)); - $GLOBALS['egw']->log->clearstack(); - $GLOBALS['egw']->log->commit(); // commit error stack to log... - - // Test 3: one debug message - $GLOBALS['egw']->log->error(array('text'=>'D-Debug, dbg: %1','p1'=>'This debug statment should be in log','file'=>__FILE__,'line'=>__LINE__)); - $GLOBALS['egw']->log->commit(); // commit error stack to log... - - // Test 3: debug and one informational - $GLOBALS['egw']->log->error(array('text'=>'D-Debug, dbg: %1','p1'=>'This debug statment should be in log','file'=>__FILE__,'line'=>__LINE__)); - $GLOBALS['egw']->log->error(array('text'=>'I-TestInfo, info: %1','p1'=>'This Informational should be in log','file'=>__FILE__,'line'=>__LINE__)); - $GLOBALS['egw']->log->commit(); // commit error stack to log... - - // Test 4: an informational and a Warning - $GLOBALS['egw']->log->error(array('text'=>'D-Debug, dbg: %1','p1'=>'This debug statment should be in log','file'=>__FILE__,'line'=>__LINE__)); - $GLOBALS['egw']->log->error(array('text'=>'I-TestInfo, info: %1','p1'=>'This Informational should be in log','file'=>__FILE__,'line'=>__LINE__)); - $GLOBALS['egw']->log->error(array('text'=>'W-TestWarn, warn: %1','p1'=>'This is a test Warning','file'=>__FILE__,'line'=>__LINE__)); - $GLOBALS['egw']->log->commit(); // commit error stack to log... - - // Test 5: and an error - $GLOBALS['egw']->log->error(array('text'=>'D-Debug, dbg: %1','p1'=>'This debug statment should be in log','file'=>__FILE__,'line'=>__LINE__)); - $GLOBALS['egw']->log->error(array('text'=>'I-TestInfo, info: %1','p1'=>'This Informational should be in log','file'=>__FILE__,'line'=>__LINE__)); - $GLOBALS['egw']->log->error(array('text'=>'W-TestWarn, warn: %1','p1'=>'This is a test Warning','file'=>__FILE__,'line'=>__LINE__)); - $GLOBALS['egw']->log->error(array('text'=>'E-TestError, err: %1','p1'=>'This is a test Error','file'=>__FILE__,'line'=>__LINE__)); - $GLOBALS['egw']->log->commit(); // commit error stack to log... - - // Test 6: and finally a fatal... - $GLOBALS['egw']->log->error(array('text'=>'D-Debug, dbg: %1','p1'=>'This debug statment should be in log','file'=>__FILE__,'line'=>__LINE__)); - $GLOBALS['egw']->log->error(array('text'=>'I-TestInfo, info: %1','p1'=>'This Informational should be in log','file'=>__FILE__,'line'=>__LINE__)); - $GLOBALS['egw']->log->error(array('text'=>'W-TestWarn, warn: %1','p1'=>'This is a test Warning','file'=>__FILE__,'line'=>__LINE__)); - $GLOBALS['egw']->log->error(array('text'=>'E-TestError, err: %1','p1'=>'This is a test Error','file'=>__FILE__,'line'=>__LINE__)); - $GLOBALS['egw']->log->error(array('text'=>'F-Abend, abort: %1','p1'=>'Force abnormal termination','file'=>__FILE__,'line'=>__LINE__)); - } - $this->t->set_file(array('log_list_t' => 'log.tpl')); - - // -------------------------- Layout Description ------------------------------- - $phycols = array('2%', '2%', '15%', '10%', '15%', '2%', '20%', '2%', '7%', '25%'); - // -------------------------- end Layout Description --------------------------- - - // Get list of Possible Columns - $header = $this->bolog->get_error_cols_e(); - - // Describe table layout... - $header['#phycols'] = $phycols; - $header['#layout'] = $this->layout; - - // Set User Configured List of columns to show - $header['_cols']= $this->fields_inc; - - // Set Table formating parameters - $header['#table_parms']=array('width'=>"98%", 'bgcolor'=>"#000000", 'border'=>"0"); - - // Set Header formating parameters - $header['#head_parms']=array('bgcolor'=>"#D3DCFF"); - - // Column Log_ID - $header['log_id']['#parms_hdr'] = array('align'=>"center"); - $header['log_id']['#title'] = 'Id'; - $header['log_id']['align'] = 'center'; - - // Column Log_Severity - $header['log_severity']['#parms_hdr'] = array('align'=>"center"); - $header['log_severity']['#title'] = 'S'; - $header['log_severity']['align'] = 'center'; - - // Column Trans Date - $header['log_date_e']['#title'] = 'Tans. Date'; - - // Column Application - $header['log_app']['#title'] = 'App.'; - - // Column FullName - $header['log_full_name']['#title'] = 'User'; - $header['log_full_name']['align'] = 'center'; - - // Column log_msg_seq_no - $header['log_msg_seq_no']['#parms_hdr'] = array('align'=>"center"); - $header['log_msg_seq_no']['#title'] = 'Sno'; - $header['log_msg_seq_no']['align'] = 'center'; - - // Column log_msg_seq_no - $header['log_msg_date_e']['#title'] = 'TimeStamp'; - $header['log_msg_severity']['#title'] = 'S'; - $header['log_msg_severity']['align'] = 'center'; - $header['log_msg_code']['#title'] = 'Code'; - $header['log_msg_text']['#title'] = 'Error Msg'; - $header['log_msg_file']['#title'] = 'File'; - $header['log_msg_line']['#title'] = 'Line'; - - // Set up Grouping, Suppression... - $header['_groupby']=array('log_id'=>1); - $header['_supres']=array('log_id'=>1,'log_severity'=>1,'log_date_e'=>1,'log_app'=>1,'log_full_name'=>1); - - // Hack Get All Rows - $rows = $this->bolog->get_error_e(array('orderby'=>array('log_id','log_msg_log_id'))); - $norows = count($rows); - $header['_edittable']=$this->editmode; - $table = $this->html->hash_table($rows,$header,$this, 'format_row'); - $this->t->set_var('event_list',$table); - - $GLOBALS['egw_info']['flags']['app_header'] = lang('Admin').' - '.($this->editmode?lang('Edit Table format') : lang('View error log')); - $GLOBALS['egw']->common->egw_header(); - echo parse_navbar(); - $this->t->pfp('out','log_list_t'); -// $this->set_app_langs(); - } - - function format_row($rno, $row) - { - switch($row['log_severity']['value']) - { - case 'D': $row['log_severity']['bgcolor'] = '#D3DCFF'; break; - case 'I': $row['log_severity']['bgcolor'] = '#C0FFC0'; break; - case 'W': $row['log_severity']['bgcolor'] = '#FFFFC0'; break; - case 'E': $row['log_severity']['bgcolor'] = '#FFC0C0'; break; - case 'F': $row['log_severity']['bgcolor'] = '#FF0909'; break; - } - - switch($row['log_msg_severity']['value']) - { - case 'D': $color = '#D3DCFF'; break; - case 'I': $color = '#C0FFC0'; break; - case 'W': $color = '#FFFFC0'; break; - case 'E': $color = '#FFC0C0'; break; - case 'F': $color = '#FF0909'; break; - } - reset($this->fields_inc); - while(list($cno,$fld) = each($this->fields_inc)) - { - if (substr($fld,0,7) == 'log_msg') - { - $row[$fld]['bgcolor'] = $color; - } - else - { -// $row[$cno]['bgcolor'] = $lcolor; - } - } - return $row; - } - } -?> diff --git a/phpgwapi/inc/class.auth_ldap.inc.php b/phpgwapi/inc/class.auth_ldap.inc.php index a1e82cec41..97c074d068 100644 --- a/phpgwapi/inc/class.auth_ldap.inc.php +++ b/phpgwapi/inc/class.auth_ldap.inc.php @@ -47,8 +47,6 @@ class auth_ldap implements auth_backend if(!$ldap = common::ldapConnect()) { - $GLOBALS['egw']->log->message('F-Abort, Failed connecting to LDAP server for authenication, execution stopped'); - $GLOBALS['egw']->log->commit(); return False; } @@ -167,8 +165,6 @@ class auth_ldap implements auth_backend if(!$ldap = common::ldapConnect()) { - $GLOBALS['egw']->log->message('F-Abort, Failed connecting to LDAP server for authenication, execution stopped'); - $GLOBALS['egw']->log->commit(); return False; } diff --git a/phpgwapi/inc/class.egw.inc.php b/phpgwapi/inc/class.egw.inc.php index 4463302639..fbf00bfd8c 100644 --- a/phpgwapi/inc/class.egw.inc.php +++ b/phpgwapi/inc/class.egw.inc.php @@ -471,7 +471,7 @@ class egw extends egw_minimal * @param string The url ro redirect to * @param string $link_app=null appname to redirect for, default currentapp */ - static function redirect($url, $link_app) + static function redirect($url, $link_app=null) { // Determines whether the current output buffer should be flushed $do_flush = true; diff --git a/phpgwapi/inc/class.egw_session.inc.php b/phpgwapi/inc/class.egw_session.inc.php index 542b35b69d..20771e7d13 100644 --- a/phpgwapi/inc/class.egw_session.inc.php +++ b/phpgwapi/inc/class.egw_session.inc.php @@ -543,16 +543,6 @@ class egw_session $GLOBALS['egw_info']['user'] = $this->read_repositories(); if ($GLOBALS['egw']->accounts->is_expired($GLOBALS['egw_info']['user'])) { - if(is_object($GLOBALS['egw']->log)) - { - $GLOBALS['egw']->log->message(array( - 'text' => 'W-LoginFailure, account loginid %1 is expired', - 'p1' => $this->account_lid, - 'line' => __LINE__, - 'file' => __FILE__ - )); - $GLOBALS['egw']->log->commit(); - } $this->reason = 'account is expired'; $this->cd_reason = 98; @@ -951,16 +941,6 @@ class egw_session if ($GLOBALS['egw']->accounts->is_expired($GLOBALS['egw_info']['user'])) { if (self::ERROR_LOG_DEBUG) error_log("*** session::verify($sessionid) accounts is expired"); - if(is_object($GLOBALS['egw']->log)) - { - $GLOBALS['egw']->log->message(array( - 'text' => 'W-VerifySession, account loginid %1 is expired', - 'p1' => $this->account_lid, - 'line' => __LINE__, - 'file' => __FILE__ - )); - $GLOBALS['egw']->log->commit(); - } return false; } $this->passwd = base64_decode(egw_cache::getSession('phpgwapi', 'password')); @@ -972,17 +952,6 @@ class egw_session if ($this->account_domain != $GLOBALS['egw_info']['user']['domain']) { if (self::ERROR_LOG_DEBUG) error_log("*** session::verify($sessionid) wrong domain"); - if(is_object($GLOBALS['egw']->log)) - { - $GLOBALS['egw']->log->message(array( - 'text' => 'W-VerifySession, the domains %1 and %2 don\'t match', - 'p1' => $userid_array[1], - 'p2' => $GLOBALS['egw_info']['user']['domain'], - 'line' => __LINE__, - 'file' => __FILE__ - )); - $GLOBALS['egw']->log->commit(); - } return false; } @@ -992,18 +961,6 @@ class egw_session $GLOBALS['egw_info']['user']['session_ip'] != $this->getuser_ip())) { if (self::ERROR_LOG_DEBUG) error_log("*** session::verify($sessionid) wrong IP"); - if(is_object($GLOBALS['egw']->log)) - { - // This needs some better wording - $GLOBALS['egw']->log->message(array( - 'text' => 'W-VerifySession, IP %1 doesn\'t match IP %2 in session table', - 'p1' => $this->getuser_ip(), - 'p2' => $GLOBALS['egw_info']['user']['session_ip'], - 'line' => __LINE__, - 'file' => __FILE__ - )); - $GLOBALS['egw']->log->commit(); - } return false; } } @@ -1017,17 +974,6 @@ class egw_session if (!$this->account_lid) { if (self::ERROR_LOG_DEBUG) error_log("*** session::verify($sessionid) !account_lid"); - if(is_object($GLOBALS['egw']->log)) - { - // This needs some better wording - $GLOBALS['egw']->log->message(array( - 'text' => 'W-VerifySession, account_id is empty', - 'line' => __LINE__, - 'file' => __FILE__ - )); - $GLOBALS['egw']->log->commit(); - } - //echo 'DEBUG: Sessions: account_id is empty!
'."\n"; return false; } diff --git a/phpgwapi/inc/class.error.inc.php b/phpgwapi/inc/class.error.inc.php deleted file mode 100755 index cf2695ec31..0000000000 --- a/phpgwapi/inc/class.error.inc.php +++ /dev/null @@ -1,114 +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 error - { - /***************************\ - * Instance Variables... * - \***************************/ - var $severity = 'E'; - var $code = 'Unknown'; - var $msg = 'Unknown error'; - var $parms = array(); - var $ismsg = 0; - var $timestamp; - var $fname; - var $line; - var $app; - - var $public_functions = array(); - - // Translate Message into Language - function langmsg() - { - return lang($this->msg,$this->parms); - } - - function error($parms) - { - if ($parms == '') - { - return; - } - $etext = $parms['text']; - $parray = Array(); - for($counter=1;$counter<=10;$counter++) - { - $str = 'p_'.$counter; - if(isset($parms[$str]) && !empty($parms[$str])) - { - $parray[$counter] = $parms[$str]; - } - else - { - $str = 'p'.$counter; - if(isset($parms[$str]) && !empty($parms[$str])) - { - $parray[$counter] = $parms[$str]; - } - } - } - $fname = $parms['file']; - $line = $parms['line']; - if (preg_match('/([DIWEF])-([[:alnum:]]*)\, (.*)/i',$etext,$match)) - { - $this->severity = strtoupper($match[1]); - $this->code = $match[2]; - $this->msg = trim($match[3]); - } - else - { - $this->msg = trim($etext); - } - - @reset($parray); - while( list($key,$val) = each( $parray ) ) - { - $this->msg = preg_replace( "/%$key/", "'".$val."'", $this->msg ); - } - @reset($parray); - - $this->timestamp = time(); - $this->parms = $parray; - $this->ismsg = $parms['ismsg']; - $this->fname = $fname; - $this->line = $line; - $this->app = $GLOBALS['phpgw_info']['flags']['currentapp']; - - if (!$this->fname or !$this->line) - { - $GLOBALS['phpgw']->log->error(array( - 'text'=>'W-PGMERR, Programmer failed to pass __FILE__ and/or __LINE__ in next log message', - 'file'=>__FILE__,'line'=>__LINE__ - )); - } - - $GLOBALS['phpgw']->log->errorstack[] = $this; - if ($this->severity == 'F') - { - // This is it... Don't return - // do rollback! - // Hmmm this only works if UI!!!! - // What Do we do if it's a SOAP/XML? - echo "
"; - echo "

Fatal Error

"; - echo "

Error Stack

"; - echo $GLOBALS['phpgw']->log->astable(); - echo "
"; - // Commit stack to log - $GLOBALS['phpgw']->log->commit(); - $GLOBALS['phpgw']->common->phpgw_exit(True); - } - } - } diff --git a/phpgwapi/inc/class.errorlog.inc.php b/phpgwapi/inc/class.errorlog.inc.php deleted file mode 100644 index 6043f641a0..0000000000 --- a/phpgwapi/inc/class.errorlog.inc.php +++ /dev/null @@ -1,196 +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 errorlog - { - /***************************\ - * Instance Variables... * - \***************************/ - var $errorstack = array(); - var $public_functions = array( - 'message', - 'error', - 'iserror', - 'severity', - 'commit', - 'clearstack', - 'astable' - ); - var $log_table = 'egw_log'; - var $msg_table = 'egw_log_msg'; - - function message($parms) - { - $parms['ismsg']=1; - CreateObject('phpgwapi.error',$parms); - return true; - } - - function error($parms) - { - $parms['ismsg']=0; - CreateObject('phpgwapi.error',$parms); - return true; - } - - function write($parms) - { - $parms['ismsg']=0; - $save = $this->errorstack; - $this->errorstack = array(); - CreateObject('phpgwapi.error',$parms); - $this->commit(); - $this->errorstack = $save; - return true; - } - - function iserror($parms) - { - $ecode = $parms['code']; - foreach($this->errorstack as $err) - { - if ($ecode == $err->code) - { - return true; - } - } - return false; - } - - function severity() - { - $max = 'D'; - foreach($this->errorstack as $err) - { - switch($err->severity) - { - case 'F': - return 'F'; - break; - case 'E': - $max = 'E'; - break; - case 'W': - if ($max != 'E') - { - $max = 'W'; - } - break; - case 'I': - if ($max == 'D') - { - $max = 'I'; - } - break; - default: - break; - } - } - return $max; - } - - function commit() - { - $db = clone($GLOBALS['egw']->db); - - $db->insert($this->log_table,array( - 'log_date' => $GLOBALS['egw']->db->to_timestamp(time()), - 'log_user' => $GLOBALS['egw_info']['user']['account_id'], - 'log_app' => $GLOBALS['egw_info']['flags']['currentapp'], - 'log_severity' => $this->severity(), - ),false,__LINE__,__FILE__); - - $log_id = $db->get_last_insert_id($this->log_table,'log_id'); - - foreach($this->errorstack as $i => $err) - { - $db->insert($this->msg_table,array( - 'log_msg_log_id' => $log_id, - 'log_msg_seq_no' => $i, - 'log_msg_date' => $GLOBALS['egw']->db->to_timestamp($err->timestamp), - 'log_msg_severity' => $err->severity, - 'log_msg_code' => $err->code, - 'log_msg_msg' => $err->msg, - 'log_msg_parms' => implode('|',(array)$err->parms), - 'log_msg_file' => $err->fname, - 'log_msg_line' => $err->line, - ),false,__LINE__,__FILE__); - } - $this->errorstack = array(); - - return true; - } - - function clearstack() - { - $new = array(); - reset($this->errorstack); - for ($i = 0; $i < count($this->errorstack); $i++) - { - $err = $this->errorstack[$i]; - if ($err->ismsg) - { - $new[] = $err; - }; - } - unset ($this->errorstack); - $this->errorstack = $new; - return true; - } - - function astable() - { - $html = "
\n"; - $html .= "
".$col['value']."
\n"; - $html .= "\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\n"; - - $errorstack = $this->errorstack; - for ($i = 0; $i < count($errorstack); $i++) - { - $err = $errorstack[$i]; - switch ($err->severity) - { - case 'D': $color = 'D3DCFF'; break; - case 'I': $color = 'C0FFC0'; break; - case 'W': $color = 'FFFFC0'; break; - case 'E': $color = 'FFC0C0'; break; - case 'F': $color = 'FF0909'; break; - } - - $html .= "\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\t\n"; - $html .= "\t\n"; - } - $html .= "
NoDateAppSError CodeMsgFileLine
".$i."".$GLOBALS['egw']->common->show_date($err->timestamp)."".$err->app."  ".$err->severity."".$err->code."".$err->langmsg()."".$err->fname."".$err->line."
\n"; - $html .= "\n"; - - return $html; - } - } diff --git a/phpgwapi/inc/class.ldap.inc.php b/phpgwapi/inc/class.ldap.inc.php index 3dffd56820..b08d096abf 100644 --- a/phpgwapi/inc/class.ldap.inc.php +++ b/phpgwapi/inc/class.ldap.inc.php @@ -129,12 +129,6 @@ class ldap { if(!function_exists('ldap_connect')) { - /* log does not exist in setup(, yet) */ - if(isset($GLOBALS['egw']->log)) - { - $GLOBALS['egw']->log->message('F-Abort, LDAP support unavailable'); - $GLOBALS['egw']->log->commit(); - } if ($this->exception_on_error) throw new egw_exception_assertion_failed('LDAP support unavailable!'); printf('Error: LDAP support unavailable
',$host); @@ -196,12 +190,6 @@ class ldap // connect to ldap server (never fails, as connection happens in bind!) if(!$this->ds = ldap_connect($host, $port)) { - /* log does not exist in setup(, yet) */ - if(isset($GLOBALS['egw']->log)) - { - $GLOBALS['egw']->log->message('F-Abort, Failed connecting to LDAP server'); - $GLOBALS['egw']->log->commit(); - } return False; } @@ -220,7 +208,7 @@ class ldap $this->ldapServerInfo->host != $host) { //error_log("no ldap server info found"); - $ldapbind = @ldap_bind($this->ds, $GLOBALS['egw_info']['server']['ldap_root_dn'], $GLOBALS['egw_info']['server']['ldap_root_pw']); + @ldap_bind($this->ds, $GLOBALS['egw_info']['server']['ldap_root_dn'], $GLOBALS['egw_info']['server']['ldap_root_pw']); $this->ldapServerInfo = ldapserverinfo::get($this->ds, $host, $supportedLDAPVersion); $this->saveSessionData(); @@ -228,12 +216,6 @@ class ldap if(!@ldap_bind($this->ds, $dn, $passwd)) { - if(isset($GLOBALS['egw']->log)) - { - $GLOBALS['egw']->log->message('F-Abort, Failed binding to LDAP server'); - $GLOBALS['egw']->log->commit(); - } - return False; } diff --git a/phpgwapi/setup/setup.inc.php b/phpgwapi/setup/setup.inc.php index d64012a605..9a270c5993 100755 --- a/phpgwapi/setup/setup.inc.php +++ b/phpgwapi/setup/setup.inc.php @@ -34,8 +34,6 @@ $setup_info['phpgwapi']['tables'][] = 'egw_languages'; $setup_info['phpgwapi']['tables'][] = 'egw_lang'; $setup_info['phpgwapi']['tables'][] = 'egw_nextid'; $setup_info['phpgwapi']['tables'][] = 'egw_categories'; -$setup_info['phpgwapi']['tables'][] = 'egw_log'; -$setup_info['phpgwapi']['tables'][] = 'egw_log_msg'; $setup_info['phpgwapi']['tables'][] = 'egw_history_log'; $setup_info['phpgwapi']['tables'][] = 'egw_async'; $setup_info['phpgwapi']['tables'][] = 'egw_api_content_history'; diff --git a/phpgwapi/setup/tables_current.inc.php b/phpgwapi/setup/tables_current.inc.php index 130fde7aae..522be9b304 100644 --- a/phpgwapi/setup/tables_current.inc.php +++ b/phpgwapi/setup/tables_current.inc.php @@ -163,38 +163,6 @@ $phpgw_baseline = array( 'ix' => array(array('cat_appname','cat_owner','cat_parent','cat_level')), 'uc' => array() ), - 'egw_log' => array( - 'fd' => array( - 'log_id' => array('type' => 'auto','precision' => '4','nullable' => False), - 'log_date' => array('type' => 'timestamp','nullable' => False), - 'log_user' => array('type' => 'int','meta' => 'account','precision' => '4','nullable' => False), - 'log_app' => array('type' => 'varchar','precision' => '50','nullable' => False), - 'log_severity' => array('type' => 'char','precision' => '1','nullable' => False) - ), - 'pk' => array('log_id'), - 'fk' => array(), - 'ix' => array(), - 'uc' => array() - ), - 'egw_log_msg' => array( - 'fd' => array( - 'log_msg_log_id' => array('type' => 'int','precision' => '4','nullable' => False), - 'log_msg_seq_no' => array('type' => 'int','precision' => '4','nullable' => False), - 'log_msg_date' => array('type' => 'timestamp','nullable' => False), - 'log_msg_tx_fid' => array('type' => 'varchar','precision' => '4','nullable' => True), - 'log_msg_tx_id' => array('type' => 'varchar','precision' => '4','nullable' => True), - 'log_msg_severity' => array('type' => 'char','precision' => '1','nullable' => False), - 'log_msg_code' => array('type' => 'varchar','precision' => '30','nullable' => False), - 'log_msg_msg' => array('type' => 'text','nullable' => False), - 'log_msg_parms' => array('type' => 'text','nullable' => False), - 'log_msg_file' => array('type' => 'varchar','precision' => '255','nullable' => False), - 'log_msg_line' => array('type' => 'int','precision' => '4','nullable' => False) - ), - 'pk' => array('log_msg_log_id','log_msg_seq_no'), - 'fk' => array(), - 'ix' => array(), - 'uc' => array() - ), 'egw_history_log' => array( 'fd' => array( 'history_id' => array('type' => 'auto','precision' => '4','nullable' => False), diff --git a/phpgwapi/setup/tables_update_1_8.inc.php b/phpgwapi/setup/tables_update_1_8.inc.php index f5abcc6091..83a8208d24 100644 --- a/phpgwapi/setup/tables_update_1_8.inc.php +++ b/phpgwapi/setup/tables_update_1_8.inc.php @@ -590,5 +590,9 @@ function phpgwapi_upgrade1_9_021() } } + // drop not used egw_log and egw_log_msg tables + $GLOBALS['egw_setup']->oProc->DropTable('egw_log'); + $GLOBALS['egw_setup']->oProc->DropTable('egw_log_msg'); + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '14.1'; }