• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

[solved] How can I use the user management/right management in packages

Scheduled Pinned Locked Moved pfSense Packages
1 Posts 1 Posters 642 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    snowyrain
    last edited by May 23, 2014, 6:42 AM May 19, 2014, 5:36 PM

    Hello,

    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:

    1. Put the new side in the “System: Group manager: Add privileges”-list (however?!?)
    2. 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
    or:
    2a. how can I get the username in a php-script
    2b. how can I get the groups of a user.

    Thank you

    Snowyrain

    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:

    global $priv_list;
    $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.

    1 Reply Last reply Reply Quote 0
    1 out of 1
    • First post
      1/1
      Last post
    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
      This community forum collects and processes your personal information.
      consent.not_received