close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Login Form (security assist) Not Working

Thread began 5/22/2012 1:16 pm by ruth265305 | Last modified 5/24/2012 4:06 pm by ruth265305 | 2253 views | 6 replies |

ruth265305

Login Form (security assist) Not Working

I created a registration form; forgot password form; userupdate form; and logout form ... all of which work perfectly.

The login form is not working ... I've double-checked the database fields, the username and password and can't seem to find the problem, please help! I'm using the latest Data Bridge extension; Dreamweaver CS5.5; and Windows 7.

A link to the page in development:
login.php

Thanks! I'm on a deadline and this has me stumped.

Ruth

Sign in to reply to this post

Jason ByrnesWebAssist

please send a copy of the registration, login and Members-Home.php pages in a zip archive so i can look at the code.

Sign in to reply to this post

ruth265305

Files Requested for: Login Form (security assist) Not Working

Hi Jason:
thank you for your assistance! The files are attached in a zip file.

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

Jason ByrnesWebAssist

the problem is on the Members-Home.php page.


you have a mix of Security assist And Dreamweaver User Authentication.

The Dreamweaver User Authentication. is causing the login to fail.


delete the code from line 7 - 79:

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 "../index.php";
  if (
$logoutGoTo) {
    
header("Location: $logoutGoTo");
    exit;
  }
}
?>
<?php
if (!isset($_SESSION)) {
  
session_start();
}
$MM_authorizedUsers "";
$MM_donotCheckaccess "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers$strGroups$UserName$UserGroup) { 
  
// For security, start by assuming the visitor is NOT authorized. 
  
$isValid False

  
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
  // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
  
if (!empty($UserName)) { 
    
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
    // Parse the strings into arrays. 
    
$arrUsers Explode(","$strUsers); 
    
$arrGroups Explode(","$strGroups); 
    if (
in_array($UserName$arrUsers)) { 
      
$isValid true
    } 
    
// Or, you may restrict access to only certain users based on their username. 
    
if (in_array($UserGroup$arrGroups)) { 
      
$isValid true
    } 
    if ((
$strUsers == "") && true) { 
      
$isValid true
    } 
  } 
  return 
$isValid
}

$MM_restrictGoTo "../login.php";
if (!((isset(
$_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers$_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
  
$MM_qsChar "?";
  
$MM_referrer $_SERVER['PHP_SELF'];
  if (
strpos($MM_restrictGoTo"?")) $MM_qsChar "&";
  if (isset(
$_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0
  
$MM_referrer .= "?" $_SERVER['QUERY_STRING'];
  
$MM_restrictGoTo $MM_restrictGoTo$MM_qsChar "accesscheck=" urlencode($MM_referrer);
  
header("Location: "$MM_restrictGoTo); 
  exit;
}
?>




and change the logout link to point to the Security assist logout page:
<a href="../logout.php">Logout</a>

Sign in to reply to this post

ruth265305

++ Add'l Help, still not working ++ Login Form (security assist) Not Working

Hi Jason,
I followed your instructions, uploaded the new file, and the login page still just sits there. I'll attach my new code. (revised page attached).

What did I do wrong?

Attached Files
Members-Home.zip
Sign in to reply to this post

Jason ByrnesWebAssist

you're login link no longer works. Where can i test the login?

Sign in to reply to this post

ruth265305

changed files

Hi Jason,
While I was waiting for a reply. I started all over again using the assumption that the Members-Home.php page was the problem and that I had dualing authentications.

I have redone all of the pages and am just now testing ... I was just about to post a message that I THINK it might be solved... I'll post again when things are working so we can close the thread. Thanks again so much for your help today.

Sign in to reply to this post

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...