How are cmsmadesimple events sent?

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
darwin31
New Member
New Member
Posts: 3
Joined: Wed Feb 19, 2014 3:01 pm

How are cmsmadesimple events sent?

Post by darwin31 »

Hi,
I need help with cmsmadesimple events. I'm trying handle modules FrontEndUsers event OnLogin. This module initiates this event in method.install.php:

Code: Select all

$this->CreateEvent( 'OnLogin' );
In my Civicrm module method.instal.php I register OnLogin handler:

Code: Select all

$this->AddEventHandler( 'FrontEndUsers', 'OnLogin' );
So, lets start. FrontEndUser sends this event in action.do_login.php with:

Code: Select all

$parms = array();
$parms['id'] = $this->LoggedInId();
$parms['username'] = $params['feu_input_username'];
$parms['ip'] = cge_utils::get_real_ip();
$this->SendEvent( 'OnLogin', $parms );
$this->_SendNotificationEmail('OnLogin',$parms);
I do in CiviCRM module:

Code: Select all

public function DoEvent($originator, $eventname, &$params)
{
    if ($originator == 'FrontEndUsers' && $eventname == 'OnLogin')
        var_dump($params);
        die("feulogin");
    }
}
When you do front login, script is terminated as expected, but when trying to debug $params, got confused how event is send, because even commented out:

Code: Select all

//$this->SendEvent( 'OnLogin', $parms ); 
DoEvent()handles event as well (exits script with message).

Couldnt find any more code in FrontEndUsers where OnLogin event is sent, so please help me find out that.
chandra

Re: How are cmsmadesimple events sent?

Post by chandra »

darwin31 wrote: CiviCRM module.
Sounds interesting... will this module be open source?
darwin31
New Member
New Member
Posts: 3
Joined: Wed Feb 19, 2014 3:01 pm

Re: How are cmsmadesimple events sent?

Post by darwin31 »

Solved it myself. FrontEndUsers also sends event OnLogin in method 'Login'
chandra

Re: How are cmsmadesimple events sent?

Post by chandra »

chandra wrote:
Sounds interesting... will this module be open source?
Bump
darwin31
New Member
New Member
Posts: 3
Joined: Wed Feb 19, 2014 3:01 pm

Re: How are cmsmadesimple events sent?

Post by darwin31 »

chandra wrote:
chandra wrote:
Sounds interesting... will this module be open source?
Bump
Hi chandra, of cource it's open source module, but in alpha stage yet.
Post Reply

Return to “The Lounge”