Skip to content

Instantly share code, notes, and snippets.

@fititnt
Created December 16, 2011 04:06
Show Gist options
  • Save fititnt/1484414 to your computer and use it in GitHub Desktop.
Save fititnt/1484414 to your computer and use it in GitHub Desktop.
Exemplo de como obter variaveis depois do cadastro de um usuario
<?php
// Plugin do tipo user
// No direct access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.plugin.plugin');
class plgUserNomedoplugin extends JPlugin {
/**
* Utility method to act on a user after it has been saved.
*
* This method sends a registration email to new users created in the backend.
*
* @param array $user Holds the new user data.
* @param boolean $isnew True if a new user is stored.
* @param boolean $success True if user was succesfully stored in the database.
* @param string $msg Message.
*
* @return void
* @since 1.6
*/
public function onUserAfterSave($user, $isnew, $success, $msg) {
//$_POST conten todos os dados enviados apoos um usuario ter sido cadastrado com sucesso
//Nesse tipo de plugin da pra fazer rotinas adicionais, como cadastrar em outra tabela
//e afins
//Caso queira fazer algo a cada login/logout, o ideal é usar plugin do tipo autenticacao
print_r($_POST);
die();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment