[solved] How can I use the user management/right management in packages
snowyrain last edited by
I’ve written a add-on for squidGuard. It needs squidGuard3 and works well on the first test. But I need a user management. How can I use the included user management. I have created a user, the user should only be able to use the new add-on. I see two opportunities:
- Put the new side in the “System: Group manager: Add privileges”-list (however?!?)
- Check in the new side the group of the current user (however?!?)
I think the first is more nicely but the second is easier. But I have no idea to realize it.
So my questions are:
1. how can I add a self created side to the “System: Group manager: Add privileges”-list
2a. how can I get the username in a php-script
2b. how can I get the groups of a user.
I found it:
I take a look in the package file "/usr/local/pkg/squidguard.xml". In this file ist the internal name of the package "<name>squidguardgeneral</name>"
Then I creat a file “/etc/inc/priv/squidguardgeneral.priv.inc” with:
$priv_list['page-squidguardgeneral'] = array();
$priv_list['page-squidguardgeneral']['name'] = gettext("WebCfg - Services: squidGuard");
$priv_list['page-squidguardgeneral']['descr'] = "Indicates whether the user is able to login on squidguard.";
$priv_list['page-squidguardgeneral']['match'] = array();
$priv_list['page-squidguardgeneral']['match'] = "squidGuard/squidguard_addon.php*";
Now I can see a new line in the privileges-list and give this privilege to a user. And it works.