updated module import statements. not sure how I missed these before.
[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,13 @@
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 +                       if ( $row['url'] == 'index.php' ) {
26 +                               $row['url'] = 'dashboard.php';
27 +                       }
28                         redirect($row["url"]);
29                         die();
30  //                     return;
31 --- /home/soltesz/zabbix-1.6.1/frontends/php/include/perm.inc.php       2008-11-04 16:45:02.000000000 -0500
32 +++ include/perm.inc.php        2008-12-22 16:09:48.000000000 -0500
33 @@ -69,6 +69,13 @@
34                         
35                         DBexecute('UPDATE users SET attempt_failed=0 WHERE userid='.$login['userid']);
36                 }
37 +       } else {
38 +               if ( ! $_GET['redirect'] ) {
39 +                       $_GET['redirect'] = true;
40 +                       $_GET['url'] = $_SERVER['REQUEST_URI'];
41 +                       $url = http_build_query($_GET);
42 +                       header("Location: index.php?$url");
43 +               }
44         }
45  
46         if(!$USER_DETAILS){
47 @@ -738,4 +745,4 @@
48  
49  return $result;
50  }
51 -?>
52 \ No newline at end of file
53 +?>