<?php


/**
  * SquirrelMail Login Auth Plugin
  * Copyright (C) 2001 Tyler Akins
  * Copyright (C) 2004 Paul Lesneiwski <pdontthink@angrynerds.com>
  * This program is licensed under GPL. See COPYING for details
  *
  */


/**
  * Register plugin hooks
  *
  */
function squirrelmail_plugin_init_login_auth()
{
   global $squirrelmail_plugin_hooks;

   $squirrelmail_plugin_hooks['login_cookie']['login_auth'] = 'login_auth_skip_login';
   $squirrelmail_plugin_hooks['login_before']['login_auth'] = 'login_auth_login_before';
}



if (!defined('SM_PATH'))
   define('SM_PATH', '../');


/**
  * Plugin version
  *
  */
function login_auth_version()
{

   return '2.0';

}



/**
  * Check if user has already authenticated themselves;
  * can we skip login page?
  *
  */
function login_auth_skip_login()
{

   include_once(SM_PATH . 'plugins/login_auth/functions.php');
   login_auth_skip_login_do();

}



/**
  * Use correct login info from HTTP
  *
  */
function login_auth_login_before()
{

   include_once(SM_PATH . 'plugins/login_auth/functions.php');
   login_auth_login_before_do();

}


?>
