Code Monkey home page Code Monkey logo

autogroups's People

Contributors

davidiq avatar imattpro avatar kasimi avatar marc1706 avatar michaelcullum avatar nicofuma avatar paul999 avatar pico avatar rxu avatar scanialady avatar senky avatar tms32010 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autogroups's Issues

Problems with 0 min and 0 max values

Submitting Auto Groups settings with 0 min and 0 max at the same time yields the following issues:

Posts type:
All board members are added to the group. Technically this is correct, if all users have at least 1 post, and there is no maximum limit. But it also seems illogical.

User Age type:
All board members are added to the group. This is also correct, since all users are older than 0 but is sort of the same issue as with posts.

Warnings type:

SQL ERROR [ mysqli ]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') OR ug.group_id = '12') AND u.user_type NOT IN (1, 2) GROUP BY u.user_id' at line 1 [1064]
SQL
SELECT DISTINCT u.user_id, u.user_warnings FROM (phpbb_users u) LEFT JOIN phpbb_user_group ug ON (u.user_id = ug.user_id) WHERE (() OR ug.group_id = '12') AND u.user_type NOT IN (1, 2) GROUP BY u.user_id

The main bug to fix is with Warnings. But I think it may also be worth not allowing 0 values for both max and min to be allowed at the same time, since that could inadvertently auto group all a board's users.

Inactive User auto group

Inactive User type class ? Was requested by a user though not part of our original plans. Add users after a period of inactivity to a group.

Possible selectors:
user_lastvisit is a timestamp reflecting the last time a user logged in. This could be used in cron to add users. But it should probably also be called at login to remove a user (since they've just become active again). If the value is 0, it means the user has never logged in.

user_inactive_time is a timestamp set when a user account is deactivated (or just never activated). I'm not sure if this is worth including since it refers to accounts that most likely were just never activated in the first place, and never did anything. If the value is 0, it means the user account is activated. The timestamp is only recorded when an account requiring activation is created, or if an Admin deactivates an account.

Failed to parse time string

I got an error log where this happens a lot:

PHP Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (99-0-9999) at position 6 (9): Unexpected character in ext/phpbb/autogroups/conditions/type/birthdays.php:114

Auto sync

Hello. How to make the autogroup automatically add users, otherwise you have to constantly synchronize data?

Cron

Constantly manually synchronizing data is somehow not right, this should be done by the extension itself, that's what it is intended for, but it turns out that the functionality is not complete ...

phpbb.com -> www.phpbb.com

We should be including the www. in the composer.json. This might apply to the other extensions too but I haven't checked.

Add possibility to extend autogroups with non-integer criteria

I would like to have some kind of auto-groups that are not based on "numerical" data. I am talking about the possibility to ADD new auto-group types myself that are NOT integer based.

I have not looked at it at full depth, but I see there is no way to enter "selection criteria" other than min and (optional) max integer values. This rules out things like "if user has rank 1, 3 or 7, add to group 10" or "if profile field blah has value blahblah then add user to group hasblahblah".

Note that I am looking for ways to EXTEND the extension (as you describe in the wiki) by using other types of criteria. Maybe if the extension would provide some PHP events and Template events (plus the option to have "conditional" areas in the ACP depending on the auto-group type) that would be possible.

Check membership when member visits

Use an event to run the membership check for a specific user when they visit, so they can be immediately added or removed from a user group based on the length of their membership.

Currently this is just checked by cron jobs and after registering. It should also be checked when the user is logged in or becomes active on the board.

Option to exempt from autogrouping

Currently we have an option to exempt user groups from losing their default state if autogroup is set to bacome the default one.
There can be the cases when administrator wants individual users (user groups) to be exempted from autogrouping at all eventhough they (their members) comply existing autogroups rules.

We could want to add this option to the extension, although I'm not sure if this option should be per-group-based or global-based, or both.

Fix PHP Notice when encountering users in no group

In rare cases where a user does not belong to any group, Auto Groups triggers a PHP notice when trying to test if that user belongs to any groups due to the array being null during in_array() at these lines:
https://github.com/phpbb-extensions/autogroups/blob/master/conditions/type/base.php#L187
https://github.com/phpbb-extensions/autogroups/blob/master/conditions/type/base.php#L193

We should makes sure that $user_groups[$user_id] is always an array.

Moving "excluded" when selected not to

With the setting to exclude particular groups, every time it updates the groups, it adds my moderator accounts to the other member groups I have set up by membership date even though it states those groups were selected to be excluded.

min/max post count edge case (autogroups_max_value == 0)

hello,

in your logic, you have chosen autogroups_max_value == 0 as the mechanism of disabling automatic removal from the chosen usergroup.

unfortunately, i believe this value has meaningful significance. it could be used to remove users who have made one post.

would you consider using autogroups_max_value == -1 to disable automatic removal or perhaps adding a checkbox input to disable it? thanks

To-Do List

This is just a basic to-do list for Auto Groups:

Need to complete for Beta release:

  • ACP Interface PR #31
  • ACP Option to exempt groups from having their default status changed
  • Notifications PR #14
  • Membership Days type class (called via daily cron, using user_regdate) PR #18 & #19
  • User Age type class ?? (called via daily cron, using user_birthday)
  • Warnings type class (called by events, using user_warnings) PR #25
    • warnings added events: core.mcp_warn_post_after, core.mcp_warn_user_after
    • warnings deleted in acp_users.php (no event exists) and tidy_users() (no event exists)
  • Break services.yml up (move cron, notification and type services into separate service files) PR #33

Can be completed after Beta release:

  • Inactive User type class ?? (called via daily cron, using user_lastvisit and user_inactive_time)
  • Unit test the manager and controller classes
  • Functional tests ?

Membership days with account activation enabled

With PR #145 the Membership Days condition adds a user to the group if the minimum value is set to 0. This only works if the user gets immediate access to the account. With user activation or admin activation enabled, the account status is inactive which excludes the user from being added to the group. The Auto Groups extension would need to call this code whenever an account is activated, either by the admin or by the user.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.