now you can add your own plugins to the usermanager

i have user hook's for this

hook 1:
show_user_data
creates html code which gets added to the editaccount.php pages

hook2:
show_newuser_data
creates html code which gets added to the newaccount.php pages

hook3:
update_user_data
get's called after we have put the new userdata in the database

Enjoy
This commit is contained in:
Lars Kneschke 2000-12-31 16:20:49 +00:00
parent 594434dc47
commit f4a7860474
3 changed files with 58 additions and 24 deletions

View File

@ -101,11 +101,13 @@
$t = $pref->get_preferences();
$docommit = False;
for ($j=0;$j<count($new_apps);$j++) {
if($new_apps[$j]=="admin")
$check = "common";
else
$check = $new_apps[$j];
if (!count($t["$check"])) {
$phpgw->common->hook_single("add_def_pref", $new_apps[$j]);
$docommit = True;
@ -116,6 +118,12 @@
}
}
// 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();
}
@ -233,6 +241,14 @@
$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");

View File

@ -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");

View File

@ -39,6 +39,8 @@
{permissions_list}
{gui_hooks}
<tr bgcolor="{tr_color2}">
<td colspan="4" align="right"><input type="submit" name="submit" value="{lang_button}"></td>
</tr>