From fb00dc5bc407c673b56cdddbbb706c2fec94d221 Mon Sep 17 00:00:00 2001 From: Tony Roman Date: Wed, 24 Nov 2004 01:53:42 +0000 Subject: [PATCH] fixed access denied problem when user doesn't have console access git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/branches/BRANCH_0_8_6/cacti@2299 860744bd-22fc-0310-8c96-e9fe5004b5ca --- auth_changepassword.php | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/auth_changepassword.php b/auth_changepassword.php index ee355a84e..606dbbca8 100644 --- a/auth_changepassword.php +++ b/auth_changepassword.php @@ -44,16 +44,24 @@ case 'changepassword': /* ok, at the point the user has been sucessfully authenticated; so we must decide what to do next */ - switch ($user["login_opts"]) { - case '1': /* referer */ - header("Location: " . $_POST["ref"]); break; - case '2': /* default console page */ - header("Location: index.php"); break; - case '3': /* default graph page */ - header("Location: graph_view.php"); break; + + /* if no console permissions show graphs otherwise, pay attention to user setting */ + $realm_id = $user_auth_realm_filenames["index.php"]; + + if (sizeof(db_fetch_assoc("select user_auth_realm.realm_id from user_auth_realm where user_auth_realm.user_id = '" . $_SESSION["sess_user_id"] . "' and user_auth_realm.realm_id = '" . $realm_id . "'")) > 0) { + switch ($user["login_opts"]) { + case '1': /* referer */ + header("Location: " . $_POST["ref"]); break; + case '2': /* default console page */ + header("Location: index.php"); break; + case '3': /* default graph page */ + header("Location: graph_view.php"); break; + } + }else{ + header("Location: graph_view.php"); } - exit; + }else{ $bad_password = true; } @@ -117,4 +125,4 @@ case 'changepassword': - \ No newline at end of file +