├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── README.md ├── composer.json ├── install.script.php ├── packages ├── lib_catcher │ ├── catcher.xml │ ├── language │ │ └── en-GB │ │ │ └── en-GB.lib_catcher.ini │ └── plugin │ │ └── abstract.php ├── plg_content_catcher │ ├── catcher.php │ ├── catcher.xml │ └── language │ │ └── en-GB │ │ ├── en-GB.plg_content_catcher.ini │ │ └── en-GB.plg_content_catcher.sys.ini ├── plg_extension_catcher │ ├── catcher.php │ ├── catcher.xml │ └── language │ │ └── en-GB │ │ ├── en-GB.plg_extension_catcher.ini │ │ └── en-GB.plg_extension_catcher.sys.ini └── plg_user_catcher │ ├── catcher.php │ ├── catcher.xml │ └── language │ └── en-GB │ ├── en-GB.plg_user_catcher.ini │ └── en-GB.plg_user_catcher.sys.ini ├── pkg_catcher.xml └── scripts └── build ├── build.properties └── build.xml /.gitignore: -------------------------------------------------------------------------------- 1 | scripts/build/pkg_catcher.tar.gz -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | CHANGELOG 2 | ========= 3 | 4 | This changelog references the relevant changes (features, bug and security fixes) done. 5 | 6 | * 1.0.4 (2015-10-21) 7 | * Fixed - Fixed package name and type. 8 | 9 | * 1.0.3 (2015-06-22) 10 | * Improved - Moved repository and updated docblocks 11 | 12 | * 1.0.2 (2014-11-17) 13 | * Improved - Updated Composer information 14 | 15 | * 1.0.1 (2014-11-10) 16 | * Added - Added support for logging events in log files 17 | 18 | * 1.0.0 (2014-09-19) 19 | * Added - First stable release 20 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Please read [Contributing to Joomlatools Projects](http://developer.joomlatools.com/contribute.html) 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Joomlatools Catcher 2 | =================== 3 | 4 | Catcher is a bundle of plugins and a library for catching and debug Joomla! events. 5 | 6 | ## Installation 7 | 8 | ### Composer 9 | 10 | Go to the root directory of your Joomla installation in command line and execute this command: 11 | 12 | ``` 13 | composer require joomlatools/joomla-catcher:* 14 | ``` 15 | 16 | ### Phing 17 | 18 | For convenience, a [phing](http://www.phing.info/) script for building the package is also available under the `/scripts/build` folder of the repo. 19 | 20 | After building it, the package may be installed using the Joomla! extension manager. 21 | 22 | ## Usage 23 | 24 | After the package is installed, make sure to enable the plugins and configure them to catch and report events. 25 | 26 | ## Contributing 27 | 28 | Joomlatools Catcher is an open source, community-driven project. Contributions are welcome from everyone. 29 | We have [contributing guidelines](CONTRIBUTING.md) to help you get started. 30 | 31 | ## Contributors 32 | 33 | See the list of [contributors](https://github.com/joomlatools/joomla-catcher/contributors). 34 | 35 | ## License 36 | 37 | Joomlatools Catcher is free and open-source software licensed under the [GPLv3 license](LICENSE.txt). 38 | 39 | ## Community 40 | 41 | Keep track of development and community news. 42 | 43 | * Follow [@joomlatoolsdev on Twitter](https://twitter.com/joomlatoolsdev) 44 | * Join [joomlatools/dev on Gitter](http://gitter.im/joomlatools/dev) 45 | * Read the [Joomlatools Developer Blog](https://www.joomlatools.com/developer/blog/) 46 | * Subscribe to the [Joomlatools Developer Newsletter](https://www.joomlatools.com/developer/newsletter/) 47 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "joomlatools/joomla-catcher", 3 | "type": "joomla-installer", 4 | "license": "GPL-3.0-only", 5 | "description": "A bundle of plugins and a library for catching and debug Joomla! events", 6 | "keywords": [ 7 | "joomla", 8 | "extension", 9 | "events", 10 | "plugins", 11 | "nooku" 12 | ], 13 | "homepage": "https://github.com/joomlatools/joomla-catcher", 14 | "authors": [ 15 | { 16 | "name": "Timble", 17 | "email": "info@timble.net", 18 | "homepage": "http://www.timble.net" 19 | } 20 | ], 21 | "require": { 22 | "joomlatools/installer": "*" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /install.script.php: -------------------------------------------------------------------------------- 1 | 6 | * @link https://github.com/joomlatools/joomla-catcher for the canonical source repository 7 | */ 8 | defined('_JEXEC') or die; 9 | 10 | class pkg_catcherInstallerScript 11 | { 12 | protected $_query = "UPDATE `#__extensions` SET `protected` = %u WHERE `type` = 'library' AND `element` = 'catcher'"; 13 | 14 | public function uninstall($installer) 15 | { 16 | $db = JFactory::getDBO(); 17 | $db->setQuery(sprintf($this->_query, 0)); 18 | $db->query(); 19 | 20 | return true; 21 | } 22 | 23 | public function postflight($type, $installer) 24 | { 25 | $db = JFactory::getDBO(); 26 | $db->setQuery(sprintf($this->_query, 1)); 27 | $db->query(); 28 | 29 | return true; 30 | } 31 | } -------------------------------------------------------------------------------- /packages/lib_catcher/catcher.xml: -------------------------------------------------------------------------------- 1 | 2 | Catcher Library 3 | catcher 4 | Timble 5 | October 2015 6 | Copyright (C) 2015 Timble CVBA 7 | GNU GPLv3 - http://www.gnu.org/licenses/gpl.html 8 | https://github.com/joomlatools/joomla-catcher 9 | info@timble.net 10 | www.timble.net 11 | 1.0.4 12 | Base classes for events catching plugins 13 | 14 | plugin 15 | language 16 | 17 | 18 | en-GB/en-GB.lib_catcher.ini 19 | 20 | -------------------------------------------------------------------------------- /packages/lib_catcher/language/en-GB/en-GB.lib_catcher.ini: -------------------------------------------------------------------------------- 1 | ; Copyright © 2015 Timble CVBA. (http://www.timble.net) 2 | ; GNU GPLv3 3 | ; Note : All ini files need to be saved as UTF-8 4 | 5 | LIB_CATCHER_MESSAGE_CONTEXT="%s triggered in %s context" 6 | LIB_CATCHER_MESSAGE_DEFAULT="%s has been triggered" 7 | LIB_CATCHER_DISPLAY_HIDE_DATA="Display/Hide data" 8 | LIB_CATCHER_ITEM_NEW="The item is NEW" 9 | LIB_CATCHER_ITEM_NOT_NEW="The item is NOT new" -------------------------------------------------------------------------------- /packages/lib_catcher/plugin/abstract.php: -------------------------------------------------------------------------------- 1 | 6 | * @link https://github.com/joomlatools/joomla-catcher for the canonical source repository 7 | */ 8 | defined('_JEXEC') or die; 9 | 10 | /** 11 | * Catcher Abstract Plugin. 12 | */ 13 | abstract class LibCatcherPluginAbstract extends JPlugin 14 | { 15 | public function __construct(&$subject, $config = array()) 16 | { 17 | parent::__construct($subject, $config); 18 | 19 | // Load library translations. 20 | JFactory::getLanguage()->load('lib_catcher', JPATH_ROOT); 21 | } 22 | 23 | /** 24 | * Reports an event. 25 | * 26 | * @param string $event The name of the event to report. 27 | * @param array $config An optional configuration array. 28 | */ 29 | protected function _reportEvent($event, $config = array()) 30 | { 31 | $config = array_merge(array( 32 | 'data' => array(), 33 | 'message' => array(), 34 | 'new' => null 35 | ), $config); 36 | 37 | if (!isset($config['message']['text'])) { 38 | $config['message'] = array('text' => 'LIB_CATCHER_MESSAGE_DEFAULT', 'parameters' => array($event)); 39 | } 40 | 41 | $events = $this->params->get('events', array()); 42 | 43 | if (in_array($event, $events)) 44 | { 45 | $output = '
'; 46 | 47 | $args = $config['message']['parameters']; 48 | 49 | array_unshift($args, $config['message']['text']); 50 | 51 | $message = call_user_func_array(array('JText', 'sprintf'), $args); 52 | 53 | $output .= $message; 54 | 55 | if (isset($config['new'])) 56 | { 57 | if ($config['new']) { 58 | $output .= '
' . JText::_('LIB_CATCHER_ITEM_NEW'); 59 | } else { 60 | $output .= '
' . JText::_('LIB_CATCHER_ITEM_NOT_NEW'); 61 | } 62 | } 63 | 64 | if ($this->params->get('show_data') && ($data = $this->_renderData($config['data']))) 65 | { 66 | $signature = sprintf('%s_%s', $event, md5($data . microtime())); 67 | 68 | $output .= '
69 |
70 | 78 |
79 |
'; 80 | 81 | $output .= $data; 82 | 83 | $output .= '
'; 84 | } 85 | 86 | $output .= '
'; 87 | 88 | JFactory::getApplication()->enqueueMessage($output, 'warning'); 89 | 90 | // Add a log entry. 91 | jimport('joomla.log.log'); 92 | JLog::addLogger(array('text_file' => 'catcher.php'), JLog::ALL, array('catcher')); 93 | JLog::add(strip_tags($message), JLog::DEBUG, 'catcher'); 94 | } 95 | } 96 | 97 | /** 98 | * Renders event data 99 | * 100 | * @param array $data An associative array containing data 101 | * @param int $level Indentation level 102 | * @return string The rendered data 103 | */ 104 | protected function _renderData($data, $level = 0) 105 | { 106 | $data = (array) $data; 107 | $output = ''; 108 | 109 | if ($data) 110 | { 111 | foreach($data as $key => $value) 112 | { 113 | for ($i = 0; $i < 3*$level; $i++) { 114 | $output .= ' '; 115 | } 116 | 117 | $output .= "{$key}: "; 118 | 119 | if ($value instanceof JObject) { 120 | $value = $value->getProperties(); 121 | } 122 | 123 | if ($value instanceof stdClass) { 124 | $value = (array) $value; 125 | } 126 | 127 | if (is_array($value)) 128 | { 129 | if (!empty($value) || !is_numeric(key($value))) 130 | { 131 | $output .= '
'; 132 | $value = $this->_renderData($value, $level + 1); 133 | } 134 | else $value = implode(', ', $value); 135 | } 136 | 137 | if (is_object($value) && method_exists($value, '__toString')) { 138 | $value = (string) $value; 139 | } 140 | 141 | if (!is_object($value)) { 142 | $output .= $value; 143 | } 144 | 145 | $output .= '
'; 146 | } 147 | } 148 | 149 | return $output; 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /packages/plg_content_catcher/catcher.php: -------------------------------------------------------------------------------- 1 | 6 | * @link https://github.com/joomlatools/joomla-catcher for the canonical source repository 7 | */ 8 | defined('_JEXEC') or die; 9 | 10 | jimport('catcher.plugin.abstract'); 11 | 12 | /** 13 | * Catcher Content Plugin. 14 | */ 15 | class PlgContentCatcher extends LibCatcherPluginAbstract 16 | { 17 | public function onContentChangeState($context, $pks, $value) 18 | { 19 | $data = array('items' => $pks, 'state' => $value); 20 | 21 | $this->_reportEvent('onContentChangeState', array( 22 | 'message' => array( 23 | 'text' => 'LIB_CATCHER_MESSAGE_CONTEXT', 24 | 'parameters' => array('onContentStateChange', $context) 25 | ), 26 | 'data' => $data 27 | )); 28 | } 29 | 30 | public function onContentBeforeSave($context, $data, $isNew) 31 | { 32 | $this->_reportEvent('onContentBeforeSave', array( 33 | 'message' => array( 34 | 'text' => 'LIB_CATCHER_MESSAGE_CONTEXT', 35 | 'parameters' => array('onContentBeforeSave', $context) 36 | ), 37 | 'data' => array('form' => $data), 38 | 'new' => $isNew 39 | )); 40 | } 41 | 42 | public function onContentAfterSave($context, $data, $isNew) 43 | { 44 | $this->_reportEvent('onContentAfterSave', array( 45 | 'message' => array( 46 | 'text' => 'LIB_CATCHER_MESSAGE_CONTEXT', 47 | 'parameters' => array('onContentAfterSave', $context) 48 | ), 49 | 'data' => array('item' => $data), 50 | 'new' => $isNew 51 | )); 52 | } 53 | 54 | public function onContentBeforeDelete($context, $data) 55 | { 56 | $this->_reportEvent('onContentBeforeDelete', array( 57 | 'message' => array( 58 | 'text' => 'LIB_CATCHER_MESSAGE_CONTEXT', 59 | 'parameters' => array('onContentBeforeDelete', $context) 60 | ), 61 | 'data' => array('item' => $data) 62 | )); 63 | } 64 | 65 | public function onContentAfterDelete($context, $data) 66 | { 67 | $this->_reportEvent('onContentAfterDelete', array( 68 | 'message' => array( 69 | 'text' => 'LIB_CATCHER_MESSAGE_CONTEXT', 70 | 'parameters' => array('onContentAfterDelete', $context) 71 | ), 72 | 'data' => array('item' => $data) 73 | )); 74 | } 75 | 76 | public function onContentBeforeDisplay($context, $data, $params, $limitstart) 77 | { 78 | $this->_reportEvent('onContentBeforeDisplay', array( 79 | 'message' => array( 80 | 'text' => 'LIB_CATCHER_MESSAGE_CONTEXT', 81 | 'parameters' => array('onContentBeforeDisplay', $context) 82 | ), 83 | 'data' => array('item' => $data, 'parameters' => $params, 'limitstart' => $limitstart) 84 | )); 85 | } 86 | 87 | public function onContentAfterDisplay($context, $data, $params, $limitstart) 88 | { 89 | $this->_reportEvent('onContentAfterDisplay', array( 90 | 'message' => array( 91 | 'text' => 'LIB_CATCHER_MESSAGE_CONTEXT', 92 | 'parameters' => array('onContentAfterDisplay', $context) 93 | ), 94 | 'data' => array('item' => $data, 'parameters' => $params, 'limitstart' => $limitstart) 95 | )); 96 | } 97 | 98 | public function onContentAfterTitle($context, $data, $params, $limitstart) 99 | { 100 | $this->_reportEvent('onContentAfterTitle', array( 101 | 'message' => array( 102 | 'text' => 'LIB_CATCHER_MESSAGE_CONTEXT', 103 | 'parameters' => array('onContentAfterTitle', $context) 104 | ), 105 | 'data' => array('item' => $data, 'parameters' => $params, 'limitstart' => $limitstart) 106 | )); 107 | } 108 | 109 | public function onContentPrepare($context, $data, $params, $page) 110 | { 111 | $this->_reportEvent('onContentPrepare', array( 112 | 'message' => array( 113 | 'text' => 'LIB_CATCHER_MESSAGE_CONTEXT', 114 | 'parameters' => array('onContentPrepare', $context) 115 | ), 116 | 'data' => array('item' => $data, 'parameters' => $params, 'page' => $page) 117 | )); 118 | } 119 | 120 | public function onContentPrepareForm($form, $data) 121 | { 122 | $this->_reportEvent('onContentPrepareForm', array( 123 | 'data' => array( 124 | 'form' => $form->getName(), 125 | 'data' => $data 126 | ) 127 | )); 128 | } 129 | 130 | public function onContentPrepareData($context, $data) 131 | { 132 | $this->_reportEvent('onContentPrepareData', array( 133 | 'message' => array( 134 | 'text' => 'LIB_CATCHER_MESSAGE_CONTEXT', 135 | 'parameters' => array('onContentPrepareData', $context) 136 | ), 137 | 'data' => array('form' => $data) 138 | )); 139 | } 140 | } -------------------------------------------------------------------------------- /packages/plg_content_catcher/catcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | plg_content_catcher 4 | Timble 5 | October 2015 6 | Copyright (C) 2015 Timble CVBA 7 | GNU GPLv3 - http://www.gnu.org/licenses/gpl.html 8 | https://github.com/joomlatools/joomla-catcher 9 | info@timble.net 10 | www.timble.net 11 | 1.0.4 12 | PLG_CONTENT_CATCHER_XML_DESCRIPTION 13 | 14 | 15 | catcher.php 16 | language 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
41 |
42 |
43 |
44 | -------------------------------------------------------------------------------- /packages/plg_content_catcher/language/en-GB/en-GB.plg_content_catcher.ini: -------------------------------------------------------------------------------- 1 | ; Copyright © 2015 Timble CVBA. (http://www.timble.net) 2 | ; GNU GPLv3 3 | ; Note : All ini files need to be saved as UTF-8 4 | 5 | SHOW_DATA_LABEL="Show data" 6 | SHOW_DATA_DESC="If set to Yes, the data being passed to the event handler will get also displayed" 7 | EVENTS_LABEL="Events" 8 | EVENTS_DESC="The events to be catched" 9 | -------------------------------------------------------------------------------- /packages/plg_content_catcher/language/en-GB/en-GB.plg_content_catcher.sys.ini: -------------------------------------------------------------------------------- 1 | ; Copyright © 2014 Timble CVBA. (http://www.timble.net) 2 | ; GNU GPLv3 3 | ; Note : All ini files need to be saved as UTF-8 4 | 5 | PLG_CONTENT_CATCHER="Events Catcher - Content" 6 | PLG_CONTENT_CATCHER_XML_DESCRIPTION="A plugin for catching content related events" -------------------------------------------------------------------------------- /packages/plg_extension_catcher/catcher.php: -------------------------------------------------------------------------------- 1 | 6 | * @link https://github.com/joomlatools/joomla-catcher for the canonical source repository 7 | */ 8 | defined('_JEXEC') or die; 9 | 10 | jimport('catcher.plugin.abstract'); 11 | 12 | /** 13 | * Catcher Extension Plugin. 14 | */ 15 | class PlgExtensionCatcher extends LibCatcherPluginAbstract 16 | { 17 | public function onExtensionChangeState($context, $pks, $value) 18 | { 19 | $data = array('items' => $pks, 'state' => $value); 20 | 21 | $this->_reportEvent('onExtensionChangeState', array( 22 | 'message' => array( 23 | 'text' => 'LIB_CATCHER_MESSAGE_CONTEXT', 24 | 'parameters' => array('onExtensionChangeState', $context) 25 | ), 26 | 'data' => $data 27 | )); 28 | } 29 | 30 | public function onExtensionBeforeSave($context, $data, $isNew) 31 | { 32 | $this->_reportEvent('onExtensionBeforeSave', array( 33 | 'message' => array( 34 | 'text' => 'LIB_CATCHER_MESSAGE_CONTEXT', 35 | 'parameters' => array('onExtensionBeforeSave', $context) 36 | ), 37 | 'data' => array('form' => $data), 38 | 'new' => $isNew 39 | )); 40 | } 41 | 42 | public function onExtensionAfterSave($context, $data, $isNew) 43 | { 44 | $this->_reportEvent('onExtensionAfterSave', array( 45 | 'message' => array( 46 | 'text' => 'LIB_CATCHER_MESSAGE_CONTEXT', 47 | 'parameters' => array('onExtensionAfterSave', $context) 48 | ), 49 | 'data' => array('item' => $data), 50 | 'new' => $isNew 51 | )); 52 | } 53 | 54 | public function onExtensionBeforeDelete($context, $data) 55 | { 56 | $this->_reportEvent('onExtensionBeforeDelete', array( 57 | 'message' => array( 58 | 'text' => 'LIB_CATCHER_MESSAGE_CONTEXT', 59 | 'parameters' => array('onExtensionBeforeDelete', $context) 60 | ), 61 | 'data' => array('item' => $data) 62 | )); 63 | } 64 | 65 | public function onExtensionAfterDelete($context, $data) 66 | { 67 | $this->_reportEvent('onExtensionAfterDelete', array( 68 | 'message' => array( 69 | 'text' => 'LIB_CATCHER_MESSAGE_CONTEXT', 70 | 'parameters' => array('onExtensionAfterDelete', $context) 71 | ), 72 | 'data' => array('item' => $data) 73 | )); 74 | } 75 | 76 | public function onExtensionAfterInstall($installer, $eid) 77 | { 78 | $data = array('eid' => $eid); 79 | 80 | if (($manifest = $installer->manifest) && $manifest instanceof SimpleXMLElement) { 81 | $data['manifest'] = htmlspecialchars($manifest->asXML()); 82 | } 83 | 84 | $this->_reportEvent('onExtensionAfterInstall', array('data' => $data)); 85 | } 86 | 87 | public function onExtensionAfterUninstall($installer, $eid, $result) 88 | { 89 | $data = array('eid' => $eid, 'result' => $result); 90 | 91 | if (($manifest = $installer->manifest) && $manifest instanceof SimpleXMLElement) { 92 | $data['manifest'] = htmlspecialchars($manifest->asXML()); 93 | } 94 | 95 | $this->_reportEvent('onExtensionAfterUninstall', array('data' => $data)); 96 | } 97 | 98 | public function onExtensionAfterUpdate($installer, $eid) 99 | { 100 | $data = array('eid' => $eid); 101 | 102 | if (($manifest = $installer->manifest) && $manifest instanceof SimpleXMLElement) { 103 | $data['manifest'] = htmlspecialchars($manifest->asXML()); 104 | } 105 | 106 | $this->_reportEvent('onExtensionAfterUpdate', array('data' => $data)); 107 | } 108 | } -------------------------------------------------------------------------------- /packages/plg_extension_catcher/catcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | plg_extension_catcher 4 | Timble 5 | Ocotber 2015 6 | Copyright (C) 2015 Timble CVBA 7 | GNU GPLv3 - http://www.gnu.org/licenses/gpl.html 8 | https://github.com/joomlatools/joomla-catcher 9 | info@timble.net 10 | www.timble.net 11 | 1.0.4 12 | PLG_EXTENSION_CATCHER_XML_DESCRIPTION 13 | 14 | 15 | catcher.php 16 | language 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |
36 |
37 |
38 |
39 | -------------------------------------------------------------------------------- /packages/plg_extension_catcher/language/en-GB/en-GB.plg_extension_catcher.ini: -------------------------------------------------------------------------------- 1 | ; Copyright © 2015 Timble CVBA. (http://www.timble.net) 2 | ; GNU GPLv3 3 | ; Note : All ini files need to be saved as UTF-8 4 | 5 | SHOW_DATA_LABEL="Show data" 6 | SHOW_DATA_DESC="If set to Yes, the data being passed to the event handler will get also displayed" 7 | EVENTS_LABEL="Events" 8 | EVENTS_DESC="The events to be catched" 9 | -------------------------------------------------------------------------------- /packages/plg_extension_catcher/language/en-GB/en-GB.plg_extension_catcher.sys.ini: -------------------------------------------------------------------------------- 1 | ; Copyright © 2015 Timble CVBA. (http://www.timble.net) 2 | ; GNU GPLv3 3 | ; Note : All ini files need to be saved as UTF-8 4 | 5 | PLG_EXTENSION_CATCHER="Events Catcher - Extension" 6 | PLG_EXTENSION_CATCHER_XML_DESCRIPTION="A plugin for catching extension related events" -------------------------------------------------------------------------------- /packages/plg_user_catcher/catcher.php: -------------------------------------------------------------------------------- 1 | 6 | * @link https://github.com/joomlatools/joomla-catcher for the canonical source repository 7 | */ 8 | defined('_JEXEC') or die; 9 | 10 | jimport('catcher.plugin.abstract'); 11 | 12 | /** 13 | * Catcher User Plugin. 14 | */ 15 | class PlgUserCatcher extends LibCatcherPluginAbstract 16 | { 17 | public function onUserBeforeSave($data_old, $isNew, $data_current) 18 | { 19 | $this->_reportEvent('onUserBeforeSave', array( 20 | 'data' => array( 21 | 'user' => $data_old, 22 | 'form' => $data_current 23 | ), 24 | 'new' => $isNew 25 | )); 26 | } 27 | 28 | public function onUserAfterSave($data, $isNew, $result) 29 | { 30 | $this->_reportEvent('onUserAfterSave', array( 31 | 'data' => array('user' => $data, 'result' => $result), 32 | 'new' => $isNew 33 | )); 34 | } 35 | 36 | public function onUserBeforeDelete($data) 37 | { 38 | $this->_reportEvent('onUserBeforeDelete', array('data' => array('user' => $data))); 39 | } 40 | 41 | public function onUserAfterDelete($data) 42 | { 43 | $this->_reportEvent('onUserAfterDelete', array('data' => array('user' => $data))); 44 | } 45 | 46 | public function onUserBeforeSaveGroup($context, $data, $isNew) 47 | { 48 | $this->_reportEvent('onUserBeforeSaveGroup', array( 49 | 'message' => array( 50 | 'text' => 'LIB_CATCHER_MESSAGE_CONTEXT', 51 | 'parameters' => array('onUserBeforeSaveGroup', $context) 52 | ), 53 | 'data' => array('form' => $data), 54 | 'new' => $isNew 55 | )); 56 | } 57 | 58 | public function onUserAfterSaveGroup($context, $data, $isNew) 59 | { 60 | $this->_reportEvent('onUserAfterSaveGroup', array( 61 | 'message' => array( 62 | 'text' => 'LIB_CATCHER_MESSAGE_CONTEXT', 63 | 'parameters' => array('onUserAfterSaveGroup', $context) 64 | ), 65 | 'data' => array('group' => $data), 66 | 'new' => $isNew 67 | )); 68 | } 69 | 70 | public function onUserBeforeDeleteGroup($data) 71 | { 72 | $this->_reportEvent('onUserBeforeDeleteGroup', array('data' => array('group' => $data))); 73 | } 74 | 75 | public function onUserAfterDeleteGroup($data) 76 | { 77 | $this->_reportEvent('onUserAfterDeleteGroup', array('data' => array('group' => $data))); 78 | } 79 | 80 | public function onUserLogin($user, $options) 81 | { 82 | $this->_reportEvent('onUserLogin', array('data' => array('user' => $user, 'options' => $options))); 83 | } 84 | 85 | public function onUserAfterLogin($options) 86 | { 87 | $this->_reportEvent('onUserAfterLogin', array('data' => array('options' => $options))); 88 | } 89 | 90 | public function onUserLogout($credentials, $options) 91 | { 92 | $this->_reportEvent('onUserLogout', array( 93 | 'data' => array( 94 | 'credentials' => $credentials, 95 | 'options' => $options 96 | ) 97 | )); 98 | } 99 | 100 | public function onUserAfterLogout($options) 101 | { 102 | $this->_reportEvent('onUserAfterLogout', array('data' => array('options' => $options))); 103 | } 104 | 105 | public function onUserLogoutFailure($parameters) 106 | { 107 | $this->_reportEvent('onUserLogoutFailure', array('data' => array('parameters' => $parameters))); 108 | } 109 | 110 | public function onUserLoginFailure($credentials, $response) 111 | { 112 | $this->_reportEvent('onUserLoginFailure', array( 113 | 'data' => array( 114 | 'credentials' => $credentials, 115 | 'response' => $response 116 | ) 117 | )); 118 | } 119 | 120 | public function onUserAuthorisationFailure($authorization) 121 | { 122 | $this->_reportEvent('onUserAuthorisationFailure', array('data' => array('authorization' => $authorization))); 123 | } 124 | 125 | public function onUserAuthorisation($response, $options) 126 | { 127 | $this->_reportEvent('onUserAuthorisation', array( 128 | 'data' => array( 129 | 'response' => $response, 130 | 'options' => $options 131 | ) 132 | )); 133 | } 134 | } -------------------------------------------------------------------------------- /packages/plg_user_catcher/catcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | plg_user_catcher 4 | Timble 5 | October 2015 6 | Copyright (C) 2015 Timble CVBA 7 | GNU GPLv3 - http://www.gnu.org/licenses/gpl.html 8 | https://github.com/joomlatools/joomla-catcher 9 | info@timble.net 10 | www.timble.net 11 | 1.0.4 12 | PLG_USER_CATCHER_XML_DESCRIPTION 13 | 14 | 15 | catcher.php 16 | language 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 |
43 |
44 |
45 |
46 | -------------------------------------------------------------------------------- /packages/plg_user_catcher/language/en-GB/en-GB.plg_user_catcher.ini: -------------------------------------------------------------------------------- 1 | ; Copyright © 2015 Timble CVBA. (http://www.timble.net) 2 | ; GNU GPLv3 3 | ; Note : All ini files need to be saved as UTF-8 4 | 5 | SHOW_DATA_LABEL="Show data" 6 | SHOW_DATA_DESC="If set to Yes, the data being passed to the event handler will get also displayed" 7 | EVENTS_LABEL="Events" 8 | EVENTS_DESC="The events to be catched" 9 | -------------------------------------------------------------------------------- /packages/plg_user_catcher/language/en-GB/en-GB.plg_user_catcher.sys.ini: -------------------------------------------------------------------------------- 1 | ; Copyright © 2015 Timble CVBA. (http://www.timble.net) 2 | ; GNU GPLv3 3 | ; Note : All ini files need to be saved as UTF-8 4 | 5 | PLG_USER_CATCHER="Events Catcher - User" 6 | PLG_USER_CATCHER_XML_DESCRIPTION="A plugin for catching user related events" -------------------------------------------------------------------------------- /pkg_catcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Catcher 4 | Timble 5 | October 2015 6 | catcher 7 | 1.0.4 8 | https://github.com/joomlatools/joomla-catcher/ 9 | Timble 10 | http://www.timble.net/ 11 | A bundle of plugins and a library for catching and debug Joomla! events 12 | install.script.php 13 | 14 | plg_content_catcher 15 | plg_extension_catcher 16 | plg_user_catcher 17 | lib_catcher 18 | 19 | -------------------------------------------------------------------------------- /scripts/build/build.properties: -------------------------------------------------------------------------------- 1 | ## 2 | # @package Catcher 3 | # @copyright Copyright (C) 2011 - 2015 Timble CVBA (http://www.timble.net) 4 | # @license GNU GPLv3 5 | # @link https://github.com/joomlatools/joomla-catcher for the canonical source repository 6 | ## 7 | 8 | ## Override config options using: 9 | ## $ phing -Dparam=value 10 | 11 | file.compression=gzip 12 | file.extension=.tar.gz 13 | -------------------------------------------------------------------------------- /scripts/build/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | --------------------------------------------------------------------------------