CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Popup message window for restricted page?

Print topic Send  topic

Author Message
oceandeep

Posts: 17
Posted: 07/10/2014, 10:12 PM

Hi.

I'm trying to find a way to show a message in a popup window/dialog when a user, who belongs in a restricted group, tries to enter a restricted page instead of redirecting to an Access Denied Page as CC does, or the login page. The message should explain that current user does not posses permission to see the page. I know this window can be done easily with JavaScript, with 'alert();' so I tried putting a custom code in the Before Initialize event of the restricted page:
global $group;  
global $db;  
$db=new clsDBCon1();  
$us= CCGetUserLogin();  
$group=CCDLookup("group_id","users","user_login='$us'",$db);  
if ($group != 1000){  
	echo"<script languaje='JavaScript'>alert('You can't access this page.')</script>";  
    header("Location:Emp_List.php");  
	}  
$db->close();

However, it doesn't work so well. It doesn't allow for such users to access the page (this is the good part) but it's not showing the small window with the message (the bad part). I took out the 'header' part and the window shows but it also allows the restricted page to be loaded. I've also set Restricted property to 'No' because otherwise CC ignores my code and returns me to the login page.

Any advice would be very much appreciated!

Cheers.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.