From: <mi...@us...> - 2007-02-27 15:53:18
|
Author: mipmip Date: Tue Feb 27 16:45:57 2007 New Revision: 23462 URL: http://www.egroupware.org/viewvc?rev=3D3D23462&view=3D3Drev Log: remove addslashes as this is now done by egw_db make all arrayelements valid php Modified: trunk/jinn/inc/class.bouser.inc.php Modified: trunk/jinn/inc/class.bouser.inc.php URL: http://www.egroupware.org/viewvc/trunk/jinn/inc/class.bouser.inc.php?r= =3D ev=3D3D23462&r1=3D3D23461&r2=3D3D23462&view=3D3Ddiff =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D --- trunk/jinn/inc/class.bouser.inc.php (original) +++ trunk/jinn/inc/class.bouser.inc.php Tue Feb 27 16:45:57 2007 @@ -92,10 +92,10 @@ $this->object_events_plugin_manager->local_bo =3D3D &$this; //FIXME rem= ove =3D //backwards compatibility: check if unique id field is filled. If not: = =3D fill it now. - if($this->session['site_object_id'] && $this->site_object[unique_id] = =3D =3D3D=3D3D '') + if($this->session['site_object_id'] && $this->site_object['unique_id'] = =3D =3D3D=3D3D '') { $status =3D3D $this->so->set_unique_id($this->session['site_object_id']= ); - $this->site_object[unique_id] =3D3D $status[uid]; + $this->site_object['unique_id'] =3D3D $status['uid']; } =3D // if user changes site: @@ -134,7 +134,7 @@ { $field_conf_arr=3D3D$this->so->get_field_values($objectID,$fieldname); =3D - if($field_conf_arr[field_enabled]!=3D3Dnull && $field_conf_arr[field_en= ab=3D led]=3D3D=3D3D0) + if($field_conf_arr['field_enabled']!=3D3Dnull && $field_conf_arr['field= _e=3D nabled']=3D3D=3D3D0) { return false; } @@ -437,14 +437,14 @@ $post_arr=3D3D$this->mult_to_fld($i,'_POST'); $files_arr=3D3D$this->mult_to_fld($i,'_FILES'); =3D - $data=3D3D$this->remove_helper_fields($this->http_vars_pairs($post_a= rr=3D ,$files_arr,$object_arr[object_id])); - $status=3D3D$this->so->insert_object_data($this->session['site_id'],= $o=3D bject_arr[table_name],$data); - - $status_mult_where[]=3D3D$status[where_string]; + $data=3D3D$this->remove_helper_fields($this->http_vars_pairs($post_a= rr=3D ,$files_arr,$object_arr['object_id'])); + $status=3D3D$this->so->insert_object_data($this->session['site_id'],= $o=3D bject_arr['table_name'],$data); + + $status_mult_where[]=3D3D$status['where_string']; =3D $m2m_data=3D3D$this->http_vars_pairs_m2m($post_arr); $m2m_data['FLDXXX'.$status['idfield']]=3D3D$status['id']; - $status[relations]=3D3D$this->so->update_object_many_data($object_ar= r[=3D 'parent_site_id'], $m2m_data); + $status['relations']=3D3D$this->so->update_object_many_data($object_= ar=3D r['parent_site_id'], $m2m_data); } } $status['mult_where_array']=3D3D$status_mult_where; @@ -488,7 +488,7 @@ $post_arr=3D3D$this->mult_to_fld($i,'_POST'); $files_arr=3D3D$this->mult_to_fld($i,'_FILES'); =3D - $data =3D3D $this->remove_helper_fields($this->http_vars_pairs($post= _a=3D rr,$files_arr,$object_arr[object_id])); + $data =3D3D $this->remove_helper_fields($this->http_vars_pairs($post= _a=3D rr,$files_arr,$object_arr['object_id'])); $where_string=3D3Dbase64_decode($_POST['MLTWHR'.sprintf("%02d",$i)]); // $this->session['mult_where_array'][]=3D3D$where_string; $status['mult_where_array'][]=3D3D$where_string; @@ -497,9 +497,9 @@ =3D $status[m2m]=3D3D$this->so->update_object_many_data($this->session['= si=3D te_id'], $m2m_data); =3D - $status[record]=3D3D$this->so->update_object_data($object_arr['paren= t_=3D site_id'], $object_arr[table_name], $data, $where_key,$where_value,$where_s= =3D tring); - - $status[eventstatus] =3D3D $this->run_event_plugins('on_update', $po= st=3D _arr); + $status['record']=3D3D$this->so->update_object_data($object_arr['par= en=3D t_site_id'], $object_arr['table_name'], $data, $where_key,$where_value,$whe= =3D re_string); + + $status['eventstatus'] =3D3D $this->run_event_plugins('on_update', $= po=3D st_arr); } } =3D @@ -526,7 +526,7 @@ =3D if($redirect) { - if ($status[error]) + if ($status['error']) { $this->addError(lang('Records NOT succesfully deleted.')); } @@ -597,7 +597,7 @@ { if($event =3D3D=3D3D $config['conf']['event']) { - /*run_event_plugins roept uit de event_plugin de functie event_actio= =3D n_[plg_naam]() aan =3D + /*run_event_plugins roept uit de event_plugin de functie event_actio= =3D n_['plg_naam']() aan =3D met als argumenten de _POST array en de plugin configuratie. =3D Deze functie geeft alleen een status terug dus geen waarde om weer v= =3D erder te gebruiken. =3D De functie gebruikt de config_data en de post_data om iets speciaals= =3D te doen.*/ @@ -646,14 +646,14 @@ */ function del_record() =3D { - $table=3D3D$this->site_object[table_name]; + $table=3D3D$this->site_object['table_name']; $where_key=3D3Dstripslashes($this->where_key); $where_value=3D3Dstripslashes($this->where_value); $where_string=3D3Dstripslashes($this->where_string); =3D $status=3D3D$this->so->delete_object_data($this->session['site_id'], $t= ab=3D le, $where_key,$where_value,$where_string); =3D - if ($status[error]) + if ($status['error']) { $this->addError(lang('Record NOT succesfully deleted')); } @@ -661,7 +661,7 @@ { $this->addInfo(lang('Record succesfully deleted')); } - $this->addDebug(__LINE__,__FILE__,$status[sql]); + $this->addDebug(__LINE__,__FILE__,$status['sql']); =3D $this->exit_and_open_screen($this->japielink.'jinn.uiuser.index'); } @@ -679,8 +679,8 @@ $autokey=3D3D $this->so->check_auto_incr($this->session['site_id'],$thi= s-=3D >site_object['table_name']); if($autokey) { - $status=3D3D$this->so->copy_record($this->session['site_id'],$this->= si=3D te_object[table_name],$this->where_string,$autokey); - if ($status[ret_code]) + $status=3D3D$this->so->copy_record($this->session['site_id'],$this->= si=3D te_object['table_name'],$this->where_string,$autokey); + if ($status['ret_code']) { $this->addError(lang('Record NOT succesfully copied')); } @@ -688,12 +688,12 @@ { $this->addInfo(lang('Record succesfully copied')); } - $this->addDebug(__LINE__,__FILE__,$status[sql]); - - if($status[where_string]) + $this->addDebug(__LINE__,__FILE__,$status['sql']); + + if($status['where_string']) { $this->exit_and_open_screen($this->japielink.'jinn.uiu_list_records.= =3D display_last_records_page'); - #$this->exit_and_open_screen('jinn.uiu_edit_record.edit_record&where= =3D _string=3D3D'.base64_encode($status[where_string])); + #$this->exit_and_open_screen('jinn.uiu_edit_record.edit_record&where= =3D _string=3D3D'.base64_encode($status['where_string'])); } } else @@ -744,7 +744,7 @@ { foreach(array_values($relation_array) as $key =3D3D> $relation) { - $relation[name] =3D3D 'relation_'.($key+1); + $relation['name'] =3D3D 'relation_'.($key+1); $columns_arr[] =3D3D $relation; } } @@ -766,7 +766,7 @@ { foreach($relations_arr as $relation) { - if ($relation[type]=3D3D=3D3D'4') + if ($relation['type']=3D3D=3D3D'4') { $m2o_relations[]=3D3D$relation; } @@ -790,9 +790,9 @@ { foreach($relations_arr as $relation) { - if ($relation[type]=3D3D=3D3D'3') - { - $O2O_relations[$relation[org_field]]=3D3D$relation; + if ($relation['type']=3D3D=3D3D'3') + { + $O2O_relations[$relation['org_field']]=3D3D$relation; } } return $O2O_relations; @@ -837,9 +837,9 @@ { foreach($relations_arr as $relation) { - if ($relation[type]=3D3D=3D3D'1') - { - $O2M_relations[$relation[local_key]]=3D3D$relation; + if ($relation['type']=3D3D=3D3D'1') + { + $O2M_relations[$relation['local_key']]=3D3D$relation; } } return $O2M_relations; @@ -866,7 +866,7 @@ { foreach($relations_arr as $relation) { - if ($relation[type]=3D3D=3D3D'2') + if ($relation['type']=3D3D=3D3D'2') { $M2M_relations[]=3D3D$relation; } @@ -888,9 +888,9 @@ */ function get_related_field($relation_array) { - $displ_arr=3D3Dunserialize($relation_array[foreign_showfields]); =3D - - $allrecords=3D3D$this->get_records($relation_array[foreign_table],'',''= ,'=3D ','','name'); + $displ_arr=3D3Dunserialize($relation_array['foreign_showfields']); =3D + + $allrecords=3D3D$this->get_records($relation_array['foreign_table'],'',= ''=3D ,'','','name'); =3D if(is_array($allrecords)) { @@ -907,7 +907,7 @@ } $related_fields[]=3D3Darray ( - 'value'=3D3D>$record[$relation_array[foreign_key]], + 'value'=3D3D>$record[$relation_array['foreign_key']], 'name'=3D3D>$displaystring ); } @@ -928,9 +928,9 @@ */ function get_related_value($relation_array,$value) { - $displ_arr=3D3Dunserialize($relation_array[foreign_showfields]); =3D - $table=3D3D$relation_array[foreign_table]; - $related_field=3D3D$relation_array[foreign_key]; + $displ_arr=3D3Dunserialize($relation_array['foreign_showfields']); =3D + $table=3D3D$relation_array['foreign_table']; + $related_field=3D3D$relation_array['foreign_key']; =3D $allrecords=3D3D$this->get_records($table,'','','','','name'); =3D @@ -981,7 +981,7 @@ $data[] =3D3D array ( 'name' =3D3D> substr($key,$prefix_len), - 'value' =3D3D> $filtered_data //addslashes($val) + 'value' =3D3D> $filtered_data =3D ); } else // if there's no plugin, just save the vals @@ -989,7 +989,7 @@ $data[] =3D3D array ( 'name' =3D3D> substr($key,$prefix_len), - 'value' =3D3D> addslashes($val) =3D + 'value' =3D3D> $val =3D ); } } @@ -1031,8 +1031,8 @@ =3D $data =3D3D array ( - 'name' =3D3D> $_o2o_info[foreign_key], - 'value' =3D3D> $primary_val //addslashes($val) + 'name' =3D3D> $_o2o_info['foreign_key'], + 'value' =3D3D> $primary_val =3D ); =3D $o2o_data_arr[$idx]['data'][]=3D3D$data; @@ -1040,7 +1040,7 @@ elseif(substr($key,0,3)=3D3D=3D3D'O2O') { =3D - $field_values=3D3D$this->so->get_field_values($curr_object_arr[objec= t_=3D id],substr($key,6)); + $field_values=3D3D$this->so->get_field_values($curr_object_arr['obje= ct=3D _id'],substr($key,6)); $filtered_data=3D3D$this->plug->call_plugin_sf($key,$field_values,$H= TT=3D P_POST_VARS,$HTTP_POST_FILES); =3D /* Check for plugin need and plugin availability */ @@ -1050,7 +1050,7 @@ $data =3D3D array ( 'name' =3D3D> substr($key,6), - 'value' =3D3D> $filtered_data //addslashes($val) + 'value' =3D3D> $filtered_data =3D ); } else // if there's no plugin, just save the vals @@ -1058,7 +1058,7 @@ $data =3D3D array ( 'name' =3D3D> substr($key,6), - 'value' =3D3D> addslashes($val) =3D + 'value' =3D3D> $val =3D ); } $idx=3D3Dintval(substr($key,4,2)); @@ -1101,12 +1101,12 @@ */ function save_object_config() { - $prefs_order_new=3D3D$GLOBALS[HTTP_POST_VARS][ORDER]; - $prefs_show_hide_read=3D3D$this->read_preferences('show_fields'.$this->= si=3D te_object[unique_id]); - - $show_fields_entry=3D3D$this->site_object[object_id]; - - while(list($key, $x) =3D3D each($GLOBALS[HTTP_POST_VARS])) + $prefs_order_new=3D3D$GLOBALS['HTTP_POST_VARS']['ORDER']; + $prefs_show_hide_read=3D3D$this->read_preferences('show_fields'.$this->= si=3D te_object['unique_id']); + + $show_fields_entry=3D3D$this->site_object['object_id']; + + while(list($key, $x) =3D3D each($GLOBALS['HTTP_POST_VARS'])) { if(substr($key,0,4)=3D3D=3D3D'SHOW') $show_fields_entry.=3D3D','.substr($key,4); @@ -1120,7 +1120,7 @@ { =3D $pref_array=3D3Dexplode(',',$pref_s_h); - if($pref_array[0]!=3D3D$this->site_object[object_id]) + if($pref_array[0]!=3D3D$this->site_object['object_id']) { $prefs_show_hide_new.=3D3Dimplode(',',$pref_array); } @@ -1134,8 +1134,8 @@ $prefs_show_hide_new=3D3D$show_fields_entry; } =3D - $this->save_preferences('show_fields'.$this->site_object[unique_id],$pr= =3D efs_show_hide_new); - $this->save_preferences('default_order'.$this->site_object[unique_id],$= =3D prefs_order_new); + $this->save_preferences('show_fields'.$this->site_object['unique_id'],$= =3D prefs_show_hide_new); + $this->save_preferences('default_order'.$this->site_object['unique_id']= =3D ,$prefs_order_new); //the browse settings overrule the preferences, so kill them. Otherwise= =3D we will not see any results until we chamge the Object and return unset($this->session['browse_settings']['orderby']); $this->sessionmanager->save(); @@ -1152,7 +1152,7 @@ */ function set_adv_filter() { - $this->session['browse_settings'][adv_filter_str]=3D3D$_POST[adv_filter= ];=3D =3D + $this->session['browse_settings']['adv_filter_str']=3D3D$_POST['adv_fil= te=3D r']; =3D $this->sessionmanager->save(); $this->exit_and_open_screen('jinn.uiu_list_records.display'); } @@ -1166,9 +1166,9 @@ function scan_new_objects_silent() { $status =3D3D array(); - if($this->site[object_scan_prefix] !=3D3D '') - { - $prefix_arr =3D3D explode(',', $this->site[object_scan_prefix]); + if($this->site['object_scan_prefix'] !=3D3D '') + { + $prefix_arr =3D3D explode(',', $this->site['object_scan_prefix']); if(is_array($prefix_arr)) { =3D @@ -1177,23 +1177,23 @@ foreach($tables as $table) { //is this table wrapped by an object? - $objects =3D3D $this->so->get_objects_by_table($table[table_name], $= th=3D is->session['site_id']); + $objects =3D3D $this->so->get_objects_by_table($table['table_name'],= $=3D this->session['site_id']); if(count($objects) =3D3D=3D3D 0) { //if no, do we want ALL tables wrapped by an object? if($prefix_arr[0] =3D3D=3D3D '*') { //if yes, create an object from this table - $status[] =3D3D $this->save_scanned_object($this->session['site_i= d'=3D ], $table[table_name]); + $status[] =3D3D $this->save_scanned_object($this->session['site_i= d'=3D ], $table['table_name']); } //or does the table name start with one of the prefixes? else { foreach($prefix_arr as $prefix) { - if(substr($table[table_name], 0, strlen($prefix)) =3D3D=3D3D $pre= fix) + if(substr($table['table_name'], 0, strlen($prefix)) =3D3D=3D3D $p= refi=3D x) { - $status[] =3D3D $this->save_scanned_object($this->session['site_i= d'=3D ], $table[table_name]); + $status[] =3D3D $this->save_scanned_object($this->session['site_i= d'=3D ], $table['table_name']); } } } @@ -1218,7 +1218,7 @@ $this->addInfo(lang('%1 new objects where successfully created', cou= =3D nt($status))); foreach($status as $new) { - if($new[ret_code] !=3D3D 0) + if($new['ret_code'] !=3D3D 0) { $this->addError(lang('Error creating one or more new Objects')); $this->addInfo(lang('%1 new objects where successfully created', cou= =3D nt($status))); @@ -1257,14 +1257,14 @@ */ function submit_to_plugin_afa() { - if($this->site_object[plugins]) + if($this->site_object['plugins']) { $this->get_plugin_afa(); } else =3D { //die('hallo'); - $field_values=3D3D$this->so->get_field_values($this->site_object[obj= ec=3D t_id],$_GET[field_name]); + $field_values=3D3D$this->so->get_field_values($this->site_object['ob= je=3D ct_id'],$_GET['field_name']); $this->plug->call_plugin_afa($field_values); } } @@ -1280,7 +1280,7 @@ global $local_bo; $local_bo=3D3D$this; =3D - $action_plugin_name=3D3D$_GET[plg]; + $action_plugin_name=3D3D$_GET['plg']; =3D $plugins=3D3Dexplode('|',str_replace('~','=3D3D',$this->site_object['pl= ugin=3D s'])); foreach($plugins as $plugin) @@ -1308,19 +1308,19 @@ if($call_plugin) { //FIXME all plugins must get an extra argument in the sf_func - $success=3D3D@call_user_func('plg_afa_'.$sets[1],$_GET[where],$_GET[= at=3D tributes],$conf_arr); + $success=3D3D@call_user_func('plg_afa_'.$sets[1],$_GET['where'],$_GE= T[=3D 'attributes'],$conf_arr); } =3D if ($succes) { - $this->session['message'][info]=3D3Dlang('Action was succesful.'); + $this->session['message']['info']=3D3Dlang('Action was succesful.'); =3D $this->sessionmanager->save(); $this->common->exit_and_open_screen('jinn.uiuser.index'); } else { - $this->session['message'][error]=3D3Dlang('Action was not succesful.= U=3D nknown error'); + $this->session['message']['error']=3D3Dlang('Action was not succesfu= l=2E=3D Unknown error'); =3D $this->sessionmanager->save(); $this->common->exit_and_open_screen('jinn.uiuser.index'); @@ -1339,13 +1339,13 @@ foreach ( $fields as $onecol ) { // check for primaries and create array =3D - if ($onecol[primary_key] && $onecol[type]!=3D3D'blob') // FIXME howt= o =3D select long blobs + if ($onecol['primary_key'] && $onecol['type']!=3D3D'blob') // FIXME = ho=3D wto select long blobs { =3D - $pkey_arr[]=3D3D$onecol[name]; - } - elseif($onecol[type]!=3D3D'blob') // FIXME howto select long blobs - { - $akey_arr[]=3D3D$onecol[name]; + $pkey_arr[]=3D3D$onecol['name']; + } + elseif($onecol['type']!=3D3D'blob') // FIXME howto select long blobs + { + $akey_arr[]=3D3D$onecol['name']; } } if(!is_array($pkey_arr)) |