Code

1bcece131b5f9c7b6d43a8f0ff91b42716b083d0
[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'])){
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"){
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 ($this->grouptab){
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'>";
384     $actions = "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."' name='group_edit_%KEY%' title='"._("Edit this entry")."'>";
387     /* Extension images 
388         group
389         environment
390         appgroup
391         mailgroup
392         acl
393         reference
395      */
396     $posiximg = "<input type='image' class='center' src='images/select_groups.png' 
397                  name='group_group_edit_%KEY%' 
398                  alt='P'  title='"._("Posix")  ."'>";
399     $mailimg  = "<input type='image' class='center' src='images/mailto.png'            
400                  name='mailgroup_group_edit_%KEY%' 
401                   alt='M'  title='"._("Mail")   ."'>";
402     $sambaimg = "<input type='image'  class='center' src='images/select_winstation.png'  
403                  name='group_group_edit_%KEY%' 
404                   alt='S'  title='"._("Samba")  ."'>";
405     $applimg  = "<input type='image'  class='center' src='images/select_application.png' 
406                  name='appgroup_group_edit_%KEY%' 
407                   alt='A'  title='"._("Application")."'>"; 
408     $phoneimg = "<input type='image'  class='center' src='images/select_phone.png'      
409                  name='group_group_edit_%KEY%' 
410                   alt='Ph' title='"._("Phone")  ."'>"; 
411     $envimg   = "<input type='image'  class='center' src='images/smallenv.png'      
412                  name='environment_group_edit_%KEY%' 
413                   alt='E' title='"._("Environment")  ."'>"; 
415     // Space
416     $empty    = "<img class='center' src='images/empty.png' style='width:16px;height:16px;' alt=''>";
419     $divlist = new divlist("groupstab");
420     $divlist->SetHeader(array(
421           array("string" => "&nbsp;", "attach" => "style='text-align:center;width:20px;'"),
422           array("string" => _("Groupname")." / "._("Department"), "attach" => "style=''"),
423           array("string" => _("Properties"), "attach" => "style='width:136px;'"),
424           array("string" => _("Actions"), "attach" => "style='width:60px;border-right:0px;text-align:right;'")
425           ));
427     $divlist->SetSummary(_("This table displays all groups, in the selected tree."));
428     $divlist->SetEntriesPerPage(0);
430     foreach($this->departments as $key=> $val){
432       if(!isset($this->config->departments[trim($key)])){
433         $this->config->departments[trim($key)]="";
434       }
436       $non_empty="";
437       $keys= str_replace("/","\/",$key);
438       foreach($this->config->departments as $keyd=>$vald ){
439         if(preg_match("/".$keys."\/.*/",$keyd)){
440           $non_empty="full";
441         }
442       }
445       $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='department'>", "attach" => "style='text-align:center;width:20px;'");
446       $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style=''");
447       $field3 = array("string" => "&nbsp;", "attach" => "style='width:136px;'");
448       $field4 = array("string" => "&nbsp;", "attach" => "style='width:60px;border-right:0px;text-align:right;'");
450       $divlist->AddEntry(array($field1,$field2,$field3,$field4));
451     }
453     foreach($this->grouplist as $key => $val){
455       if(isset($val['objectClass'])){
456         if(in_array("posixGroup",           $val['objectClass']))   $posix = $posiximg;   else $posix   = $empty;
457         if(in_array("gosaMailAccount",      $val['objectClass']))   $mail  = $mailimg;    else $mail    = $empty;
458         if(in_array("sambaGroupMapping",    $val['objectClass']))   $samba = $sambaimg;   else $samba   = $empty;
459         if(in_array("gosaApplicationGroup", $val['objectClass']))   $appl  = $applimg;    else $appl    = $empty;
460         if(in_array("goFonPickupGroup",     $val['objectClass']))   $phone = $phoneimg;   else $phone   = $empty;
461         if(in_array("gotoEnvironment",      $val['objectClass']))   $enviro= $envimg;     else $enviro  = $empty;
462       }else{
463         $posix=$mail=$samba=$appl=$phone=$empty;
464       }
466       $title = "title='gid : ".$key." - dn : ".$val['dn']."'";
468       if(!isset($val['description'][0])){
469         $desc = "";
470       }else{
471         $desc = " - [ ".$val['description'][0]." ]";
472       }      
473       $field1 = array("string" => sprintf($userimg,$val['dn']), "attach" => "style='text-align:center;width:20px;'");
474       $field2 = array("string" => sprintf($editlink,$key,($val['cn']['0'].$desc)), "attach" => "style='' ".$title);
475       $field3 = array("string" => preg_replace("/%KEY%/", $key, $posix."&nbsp;".$enviro."&nbsp;".$mail."&nbsp;".$samba."&nbsp;".$appl."&nbsp;".$phone), "attach" => "style='width:136px;'");  
476       $field4 = array("string" => preg_replace("/%KEY%/", $key, $actions), "attach" => "style='width:60px;border-right:0px;text-align:right;'");
477       
478       $divlist->AddEntry(array($field1,$field2,$field3,$field4));    
479     }
481     /* Show main page */
482     $smarty->assign("grouplisthead", $listhead);
483     $smarty->assign("grouplist", $divlist->DrawList());
484     $smarty->assign("search_image", get_template_path('images/search.png'));
485     $smarty->assign("searchu_image", get_template_path('images/search_user.png'));
486     $smarty->assign("tree_image", get_template_path('images/tree.png'));
487     $smarty->assign("infoimage", get_template_path('images/info.png'));
488     $smarty->assign("launchimage", get_template_path('images/launch.png'));
489     $smarty->assign("deplist", $this->config->idepartments);
490     foreach( array("depselect", "guser", "regex", "primarygroups", "mailgroups","appgroups", "sambagroups", "functionalgroups", "subsearch") as $type){
491       $smarty->assign("$type", $groupfilter[$type]);
492     }
494     /* Extend if we are not using javascript */
495     $smarty->assign("apply", apply_filter());
496     $smarty->assign("alphabet", generate_alphabet());
497     $smarty->assign("hint", print_sizelimit_warning());
498     if (isset($this->config->data['MAIN']['NOPRIMARYGROUP'])){
499       $smarty->assign("showprimary", "");
500     } else {
501       $smarty->assign("showprimary", "true");
502     }
504     return($smarty->fetch(get_template_path('headpage.tpl', TRUE)));
505   }
507   function reload($CreatePosixsList=false)
508   {
509     /* Get config */
510     $groupfilter= get_global('groupfilter');
512     /* Set base for all searches */
513     $base= $groupfilter['depselect'];
515     /* Regex filter? */
516     if ($groupfilter['regex'] != ""){
517       $regex= $groupfilter['regex'];
518     } else {
519       $regex= "*";
520     }
522     /* User filter? */
523     $filter= "(objectclass=posixGroup)";
524     $error= "";
525     $error2= "";
526     $this->grouplist= array();
528     /* What are primary groups? */
529     $primaries= array();
530     $ldap= $this->config->get_ldap_link();
531     if (!isset($this->config->data['MAIN']['NOPRIMARYGROUP'])){
532       $ldap->cd($base);
533       $ldap->search("(&(uid=$regex)(!(uid=*$))(objectClass=posixAccount)(gidNumber=*))", array("gidNumber", "cn"));
534       show_ldap_error($ldap->get_error());
535       while ($attrs= $ldap->fetch()){
536         $primaries[$attrs['gidNumber'][0]]= $attrs['cn'][0];
537       }
538     }
540     /* Set filter depending on selection */
541     $sfilter= "";
542     if ($groupfilter['appgroups'] == "checked"){
543       $filter.= "(objectClass=gosaApplicationGroup)";
544     }
545     if ($this->config->current['SAMBAVERSION'] == 3){
546       if ($groupfilter['primarygroups'] != "checked"){
547         $sfilter= "(objectClass=sambaGroupMapping)";
548       } elseif ($groupfilter['sambagroups'] == "checked"){
549         $filter.= "(objectClass=sambaGroupMapping)";
550       }
551     }
553     if ($groupfilter['mailgroups'] == "checked"){
554       $filter.= "(objectClass=gosaMailAccount)";
555     }
556     $functional= array();
557     $ldap->cd(get_groups_ou().$base);
558     $ldap->set_size_limit($_SESSION['size_limit']);
559     $ldap->search("(&(cn=$regex)(objectClass=posixGroup)(!(|(objectClass=gosaMailAccount)(objectClass=gosaApplicationGroup)$sfilter)))", array("cn", "gidNumber", "description"));
560     $error2= $ldap->error;
561     while ($attrs= $ldap->fetch()){
562       if (!isset($primaries[$attrs['gidNumber'][0]])){
563         $functional[$attrs['gidNumber'][0]]= $attrs['gidNumber'][0];
564       }
565     }
567     /*
568      * We also need to search for the departments
569      * So we are able to navigate like in konquerer
570      */
572       $res3 =  get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))",
573           FALSE, $base, array("ou", "description"), TRUE);
574       $this->departments= array();
575       $tmp = array();
576       foreach ($res3 as $value){
577         $tmp[strtolower($value['dn']).$value['dn']]=$value;
578       }
579       ksort($tmp);
580       foreach($tmp as $value){
581         if(isset($value["description"][0])){
582           $this->departments[$value['dn']]=convert_department_dn2($value['dn'])." - [".$value["description"][0]."]";
583         }else{
584           $this->departments[$value['dn']]= convert_department_dn2($value['dn']);//$value["description"][0];
585         }
586       }
587     /*  Ende department generation
588      */
590     /* Generate grouplist */
591     if ($filter != ""){
592       $filter= "(&(cn=$regex)(objectClass=posixGroup)(|$filter))";
593       if ($groupfilter['guser'] != ""){
594         $filter= "(&(|(memberUID=" . $groupfilter['guser'] . ")(cn=" . $groupfilter['guser'] . "))$filter)";
595       }
596     }
598     /* Depending on $CreatePosixsList we have to create different lists */
600     if ($groupfilter['subsearch'] == "checked"){
601       $res= get_list($this->ui->subtreeACL, "$filter", FALSE, $base, array("cn", "description", "gidNumber"), TRUE);
602     } else {
603       $base= get_groups_ou().$base;
604       $res= get_list($this->ui->subtreeACL, "$filter", FALSE, $base, array("cn", "description", "gidNumber"), TRUE);
605     }
606     if (preg_match("/size limit/i", $error) || preg_match("/size limit/i", $error2)){
607       $_SESSION['limit_exceeded']= TRUE;
608     }
610     foreach ($res as $value){
611       if ($groupfilter['functionalgroups'] != "checked" && isset($functional[$value['gidNumber'][0]])){
612         continue;
613       }
614       if ($groupfilter['primarygroups'] == "checked"){
615         $this->grouplist[$value['gidNumber'][0]]= $value;
616       } else {
617         if (!isset($primaries[$value['gidNumber'][0]])){
618           $this->grouplist[$value['gidNumber'][0]]= $value;
619         }
620       }
621     }
623     $tmp=array();
625     /* Create result for group management listbox*/
626     foreach($this->grouplist as $tkey => $val ){
627       $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val;
628     }
629     ksort($tmp);
630     $this->grouplist=array();
631     foreach($tmp as $val){
632       $this->grouplist[]=$val;
633     }
634     reset ($this->grouplist);
635   }
637   function remove_from_parent()
638   {
639     /* Optionally execute a command after we're done */
640     $this->postremove();
641   }
644   /* Save data to object */
645   function save_object()
646   {
647   }
650   /* Check values */
651   function check()
652   {
653   }
656   /* Save to LDAP */
657   function save()
658   {
659     /* Optionally execute a command after we're done */
660     $this->postcreate();
661   }
663   function adapt_from_template($dn)
664   {
665   }
667   function password_change_needed()
668   {
669   }
671   function show_header($button_text, $text, $disabled= FALSE)
672   {
673   }
675   function remove_lock()
676   {
677     if (isset($this->grouptab->dn)){
678       del_lock ($this->grouptab->dn);
679     }
680   }
684 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
685 ?>