<?php
  /*
   *  Secure Login Plugin
   *  By Graham Norbury <gnorbury@bondcar.com>
   *  Changes by Paul Lesneiwski <pdontthink@angrynerds.com>
   *  v1.2 (c) 2002 (GNU GPL - see ../../COPYING)
   *
   *  This is a very simple plugin which enforces use of SSL security for logins.
   *
   *  If you need help with this, or see improvements that can be made, please
   *  email one or both of us directly at the addresses above.
   *
   */


   function squirrelmail_plugin_init_secure_login()
   {

      global $squirrelmail_plugin_hooks;

      $squirrelmail_plugin_hooks['login_cookie']['secure_login'] = 'secure_login_check';
      $squirrelmail_plugin_hooks['webmail_top']['secure_login'] = 'secure_login_logout';

   }


   function secure_login_version()
   {

      return '1.2';

   }


   function secure_login_check()
   {
      
      if (defined('SM_PATH'))
         include_once(SM_PATH . 'plugins/secure_login/functions.php');
      else
         include_once('../plugins/secure_login/functions.php');

      secure_login_check_do();

   }


   // after login, go back to http protocol
   //
   function secure_login_logout()
   {

      if (defined('SM_PATH'))
         include_once(SM_PATH . 'plugins/secure_login/functions.php');
      else
         include_once('../plugins/secure_login/functions.php');

      secure_login_logout_do();

   }


?>
