title: Joomla override users component model
body: <p>I'm writing a few plugins to handle user information through an API.  There aren't any default processes I've found that could handle this entirely, so I'm using onAfterRoute to override the component model classes.</p>
  
  <p>This is just checking that the component = com_users, and the view = reset or remind:</p>
  
  <pre><code>class plgSystemUseroverride extends JPlugin {
  
             public function __construct(&amp;$subject, $config = array()) {
                parent::__construct($subject, $config);
            }
  
            public function onAfterRoute() {
                $app = JFactory::getApplication();
                $input = $app-&gt;input;
                if('com_users' == $input-&gt;get('option') &amp;&amp; 'reset' == $input-&gt;get('view') &amp;&amp; !$app-&gt;isAdmin()) {              
                    require_once(dirname(__FILE__) . '/user/reset.php');
                }
  
                if('com_users' == $input-&gt;get('option') &amp;&amp; 'remind' == $input-&gt;get('view') &amp;&amp; !$app-&gt;isAdmin()) {
                    require_once(dirname(__FILE__) . '/user/remind.php');
                }
            }
       }
  </code></pre>
  
  <p>The files are copied from the users component, and I modified 'remind' for my testing:
  method processRemindRequest:</p>
  
  <pre><code>$return = JFactory::getMailer()-&gt;sendMail($data['mailfrom'], $data['fromname'], $user-&gt;email, $subject . " TEST Subject", $body);
  </code></pre>
  
  <p>The modification works fine if edit the component files directly, but as a plugin the classes are not being overridden.</p>