Changeset 414 for trunk/expressoAdmin1_2/inc/class.db_functions.inc.php
- Timestamp:
- 09/12/08 11:39:24 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/inc/class.db_functions.inc.php
r180 r414 106 106 { 107 107 $return['status'] = false; 108 $re turn['msg'] = "Problemas executando a query accounts no Banco de Dados.";108 $result['msg'] = $this->functions->lang('Problems running query on DB') . '.'; 109 109 $db->disconnect(); 110 110 return $return; … … 120 120 { 121 121 $return['status'] = false; 122 $re turn['msg'] = "Problemas executando a query groups no Banco de Dados.";122 $result['msg'] = $this->functions->lang('Problems running query on DB') . '.'; 123 123 $db->disconnect(); 124 124 return $return; … … 142 142 { 143 143 $return['status'] = false; 144 $re turn['msg'] = "Problemas executando a query update id no Banco de Dados.";144 $result['msg'] = $this->functions->lang('Problems running query on DB') . '.'; 145 145 } 146 146 $db->disconnect(); … … 148 148 } 149 149 150 /*151 function increment_id($id, $type)152 {153 $current_config = $_SESSION['phpgw_info']['expresso']['expressoAdmin'];154 if ($current_config['expressoAdmin_nextid_db_host'] != '')155 {156 $this->db->disconnect();157 $host = $current_config['expressoAdmin_nextid_db_host'];158 $port = $current_config['expressoAdmin_nextid_db_port'];159 $name = $current_config['expressoAdmin_nextid_db_name'];160 $user = $current_config['expressoAdmin_nextid_db_user'];161 $pass = $current_config['expressoAdmin_nextid_db_pass'];162 163 $db = new db();164 $db->Halt_On_Error = 'no';165 $db->connect($name, $host, $port, $user, $pass, 'pgsql');166 }167 else168 {169 $db = $this->db;170 }171 172 $sql = "UPDATE phpgw_nextid set id = '".$id."' WHERE appname = '" . $type . "'";173 if (!$db->query($sql))174 {175 $db->disconnect();176 return 'Erro em increment_id:' . pg_last_error();177 }178 else179 {180 $db->disconnect();181 return true;182 }183 }184 */185 186 150 function add_user2group($gidnumber, $uidnumber) 187 151 { … … 190 154 { 191 155 $result['status'] = false; 192 $result['msg'] = 'Erro em add_user2group:' . pg_last_error();156 $result['msg'] = $this->functions->lang('Error on function') . " db_functions->add_user2group.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 193 157 return $result; 194 158 } … … 203 167 { 204 168 $result['status'] = false; 205 $result['msg'] = 'Erro em add_user2group:' . pg_last_error();169 $result['msg'] = $this->functions->lang('Error on function') . " db_functions->add_user2group.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 206 170 return $result; 207 171 } … … 217 181 { 218 182 $result['status'] = false; 219 $result['msg'] = 'Erro em add_user2group:' . pg_last_error();183 $result['msg'] = $this->functions->lang('Error on function') . " db_functions->remove_user2group.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 220 184 return $result; 221 185 } … … 229 193 { 230 194 $result['status'] = false; 231 $result['msg'] = 'Erro em add_user2group:' . pg_last_error();195 $result['msg'] = $this->functions->lang('Error on function') . " db_functions->remove_user2group.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 232 196 return $result; 233 197 } … … 243 207 { 244 208 $result['status'] = false; 245 $result['msg'] = 'Erro em add_pref_changepassword:' . pg_last_error();209 $result['msg'] = $this->functions->lang('Error on function') . " db_functions->add_pref_changepassword.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 246 210 return $result; 247 211 } … … 256 220 { 257 221 $result['status'] = false; 258 $result['msg'] = 'Erro em add_pref_changepassword:' . pg_last_error();222 $result['msg'] = $this->functions->lang('Error on function') . " db_functions->add_pref_changepassword.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 259 223 return $result; 260 224 } … … 270 234 { 271 235 $result['status'] = false; 272 $result['msg'] = 'Erro em add_pref_changepassword:' . pg_last_error();236 $result['msg'] = $this->functions->lang('Error on function') . " db_functions->remove_pref_changepassword.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 273 237 return $result; 274 238 } … … 282 246 { 283 247 $result['status'] = false; 284 $result['msg'] = 'Erro em remove_pref_changepassword:' . pg_last_error();248 $result['msg'] = $this->functions->lang('Error on function') . " db_functions->remove_pref_changepassword.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 285 249 return $result; 286 250 } … … 301 265 { 302 266 $result['status'] = false; 303 $result['msg'] = 'Erro em add_id2apps: ' . pg_last_error();267 $result['msg'] = $this->functions->lang('Error on function') . " db_functions->add_id2apps.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 304 268 return $result; 305 269 } … … 316 280 { 317 281 $result['status'] = false; 318 $result['msg'] = 'Erro em add_id2apps: ' . pg_last_error();282 $result['msg'] = $this->functions->lang('Error on function') . " db_functions->add_id2apps.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 319 283 return $result; 320 284 } 321 285 else 322 286 { 323 $this->write_log("Ad icionado aplicativo $app ao id",$id,'','','');287 $this->write_log("Added application","$id:$app"); 324 288 } 325 289 } … … 341 305 { 342 306 $result['status'] = false; 343 $result['msg'] = 'Erro em remove_id2apps:' . pg_last_error();307 $result['msg'] = $this->functions->lang('Error on function') . " db_functions->remove_id2apps.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 344 308 return $result; 345 309 } … … 353 317 { 354 318 $result['status'] = false; 355 $result['msg'] = 'Erro em remove_id2apps:' . pg_last_error();319 $result['msg'] = $this->functions->lang('Error on function') . " db_functions->remove_id2apps.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 356 320 return $result; 357 321 } 358 322 else 359 323 { 360 $this->write_log("Remov ido aplicativo $app do id",$id,'','','');324 $this->write_log("Removed application from id","$id: $app"); 361 325 } 362 326 } … … 467 431 { 468 432 $result['status'] = false; 469 $result['msg'] = 'Erro em set_user_password: ' . pg_last_error();433 $result['msg'] = $this->functions->lang('Error on function') . " db_functions->set_user_password.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 470 434 return $result; 471 435 } … … 578 542 } 579 543 580 function write_log($action, $ groupinfo='', $userinfo='', $appinfo='', $msg_log='')581 { 582 $sql = "INSERT INTO phpgw_expressoadmin_log (date, manager, action, groupinfo, userinfo, appinfo, msg) "583 . "VALUES('now','" . $_SESSION['phpgw_info']['expresso']['user']['account_lid'] . "','" . strtolower($action) . "','" . strtolower($ groupinfo) . "','" . strtolower($userinfo) . "','" . strtolower($appinfo) . "','" .strtolower($msg_log) . "')";544 function write_log($action, $about) 545 { 546 $sql = "INSERT INTO phpgw_expressoadmin_log (date, manager, action, userinfo) " 547 . "VALUES('now','" . $_SESSION['phpgw_info']['expresso']['user']['account_lid'] . "','" . strtolower($action) . "','" . strtolower($about) . "')"; 584 548 $this->db->query($sql); 585 549 return;
Note: See TracChangeset
for help on using the changeset viewer.