File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments