Code

6bf78f1545b001fa94d68605f8923a3467ff036a
[gosa.git] / plugins / admin / groups / class_groupManagement.inc
1 <?php
2 /*
3    This code is part of GOsa (https://gosa.gonicus.de)
4    Copyright (C) 2003  Cajus Pollmeier
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20 require "tabs_group.inc";
22 class groupManagement extends plugin
23 {
24   /* Definitions */
25   var $plHeadline= "Groups";
26   var $plDescription= "This does something";
27   var $departments = array();
29   /* Dialog attributes */
30   var $grouptab= NULL;
31   var $grouplist= array();
32   var $ui= NULL;
33   var $acl= "";
35   function groupManagement ($config, $ui)
36   {
37     /* Save configuration for internal use */
38     $this->config= $config;
39     $this->ui= $ui;
41     /* Get global filter config */
42     if (!is_global("groupfilter")){
43       $base= get_base_from_people($ui->dn);
44       $groupfilter= array("primarygroups" => "checked",
45           "mailgroups" => "checked",
46           "sambagroups" => "checked",
47           "appgroups" => "checked",
48           "functionalgroups" => "checked",
49           "guser" => "*",
50           "subsearch" => "",
51           "depselect" => $base,
52           "regex" => "*");
53       register_global("groupfilter", $groupfilter);
54     }
55   }
57   function execute()
58   {
59         /* Call parent execute */
60         plugin::execute();
62     $_SESSION['LOCK_VARS_TO_USE'] = array("/^act$/","/^id$/","/^group_edit_/","/^group_del_/");
64     /* Save data */
65     $groupfilter= get_global("groupfilter");
66     $s_action   = "";
67     $s_entry    = "";
70     if (!isset($this->grouptab)){
71       foreach( array("depselect", "guser", "regex") as $type){
72         if (isset($_POST[$type])){
73           $groupfilter[$type]= $_POST[$type];
74         } 
75       }
76       if (isset($_POST['regex'])){
77         foreach( array("primarygroups", "sambagroups", "mailgroups", "appgroups",
78               "functionalgroups", "subsearch") as $type){
80           if (isset($_POST[$type])) {
81             $groupfilter[$type]= "checked";
82           } else {
83             $groupfilter[$type]= "";
84           }
85         }
86       }
87       if (isset($_GET['search'])){
88         $s= mb_substr($_GET['search'], 0, 1, "UTF8")."*";
89         if ($s == "**"){
90           $s= "*";
91         }
92         $groupfilter['regex']= $s;
93       }
94       register_global("groupfilter", $groupfilter);
95     }
98     /* Test Posts */
99     foreach($_POST as $key => $val){
100       // Post for delete
101       if(preg_match("/^group_del.*/",$key)){
102         $s_action = "del";
103         $s_entry  = preg_replace("/group_".$s_action."_/i","",$key);
104         // Post for edit
105       }elseif(preg_match("/^group_edit_.*/",$key)){
106         $s_action="edit";
107         $s_entry  = preg_replace("/group_".$s_action."_/i","",$key);
108         // Post for new
109       }elseif(preg_match("/^dep_back.*/i",$key)){
110         $s_action="back";
111       }elseif(preg_match("/^group_new.*/",$key)){
112         $s_action="new";
113       }elseif(preg_match("/^dep_home.*/i",$key)){
114         $s_action="home";
115       }elseif(preg_match("/^group_tplnew.*/i",$key)){
116         $s_action="new_tpl";
117       }elseif(preg_match("/^group_chgpw.*/i",$key)){
118         $s_action="change_pw";
119         $s_entry  = preg_replace("/group_chgpw_/i","",$key);
120       }elseif(preg_match("/^dep_root.*/i",$key)){
121         $s_action="root";
122       }elseif(preg_match("/_group_edit_/",$key)){
123         $type = preg_replace("/_group_edit_.*$/","",$key);
124         $s_action="edit";
125         $s_entry  = preg_replace("/".$type."_group_edit_/i","",$key); 
126         $_POST['arg'] = $type;
127       }
128     }
129     $s_entry  = preg_replace("/_.$/","",$s_entry); 
131     /* Start for New List Managment */
132     if(isset($_GET['act'])&&($_GET['act']=="dep_open")){
133       $s_action="open";
134       $s_entry = base64_decode($_GET['dep_id']);
135       $groupfilter['depselect']= "".$this->config->departments[trim($s_entry)];
136     }
138     // Edit if
139     if((isset($_GET['act']))&&($_GET['act']=="edit_entry")){
140       $s_action ="edit";
141       $s_entry  = $_GET['id'];
142     }
144     /* Department changed? */
145     if(isset($_POST['depselect']) && $_POST['depselect']){
146       $groupfilter['depselect']= $_POST['depselect'];
147     }
149     /* Homebutton is posted */
150     if($s_action=="home"){
151       $groupfilter['depselect']= (preg_replace("/^[^,]+,/","",$this->ui->dn));
152       $groupfilter['depselect']= (preg_replace("/^[^,]+,/","",$groupfilter['depselect']));
153     }
155     if($s_action=="root"){
156       $groupfilter['depselect']=($this->config->current['BASE']);
157     }
159     /* If Backbutton is Posted */
160     if($s_action == "back"){
161       $base_back= preg_replace("/^[^,]+,/","",$groupfilter['depselect']);
162       $base_back= convert_department_dn($base_back);
164       if(isset($this->config->departments[trim($base_back)])){
165         $groupfilter['depselect']= $this->config->departments[trim($base_back)];
166       }else{
167         $groupfilter['depselect']= $this->config->departments["/"];
168       }
169     }
170     register_global("groupfilter", $groupfilter);
172     $smarty= get_smarty();
174     /* Prepare formular */
175     $this->reload();
177     /* Check for exeeded sizelimit */
178     if (($message= check_sizelimit()) != ""){
179       return($message);
180     }
182     /* New group? */
183     if ($s_action=="new"){
185       /* By default we set 'dn' to 'new', all relevant plugins will
186          react on this. */
187       $this->dn= "new";
189       /* Create new usertab object */
190       $this->grouptab= new grouptabs($this->config,
191           $this->config->data['TABS']['GROUPTABS'], $this->dn);
192       /* Set up the users ACL's for this 'dn' */
193       $acl= get_permissions ($groupfilter['depselect'], $this->ui->subtreeACL);
194       $this->grouptab->set_acl($acl);
195     }
197     /* Cancel dialogs */
198     if (isset($_POST['edit_cancel']) || isset($_POST['password_cancel'])){
199       del_lock ($this->grouptab->dn);
200       unset ($this->grouptab);
201       $this->grouptab= NULL;
202       unset($_SESSION['objectinfo']);
203     }
205     /* Finish group edit is triggered by the tabulator dialog, so
206        the user wants to save edited data. Check and save at this
207        point. */
208     if ((isset($_POST['edit_finish'])) && (isset($this->grouptab->config)) ){
210       /* Check tabs, will feed message array */
211       $message= $this->grouptab->check();
213       /* Save, or display error message? */
214       if (count($message) == 0){
216         /* Save user data to ldap */
217         $this->grouptab->save();
218         gosa_log ("Group object'".$this->dn."' has been saved");
220         /* Group has been saved successfully, remove lock from
221            LDAP. */
222         if ($this->dn != "new"){
223           del_lock ($this->dn);
224         }
226         /* There's no page reload so we have to read new users at
227            this point. */
228         $this->reload ();
229         unset ($this->grouptab);
230         $this->grouptab= NULL;
231         unset ($_SESSION['objectinfo']);
233       } else {
234         /* Ok. There seem to be errors regarding to the tab data,
235            show message and continue as usual. */
236         show_errors($message);
237       }
238     }
240     /* User wants to edit data? */
241     if (($s_action=="edit") && (!isset($this->grouptab-> config))){
243       /* Get 'dn' from posted 'uid', must be unique */
244       $this->dn= $this->grouplist[trim($s_entry)]['dn'];
246       /* Check locking, save current plugin in 'back_plugin', so
247          the dialog knows where to return. */
249       $user = get_lock($this->dn);
251       if ($user != ""){
252         return(gen_locked_message ($user, $this->dn));
253       }
255       /* Lock the current entry, so everyone will get the
256          above dialog */
257       add_lock ($this->dn, $this->ui->dn);
259       /* Set up the users ACL's for this 'dn' */
260       $acl= get_permissions ($this->dn, $this->ui->subtreeACL);
262       /* Register grouptab to trigger edit dialog */
263       $this->grouptab= new grouptabs($this->config,
264           $this->config->data['TABS']['GROUPTABS'], $this->dn);
265       $this->grouptab->set_acl($acl);
266       $_SESSION['objectinfo']= $this->dn;
267     }
269     /* Remove user was requested */
270     if ($s_action=="del"){
271       /* Get 'dn' from posted 'uid' */
272       $this->dn= $this->grouplist[trim($s_entry)]['dn'];
274       /* Load permissions for selected 'dn' and check if
275          we're allowed to remove this 'dn' */
276       $acl= get_permissions ($this->dn, $this->ui->subtreeACL);
277       $this->acl= get_module_permission($acl, "group", $this->dn);
278       if (chkacl($this->acl, "delete") == ""){
280         /* Check locking, save current plugin in 'back_plugin', so
281            the dialog knows where to return. */
282         if (($user= get_lock($this->dn)) != ""){
283           return(gen_locked_message ($user, $this->dn));
284         }
286         /* Lock the current entry, so nobody will edit it during deletion */
287         add_lock ($this->dn, $this->ui->dn);
288         $smarty->assign("info", sprintf(_("You're about to delete the group '%s'."), LDAP::fix($this->dn)));
289         return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
290       } else {
292         /* Obviously the user isn't allowed to delete. Show message and
293            clean session. */
294         print_red (_("You are not allowed to delete this group!"));
295       }
296     }
298     /* Confirmation for deletion has been passed. Group should be deleted. */
299     if (isset($_POST['delete_group_confirm'])){
301       /* Some nice guy may send this as POST, so we've to check
302          for the permissions again. */
303       if (chkacl($this->acl, "delete") == ""){
305         /* Delete request is permitted, perform LDAP action */
306         $this->grouptab= new grouptabs($this->config,
307             $this->config->data['TABS']['GROUPTABS'], $this->dn);
308         $this->grouptab->set_acl(array($this->acl));
309         $this->grouptab->delete ();
310         gosa_log ("Group object'".$this->dn."' has been removed");
311         unset ($this->grouptab);
312         $this->grouptab= NULL;
314         /* Group list has changed, reload it. */
315         $this->reload ();
316       } else {
318         /* Normally this shouldn't be reached, send some extra
319            logs to notify the administrator */
320         print_red (_("You are not allowed to delete this group!"));
321         gosa_log ("Warning: '".$this->ui->uid."' tried to trick group deletion.");
322       }
324       /* Remove lock file after successfull deletion */
325       del_lock ($this->dn);
326       unset($_SESSION['objectinfo']);
327     }
330     /* Delete group canceled? */
331     if (isset($_POST['delete_cancel'])){
332       del_lock ($this->dn);
333       unset($_SESSION['objectinfo']);
334     }
336     /* Show tab dialog if object is present */
337     if (isset($this->grouptab->config)){
338       $display= $this->grouptab->execute();
340       /* Don't show buttons if tab dialog requests this */
341       if (!$this->grouptab->by_object[$this->grouptab->current]->dialog){
342         $display.= "<p style=\"text-align:right\">\n";
343         $display.= "<input type=submit name=\"edit_finish\" value=\""._("Finish")."\">\n";
344         $display.= "&nbsp;\n";
345         $display.= "<input type=submit name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
346         $display.= "</p>";
347       }
348       return ($display);
349     }
351     /* Prepare departments */
352     $options= "";
353     foreach ($this->config->idepartments as $key => $value){
354             if ($groupfilter['depselect'] == $key){
355                     $options.= "<option selected value='$key'>$value</option>";
356             } else {
357                     $options.= "<option value='$key'>$value</option>";
358             }
359     }
361     // Managment
362     $listhead = "<div style='background:#F0F0F9;padding:5px;'>".
363       " <input type='image' class='center' src='images/list_back.png' title='"._("Go up one department")."' alt='"._("Up")."' name='dep_back'>&nbsp;".
364       " <input type='image' class='center' src='images/list_root.png' title='"._("Go to root department")."' name='dep_root' alt='"._("Root")."'>&nbsp;".
365       " <input type='image' class='center' src='images/list_home.png' title='"._("Go to users department")."' alt='"._("Home")."' name='dep_home'>&nbsp;".
366       " <img class='center' src='images/list_seperator.png' alt='' height='16' width='1'>&nbsp;".
367       " <input type='image' class='center' src='images/list_new_group.png' title='"._("Create new group")."' alt='"._("New")."' name='group_new'>&nbsp;".
368       " <img class='center' src='images/list_seperator.png' alt='' height='16' width='1'>&nbsp;".
369       _("Base")."&nbsp;<select name='depselect' onChange='mainform.submit()' class='center'>$options</select>".
370        " <input type='image' class='center' src='images/list_submit.png' title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'>&nbsp;".
371       "</div>";
373     
374     $actions = "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."' name='group_edit_%KEY%' title='"._("Edit this entry")."'>";
375     $actions.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."' name='group_del_%KEY%' title='"._("Delete this entry")."'>";
377     // Defining Links
378     $linkopen = "<a href='?plug=".$_GET['plug']."&amp;act=dep_open&amp;dep_id=%s'>%s</a>";
380     // image Buttons 
381     $editlink = "<a href='?plug=".$_GET['plug']."&amp;id=%s&amp;act=edit_entry'>%s</a>";
382     $userimg  = "<img class='center' src='images/select_groups.png' alt='User'    title='%s'>";
385     /* Extension images 
386         group
387         environment
388         appgroup
389         mailgroup
390         acl
391         reference
393      */
394     $posiximg = "<input type='image' class='center' src='images/select_groups.png' 
395                  name='group_group_edit_%KEY%' 
396                  alt='P'  title='"._("Posix")  ."'>";
397     $mailimg  = "<input type='image' class='center' src='images/mailto.png'            
398                  name='mailgroup_group_edit_%KEY%' 
399                   alt='M'  title='"._("Mail")   ."'>";
400     $sambaimg = "<input type='image'  class='center' src='images/select_winstation.png'  
401                  name='group_group_edit_%KEY%' 
402                   alt='S'  title='"._("Samba")  ."'>";
403     $applimg  = "<input type='image'  class='center' src='images/select_application.png' 
404                  name='appgroup_group_edit_%KEY%' 
405                   alt='A'  title='"._("Application")."'>"; 
406     $phoneimg = "<input type='image'  class='center' src='images/select_phone.png'      
407                  name='group_group_edit_%KEY%' 
408                   alt='Ph' title='"._("Phone")  ."'>"; 
409     $envimg   = "<input type='image'  class='center' src='images/smallenv.png'      
410                  name='environment_group_edit_%KEY%' 
411                   alt='E' title='"._("Environment")  ."'>"; 
413     // Space
414     $empty    = "<img class='center' src='images/empty.png' style='width:16px;height:16px;' alt=''>";
417     $divlist = new divlist("groupstab");
418     $divlist->SetHeader(array(
419           array("string" => "&nbsp;", "attach" => "style='text-align:center;width:20px;'"),
420           array("string" => _("Groupname")." / "._("Department"), "attach" => "style=''"),
421           array("string" => _("Properties"), "attach" => "style='width:136px;'"),
422           array("string" => _("Actions"), "attach" => "style='width:60px;border-right:0px;text-align:right;'")
423           ));
425     $divlist->SetSummary(_("This table displays all groups, in the selected tree."));
426     $divlist->SetEntriesPerPage(0);
428     foreach($this->departments as $key=> $val){
430       if(!isset($this->config->departments[trim($key)])){
431         $this->config->departments[trim($key)]="";
432       }
434       $non_empty="";
435       $keys= str_replace("/","\/",$key);
436       foreach($this->config->departments as $keyd=>$vald ){
437         if(preg_match("/".$keys."\/.*/",$keyd)){
438           $non_empty="full";
439         }
440       }
443       $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='department'>", "attach" => "style='text-align:center;width:20px;'");
444       $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style=''");
445       $field3 = array("string" => "&nbsp;", "attach" => "style='width:136px;'");
446       $field4 = array("string" => "&nbsp;", "attach" => "style='width:60px;border-right:0px;text-align:right;'");
448       $divlist->AddEntry(array($field1,$field2,$field3,$field4));
449     }
451     foreach($this->grouplist as $key => $val){
453       if(isset($val['objectClass'])){
454         if(in_array("posixGroup",           $val['objectClass']))   $posix = $posiximg;   else $posix   = $empty;
455         if(in_array("gosaMailAccount",      $val['objectClass']))   $mail  = $mailimg;    else $mail    = $empty;
456         if(in_array("sambaGroupMapping",    $val['objectClass']))   $samba = $sambaimg;   else $samba   = $empty;
457         if(in_array("gosaApplicationGroup", $val['objectClass']))   $appl  = $applimg;    else $appl    = $empty;
458         if(in_array("goFonPickupGroup",     $val['objectClass']))   $phone = $phoneimg;   else $phone   = $empty;
459         if(in_array("gotoEnvironment",      $val['objectClass']))   $enviro= $envimg;     else $enviro  = $empty;
460       }else{
461         $posix=$mail=$samba=$appl=$phone=$empty;
462       }
464       $title = "title='gid : ".$key." - dn : ".$val['dn']."'";
466       if(!isset($val['description'][0])){
467         $desc = "";
468       }else{
469         $desc = " - [ ".$val['description'][0]." ]";
470       }      
471       $field1 = array("string" => sprintf($userimg,$val['dn']), "attach" => "style='text-align:center;width:20px;'");
472       $field2 = array("string" => sprintf($editlink,$key,($val['cn']['0'].$desc)), "attach" => "style='' ".$title);
473       $field3 = array("string" => preg_replace("/%KEY%/", $key, $posix."&nbsp;".$enviro."&nbsp;".$mail."&nbsp;".$samba."&nbsp;".$appl."&nbsp;".$phone), "attach" => "style='width:136px;'");  
474       $field4 = array("string" => preg_replace("/%KEY%/", $key, $actions), "attach" => "style='width:60px;border-right:0px;text-align:right;'");
475       
476       $divlist->AddEntry(array($field1,$field2,$field3,$field4));    
477     }
479     /* Show main page */
480     $smarty->assign("grouplisthead", $listhead);
481     $smarty->assign("grouplist", $divlist->DrawList());
482     $smarty->assign("search_image", get_template_path('images/search.png'));
483     $smarty->assign("searchu_image", get_template_path('images/search_user.png'));
484     $smarty->assign("tree_image", get_template_path('images/tree.png'));
485     $smarty->assign("infoimage", get_template_path('images/info.png'));
486     $smarty->assign("launchimage", get_template_path('images/launch.png'));
487     $smarty->assign("deplist", $this->config->idepartments);
488     foreach( array("depselect", "guser", "regex", "primarygroups", "mailgroups","appgroups", "sambagroups", "functionalgroups", "subsearch") as $type){
489       $smarty->assign("$type", $groupfilter[$type]);
490     }
492     /* Extend if we are not using javascript */
493     $smarty->assign("apply", apply_filter());
494     $smarty->assign("alphabet", generate_alphabet());
495     $smarty->assign("hint", print_sizelimit_warning());
496     if (isset($this->config->data['MAIN']['NOPRIMARYGROUP'])){
497       $smarty->assign("showprimary", "");
498     } else {
499       $smarty->assign("showprimary", "true");
500     }
502     return($smarty->fetch(get_template_path('headpage.tpl', TRUE)));
503   }
505   function reload($CreatePosixsList=false)
506   {
507     /* Get config */
508     $groupfilter= get_global('groupfilter');
510     /* Set base for all searches */
511     $base= $groupfilter['depselect'];
513     /* Regex filter? */
514     if ($groupfilter['regex'] != ""){
515       $regex= $groupfilter['regex'];
516     } else {
517       $regex= "*";
518     }
520     /* User filter? */
521     $filter= "(objectclass=posixGroup)";
522     $error= "";
523     $error2= "";
524     $this->grouplist= array();
526     /* What are primary groups? */
527     $primaries= array();
528     $ldap= $this->config->get_ldap_link();
529     if (!isset($this->config->data['MAIN']['NOPRIMARYGROUP'])){
530       $ldap->cd($base);
531       $ldap->search("(&(uid=$regex)(!(uid=*$))(objectClass=posixAccount)(gidNumber=*))", array("gidNumber", "cn"));
532       show_ldap_error($ldap->get_error());
533       while ($attrs= $ldap->fetch()){
534         $primaries[$attrs['gidNumber'][0]]= $attrs['cn'][0];
535       }
536     }
538     /* Set filter depending on selection */
539     $sfilter= "";
540     if ($groupfilter['appgroups'] == "checked"){
541       $filter.= "(objectClass=gosaApplicationGroup)";
542     }
543     if ($this->config->current['SAMBAVERSION'] == 3){
544       if ($groupfilter['primarygroups'] != "checked"){
545         $sfilter= "(objectClass=sambaGroupMapping)";
546       } elseif ($groupfilter['sambagroups'] == "checked"){
547         $filter.= "(objectClass=sambaGroupMapping)";
548       }
549     }
551     if ($groupfilter['mailgroups'] == "checked"){
552       $filter.= "(objectClass=gosaMailAccount)";
553     }
554     $functional= array();
555     $ldap->cd(get_groups_ou().$base);
556     $ldap->set_size_limit($_SESSION['size_limit']);
557     $ldap->search("(&(cn=$regex)(objectClass=posixGroup)(!(|(objectClass=gosaMailAccount)(objectClass=gosaApplicationGroup)$sfilter)))", array("cn", "gidNumber", "description"));
558     $error2= $ldap->error;
559     while ($attrs= $ldap->fetch()){
560       if (!isset($primaries[$attrs['gidNumber'][0]])){
561         $functional[$attrs['gidNumber'][0]]= $attrs['gidNumber'][0];
562       }
563     }
565     /*
566      * We also need to search for the departments
567      * So we are able to navigate like in konquerer
568      */
570       $res3 =  get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))",
571           FALSE, $base, array("ou", "description"), TRUE);
572       $this->departments= array();
573       $tmp = array();
574       foreach ($res3 as $value){
575         $tmp[strtolower($value['dn']).$value['dn']]=$value;
576       }
577       ksort($tmp);
578       foreach($tmp as $value){
579         if(isset($value["description"][0])){
580           $this->departments[$value['dn']]=convert_department_dn2($value['dn'])." - [".$value["description"][0]."]";
581         }else{
582           $this->departments[$value['dn']]= convert_department_dn2($value['dn']);//$value["description"][0];
583         }
584       }
585     /*  Ende department generation
586      */
588     /* Generate grouplist */
589     if ($filter != ""){
590       $filter= "(&(cn=$regex)(objectClass=posixGroup)(|$filter))";
591       if ($groupfilter['guser'] != ""){
592         $filter= "(&(|(memberUID=" . $groupfilter['guser'] . ")(cn=" . $groupfilter['guser'] . "))$filter)";
593       }
594     }
596     /* Depending on $CreatePosixsList we have to create different lists */
598     if ($groupfilter['subsearch'] == "checked"){
599       $res= get_list($this->ui->subtreeACL, "$filter", FALSE, $base, array("cn", "description", "gidNumber"), TRUE);
600     } else {
601       $base= get_groups_ou().$base;
602       $res= get_list($this->ui->subtreeACL, "$filter", FALSE, $base, array("cn", "description", "gidNumber"), TRUE);
603     }
604     if (preg_match("/size limit/i", $error) || preg_match("/size limit/i", $error2)){
605       $_SESSION['limit_exceeded']= TRUE;
606     }
608     foreach ($res as $value){
609       if ($groupfilter['functionalgroups'] != "checked" && isset($functional[$value['gidNumber'][0]])){
610         continue;
611       }
612       if ($groupfilter['primarygroups'] == "checked"){
613         $this->grouplist[$value['gidNumber'][0]]= $value;
614       } else {
615         if (!isset($primaries[$value['gidNumber'][0]])){
616           $this->grouplist[$value['gidNumber'][0]]= $value;
617         }
618       }
619     }
621     $tmp=array();
623     /* Create result for group management listbox*/
624     foreach($this->grouplist as $tkey => $val ){
625       $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val;
626     }
627     ksort($tmp);
628     $this->grouplist=array();
629     foreach($tmp as $val){
630       $this->grouplist[]=$val;
631     }
632     reset ($this->grouplist);
633   }
635   function remove_from_parent()
636   {
637     /* Optionally execute a command after we're done */
638     $this->postremove();
639   }
642   /* Save data to object */
643   function save_object()
644   {
645   }
648   /* Check values */
649   function check()
650   {
651   }
654   /* Save to LDAP */
655   function save()
656   {
657     /* Optionally execute a command after we're done */
658     $this->postcreate();
659   }
661   function adapt_from_template($dn)
662   {
663   }
665   function password_change_needed()
666   {
667   }
669   function show_header($button_text, $text, $disabled= FALSE)
670   {
671   }
673   function remove_lock()
674   {
675     if (isset($this->grouptab->dn)){
676       del_lock ($this->grouptab->dn);
677     }
678   }
682 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
683 ?>