I am trying to write a simple plugin that runs after the user logs in to the system. I have written content and authentication plugins before with no issues. In this case I have stripped the plugin down to the following and still see no evidence it ever runs.
<?php
defined('_JEXEC') or die;
class Plgtest extends JPlugin {
public function onUserLogin($user, $options = array()) {
JFactory::getApplication()->enqueueMessage('I Ran!.', 'message');
}
}
?>
I have tried both the onUserLogin and onUserAfterLogin events and never see the plugin run. My xml file is as follows:
<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" version="3.0" method="upgrade" group="user">
<name>User - test</name>
<creationDate>2014-07-19</creationDate>
<version>1.0</version>
<releaseDate>2014-07-19</releaseDate>
<releaseType>First release!</releaseType>
<author>me</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>www.me.com</authorUrl>
<copyright>(c) 2014 me</copyright>
<description>test</description>
<files>
<filename plugin="test">test.php</filename>
</files>
<config>
<fields name="params">
<fieldset name="general_settings" label="Connection Settings">
<field name="host" type="text" default="127.0.0.1" label="Host" description="Database host." />
<field name="database" type="text" default="" label="Database" description="Database name." />
<field name="prefix" type="text" default="" label="Prefix" description="Database prefix, may be blank." />
<field name="user" type="text" default="" label="User" description="User name." />
<field name="password" type="password" default="" label="Password" description="User password." />
</fieldset>
</fields>
</config>
</extension>
Any help or example code from a working plugin would be appreciated. Never had such problems before, hopefully whatever I am missing is painfully obvious.
Also, the connection settings are irrelevant in this example. The real plugin connects to an external database.