Note that there are some explanatory texts on larger screens.

plurals
  1. POJoomla 1.5 com_user and importing user plugins like Joomla 1.6 and above
    primarykey
    data
    text
    <p>When accessing com_users component in Joomla 1.6 and 1.7 on front-end the application automatically imports all plugins from 'user' group. Obviously it is very useful if one doesn't want to create a component to simply pass some variables to a plugin.</p> <p>Ok. let's make it simplier:</p> <ol> <li>User gets an activation link: <a href="http://example.com/index.php?option=com_users&amp;task=edit&amp;emailactivation=1&amp;u=63&amp;d077b8106=1" rel="nofollow">http://example.com/index.php?option=com_users&amp;task=edit&amp;emailactivation=1&amp;u=63&amp;d077b8106=1</a> and clicks it.</li> <li>Of course the component will omit <strong>emailactivation</strong> and other params simply displying "Edit Profile Form" (or login form for guests).</li> <li>Then JApplication imports all plugins from '<strong>user</strong>' group, which triggers __constructors</li> </ol> <p>Basically, with plugin's <strong>__constructor</strong> one can set up simple action like this one below:</p> <pre><code>class plgUserAccountactivation extends JPlugin { public function __construct(&amp; $subject, $config) { parent::__construct($subject, $config); if(isset($_GET['emailactivation'])) { // check token // activate account, email or whatever // redirect with message } } } </code></pre> <p>Wow! It works, it is not necessary to create a whole controller to handle one simple task.</p> <p>But hold on a minute...</p> <ul> <li>In the link change index.php?option=com_users to index.php?option=com_user</li> <li>And let's try on Joomla 1.5...</li> </ul> <p>Hey, hey, nothing happens com_user didn't import anything at all and __constructor wan't called.</p> <p>I am very troubled by this in Joomla 1.5 and I don't feel like writing whole component. </p> <p>Should anybody have some bright idea, please let me know.</p> <p><strong>Edit:</strong> I've solved my problem by sending the link in the following form:</p> <blockquote> <p>http:/example.com/index.php?option=com_user&amp;<strong>task=logout</strong>&amp;emailactivation=1&amp;u=63&amp;d077b8106=1</p> </blockquote> <p>This way user plugins are included and __constructors are executed. But this is so frivolous as <strong>task=logout</strong> doesn't really encourage to click in the link.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload