28, May 2012

if access level is > than User, an error page appears - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: if access level is > than User, an error page appears
« previous next »
Pages: [1] Print

Author Topic: if access level is > than User, an error page appears  (Read 2129 times)
Kill the googlebot
*
Posts: 6
44 credits
Members referred : 0


« on: May 13, 2006, 11:13:37 pm »

hi Olaf,

why if a user has a level 1 and page is set up for level 2 to granted access, instead of appearing a message or returning to same page when user is rejected, this situation appears http://192.168.0.1/classes/access_user/2 and the error message "the page can not be found" appears. its possible to change something looking to send the user to an alternative page to explain the problem, or show a message with the problem?.

thank you so much
sebastian
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: May 14, 2006, 09:46:15 am »

Hello,

You have to setup this variable (config file):
Code:
define("DENY_ACCESS_PAGE", APPLICATION_PATH."deny_access.php");

Kill the googlebot
*
Posts: 6
44 credits
Members referred : 0


« Reply #2 on: May 14, 2006, 05:09:21 pm »

I checked the dbconfig file and that variable was already defined with all these ones...

define("LOGIN_PAGE", "/classes/access_user/login.php");
define("START_PAGE", "/demo.php");
define("ACTIVE_PASS_PAGE", APPLICATION_PATH."activate_password.php");
define("DENY_ACCESS_PAGE", APPLICATION_PATH."deny_access.php");
define("ADMIN_PAGE", APPLICATION_PATH."admin_user.php");

but I have the same error.. in the page I set up for access levels I put this information:

<h2><?php echo "Hello ".$hello_name." !"; ?></h2>
<p><a href="<?php echo $_SERVER['PHP_SELF']; ?>?action=log_out">Click here to log out.</a></p>
<?PHP echo $_SESSION['user'] ?>

I have to add something more?
thank you.
sebastian

Hello,

You have to setup this variable (config file):
Code:
define("DENY_ACCESS_PAGE", APPLICATION_PATH."deny_access.php");
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: May 14, 2006, 05:37:00 pm »

You don't need to add something but the path to the deny access file be OK.

what is the application path in your case and where is the deny access file located?

Kill the googlebot
*
Posts: 6
44 credits
Members referred : 0


« Reply #4 on: May 14, 2006, 05:45:46 pm »

hi olaf,

I used the standard path.. This file is located inside classes/access_user/deny_access.php and in the same folder is classes/access_user/db_config.php

i will check again.

In the other post I forgot to put, this is the first part of the page
<?php
include($_SERVER['DOCUMENT_ROOT']."/classes/access_user/access_user_class.php");

$page_protect = new Access_user;
// $page_protect->login_page = "/classes/access_user/login.php"; // change this only if your login is on another page
$page_protect->access_page(2); // only set this this method to protect your page
$page_protect->get_user_info();
$hello_name = ($page_protect->user_full_name != "") ? $page_protect->user_full_name : $page_protect->user;

if (isset($_GET['action']) && $_GET['action'] == "log_out") {
   $page_protect->log_out(); // the method to log off
}
?>

and then I have this..

<p><a href="<?php echo $_SERVER['PHP_SELF']; ?>?action=log_out">Click here to log out.</a></p>
<?PHP echo $_SESSION['user'] ?>

thank you.
sebastian

I checked the dbconfig file and that variable was already defined with all these ones...

define("LOGIN_PAGE", "/classes/access_user/login.php");
define("START_PAGE", "/demo.php");
define("ACTIVE_PASS_PAGE", APPLICATION_PATH."activate_password.php");
define("DENY_ACCESS_PAGE", APPLICATION_PATH."deny_access.php");
define("ADMIN_PAGE", APPLICATION_PATH."admin_user.php");

but I have the same error.. in the page I set up for access levels I put this information:

<h2><?php echo "Hello ".$hello_name." !"; ?></h2>
<p><a href="<?php echo $_SERVER['PHP_SELF']; ?>?action=log_out">Click here to log out.</a></p>
<?PHP echo $_SESSION['user'] ?>

I have to add something more?
thank you.
sebastian

Hello,

You have to setup this variable (config file):
Code:
define("DENY_ACCESS_PAGE", APPLICATION_PATH."deny_access.php");
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=2497
Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: if access level is > than User, an error page appears
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 11:08:22 am





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.