summaryrefslogtreecommitdiff
path: root/roundcubemail/plugins/autologon
diff options
context:
space:
mode:
authortill <till@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-03-20 14:20:01 +0000
committertill <till@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-03-20 14:20:01 +0000
commit8660a74501de5ee206f6c14246f7112e6ea91ad3 (patch)
tree1e67a0bcc9ebe254d6f0c21eb07728216f5b3149 /roundcubemail/plugins/autologon
parent85de1261ba60e3df477a49a15de8471f79d2946a (diff)
moved plugins
git-svn-id: https://svn.roundcube.net/trunk@3394 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/plugins/autologon')
-rw-r--r--roundcubemail/plugins/autologon/autologon.php45
1 files changed, 0 insertions, 45 deletions
diff --git a/roundcubemail/plugins/autologon/autologon.php b/roundcubemail/plugins/autologon/autologon.php
deleted file mode 100644
index bc3d2ee76..000000000
--- a/roundcubemail/plugins/autologon/autologon.php
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-
-/**
- * Sample plugin to try out some hooks.
- * This performs an automatic login if accessed from localhost
- */
-class autologon extends rcube_plugin
-{
- public $task = 'login';
-
- function init()
- {
- $this->add_hook('startup', array($this, 'startup'));
- $this->add_hook('authenticate', array($this, 'authenticate'));
- }
-
- function startup($args)
- {
- $rcmail = rcmail::get_instance();
-
- // change action to login
- if (empty($_SESSION['user_id']) && !empty($_GET['_autologin']) && $this->is_localhost())
- $args['action'] = 'login';
-
- return $args;
- }
-
- function authenticate($args)
- {
- if (!empty($_GET['_autologin']) && $this->is_localhost()) {
- $args['user'] = 'me';
- $args['pass'] = '******';
- $args['host'] = 'localhost';
- }
-
- return $args;
- }
-
- function is_localhost()
- {
- return $_SERVER['REMOTE_ADDR'] == '::1' || $_SERVER['REMOTE_ADDR'] == '127.0.0.1';
- }
-
-}
-