Skip to content

Commit aade4eb

Browse files
committed
initial import
1 parent 35cc2f3 commit aade4eb

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

formlogon.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
class formlogon extends rcube_plugin
4+
{
5+
public $task = 'login';
6+
7+
function init()
8+
{
9+
$this->add_hook('startup', array($this, 'startup'));
10+
$this->add_hook('authenticate', array($this, 'authenticate'));
11+
}
12+
13+
function startup($args)
14+
{
15+
if (!empty($_POST['_autologin']) && $this->is_allowed()) {
16+
$args['action'] = 'login';
17+
}
18+
19+
return $args;
20+
}
21+
22+
function authenticate($args)
23+
{
24+
if (!empty($_POST['_autologin']) && $this->is_allowed()) {
25+
$args['user'] = $_POST["_user"];
26+
$args['pass'] = $_POST["_pass"];
27+
$args['host'] = $_POST["_mailserver"];
28+
$args['cookiecheck'] = false;
29+
$args['valid'] = true;
30+
}
31+
32+
return $args;
33+
}
34+
35+
function is_allowed()
36+
{
37+
return true;
38+
}
39+
40+
}

0 commit comments

Comments
 (0)