Can "Report Builder" plugin calculate/display which account users logged in and how many times during a given period(month, 6 weeks, etc.)?

3 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: May 31, 2013   (RSS)

By gregThomas - May 31, 2013

Hi Equinox,

The report builder plugin won't be able to do this automatically, as there isn't a table that stores how often a user logs into the CMS.

But if you create a second plugin to add a record to a table when a user logs in you could use this information in report builder. You would need to use the login_isValidLogin plugin filter, along with the detecting when the login form has been filled in by detecting when $_REQUEST['action'] equals loginSubmit.

The record update plugin would need to look something like this:

  addFilter('login_isValidLogin', 'websiteLogin_login', 0, 1);
  

  function websiteLogin_login($acc) {

    list($isValidLogin, $user, $updateLastLoginDate) = $acc;
    
    if(@$_REQUEST['action'] == 'loginSubmit' && $isValidLogin){
      //update code in here
    }

    return array($isValidLogin, $user, $updateLastLoginDate);
  }

It would be fairly quick for us to create this plugin for you if you require. If you send an e-mail to consulting@interactivetools.com we can give you an estimate of the cost.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By Codee - May 31, 2013

Thanks for the quick response, Greg!