0) { $authorized = db_fetch_cell("SELECT COUNT(*) FROM ( SELECT realm_id FROM user_auth_realm AS uar WHERE uar.user_id=" . $_SESSION['sess_user_id'] . " AND uar.realm_id=$realm_id UNION SELECT realm_id FROM user_auth_group_realm AS uagr INNER JOIN user_auth_group_members AS uagm ON uagr.group_id=uagm.group_id INNER JOIN user_auth_group AS uag ON uag.id=uagr.group_id WHERE uag.enabled='on' AND uagm.user_id=" . $_SESSION['sess_user_id'] . " AND uagr.realm_id=$realm_id ) AS authorized"); }else{ $authroized = false; } if ($realm_id != -1 && !$authorized) { if (isset($_SERVER['HTTP_REFERER'])) { $goBack = "
| You are not permitted to access this section of Cacti. If you feel that you tneed access to this particular section, please contact the Cacti administrator. | \n"; print "\t\t|