We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Help with EE Extensions

Development and Programming

mithra62's avatar
mithra62
39 posts
8 years ago
mithra62's avatar mithra62

I’ve had some requests for a couple of my EE2 add-ons be ported to EE3, but am having some issues since, I think, some hooks behave differently now. For example, Securit:ee relied heavily on a LOT of hooks that don’t appear to exist any longer. Any chance I can get a cheat sheet on how best to reconcile?

Export It

Extension Hooks

cp_menu_array (Just adds menu to CP)

Securit:ee

Extension Hooks

sessions_start (IP Locker)

Has to check the member_id and member_group for access to front/back end of site based on IP

cp_member_login (CP Quick Deny)

Has to check the member_id and member_group for access to backend of site based on member_group and/or member_id

cp_member_login (CP Login Alert)

Sends an email when someone logs into the backend

cp_members_member_delete_end (Forgot Password)

Just used to remove any temp data that may be stored during the Forgot Password flow (hashes and the like)

sessions_end (Password Expire)

This one’s tricky and where a real problem lies. If the CP is configured to require a session ID in URLs, then this hook can’t access the value since it doesn’t exist at the time this hook is called now.

cp_members_member_create (Member Registration Nofication)

Just sends a custom registration email on account creation in the CP

sessions_end (Member Expire)

Has to dispaly an error page if a member account is expired

Entry Analytics

Extension Hooks cp_menu_array (Injection of the CP JavaScript for entry stats widget)

channel_entries_query_result (injection into tempalte tags)

post_controller (REALLY important to handle the override on debug output)

Any ideas?

       
Pedro Guimaraes's avatar
Pedro Guimaraes
170 posts
8 years ago
Pedro Guimaraes's avatar Pedro Guimaraes

Are you sure you’ve checked the latest docs? For example, sessions_end and sessions_start both exist in EE3 as shown in the Session Library Extension Hooks

EE Extension Hooks

       
mithra62's avatar
mithra62
39 posts
8 years ago
mithra62's avatar mithra62

Yes, I have indeed. Those hooks were listed for completeness, but also because the behavior changed and it those hooks no longer work as they used to. Previously, there was access to the session id but that’s no longer the case.

       
Pedro Guimaraes's avatar
Pedro Guimaraes
170 posts
8 years ago
Pedro Guimaraes's avatar Pedro Guimaraes

I just look at /ee/legacy/libraries/Session.php and it looks like session_id is indeed still available…

       
mithra62's avatar
mithra62
39 posts
8 years ago
mithra62's avatar mithra62

So, you’re saying that if I call the sessions_end hook on a CP request, I’ll have access to the value for session_id that’s expected in the query string security checks, like it used to in EE <= 2.8 (or whenever it changed)?

Is that what you’re saying? Because, the variable being defined in that file isn’t the same as being defined AND having a value that passes the security, you know?

       
Pedro Guimaraes's avatar
Pedro Guimaraes
170 posts
8 years ago
Pedro Guimaraes's avatar Pedro Guimaraes

I’m not entirely sure what you’re trying to do, but I can confirm that the session_id is the same that is in the exp_sessions table.

       
mithra62's avatar
mithra62
39 posts
8 years ago
mithra62's avatar mithra62

VERY cool! Ok, thanks Pedro. Any idea on the other hooks?

       
Derek Jones's avatar
Derek Jones
7,561 posts
8 years ago
Derek Jones's avatar Derek Jones

cp_menu_array:

Have you checked out the new menu hook in the 3.4.0 developer preview?

sessions_start, sessions_end:

These haven’t changed, per se. They have always been a bit unusual in that they occur in the class’s constructor, so they are executed while PHP is still instantiating the object. So session won’t be on the facade since it technically doesn’t exist yet. But we’ve always passed the session object as a parameter and recommended its use—are you taking advantage of that? If so, please share what isn’t working.

cp_member_login, cp_members_member_delete_end, cp_members_member_create, channel_entries_query_result:

None of these hooks changed to my knowledge. If you’re having issues, please share your code and let us know what isn’t working as expected.

post_controller:

This was a CodeIgniter system-level “hook” and not an ExpressionEngine extension hook. We removed them entirely in v3 as it’s confusing to have separate entrance points for extending the system, and CI’s hooks were not supported anyway as they are not installable or manageable without manual manipulation on the part of the end user.

Let us know what you’re wanting to do, perhaps even requesting a specific extension hook (and identifying the location in the code) that you’d like to see, and we can see if we can accommodate that with a new properly supported hook.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.