summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c669624)
raw | patch | inline | side by side (parent: c669624)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 9 Jan 2009 10:45:03 +0000 (10:45 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 9 Jan 2009 10:45:03 +0000 (10:45 +0000) |
-Templates were not working as expected
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13336 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13336 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/admin/users/class_userManagement.inc | patch | blob | history | |
gosa-core/plugins/admin/users/tabs_user.inc | patch | blob | history |
diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc
index 452c6437fd3a42f6cd86ca47d6c245b554ea0957..8b8848a833ad952a1c1dbad6e4640613e885ab21 100644 (file)
/* 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 37f5e719ae09dc7b1a6cc61f08cd521f38d135d9..0f95ed9012d8bae37ebe401b6500eee1bb0a70e7 100644 (file)
{
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();