mirror of
https://github.com/Cacti/cacti.git
synced 2026-11-09 22:13:05 +09:00
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:
1 parent
f9af4a4e34
commit
fb00dc5bc4
1 file changed
+17
-9
+17
-9
@@ -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>
|
||||
Reference in new issue
Block a user