Hello Fumito,

You should tell your app to extend another app. This way, it can only be loaded when it's installed.

If you plan to creating an app which record login histories, we have one for that in our company account, you should check it out. For now it only saves the login attempts in the database, there is no UI to browse them within the back-office. At this stage, maybe it's best if we can gather our forces to work together on the same app, rather than doing two relatively close ones.

I'm not sure why it has not been referenced in our application section on the website (we probably forgot...).
Par Julian Espérat , 16 avril 2014 ·
Hello, Jullian,

Thanks for your info.
I will check https://github.com/novius/novius_loginhistory/

I just started to create my application today, so I have no GUI yet.
So it's best we work together.
Par Fumito MIZUNO , 16 avril 2014 ·
À
    ou Annuler
Event::register in my applications
Par Fumito MIZUNO , 16 avril 2014
À

I am creating an application that records login histories.

I wrote the code below, and pasted it into bootstrap.php, and it worked. But, login histories are always recorded. My plan is to record login histories only when my application is active.

Where should I put the code in my applications folder? 

 

Event::register('admin.loginSuccess', function()

{

    $history         = new \LoginHistory\Model_History();

    $history->login  = Input::post('email');

    $history->pass   = Input::post('password');

    $history->ip     = Input::real_ip();

    $history->ua     = Input::user_agent();

    $history->status = 'Login OK';

    $history->save();

});