Online demo Privacy policy

Custom authentication

Piler from version 1.2.0 (including the master branch) allows you to alter or fix the authentication, eg. add extra email addresses, etc. You may think about it as a post authentication hook.

The following example adds a 2nd domain name to your email addresses. Let's say you have two addresses, and, and you want to read emails for, and Then add the following to config-site.php:

$config['CUSTOM_EMAIL_QUERY_FUNCTION'] = 'my_custom_func';

function my_custom_func($username = '') {
   $session = Registry::get('session');
   $data = $session->get("auth_data");

   $a = array();

   foreach($data['emails'] as $email) {
      $s = explode("@", $email);
      array_push($a, $s[0] . "");

   $data['emails'] = array_merge($data['emails'] , $a);

   $session->set("auth_data", $data);

If you want to change some aspects of the gui before the authentication takes place, then write a similar function. The following example would allow logins from a certain domain only, and reject others:


function iii($username = '') {
   global $session;

   if(!strstr($username, "")) {
      $session->set("auth_data", array());
Google Analytics Alternative