source: trunk/jabberit_messenger/inc/class.db_im.inc.php @ 896

Revision 896, 19.9 KB checked in by alexandrecorreia, 15 years ago (diff)
  • Property svn:executable set to *
Line 
1<?php
2  /***************************************************************************\
3  *  Expresso - Expresso Messenger                                            *
4  *     - Alexandre Correia / Rodrigo Souza                                                               *
5  *     - JETI - http://jeti-im.org/                                                                              *
6  * ------------------------------------------------------------------------- *
7  *  This program is free software; you can redistribute it and/or modify it  *
8  *  under the terms of the GNU General Public License as published by the    *
9  *  Free Software Foundation; either version 2 of the License, or (at your   *
10  *  option) any later version.                                               *
11  \***************************************************************************/
12
13define('PHPGW_INCLUDE_ROOT','../');     
14define('PHPGW_API_INC','../phpgwapi/inc');
15require_once(PHPGW_API_INC . '/class.db.inc.php');
16       
17class db_im
18{       
19        private $db;
20        private $db_name;
21        private $db_host;
22        private $db_port;
23        private $db_user;
24        private $db_pass;
25        private $db_type;
26        private $user_id;
27       
28        public final function __construct()
29        {
30                $this->db_name = $_SESSION['phpgw_info']['jabberit_messenger']['server']['db_name'];
31                $this->db_host = $_SESSION['phpgw_info']['jabberit_messenger']['server']['db_host'];
32                $this->db_port = $_SESSION['phpgw_info']['jabberit_messenger']['server']['db_port'];
33                $this->db_user = $_SESSION['phpgw_info']['jabberit_messenger']['server']['db_user'];
34                $this->db_pass = $_SESSION['phpgw_info']['jabberit_messenger']['server']['db_pass'];
35                $this->db_type = $_SESSION['phpgw_info']['jabberit_messenger']['server']['db_type'];
36                $this->user_id = $_SESSION['phpgw_info']['jabberit_messenger']['user_id'];
37                $this->connectDB();
38        }
39
40        private final function connectDB()
41        {
42                $this->db = new db();
43                $this->db_name = ( !$this->db_name ) ? $_SESSION['phpgwinfo']['db_name'] : $this->db_name;
44                $this->db_host = ( !$this->db_host ) ? $_SESSION['phpgwinfo']['db_host'] : $this->db_host;
45                $this->db_port = ( !$this->db_port ) ? $_SESSION['phpgwinfo']['db_port'] : $this->db_port;
46                $this->db_user = ( !$this->db_user ) ? $_SESSION['phpgwinfo']['db_user'] : $this->db_user;
47                $this->db_pass = ( !$this->db_pass ) ? $_SESSION['phpgwinfo']['db_pass'] : $this->db_pass;
48                $this->db_type = ( !$this->db_type ) ? $_SESSION['phpgwinfo']['db_type'] : $this->db_type;
49               
50                $this->db->connect($this->db_name,$this->db_host,$this->db_port,$this->db_user,$this->db_pass,$this->db_type);         
51        }       
52
53        public final function getApplicationsEnabled()
54        {
55               
56                $this->db->query("SELECT * FROM phpgw_config WHERE config_app = 'phpgwapi' and config_name ='apps_jabberit'");
57                if($this->db->num_rows())
58                {
59                        $tmp = "";
60                        while($this->db->next_record())
61                        {
62                                $tmp[]= $this->db->row();
63                        }
64                        return $tmp[0]['config_value'];
65                }
66                return false;
67        }
68       
69        public final function getApplicationsList()
70        {
71                $this->db->query("SELECT * FROM phpgw_applications WHERE app_enabled = '1' order by app_name");
72                if($this->db->num_rows())
73                {
74                        while ($this->db->next_record())
75                        {
76                                $app = $this->db->f('app_name');
77                                $title = @$GLOBALS['phpgw_info']['apps'][$app]['title'];
78                                if (empty($title))
79                                {
80                                        $title = lang($app) == $app.'*' ? $app : lang($app);
81                                }
82                                $apps[$app] = array(
83                                        'title'  => $title,
84                                        'name'   => $app,
85                                        'status' => $this->db->f('app_enabled')
86                                );
87                        }
88                }
89                return $apps;
90        }
91
92        public final function get_accounts_acl()
93        {
94                $query  = "select acl_account from phpgw_acl where acl_location in (select acl_account from phpgw_acl where acl_appname = 'jabberit_messenger') ";
95                $query .= "union select acl_account from phpgw_acl where acl_appname = 'jabberit_messenger'";
96               
97                if( $this->db->query($query) ) 
98                {
99                        $users = array();
100                        $new_users = array();
101                        while($this->db->next_record())
102                                $users[] = $this->db->row();
103
104                        if(is_array($users))
105                                foreach($users as $tmp)
106                                        $new_users[] = $tmp['acl_account'];
107                       
108                        return $new_users;
109                }
110               
111                return false;
112        }
113       
114        public final function getGroupsBlocked()
115        {
116                $return = "";
117               
118                if( $this->db )
119                {
120                        $query = "SELECT * FROM phpgw_config WHERE config_app = 'phpgwapi' AND config_name = 'groups_locked_jabberit';";       
121                       
122                        if($this->db->query($query))
123                        {
124
125                                if ( $this->db->query($query) )
126                                {       
127                                        while($this->db->next_record())
128                                                $result[] = $this->db->row();
129                                }
130                               
131                                if( count($result) > 0 )
132                                        $return = $result[0]['config_value'];
133                        }
134                }
135               
136                return $return;
137        }
138       
139        public final function getHostsJabber()
140        {
141                $return = "";
142       
143                if( $this->db )
144                {
145                        $query = "SELECT * FROM phpgw_config WHERE config_app = 'phpgwapi' AND config_name = 'map_org_realm_jabberit';";
146                       
147                        if($this->db->query($query))
148                        {
149                                while($this->db->next_record())
150                                        $result[] = $this->db->row();                           
151                        }
152
153                        if( count($result) > 0 )
154                                $return = $result[0]['config_value'];
155                }
156               
157                return $return;
158        }
159       
160        public final function getPreferences()
161        {
162                $result = array();
163                $query = "select * from phpgw_preferences where preference_owner = '".$this->user_id."' and preference_app = 'jabberit_messenger'";
164               
165                if ( $this->db->query($query) )
166                {       
167                        while($this->db->next_record())
168                                $result[] = $this->db->row();
169       
170                        if(count($result) > 0)
171                                return unserialize($result[0]['preference_value']);
172                }
173
174                return "openWindowJabberit:true;openWindowJabberitPopUp:false;flagAwayIM:5";
175        }
176
177        public final function setPreferences($pParam)
178        {
179                $preferences = $pParam['preferences1'];
180               
181                if(isset($pParam['preferences2']))
182                        $preferences .= ";". $pParam['preferences2'];
183               
184                if(isset($pParam['preferences3']))
185                        $preferences .= ";". $pParam['preferences3'];
186               
187                $user_id  = $this->user_id;
188               
189                $query = "insert into phpgw_preferences values('".$user_id."','jabberit_messenger','".serialize($preferences)."')";
190                               
191                if($this->db->query($query))
192                {
193                        return "true";
194                }
195                else
196                {
197                        $query = "update phpgw_preferences set preference_value = '".serialize($preferences)."' where preference_app='jabberit_messenger' and preference_owner='".$user_id."'";
198
199                        if($this->db->query($query))
200                                return "true";
201                        else
202                                return "false";                 
203                }               
204        }
205       
206        public final function setApplications($pApplications)
207        {
208                $apps = serialize($pApplications);
209               
210                if( $this->db )
211                {
212                        $query = "SELECT * FROM phpgw_config WHERE config_app = 'phpgwapi' and config_name ='apps_jabberit'";
213                               
214                        $this->db->query($query);
215                                       
216                        if(!$this->db->next_record())
217                        {
218                                $query = "INSERT INTO phpgw_config(config_app,config_name,config_value) VALUES('phpgwapi','apps_jabberit','".$apps."')";
219                                $this->db->query($query);
220                                return true;
221                        }
222                        else
223                        {
224                                $query = "UPDATE phpgw_config SET config_value = '".$apps."' WHERE config_app = 'phpgwapi' AND config_name = 'apps_jabberit'";
225                                $this->db->query($query);
226                                return true;
227                        }
228                }
229                return false;   
230        }
231       
232        public final function setAttributesLdap($pAttributes)
233        {
234                $values = $pAttributes['conf'];
235                $attributesOrg = "";           
236
237                if( $this->db )
238                {
239                        $query = "SELECT * from phpgw_config WHERE config_app = 'phpgwapi' and config_name = 'attributes_org_ldap_jabberit'";
240
241                        if ( $this->db->query($query) )
242                        {       
243                                while($this->db->next_record())
244                                        $result[] = $this->db->row();
245               
246                                if(count($result) > 0)
247                                        $attributesOrg = $result[0]['config_value'];
248                        }
249
250                        if( trim($attributesOrg) == "" )
251                        {
252                                $query = "INSERT INTO phpgw_config(config_app,config_name,config_value) VALUES('phpgwapi','attributes_org_ldap_jabberit','".$values."')";
253                                $this->db->query($query);
254                               
255                                $attr = explode(";", $values);
256                                $values = "<return><ou attr='".$attr[1]."'>".$attr[0]."</ou></return>";
257                                return $values;
258                        }
259                        else
260                        {
261                                $org = explode(",", $attributesOrg);
262                                $newValue = explode(";", $values);
263                               
264                                foreach( $org as $tmp )
265                                {
266                                        $attr = explode(";",$tmp);
267                                        if( strtolower(trim($attr[0])) == strtolower(trim($newValue[0])) )
268                                                return false;
269                                }
270
271                                $values = $values . "," . $attributesOrg;
272                                $query = "UPDATE phpgw_config SET config_value = '".$values."' WHERE config_app = 'phpgwapi' AND config_name = 'attributes_org_ldap_jabberit'";
273                                $this->db->query($query);
274
275                                $return = explode(",",$values);
276                                natcasesort($return);
277
278                                $values = "<return>";
279                               
280                                foreach($return as $tmp)
281                                {
282                                        $attr = explode(";", $tmp);
283                                        $values .= "<ou attr='" . $attr[1] . "'>" . $attr[0] . "</ou>";
284                                }
285                                       
286                                $values .= "</return>";
287                               
288                                return $values;                         
289                        }
290                }
291                return false;
292        }
293
294        public final function setGroupsLocked($pGroups)
295        {
296                $groups = "";
297               
298                if( is_array($pGroups) )
299                {
300                        foreach($pGroups as $tmp)               
301                                if(trim($tmp) != "")
302                                        $groups .= $tmp . ";";
303               
304                        $groups = substr($groups, 0, strlen($groups) - 1 );             
305                }
306               
307                if( $this->db )
308                {
309                        $query = "SELECT * FROM phpgw_config WHERE config_app = 'phpgwapi' AND config_name = 'groups_locked_jabberit';";       
310                       
311                        if($this->db->query($query))
312                        {
313
314                                if ( $this->db->query($query) )
315                                {       
316                                        while($this->db->next_record())
317                                                $result[] = $this->db->row();
318                                }
319
320                                if( count($result) == 0 )
321                                {
322                                        $query = "INSERT INTO phpgw_config(config_app,config_name,config_value) VALUES('phpgwapi','groups_locked_jabberit','".$groups."');";
323                                        $this->db->query($query);
324                                        return true;
325                                }
326                                else
327                                {
328                                        $query = "UPDATE phpgw_config SET config_value = '".trim($groups)."' WHERE config_app = 'phpgwapi' AND config_name = 'groups_locked_jabberit';";
329                                        $this->db->query($query);
330                                        return true;
331                                }
332                        }
333                }
334               
335                return false;
336        }
337       
338        public final function setHostJabber($pParam)
339        {
340                $organization   = $pParam['organization'];
341                $hostJabber             = $pParam['hostJabber'];
342       
343                if( $this->db )
344                {
345                        $query = "SELECT * FROM phpgw_config WHERE config_app = 'phpgwapi' AND config_name = 'map_org_realm_jabberit';";
346                       
347                        if($this->db->query($query))
348                        {
349                       
350                                if ( $this->db->query($query) )
351                                {       
352                                        while($this->db->next_record())
353                                                $result[] = $this->db->row();
354                                }
355                               
356                                if( count($result) == 0 )
357                                {
358                                        $confHostJabber = strtoupper($organization).":".$hostJabber;
359                                        $return = "<return><confServer ou='".strtoupper($organization)."' serverName='".$hostJabber."'>".$confHostJabber."</confServer></return>";
360                                        $query = "INSERT INTO phpgw_config(config_app,config_name, config_value) VALUES('phpgwapi','map_org_realm_jabberit','".serialize($confHostJabber)."')";
361                                        $_SESSION['debug']['gravar'] = $confHostJabber;
362                                        $this->db->query($query);                                       
363                                }
364                                else
365                                {
366                                        $confHostJabber = unserialize($result[0]['config_value']);
367                                        $OrgHosts = explode(";", $confHostJabber);
368                                        $stringSearch = strtoupper($organization).":".$hostJabber;
369                                        $FoundString = array_search($stringSearch, $OrgHosts);
370
371                                        if( $FoundString === false)
372                                                $confHostJabber .= ";" . $stringSearch;
373                               
374                                        $items = explode(";", $confHostJabber);
375                                        natcasesort($items);
376                                                                                       
377                                        $return = "<return>";
378                                        foreach($items as $tmp)
379                                        {
380                                                $aux = explode(":",$tmp);
381                                                $return .= "<confServer ou='".$aux[0]."' serverName='".$aux[1]."'>".$tmp."</confServer>";
382                                        }                                       
383                                        $return .= "</return>";
384
385                                        $query = "UPDATE phpgw_config SET config_value = '".serialize($confHostJabber)."' WHERE config_name = 'map_org_realm_jabberit';";
386                                        $this->db->query($query);
387                                }
388                               
389                                return $return;
390                        }
391                }
392
393                return false;
394        }
395       
396        public final function setOuGroupsLocked($pGroup)
397        {
398                $group = $pGroup['group'];
399                $gidnumber = $pGroup['gidnumber'];
400                $organization = strtoupper($pGroup['ou']);
401
402                if( $this->db )
403                {
404                        $query = "SELECT * FROM phpgw_config WHERE config_app = 'phpgwapi' AND config_name = 'groups_locked_jabberit';";       
405                       
406                        if($this->db->query($query))
407                        {
408
409                                if ( $this->db->query($query) )
410                                {       
411                                        while($this->db->next_record())
412                                                $result[] = $this->db->row();
413                                }
414
415                                $groupsLocked = explode(";",$result[0]['config_value']);
416                                       
417                                foreach( $groupsLocked as $tmp )
418                                {
419                                        $aux = explode(":", $tmp);
420                                        if(($group.":".$gidnumber) == ($aux[0].":".$aux[1]))
421                                        {
422                                                if( $aux[2] )
423                                                {
424                                                        $ou_groups = explode(",",$aux[2]);
425                                                        natcasesort($ou_groups);
426                                                        $key = array_search($organization, $ou_groups);
427                                                       
428                                                        if( $key === false )
429                                                                array_push($ou_groups, $organization);
430                                                       
431                                                        $groups .= $group.":".$gidnumber.":";
432                                                       
433                                                        $return = "<return>";                                           
434                                                       
435                                                        foreach($ou_groups as $tmp)
436                                                        {
437                                                                $return .= "<ou attr='".$tmp."'>".$tmp."</ou>";
438                                                                $groups .= $tmp .",";   
439                                                        }
440                                                       
441                                                        $return .= "</return>";
442                                                       
443                                                        $groups  = substr($groups,0,strlen($groups)-1);
444                                                        $groups .= ";";
445                                                }
446                                                else
447                                                {
448                                                        $groups .= $group.":".$gidnumber.":".$organization.";";
449                                                        $return = "<return><ou attr='".$organization."'>".$organization."</ou></return>";
450                                                }
451                                        }
452                                        else
453                                                $groups .= $tmp . ";" ;
454                                }
455
456                                $groups = substr($groups,0,strlen($groups)-1);
457
458                                $query = "UPDATE phpgw_config SET config_value = '".trim($groups)."' WHERE config_app = 'phpgwapi' AND config_name = 'groups_locked_jabberit';";
459                                $this->db->query($query);
460                               
461                                return $return;
462                        }
463                }
464               
465                return false;
466        }
467       
468        public final function setUseParticipantsExternal($pFlag)
469        {
470                $flag = $pFlag['value'];
471                $return = "";
472               
473                if( $this->db )
474                {
475                        $query = "SELECT * FROM phpgw_config WHERE config_app = 'phpgwapi' AND config_name = 'use_external_participants_jabberit';";
476
477                        if ( $this->db->query($query) )
478                        {       
479                                while($this->db->next_record())
480                                        $result[] = $this->db->row();
481                        }
482
483                        if(count($result) == 0)
484                        {
485                                $query = "INSERT INTO phpgw_config(config_app,config_name,config_value) VALUES('phpgwapi','use_external_participants_jabberit','".$flag."')";
486                                $this->db->query($query);
487                                return true;
488                        }
489                        else
490                        {
491                                $query = "UPDATE phpgw_config SET config_value = '".$flag."' WHERE config_app = 'phpgwapi' AND config_name = 'use_external_participants_jabberit'";
492                                $this->db->query($query);
493                                return true;
494                        }
495                }
496                return false;
497        }
498       
499        public final function setOrganization($pOrganization)
500        {
501                $organization = $pOrganization['organization'];
502                $orgConfiguration = "";
503               
504                if( $this->db )
505                {
506                        $query = "SELECT * from phpgw_config WHERE config_app = 'phpgwapi' and config_name = 'conf_organization_jabberit'";
507
508                        if ( $this->db->query($query) )
509                        {       
510                                while($this->db->next_record())
511                                        $result[] = $this->db->row();
512               
513                                if(count($result) > 0)
514                                        $orgConfiguration = $result[0]['config_value'];
515                        }
516
517                        if( trim($orgConfiguration) == "" )
518                        {
519                                $query = "INSERT INTO phpgw_config(config_app,config_name,config_value) VALUES('phpgwapi','conf_organization_jabberit','".$organization."')";
520                                $this->db->query($query);
521                               
522                                return "<return><ou attr='".$organization."'>".$organization."</ou></return>";
523                        }
524                        else
525                        {
526                                $orgAux = explode(",",$orgConfiguration);
527                               
528                                foreach( $orgAux as $tmp )
529                                {
530                                        if(strtolower(trim($tmp)) === strtolower(trim($organization)))
531                                                return false;
532                                }
533
534                                $value = $orgConfiguration . "," . $organization;
535                                $query = "UPDATE phpgw_config SET config_value = '".$value."' WHERE config_app = 'phpgwapi' AND config_name = 'conf_organization_jabberit'";
536                                $this->db->query($query);
537
538                                $return = explode(",",$value);
539                                natcasesort($return);
540
541                                $values = "<return>";
542                               
543                                foreach($return as $tmp)
544                                        $values .= "<ou attr='" . $tmp . "'>" . $tmp . "</ou>";
545                                       
546                                $values .= "</return>";
547                               
548                                return $values;                 
549                        }
550                }
551                return false;
552        }
553
554        public final function removeAttributesLdap($pOrg)
555        {
556                $organization = $pOrg['org'];
557               
558                if( $this->db )
559                {
560                        $query = "SELECT * from phpgw_config WHERE config_app = 'phpgwapi' and config_name = 'attributes_org_ldap_jabberit'";
561                               
562                        if ( $this->db->query($query) )
563                        {       
564                                while( $this->db->next_record() )
565                                        $result[] = $this->db->row();
566               
567                                if( count($result) > 0 )
568                                        $attributesOrg = $result[0]['config_value'];
569                        }
570
571                        $attributesOrg = explode(",", $attributesOrg);
572                        $newValue = "";
573                        foreach($attributesOrg as $tmp)
574                        {
575                                $attr = explode(";",$tmp);
576                                 
577                                if( strtolower(trim($attr[0])) != strtolower(trim($organization)))
578                                {
579                                        $newValue .= $attr[0] . ";" . $attr[1] . ",";
580                                }
581                        }
582                       
583                        $newValue = substr($newValue, 0,(strlen($newValue) -1 ));
584                       
585                        if( trim($newValue) != "")
586                                $query = "UPDATE phpgw_config SET config_value = '".$newValue."' WHERE config_app = 'phpgwapi' AND config_name = 'attributes_org_ldap_jabberit'";
587                        else
588                                $query = "DELETE from phpgw_config where config_name = 'attributes_org_ldap_jabberit'";
589                               
590                        if( $this->db->query($query))
591                                return true;
592                        else
593                                return false;
594                }
595                return false;   
596        }
597
598        public final function removeHostsJabber($pItem)
599        {
600                $query = "SELECT * FROM phpgw_config WHERE config_app = 'phpgwapi' AND config_name = 'map_org_realm_jabberit';";
601
602                if( $this->db )
603                {
604                        if($this->db->query($query))
605                        {
606                                while($this->db->next_record())
607                                        $result[] = $this->db->row();
608                                       
609                                if( count($result) > 0 )
610                                {
611                                        $confHostsOrgs = unserialize($result[0]['config_value']);
612                                        $confHostsOrgs = explode(";", $confHostsOrgs);                                 
613                                        $foundValue = array_search($pItem['item'], $confHostsOrgs);                                     
614       
615                                        if( $foundValue !== false )
616                                                array_splice($confHostsOrgs, $foundValue, 1);
617                                       
618                                        if(count($confHostsOrgs) > 0 )
619                                        {
620                                                foreach( $confHostsOrgs as $values )
621                                                        $stringHostsOrgs .= $values . ";";
622       
623                                                $stringHostsOrgs = substr($stringHostsOrgs, 0, strlen($stringHostsOrgs) -1 );
624                                                $query = "UPDATE phpgw_config SET config_value = '".serialize($stringHostsOrgs)."' WHERE config_name = 'map_org_realm_jabberit';";
625                                        }
626                                        else
627                                                $query = "DELETE FROM phpgw_config WHERE config_name = 'map_org_realm_jabberit';";
628                                       
629                                        if( $this->db->query($query) )
630                                                return "true";
631                                }               
632                        }                       
633                }
634                return "false";
635        }
636
637        public final function removeOuGroupsLocked($pGroup)
638        {
639                $group = $pGroup['group'];
640                $gidnumber = $pGroup['gidnumber'];
641                $organization = strtoupper($pGroup['ou']);
642                $return = false;
643               
644                if( $this->db )
645                {
646                        $query = "SELECT * FROM phpgw_config WHERE config_app = 'phpgwapi' AND config_name = 'groups_locked_jabberit';";       
647                       
648                        if($this->db->query($query))
649                        {
650
651                                if ( $this->db->query($query) )
652                                {       
653                                        while($this->db->next_record())
654                                                $result[] = $this->db->row();
655                                }
656
657                                $groupsLocked = explode(";",$result[0]['config_value']);
658                               
659                                foreach( $groupsLocked as $tmp )
660                                {
661                                        $aux = explode(":",$tmp);
662                                       
663                                        if(($group.":".$gidnumber) == ($aux[0].":".$aux[1]))
664                                        {
665                                                $ous = explode(",", $aux[2]);
666                                                $key = array_search($organization, $ous);
667
668                                                if( $key !== false )
669                                                        unset($ous[$key]);
670
671                                                $groups .= $group.":".$gidnumber.":";
672                                               
673                                                foreach($ous as $ouTmp)
674                                                        $groups .= $ouTmp .",";
675                                               
676                                                $groups  = substr($groups,0,strlen($groups)-1);
677                                                $groups .= ";";
678                                        }
679                                        else
680                                                $groups .= $tmp . ";" ;                                                                 
681                                }
682                                       
683                                $groups  = substr($groups,0,strlen($groups)-1);
684                       
685                                $query = "UPDATE phpgw_config SET config_value = '".trim($groups)."' WHERE config_app = 'phpgwapi' AND config_name = 'groups_locked_jabberit';";
686
687                                if( $this->db->query($query))
688                                        $return = true;
689                        }
690                }       
691               
692                return $return;
693        }
694       
695        public final function removeParticipantsExternal($pOrganization)
696        {
697               
698                $organization = $pOrganization['participants'];
699               
700                if( $this->db )
701                {
702                        $query = "SELECT * from phpgw_config WHERE config_app = 'phpgwapi' and config_name = 'conf_organization_jabberit'";
703                               
704                        if ( $this->db->query($query) )
705                        {       
706                                while( $this->db->next_record() )
707                                        $result[] = $this->db->row();
708               
709                                if( count($result) > 0 )
710                                        $valueDB = $result[0]['config_value'];
711                        }
712
713                        $OrgDB = explode(",", $valueDB);
714                        $newValue = "";
715
716                        foreach($OrgDB as $tmp)
717                        {
718                                if( strtolower(trim($tmp)) != strtolower(trim($organization)))
719                                        $newValue .= $tmp . ",";
720                        }
721                       
722                        $newValue = substr($newValue, 0,(strlen($newValue) -1 ));
723                       
724                        if( trim($newValue) != "")
725                                $query = "UPDATE phpgw_config SET config_value = '".$newValue."' WHERE config_app = 'phpgwapi' AND config_name = 'conf_organization_jabberit'";
726                        else
727                                $query = "DELETE from phpgw_config where config_name = 'conf_organization_jabberit'";
728                               
729                        if( $this->db->query($query))
730                                return true;
731                        else
732                                return false;
733                }
734                return false;   
735        }
736}
737?>
Note: See TracBrowser for help on using the repository browser.