Hello,
I'm running Elgg 3.3.12 and attempting to create a custom login page. I've created the plugin as per Elgg 3.0 recommended structure, but I'm having problems with redirecting the action to use the login script in my_plugin > actions > myplugin. I have read many pages of documentation and looked at other plugins, but I cannot get it work. Either it defaults to the Elgg login script or says "You don't have permission to view the requested page" or the "action/login cannot be found". I'm now completely lost.
Could someone please point me in the right direction or to an example?
Many thanks.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 1 like
The mentioned code means you have your own custom login action in /mod/YOUR_COOL_PLUGIN/actions/login.php
- VinceK@vincek
VinceK - 0 likes
You must log in to post replies.Have you defined 'action/login' in your plugin?
In elgg-plugin.php:
You're a star! I needed both your suggestions.
The problem was I had read so many different examples and docs relating to earlier Elgg versions I ended up with a muddle of actions, routes and calls to registers. i.e. in elgg-plugin.php I had tried:
'actions' => [ 'login' => [], ],
'login' => ['path' => '/actions/my_plugin', 'resource' => 'actions/my_plugin', ],]
'actions' => ['login' => ['access' => 'public', 'filename' => __DIR__ . '/actions/login.php']
I was also a little confused about the correct directory structure, I had incorrectly placed the login script in my_plugin/actions/my_plugin
Thanks again.