allow auto-login into the zabbix account. this will allow other scripts to
[monitor.git] / zabbix / zabbix-auto-login.diff
1 --- /home/soltesz/zabbix-1.6.1/frontends/php/index.php  2008-12-05 17:27:03.000000000 -0500
2 +++ index.php   2008-12-22 16:26:28.000000000 -0500
3 @@ -69,9 +69,12 @@
4                         access_deny();
5                 }
6         }
7 -       $_REQUEST['name'] = 'Admin'
8 +
9 +       $_REQUEST['enter'] = 'Enter';
10 +       $_REQUEST['name'] = 'Admin';
11         $_REQUEST['password'] = 'zabbix';
12  
13 +
14         if(isset($_REQUEST['enter'])&&($_REQUEST['enter']=='Enter')){
15                 
16                 $name = get_request('name','');
17 @@ -154,6 +157,10 @@
18                                 $row["url"] = get_profile('web.menu.view.last','index.php');
19                                 unset($USER_DETAILS);
20                         }
21 +                       if ( array_key_exists('url', $_GET) )
22 +                       {
23 +                               $row['url'] = urldecode($_GET['url']);
24 +                       }
25                         redirect($row["url"]);
26                         die();
27  //                     return;
28 --- /home/soltesz/zabbix-1.6.1/frontends/php/include/perm.inc.php       2008-11-04 16:45:02.000000000 -0500
29 +++ include/perm.inc.php        2008-12-22 16:09:48.000000000 -0500
30 @@ -69,6 +69,13 @@
31                         
32                         DBexecute('UPDATE users SET attempt_failed=0 WHERE userid='.$login['userid']);
33                 }
34 +       } else {
35 +               if ( ! $_GET['redirect'] ) {
36 +                       $_GET['redirect'] = true;
37 +                       $_GET['url'] = $_SERVER['REQUEST_URI'];
38 +                       $url = http_build_query($_GET);
39 +                       header("Location: index.php?$url");
40 +               }
41         }
42  
43         if(!$USER_DETAILS){
44 @@ -738,4 +745,4 @@
45  
46  return $result;
47  }
48 -?>
49 \ No newline at end of file
50 +?>