From: hickert Date: Wed, 17 Oct 2007 14:03:03 +0000 (+0000) Subject: Next checkin for multiple user edits. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bfd2ef5743cd4c70aeab2a3a22159198652611c6;p=gosa.git Next checkin for multiple user edits. Not working! git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7586 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index bfd6bd462..3e8e1e3d7 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -83,7 +83,7 @@ class user extends plugin /* variables to trigger password changes */ var $pw_storage= "crypt"; - var $last_pw_storage= "crypt"; + var $last_pw_storage= "unset"; var $had_userCertificate= FALSE; var $view_logged = FALSE; @@ -105,8 +105,8 @@ class user extends plugin "functionalTitle", "certificateSerialNumber", "publicVisible", "street", "role", "postalCode"); - var $multiple_support =TRUE; - + var $multiple_support = TRUE; + var $multiple_handle = FALSE; /* constructor, if 'dn' is set, the node loads the given 'dn' from LDAP */ @@ -119,9 +119,10 @@ class user extends plugin $this->attributes=array_merge($this->attributes,$this->govattrs); } - $this->dn = $dn; if(is_array($dn)){ - return; + $this->dn = $dn; + $this->multiple_handle = TRUE; + return($this->construct_multiple()); } /* Load base attributes */ @@ -225,14 +226,51 @@ class user extends plugin } + function construct_multiple() + { + /* Configuration is fine, allways */ + $this->multiple_attrs = array(); + foreach($this->dn as $dn){ + $this->multiple_attrs[] = new user($this->config,$dn); + } + } + + + function execute_multiple() + { + + $smarty =get_smarty(); + + $u_attrs = array(); + $d_attrs = array(); + foreach($this->attributes as $attr){ + foreach($this->multiple_attrs as $class){ + if(!isset($u_attrs[$attr]) && !empty($class->$attr)){ + $u_attrs[$attr] = $class->$attr; + }elseif(isset($u_attrs[$attr]) && !empty($class->$attr)){ + $d_attrs[$attr] = TRUE; + } + } + } + print_a(array($u_attrs,$d_attrs)); + foreach($this->attributes as $attr){ + if(!isset($u_attrs[$attr])){ + $u_attrs[$attr] = "empty"; + } + $smarty->assign($attr,$u_attrs[$attr]); + } + return($smarty->fetch (get_template_path('multiple_generic.tpl', TRUE, dirname(__FILE__)))); + } + + /* execute generates the html output for this node */ function execute() { /* Call parent execute */ plugin::execute(); - if(is_array($this->dn)){ - return("Still not supported."); + if($this->multiple_handle){ + return($this->execute_multiple()); } /* Log view */ if($this->is_account && !$this->view_logged){ diff --git a/plugins/personal/generic/multiple_generic.tpl b/plugins/personal/generic/multiple_generic.tpl new file mode 100644 index 000000000..ce2e24246 --- /dev/null +++ b/plugins/personal/generic/multiple_generic.tpl @@ -0,0 +1,366 @@ + + + + + + + + + +
+

{t}Personal information{/t}

+
+ + + + + +
+ {t}Personal picture{/t} +
+ +
+ + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+ +
+
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + {if $is_template ne "true"} + + + + + {/if} + +
+ +
+ + +
+ +
+
+
+ + {if $pw_configurable eq "true"} +   + {/if} +
+ +
+
+ +

 

+ + + + + + + + + + + + {if $governmentmode ne "true"} + + + + + + + + + + + + + + {else} + + + + + + + + + + {/if} + +
+

 {t}Organizational information{/t}

+
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+
+   + + + + + + + {if $has_phoneaccount ne "true"} + + + + + {/if} + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+
+   + + + + + + + + + + + + + + +
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ {if $has_phoneaccount ne "true"} + + {else} + {t}Please use the phone tab{/t} + {/if} +
+ +
+ +
+ +
+
+ + + + +