Code

400502e09d35e4c9d7afab826fa9406c989c75d1
[gosa.git] / plugins / admin / ogroups / class_phonequeue.inc
1 <?php
3 class phonequeue extends plugin
4 {
5   /* plugin specific values */
6   var $mail= "";
7   var $cn= "";
10   var $goFonTimeOut             ="20"; 
11   var $goFonMaxLen              ="20"; // 
12   var $goFonAnnounceFrequency   ="60"; // Annouce Frequency in seconds
13   var $goFonDialOption_t        ="";
14   var $goFonDialOption_T        ="";
15   var $goFonDialOption_h        ="";
16   var $goFonDialOption_r        ="";
17   var $goFonQueueAnnounce       ="gonicus-berlin-welcome";
18   var $goFonDialOption_H        ="";
19   var $goFonMusiconHold         ="default";
20   var $goFonWelcomeMusic        ="gonicus-berlin-welcome";
21   var $goFonQueueReportHold     ="yes";
22   var $goFonQueueYouAreNext     ="queue-youarenext";
23   var $goFonQueueThereAre       ="queue-thereare";
24   var $goFonQueueCallsWaiting   ="queue-callswaiting";
25   var $goFonQueueThankYou       ="queue-thankyou";
26   var $goFonQueueMinutes        ="queue-minutes"; 
27   var $goFonQueueSeconds        ="queue-seconds";
28   var $goFonQueueLanguage       ="queue-holdtime";
29   var $goFonQueueStrategy       ="ringall";
30   var $goFonQueueAnnounceHoldtime="yes";
31   var $telephoneNumber          =array();
32   var $goFonQueueMember         =array(); 
33   var $goFonDialOption          ="tThH";
34   var $goFonQueueRetry          =5;
36   var $old_phone_numbers        =array();
38   /* attribute list for save action */
39   var $attributes= array( "goFonTimeOut","goFonMaxLen","goFonAnnounceFrequency","goFonDialOption_t","goFonDialOption_T",
40       "goFonDialOption_h","goFonDialOption_r",
41       "goFonDialOption_H","goFonMusiconHold","goFonWelcomeMusic","goFonQueueReportHold","goFonQueueYouAreNext",
42       "goFonQueueThereAre","goFonQueueCallsWaiting","goFonQueueThankYou","goFonQueueMinutes","goFonQueueSeconds",
43       "telephoneNumber","goFonQueueLanguage","goFonQueueStrategy","goFonQueueAnnounceHoldtime","goFonQueueAnnounce","goFonDialOption","goFonQueueRetry");
44   /* ObjectClass */
45   var $objectclasses= array("goFonQueue");
47   function phonequeue ($config, $dn= NULL)
48   {
49     plugin::plugin($config, $dn);
51     /* Include config object */
52     $this->config= $config;
54     /* Save initial account state */
55     $this->initially_was_account= $this->is_account;
57     if($this->is_account){
58       if(isset($this->attrs['telephoneNumber'])){
59         $this->telephoneNumber=$this->attrs['telephoneNumber'];
60         unset($this->telephoneNumber['count']); 
61       }
63       for($i = 0; $i < strlen($this->goFonDialOption); $i++){
64         $name = "goFonDialOption_".$this->goFonDialOption[$i];
65         $this->$name=$this->goFonDialOption[$i];
66       }
67     }
69     $this->old_phone_numbers = $this->telephoneNumber;
70   }
73   function execute()
74   {
75     /* Do we need to flip is_account state? */
76     if (isset($_POST['modify_state'])){
77       $this->is_account= !$this->is_account;
78     }
80     /* Show tab dialog headers */
81     if ($this->parent != NULL){
82       if ($this->is_account){
83         $display= $this->show_header(_("Remove the phone queue from this Account"),
84             _("Phone queue is enabled for this group. You can disable it by clicking below."));
85       } else {
86         $display= $this->show_header(_("Create phone queue"), _("For this group the phone queues are disabled. You can enable them by clicking below."));
87         return ($display);
88       }
89     }
91     /* Add queue number */ 
92     if(isset($_POST['add_phonenumber'])&&(isset($_POST['phonenumber']))&&(!empty($_POST['phonenumber']))){
93       if((!in_array($_POST['phonenumber'],$this->telephoneNumber))&&(is_numeric($_POST['phonenumber']))){
94         $this->telephoneNumber[]=$_POST['phonenumber'];
95       }
96     }
98     /* Delete queue number */ 
99     if(isset($_POST['delete_phonenumber'])&&(isset($_POST['goFonQueueNumber_List']))){
100       unset($this->telephoneNumber[$_POST['goFonQueueNumber_List']]);
101     }
102   
103     $tmp = array();
104     foreach($this->telephoneNumber as $val){
105       if(!empty($val)){
106         $tmp[]= $val;
107       }
108     }  
109     $this->telephoneNumber=$tmp;
111     /* queue number up */ 
112     if(isset($_POST['up_phonenumber'])&&(isset($_POST['goFonQueueNumber_List']))){
113       if($_POST['goFonQueueNumber_List']>0){
114         $up   = $this->telephoneNumber[$_POST['goFonQueueNumber_List']];
115         $down = $this->telephoneNumber[$_POST['goFonQueueNumber_List']-1];
116         $this->telephoneNumber[$_POST['goFonQueueNumber_List']]    = $down; 
117         $this->telephoneNumber[$_POST['goFonQueueNumber_List']-1]  = $up;
118       }
119     }
121     /* Queuenumber down */ 
122     if(isset($_POST['down_phonenumber'])&&(isset($_POST['goFonQueueNumber_List']))){
123       if(isset($this->telephoneNumber[($_POST['goFonQueueNumber_List']+1)])){
124         $up   = $this->telephoneNumber[$_POST['goFonQueueNumber_List']+1];
125         $down = $this->telephoneNumber[$_POST['goFonQueueNumber_List']];
126         $this->telephoneNumber[$_POST['goFonQueueNumber_List']+1]    = $down; 
127         $this->telephoneNumber[$_POST['goFonQueueNumber_List']]  = $up;
128       }
129     }
132     $smarty= get_smarty();
134     $smarty->assign("goFonQueueLanguageOptions",array('de'=>_('German'),'ur'=>_('Uruguai')));
135     $smarty->assign("goFonQueueAnnounceHoldtimeOptions",array('no'=>_("No"),'yes'=>_('Yes')));
136     $types= array('ringall'    =>_("ring all"),
137           'roundrobin' =>_("round robin"),
138           'leastrecent'=>_("least recently called"),
139           'fewestcalls'=>_("fewest completed calls"),
140           'random'     =>_("random"),
141           'rrmemory'   =>_("round robin with memory"));
142     sort($types);
143     $smarty->assign("goFonQueueStrategyOptions", $types);
145     foreach($this->attributes as $key => $val){
146       $smarty->assign($val,$this->$val);  
148       if($this->$val == false){
149         $smarty->assign($val."CHK","");
150       }else{
151         $smarty->assign($val."CHK"," checked ");
152       }
154       if(chkacl($this->acl,$key)==""){
155         $smarty->assign($val."ACL","");
156       }else{
157         $smarty->assign($val."ACL"," disabled ");
158       }
159     }
160     return ($display.$smarty->fetch (get_template_path('phonequeue.tpl', TRUE)));
161   }
164   /* Check formular input */
165   function check()
166   {
167     $message= array();
168   #fixme workaround : Tab is not initialised correct
169           if(!$this->is_account) return($message);
171     if($this->is_number_used()){
172       $message[] = $this->is_number_used();
173     }
175     if($this->generate_mysql_entension_entries()){
176       $message[] = $this->generate_mysql_entension_entries();
177     }
179     if(!((is_numeric($this->goFonTimeOut))||(empty($this->goFonTimeOut)))){
180       $message[] = _("Timeout must be numeric");
181     }
182     if(!((is_numeric($this->goFonQueueRetry))||(empty($this->goFonQueueRetry)))){
183       $message[] = _("Retry must be numeric");
184     }
185     if(!((is_numeric($this->goFonMaxLen))||(empty($this->goFonMaxLen)))){
186       $message[] = _("Max queue length must be numeric");
187     }
188     if(!((is_numeric($this->goFonAnnounceFrequency))||(empty($this->goFonAnnounceFrequency)))){
189       $message[] = _("Announce frequency must be numeric");
190     }
191     if(count($this->telephoneNumber)==0){
192       $message[] = _("There must be least one queue number defined.");
193     }
195     return $message;
196   }
200   function generate_mysql_entension_entries($save = false)
201   {
203     $SQL = array();
204  
205     // Get Configuration for Mysql database Server
206     $a_SETUP = $_SESSION['config']->data['SERVERS']['FON'];
207     $s_parameter  ="";
209     // Connect to DB server
210     $r_con =  @mysql_pconnect($a_SETUP['SERVER'],$a_SETUP['LOGIN'],$a_SETUP['PASSWORD']);
212     // Check if we are  connected correctly
213     if(!$r_con){
214       gosa_log(mysql_error());
215       return (sprintf(_("The MySQL Server '%s' isn't reachable as user '%s', check GOsa log for mysql error."),
216           $a_SETUP['SERVER'],$a_SETUP['LOGIN']));
217     }
219     // Select database for Extensions
220     $db  =  @mysql_select_db($a_SETUP['DB'],$r_con);
222     // Test if we have the database selected correctly
223     if(!$db){
224       gosa_log(mysql_error());
225       return( sprintf(_("Can't select database %s on %s."),$a_SETUP['DB'],$a_SETUP['SERVER']));
226     }
228     if($save){
229       $i = 0;
230       $prio = 11; 
232       if(empty($this->cn)){
233         $this->cn = $this->parent->by_object['ogroup']->cn;
234         $this->attrs['cn'][0] = $this->parent->by_object['ogroup']->cn;
235       }
237       // Delete old Entries 
238       $delete = array();
239       if(is_array($this->old_phone_numbers)){
240         foreach($this->old_phone_numbers as $phone){
241           $delete[]= "DELETE FROM ".$a_SETUP['EXT_TABLE']." WHERE exten='".$phone."';\n";
242         }
243       }
244       $delete[]=    "DELETE FROM ".$a_SETUP['EXT_TABLE']."    WHERE exten='".$this->attrs['cn'][0]."';\n";
245       $delete[]=    "DELETE FROM ".$a_SETUP['QUEUE_TABLE']."  WHERE name=\"".$this->attrs['cn'][0]."\"; \n";
246       $delete[]=    "DELETE FROM ".$a_SETUP['QUEUE_MEMBER_TABLE']." WHERE queue_name=\"".$this->attrs['cn'][0]."\";\n";
248       /* Perform queries to delte old entries */
249       foreach($delete as $query){
250         if(!mysql_query($query)){
251           gosa_log(mysql_error());
252           return(mysql_error(). sprintf(_("Can't delete in Database %s, on Server %s."),$a_SETUP['DB'],$a_SETUP['SERVER']));
253         }
254       }
256       /* Append new Member for this queue */ 
257       $i = 0;
258       $queueuser =array();
259       foreach($this->parent->by_object['ogroup']->memberList as $member){
260         if(in_array("goFonAccount",$member['objectClass'])){
261           $i ++ ;
262           $queueuser[$i]['queue_name']  = $this->attrs['cn'][0]; 
263           $queueuser[$i]['interface']   = "SIP/".$member['uid'][0]; 
264           $queueuser[$i]['penalty']     = 1; 
265         }
266       }
268       /* Parse and Add members to query Array */
269       if(is_array($queueuser)){
270         foreach($queueuser as $user){
271           $entries = "";
272           $values  = "";
273           foreach($user as $attr => $val){
274             $entries.= "`".$attr."`,"; 
275             $values .= "'".$val."',";
276           }
277           $values  = preg_replace("/,$/","",$values);
278           $entries = preg_replace("/,$/","",$entries );
280           $SQL[]="INSERT INTO ".$a_SETUP['QUEUE_MEMBER_TABLE']." (".$entries.") VALUES (".$values.")"; 
281         }
282       }
283       
285       /* generate Extension entries, with priority  */
287       $queueusers=0;
288       foreach($this->parent->by_object['ogroup']->memberList as $member){
289         if(in_array("goFonAccount",$member['objectClass'])){
290           $queueusers++;
291         }
292       }
295       $i = 0;
296       foreach($this->telephoneNumber as $num){
297        
298         // If there are no member in a Queue
299         // Play sound an quit
301         // A Queue is not deleted directly, it is stored until the o group is deleted
302         
303         $a_ext[$i]['context']  = 'GOsa';
304         $a_ext[$i]['exten']    = $this->attrs['cn'][0];
305         $a_ext[$i]['priority'] = 1;
306         $a_ext[$i]['app']      = "Goto";
307         $a_ext[$i]['appdata']  = $num."|1";
308         $i ++ ; 
309     
310         if($queueusers == 0){
311           $a_ext[$i]['context']  = 'GOsa';
312           $a_ext[$i]['exten']    = $num;
313           $a_ext[$i]['priority'] = 1;
314           $a_ext[$i]['app']      = "SetLanguage";
315           $a_ext[$i]['appdata']  = "de";
316           $i ++ ; 
317           
318           $a_ext[$i]['context']  = 'GOsa';
319           $a_ext[$i]['exten']    = $num;
320           $a_ext[$i]['priority'] = 2;
321           $a_ext[$i]['app']      = "Playback";
322           $a_ext[$i]['appdata']  = "ss-noservice";
323           $i ++ ; 
324           
325           $a_ext[$i]['context']  = 'GOsa';
326           $a_ext[$i]['exten']    = $num;
327           $a_ext[$i]['priority'] = 3;
328           $a_ext[$i]['app']      = "Goto";
329           $a_ext[$i]['appdata']  = "default";
330           $i ++ ; 
331         }else{
332           $prio --;
333           $a_ext[$i]['context']  = 'GOsa';
334           $a_ext[$i]['exten']    = $num;
335           $a_ext[$i]['priority'] = 1;
336           $a_ext[$i]['app']      = "Wait";
337           $a_ext[$i]['appdata']  = "2";
338           $i ++ ; 
339           $a_ext[$i]['context']  = 'GOsa';
340           $a_ext[$i]['exten']    = $num;
341           $a_ext[$i]['priority'] = 2;
342           $a_ext[$i]['app']      = "SetLanguage";
343           $a_ext[$i]['appdata']  = $this->goFonQueueLanguage;
344           $i ++ ; 
345           $a_ext[$i]['context']  = 'GOsa';
346           $a_ext[$i]['exten']    = $num;
347           $a_ext[$i]['priority'] = 3;
348           $a_ext[$i]['app']      = "Playback";
349           $a_ext[$i]['appdata']  = $this->goFonWelcomeMusic;
350           $i ++ ; 
351           $a_ext[$i]['context']  = 'GOsa';
352           $a_ext[$i]['exten']    = $num;
353           $a_ext[$i]['priority'] = 4;
354           $a_ext[$i]['app']      = "SetCIDName";
355           if(!empty($this->parent->by_object['ogroup']->description)){
356             $a_ext[$i]['appdata']  = $this->parent->by_object['ogroup']->description;
357           }else{
358             $a_ext[$i]['appdata']  = $this->attrs['cn'][0]." - ".$num;
359           }
360           $i ++ ; 
361           $a_ext[$i]['context']  = 'GOsa';
362           $a_ext[$i]['exten']    = $num;
363           $a_ext[$i]['priority'] = 5;
364           $a_ext[$i]['app']      = "SetVar";
365           $a_ext[$i]['appdata']  =  $prio;
366           $i ++ ; 
367           $a_ext[$i]['context']  = 'GOsa';
368           $a_ext[$i]['exten']    = $num;
369           $a_ext[$i]['priority'] = 6;
370           $a_ext[$i]['app']      = "Queue";
371           $a_ext[$i]['appdata']  =  $this->attrs['cn'][0].
372             "|".
373             $this->goFonDialOption_t.
374             $this->goFonDialOption_T.
375             $this->goFonDialOption_h.
376             $this->goFonDialOption_H.
377             $this->goFonDialOption_r;
378         }
380         /* Generate Priority Entry */
381         $queue["announce"]              = "";
382         $queue["monitor_join"]          = "";
383         $queue["monitor_format"]        = "";
384         $queue["queue_holdtime"]        = $this->goFonQueueAnnounce;
385         $queue["queue_lessthan"]        = "";   
386         $queue["announce_round_seconds"]= "";   
387         $queue["retry"]                 = $this->goFonQueueRetry;
388         $queue["wrapuptime"]            = "";
389         $queue["servicelevel"]          = "";
390         $queue["joinempty"]             = "no";
391         $queue["leavewhenempty"]        = "yes";   
392         $queue["eventmemberstatus"]     = "";
393         $queue["eventwhencalled"]       = "";
394         $queue["reportholdtime"]        = "yes";
395         $queue["memberdelay"]           = "";
396         $queue["weight"]                = "";
397         $queue["timeoutrestart"]        = "";
399         $queue["context"]               = "default";
400         $queue["name"]                  = $this->attrs['cn'][0];  
401         $queue["timeout"]               = $this->goFonTimeOut; 
402         $queue["maxlen"]                = $this->goFonMaxLen;
403         $queue["strategy" ]             = $this->goFonQueueStrategy;
404         $queue["queue_thankyou"]        = $this->goFonQueueThankYou;   
405         $queue["queue_reporthold"]      = $this->goFonQueueReportHold; 
406         $queue["announce_frequency"]    = $this->goFonAnnounceFrequency;
407         $queue["queue_youarenext"]      = $this->goFonQueueYouAreNext;   
408         $queue["queue_thereare"]        = $this->goFonQueueThereAre;   
409         $queue["queue_callswaiting"]    = $this->goFonQueueCallsWaiting;
410         $queue["queue_minutes"]         = $this->goFonQueueMinutes;
411         $queue["queue_seconds"]         = $this->goFonQueueSeconds;   
412         $queue["announce_holdtime"]     = $this->goFonQueueAnnounceHoldtime;   
413         $queue["musiconhold"]           = $this->goFonMusiconHold;
415         $i++;
416       }
418       /* Parse and Add Extension entries */
419       foreach($a_ext as $ext){
420         $entries = "";
421         $values  = "";
422         foreach($ext as $attr => $val){
423           $entries.= "`".$attr."`,";
424           $values .= "'".$val."',";
425         }
426         $values  = preg_replace("/,$/","",$values);
427         $entries = preg_replace("/,$/","",$entries );
428         $SQL[]="INSERT INTO ".$a_SETUP['EXT_TABLE']." (".$entries.") VALUES (".$values.")";
429       }
432       /* Parse and Add Queue */
433       $entries = "";
434       $values  = "";
435       foreach($queue as $attr=>$val){
436         if($val == "") continue;
437         $entries.= "`".$attr."`,";
438         $values .= "'".$val."',";
439       }
440       $values  = preg_replace("/,$/","",$values);
441       $entries = preg_replace("/,$/","",$entries );
442       $SQL[]="INSERT INTO ".$a_SETUP['QUEUE_TABLE']." (".$entries.") VALUES (".$values.")";
444       foreach($SQL as $query){
445          if(!mysql_query($query)){
446           gosa_log(mysql_error());
447           print_red(mysql_error());
448           return(mysql_error(). sprintf(_("Can't delete in Database %s, on Server %s."),$a_SETUP['DB'],$a_SETUP['SERVER']));
449         }
450       }
452     }
453     return(false);
454   }
458  /* This function checks if the given phonenumbers are available or already in use*/
460   function is_number_used()
461   {
462     $ldap= $this->config->get_ldap_link();
463     $ldap->cd($this->config->current['BASE']);
464     $ldap->search("(|(objectClass=goFonAccount)(objectClass=goFonQueue))", array("telephoneNumber","cn","uid"));
465     while($attrs = $ldap->fetch()) {
466       unset($attrs['telephoneNumber']['count']);
467       foreach($attrs['telephoneNumber'] as $tele){
468         if(!isset($attrs['cn'][0])) $attrs['cn'][0]=$attrs['dn'];
469         if(!isset($attrs['uid'][0])) $attrs['uid'][0]=$attrs['dn'];
470         $numbers[$tele]=$attrs;
471       }
472     }
474     foreach($this->telephoneNumber as $num){
475       if((isset($numbers[$num]))&&(($numbers[$num]['cn'][0]!= $this->attrs['cn'][0]))){
476         if(isset($numbers[$num]['uid'][0])){
477           return sprintf(_("The specified telephonenumber '%s' is already assigned to '%s'."),$num,$numbers[$num]['uid'][0]);
478         }else{
479           return sprintf(_("The specified telephonenumber '%s' is already assigned to '%s'."),$num,$numbers[$num]['cn'][0]);
480         }
481       }
482     }
483   }
489   function save_object()
490   {
491     plugin::save_object();  
492     if(isset($_POST['phonenumber'])){
493       foreach(array("goFonDialOption_t","goFonDialOption_T","goFonDialOption_h","goFonDialOption_r","goFonDialOption_H","goFonMusiconHold") as $val){
494         if(isset($_POST[$val])){
495           $this->$val = $_POST[$val];
496         }else{
497           $this->$val = false;
498         }
499       }
500     }
502   }
504   function save()
505   {
506   #fixme workaround : Tab is not initialised correct
507         if(!$this->is_account) return;
508     $ldap= $this->config->get_ldap_link();
510     plugin::save();
511     $this->attrs['goFonDialOption'] = "";
512     foreach(array("goFonDialOption_t","goFonDialOption_T","goFonDialOption_r","goFonDialOption_h","goFonDialOption_H") as $val){
513       $this->attrs['goFonDialOption'].=$this->$val; 
514       unset($this->attrs[$val]); 
515     }
516     $this->generate_mysql_entension_entries(true);
517     if($this->attrs['goFonDialOption']=="") $this->attrs['goFonDialOption']=array();
518     
519     /* Save data to LDAP */
520     $ldap->cd($this->dn);
521     $ldap->modify($this->attrs);
523     show_ldap_error($ldap->get_error());
525     /* Optionally execute a command after we're done */
526     if ($this->initially_was_account == $this->is_account){
527       if ($this->is_modified){
528         $this->handle_post_events("mofify");
529       }
530     } else {
531       $this->handle_post_events("add");
532     }
533   }
536   /* remove object from parent */
537   function remove_from_parent()
538   {
539     $SQL = array();
541     // Get Configuration for Mysql database Server
542     $a_SETUP = $_SESSION['config']->data['SERVERS']['FON'];
543     $s_parameter  ="";
545     // Connect to DB server
546     $r_con =  @mysql_pconnect($a_SETUP['SERVER'],$a_SETUP['LOGIN'],$a_SETUP['PASSWORD']);
548     // Check if we are  connected correctly
549     if(!$r_con){
550       gosa_log(mysql_error());
551       return (sprintf(_("The MySQL Server '%s' isn't reachable as user '%s', check GOsa log for mysql error."),
552             $a_SETUP['SERVER'],$a_SETUP['LOGIN']));
553     }
555     // Select database for Extensions
556     $db  =  @mysql_select_db($a_SETUP['DB'],$r_con);
558     // Test if we have the database selected correctly
559     if(!$db){
560       gosa_log(mysql_error());
561       return( sprintf(_("Can't select database %s on %s."),$a_SETUP['DB'],$a_SETUP['SERVER']));
562     }
564     $tmp = array_flip($this->attributes);
565     foreach(array("goFonDialOption_t","goFonDialOption_T","goFonDialOption_r","goFonDialOption_h","goFonDialOption_H") as $val){
566       unset($this->$val);
567       unset($this->attrs[$val]);
568       unset($tmp[$val]);
569     }   
570     foreach(array_flip($tmp) as $key => $val){
571       $tmp2[]=$val;
572     } 
573     $this->attributes = $tmp2;
575     $i = 0;
576     $prio = 11;
578     if(empty($this->cn)){
579       $this->cn = $this->parent->by_object['ogroup']->cn;
580       $this->attrs['cn'][0] = $this->parent->by_object['ogroup']->cn;
581     }
583     // Delete old Entries
584     $delete = array();
585     foreach($this->old_phone_numbers as $phone){
586       $delete[]= "DELETE FROM ".$a_SETUP['EXT_TABLE']." WHERE exten='".$phone."';\n";
587     }
588     $delete[]=    "DELETE FROM ".$a_SETUP['EXT_TABLE']."    WHERE exten='".$this->attrs['cn'][0]."';\n";
589     $delete[]=    "DELETE FROM ".$a_SETUP['QUEUE_TABLE']." WHERE name=\"".$this->attrs['cn'][0]."\"; \n";
590     $delete[]=    "DELETE FROM ".$a_SETUP['QUEUE_MEMBER_TABLE']." WHERE queue_name=\"".$this->attrs['cn'][0]."\";\n";
592     /* Perform queries to delte old entries */
593     foreach($delete as $query){
594       if(!mysql_query($query)){
595         gosa_log(mysql_error());
596         return(mysql_error(). sprintf(_("Can't delete in Database %s, on Server %s."),$a_SETUP['DB'],$a_SETUP['SERVER']));
597       }
598     }
602     /* Cancel if there's nothing to do here */
603     if (!$this->initially_was_account){
604       return;
605     }
607     /* include global link_info */
608     $ldap= $this->config->get_ldap_link();
610     /* Remove and write to LDAP */
611     plugin::remove_from_parent();
613     @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
614         $this->attributes, "Save");
615     $ldap->cd($this->dn);
616     $ldap->modify($this->attrs);
617     show_ldap_error($ldap->get_error());
618   }
622 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
623 ?>