From: hickert Date: Fri, 9 Jan 2009 10:45:03 +0000 (+0000) Subject: Updated user plugins X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f528ffb6de5325488436730c6932b8a13fcd19cd;p=gosa.git Updated user plugins -Templates were not working as expected git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13336 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index 452c6437f..8b8848a83 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -902,17 +902,15 @@ class userManagement extends plugin /* Finish template preamble */ if (isset($_POST['template_continue']) && $_POST['template'] != 'none' && (isset($_POST['uid']))){ - /* Might not be filled if IDGEN is unset */ - $this->sn = $_POST['sn']; - $this->givenName = $_POST['givenName']; - /* Move user supplied data to sub plugins */ - $this->uid = $_POST['uid']; - $this->usertab->uid = $this->uid; - $this->usertab->sn = $this->sn; - $this->usertab->givenName = $this->givenName; + foreach(array("uid","sn","givenName") as $attr){ + $this->$attr = $_POST[$attr]; + $this->usertab->$attr = $this->$attr; + $this->usertab->by_object['user']->$attr = $this->$attr; + } + $template_dn = $_POST['template']; - $this->usertab->adapt_from_template($template_dn); + $this->usertab->adapt_from_template($template_dn, array("uid","cn","givenName","sn")); $template_base = preg_replace("/^[^,]+,".preg_quote(get_people_ou(), '/')."/", '', $template_dn); $this->usertab->by_object['user']->base= $template_base; } diff --git a/gosa-core/plugins/admin/users/tabs_user.inc b/gosa-core/plugins/admin/users/tabs_user.inc index 37f5e719a..0f95ed901 100644 --- a/gosa-core/plugins/admin/users/tabs_user.inc +++ b/gosa-core/plugins/admin/users/tabs_user.inc @@ -24,11 +24,21 @@ class usertabs extends tabs { var $base; + /* Template adaption variables + */ + var $uid =""; + var $givenName = ""; + var $sn; + function usertabs($config, $data, $dn) { tabs::tabs($config, $data, $dn, 'users'); $this->base= $this->by_object['user']->base; + $this->uid = &$this->by_object['user']->uid; + $this->sn = &$this->by_object['user']->sn; + $this->givenName = &$this->by_object['user']->givenName; + /* Add references/acls/snapshots */ $this->addSpecialTabs();