close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Cannot access page even though logged in

Thread began 6/08/2011 7:29 am by A Sound Design | Last modified 6/30/2011 11:02 am by Jason Byrnes | 2803 views | 12 replies |

A Sound Design

Cannot access page even though logged in

I am using SA 2 and have created login, registration pages etc. using the wizard.

I can successfully register and login but when I try to access a page that is protected using the Access Pages Manager I am continually redirected to the Access Denied page I have created. In the MySQL table I have set a field UserLevel as Int (11). I manually assign a user access level to each registered user, where administrators are level 3. In the SA Secure Page settings for each page I have it as in the attached screenshot. I cannot see why this does not work based upon this rule setting.

The code at the top of the page is

php:
<?php require_once( "../webassist/security_assist/helper_php.php" ); ?>
<?php
if (!WA_Auth_RulePasses("Administrator")){
    
WA_Auth_RestrictAccess("access_denied.php");
}
?>
<?php
//initialize the session
if (!isset($_SESSION)) {
  
session_start();
}

// ** Logout the current user. **
$logoutAction $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset(
$_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  
$logoutAction .="&"htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset(
$_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  
//to fully log out a visitor we need to clear the session varialbles
  
$_SESSION['MM_Username'] = NULL;
  
$_SESSION['MM_UserGroup'] = NULL;
  
$_SESSION['PrevUrl'] = NULL;
  unset(
$_SESSION['MM_Username']);
  unset(
$_SESSION['MM_UserGroup']);
  unset(
$_SESSION['PrevUrl']);
    
  
$logoutGoTo "logout.php";
  if (
$logoutGoTo) {
    
header("Location: $logoutGoTo");
    exit;
  }
}
?>



Thanks in advance. I'm now way behind on schedule for this project so any help appreciated.

Sign in to reply to this post

Jason ByrnesWebAssist

Does the login page set the UserLevel Session?

Double click the Authenticate User server behavior on the login page and go to the third page, make sure the UserLevel column is added to the list of sessions to set.



just to double check what sessions are being set, add the following code to the access denied page:

php:
</pre><?php var_dump($_SESSION); ?></pre>
Sign in to reply to this post

A Sound Design

Originally Said By: Jason Byrnes
  Does the login page set the UserLevel Session?

Double click the Authenticate User server behavior on the login page and go to the third page, make sure the UserLevel column is added to the list of sessions to set.



just to double check what sessions are being set, add the following code to the access denied page:
php:
</pre><?php var_dump($_SESSION); ?></pre>
  



The output from the above code simply says 'NULL'. I've attached the code for the login page.

Attached Files
login.zip
Sign in to reply to this post

Jason ByrnesWebAssist

that make me think the server is not setting session variables properly.

use the session test page from the following thread to test the servers session management:
showpost.php?p=23826&postcount=2

if the session test fails, you will need to contact the host to have them correct the problem, it is most likely a bad setting for the session.save_path in the php.ini

Sign in to reply to this post

A Sound Design

Uploaded that file and the server passed the test. Btw, I'm using XAMPP on local testing server.

Sign in to reply to this post

Jason ByrnesWebAssist

strange,

try changing:

php:
</pre><?php var_dump($_SESSION); ?></pre>



to:

php:
</pre><?php @session_start(); var_dump($_SESSION); ?></pre>
Sign in to reply to this post

A Sound Design

Outputs

array(3) { ["WAENCRYPTEDRETURNUSED"]=> bool(false) ["WAENCRYPTEDRETURNSUCCESS"]=> bool(false) ["test"]=> string(4) "test" }

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.

Sign in to reply to this post

A Sound Design

Originally Said By: Jason Byrnes
  I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.  



Thanks, but I had to uninstall version 2 and go back to version 1.1.9 for now at least so that I can get the job finished. Still took a bit of fiddling but at least I can create a registration page, a login page and get pages secured.

I have had nothing but problems with version 2 since installing it and have spent hours of my time, and money on the upgrade unless I can get it to work. I'll come back to this once I have this project finished as that is the immediate priority.

Sign in to reply to this post

Jason ByrnesWebAssist

ok, if you run into problems again with version 2, update the ticket that was created and we will look into the cause of the issue with you over the phone.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...