Jump to content

Registering Users.login And Users.logout Events


MartyIX

Recommended Posts

Hello,

 

I try to implement a plugin that would integrate Blesta with our system and I would like to use callbacks: "Users.login" and "Users.logout" (http://docs.blesta.com/display/dev/Event+Handlers). I tried to register these two events as follows:

 

class MyPlugin extends Plugin {

...

public function getEvents() {
 return array(
   array(
      'event' => "Appcontroller.preAction",
      'callback' => array("this", "run")
   ),
   array(
      'event' => "Users.login",
      'callback' => array("this", "userWasLoggedIn"),
   ),
   array(
     'event' => "Users.logout",
     'callback' => array("this", "userWasLoggedOut")
   )
  );
}

// This method IS called.
public function run($event) {


        echo "run -- method";      
}

// This method is NOT called.
public function userWasLoggedIn($event) {


          var_dump("in", $event);
          throw new \Excepion("aaa");
}

// This method is NOT called.

public function userWasLoggedOut($event) {          
     var_dump("out", $event);          
    throw new \Excepion("sss");
}

}

 

The problem is that the methods userWasLoggedIn and userWasLoggedOut are not called when a user submits form located at https://blesta.domain.com/client/login/

 

http://docs.blesta.com/display/dev/Event+Handlers - I've just noticed that the events are available since version 3.1. Does it mean that the events will be available in the next release of Blesta? As far as I know the last released version is 3.0.5.

Link to comment
Share on other sites

http://docs.blesta.com/display/dev/Event+Handlers - I've just noticed that the events are available since version 3.1. Does it mean that the events will be available in the next release of Blesta? As far as I know the last released version is 3.0.5.

 

Yes, v3.1 has not yet been released, so those events are not usable with any version of Blesta currently available.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...