source: trunk/jabberit_messenger/jmessenger/inc/class.DataBaseIM.inc.php @ 7655

Revision 7655, 19.4 KB checked in by douglasz, 11 years ago (diff)

Ticket #3236 - Melhorias de performance no codigo do Expresso.

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