[php] Add event to acp_users.php (core.acp_user_add)

These event requests have either been rejected by the community or have become redundant because of code changes or other events requests.
User avatar
John P
Posts: 157
Joined: Sun Nov 04, 2012 7:39 am
Location: Netherlands
Contact:

[php] Add event to acp_users.php (core.acp_user_add)

Post by John P »

Identifer: core.acp_user_add
Location: includes/acp_users.php
Parameters: 'id', 'mode', 'username', 'user_id', 'trigger_override'

Explanation: To be able to add a new user in user management. About line 99

Code: Select all

                // A listener can set this variable to `true` when it overrides this function
                $trigger_override = false;
                /**
                * Run Add user
                *
                * @event core.acp_user_add
                * @var    int        id                    Module id
                * @var    string    mode                Module mode
                * @var    string    username            username
                * @var    int        user_id                user_id
                * @var    bool    trigger_override    Shall we return to normal operations
                * @since 3.1.0-RC4
                */
                $vars = array('id', 'mode', 'username', 'user_id', 'trigger_override');
                extract($phpbb_dispatcher->trigger_event('core.acp_user_add', compact($vars)));

                if (!$trigger_override)
                {
                    trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING);
                }
In mode overview around line 187 change to

Code: Select all

                include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
Tracker: https://tracker.phpbb.com/browse/PHPBB3-13037
PR: https://github.com/phpbb/phpbb/pull/2924

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: [php] Add event to acp_users.php (core.acp_user_add)

Post by DavidIQ »

Not sure what the purpose of adding an event here would be. Wouldn't you just create a separate module for adding users? You would just create the module and include functions_user.php in it, which is what the "Add users" MOD does. Or am I missing something?
Image

User avatar
John P
Posts: 157
Joined: Sun Nov 04, 2012 7:39 am
Location: Netherlands
Contact:

Re: [php] Add event to acp_users.php (core.acp_user_add)

Post by John P »

Well, we should create extensions and not modules for 3.1.
In this way you can add a new user, enabling this extension, where it will ask you if it should create a new user if the username is not found. You have the possibility to cancel if it's typo.

User avatar
Pony99CA
Registered User
Posts: 986
Joined: Sun Feb 08, 2009 2:35 am
Location: Hollister, CA
Contact:

Re: [php] Add event to acp_users.php (core.acp_user_add)

Post by Pony99CA »

John P wrote:Well, we should create extensions and not modules for 3.1.
Is that gospel according to phpBB developers, or just your opinion? I think that Modules (and plug-ins, like CAPTCHA plug-ins) should still be used where appropriate in phpBB (but that's just my opinion).

Steve
Silicon Valley Pocket PC (http://www.svpocketpc.com)
Creator of manage_bots and spoof_user (ask me)
Need hosting for a small forum with full cPanel & MySQL access? Contact me or PM me.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: [php] Add event to acp_users.php (core.acp_user_add)

Post by DavidIQ »

John P wrote:Well, we should create extensions and not modules for 3.1.
In this way you can add a new user, enabling this extension, where it will ask you if it should create a new user if the username is not found. You have the possibility to cancel if it's typo.
Not sure where you got that from. Using a module that encapsulates everything you need to do in the ACP is still highly encouraged. We're not looking to force every single extension to use events. Some don't need to use any at all. What we will enforce/require is that extensions should not need any edits to the core.
Image

User avatar
John P
Posts: 157
Joined: Sun Nov 04, 2012 7:39 am
Location: Netherlands
Contact:

Re: [php] Add event to acp_users.php (core.acp_user_add)

Post by John P »

Think I saw it at phpbb.com somewhere, when I find it I will give you the link.
But what is the point, one event and this is possible with an extension, just upload, enable and ready.
If you don't enable this extension the functionality doesn't change.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: [php] Add event to acp_users.php (core.acp_user_add)

Post by DavidIQ »

But that's the same as with a module and you don't need an event. ;-) So this would basically be adding a next to useless event. The existence of modules is why the ACP, UCP, and MCP are not more widely extended. One can simply add a new module if they want to add new functionality. That is what was done in the 3.0 ACP user add MOD:
https://www.phpbb.com/community/viewtop ... 9&t=580108
Image

User avatar
John P
Posts: 157
Joined: Sun Nov 04, 2012 7:39 am
Location: Netherlands
Contact:

Re: [php] Add event to acp_users.php (core.acp_user_add)

Post by John P »

I really believe the strength of 3.1 Is the possibility to add extensions, plugins or whatever they are named. No more ftp'ing files and or changing files. No more adding modules, but just upload and enable and ready. Looking at our Upload Extensions, it's already more then 400 times downloaded. So I think people want to work this way, and because of that I don't think it's a useless event.

Nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 299
Joined: Sun Apr 13, 2014 1:40 am
Location: Paris

Re: [php] Add event to acp_users.php (core.acp_user_add)

Post by Nicofuma »

But a module is added by an extension... (like the auth plugins, cache plugins etc...)
Member of the phpBB Development-Team
No Support via PM

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: [php] Add event to acp_users.php (core.acp_user_add)

Post by DavidIQ »

Nicofuma wrote:But a module is added by an extension... (like the auth plugins, cache plugins etc...)
Exactly. Installing one would therefore be done exactly the same way and by even using the now popular "Upload Extension" extension.
Image

Post Reply