Announcement

Collapse
No announcement yet.

What is permcount? Problems with duplicating groups

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • What is permcount? Problems with duplicating groups

    Upgraded from: VB2 2.3.0
    Current Version: VB3 beta 4
    Problem: Trying to copy group permissions via adding a new usergroup and choosing the drop down menu at the bottom for 'Create Permissions Based off of Usergroup:' OR when trying to use the 'User group based permission duplicator' under the Forum Permission section. The drop down next to 'Copy Permissions from User Group' is emtpy.

    On or around line 238 in the forumpermission.php script, there is a query that grabs all the user groups for the duplicate function. This query returns groups if the permcount is greater than 0. Removing the permcount test of the query returns the following if run on my db.

    Query:

    SELECT usergroup.usergroupid, title, COUNT(forumpermission.forumpermissionid) AS permcount FROM usergroup AS usergroup LEFT JOIN forumpermission AS forumpermission ON (usergroup.usergroupid = forumpermission.forumpermissionid) GROUP BY usergroup.usergroupid;

    Result:

    +-------------+-----------------------------------+-----------+
    | usergroupid | title | permcount |
    +-------------+-----------------------------------+-----------+
    | 1 | Unregistered / Not Logged In | 0 |
    | 2 | Registered | 0 |
    | 3 | Users Awaiting Email Confirmation | 0 |
    | 4 | (COPPA) Users Awaiting Moderation | 0 |
    | 5 | Super Moderators | 0 |
    | 6 | Administrator | 0 |
    | 7 | Moderators | 0 |
    | 17 | Banned by Moderators | 0 |
    | 30 | template_subscriber | 0 |
    | 31 | subscriber_m_5 | 0 |
    | 32 | subscriber_m_10 | 0 |
    | 33 | subscriber_m_15 | 0 |
    | 34 | subscriber_m_20 | 0 |
    +-------------+-----------------------------------+-----------+

    As you can see, all permcounts are zero. What exactly is permcount and what causes it to get changed to something other than 0? What I would like to do is setup a basic subscriber with certain forum permissions, and then create all of my subscriber groups from that so they can all copy the same forum permission over.

    Thanks for any help.

    Edit: Ok, I noticed that permcount is an alias for something in the query. Anyway, these groups do have permissions to some of the forums, but for some reason they dont have forumpermissions.

    Edit: Sorry to keep editing. Here is one other query

    mysql> SELECT COUNT(*) FROM forumpermission WHERE forumpermissions > 0;
    +----------+
    | COUNT(*) |
    +----------+
    | 0 |
    +----------+

    Edit: Ok, last edit I promise
    If I edit a usergroup listed under a forum and change it from 'Default' to custom and change the permissions, then the above query returns 1. My question is, if usergroups are using default settings that allow them to edit/post/etc.. and things like that, doesn't this apply to the permissions? The group I just checked was 'Registered'. By default they have normal permission for one of the general discussion forums. But it seems in order to copy the permissions to a new group, they have to be setup custom for a forum.

    Sorry if I'm lost here...
    Last edited by HogMan; Fri 25 Jul '03, 10:39am.

  • #2
    It's a known and already fixed bug -- look at how the join works and you'll see. It should be joining with forumpermission.usergroupid.

    Comment


    • #3
      Originally posted by Ed Sullivan
      It's a known and already fixed bug -- look at how the join works and you'll see. It should be joining with forumpermission.usergroupid.
      Ok, thanks for the info. Sorry, I did try and find this on the forums, but must have not put in the best of info for searching

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X