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
This commit is contained in:
Tony Roman committed 2004-11-24 01:53:42 +00:00
1 parent f9af4a4e34
commit fb00dc5bc4
1 file changed
+17 -9
+17 -9
View File
@@ -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':
</form>
</body>
</html>
</html>