diff --git a/admin/editaccount.php b/admin/editaccount.php index 9ed8169fc3..02e1042d6d 100755 --- a/admin/editaccount.php +++ b/admin/editaccount.php @@ -93,31 +93,39 @@ // If the user is logged in, it will force a refresh of the session_info $phpgw->db->query("update phpgw_sessions set session_info='' where session_lid='$new_loginid@" . $phpgw_info["user"]["domain"] . "'",__LINE__,__FILE__); -// The following sets any default preferences needed for new applications.. -// This is smart enough to know if previous preferences were selected, use them. - if (count($new_apps)) { + // The following sets any default preferences needed for new applications.. + // This is smart enough to know if previous preferences were selected, use them. + if (count($new_apps)) { - $pref = new preferences($account_id); - $t = $pref->get_preferences(); - - $docommit = False; - for ($j=0;$jcommon->hook_single("add_def_pref", $new_apps[$j]); - $docommit = True; + $pref = new preferences($account_id); + $t = $pref->get_preferences(); + + $docommit = False; + + for ($j=0;$jcommon->hook_single("add_def_pref", $new_apps[$j]); + $docommit = True; + } } - } - if ($docommit) { - $pref->commit(); - } - } + if ($docommit) { + $pref->commit(); + } + } + + // start inlcuding other admin tools + while(list($key,$value) = each($phpgw_info["user"]["app_perms"])) + { + $phpgw->common->hook_single("update_user_data", $value); + } - Header("Location: " . $phpgw->link("accounts.php", "cd=$cd")); - $phpgw->common->phpgw_exit(); + Header("Location: " . $phpgw->link("accounts.php", "cd=$cd")); + $phpgw->common->phpgw_exit(); } } // if $submit @@ -231,8 +239,16 @@ $i++; } - $phpgw->template->set_var("permissions_list",$perm_html); - + $phpgw->template->set_var("permissions_list",$perm_html); + + // start inlcuding other admin tools + while(list($key,$value) = each($phpgw_info["user"]["app_perms"])) + { + // check if we have something included, when not ne need to set + // {gui_hooks} to "" + if ($phpgw->common->hook_single("show_user_data", $value)) $includedSomething="true"; + } + if (!$includedSomething) $phpgw->template->set_var("gui_hooks",""); $phpgw->template->set_var("lang_button",lang("Save")); $phpgw->template->pparse("out","form"); diff --git a/admin/newaccount.php b/admin/newaccount.php index e297211a6c..ba3d59b6c3 100755 --- a/admin/newaccount.php +++ b/admin/newaccount.php @@ -73,6 +73,13 @@ $phpgw->common->hook_single("add_def_pref", $apps[$i]); } $pref->commit(); + + // start inlcuding other admin tools + while(list($key,$value) = each($phpgw_info["user"]["app_perms"])) + { + $phpgw->common->hook_single("update_user_data", $value); + } + Header("Location: " . $phpgw->link("accounts.php","cd=$cd")); $phpgw->common->phpgw_exit(); } @@ -170,6 +177,15 @@ } $phpgw->template->set_var("permissions_list",$perms_html); + // start inlcuding other admin tools + while(list($key,$value) = each($phpgw_info["user"]["app_perms"])) + { + // check if we have something included, when not ne need to set + // {gui_hooks} to "" + if ($phpgw->common->hook_single("show_newuser_data", $value)) $includedSomething="true"; + } + if (!$includedSomething) $phpgw->template->set_var("gui_hooks",""); + $phpgw->template->set_var("lang_button",Lang("Add")); $phpgw->template->pparse("out","form"); diff --git a/admin/templates/default/account_form.tpl b/admin/templates/default/account_form.tpl index 31e27ad4b8..f5c0ca3bb3 100644 --- a/admin/templates/default/account_form.tpl +++ b/admin/templates/default/account_form.tpl @@ -38,6 +38,8 @@ {permissions_list} + + {gui_hooks}