close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Log in Server behavior not working.

Thread began 3/18/2015 8:16 am by anonymous | Last modified 3/18/2015 9:09 am by Jason Byrnes | 2311 views | 8 replies |

anonymous

Log in Server behavior not working.

Have record set established and have completed the behavior requirements per your form. I have been through the help files and nothing solves the issue. Authentication not working. success nor failure redirects working. It seems as if the app isn't checking form entries against the database. I have tried every option available with no luck. Your help is required.

Sign in to reply to this post

Jason ByrnesWebAssist

please send a copy of the page so i can see the code.

Sign in to reply to this post

anonymous

Originally Said By: Jason Byrnes
  please send a copy of the page so i can see the code.  


<?php require_once('Connections/ADPOPi.php'); ?>
<?php require_once('webassist/mysqli/rsobj.php'); ?>
<?php require_once('webassist/mysqli/authentication.php'); ?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$Authenticate = new WA_MySQLi_Auth($ADPOPi);
$Authenticate->Action = "authenticate";
$Authenticate->Name = "";
$Authenticate->Table = "sys_user";
$Authenticate->addFilter("usr_id", "=", "s", "".($rs_users->getColumnVal("usr_id")) ."");
$Authenticate->addFilter("usr_pwd", "=", "s", "".($rs_users->getColumnVal("usr_pwd")) ."");
$Authenticate->storeResult("usr_id", "usr");
$Authenticate->storeResult("usr_pwd", "pass");
$Authenticate->storeResult("usr_site_id", "site");
$Authenticate->AutoReturn = true;
$SuccessRedirect = "success.php";
$FailedRedirect = "failure.php";
if (function_exists("rel2abs")) $SuccessRedirect = $SuccessRedirect?rel2abs($SuccessRedirect,dirname(__FILE__)):"";
if (function_exists("rel2abs")) $FailedRedirect = $FailedRedirect?rel2abs($FailedRedirect,dirname(__FILE__)):"";
$Authenticate->SuccessRedirect = $SuccessRedirect;
$Authenticate->FailRedirect = $FailedRedirect;
$Authenticate->execute();
}
?>

<?php
$rs_users = new WA_MySQLi_RS("rs_users",$ADPOPi,1);
$rs_users->setQuery("SELECT * FROM sys_user");
$rs_users->execute();
?>

Sign in to reply to this post

Jason ByrnesWebAssist

in the login behavior, you have bound the user_id and password column to the fields from the recordset, you should be using the login form bindings.

also, i'm not sure why you are using the user_id column, you should be using the user name and password columns and binding them to the corresponding form elements.

Sign in to reply to this post

anonymous

So what you are saying is on the "Find record" tab in your server behavior I should not use the dynamic selector to select my database fields to be compared against and should instead use the form field ID's ? Also, the usr_id is the user name field in the database.

Sign in to reply to this post

Jason ByrnesWebAssist

yes, on the find record tab, you should not be using the dynamic bindings from the recordset, you should be using the bindings for the form fields.

Sign in to reply to this post

anonymous

Problem Solved. Thank you.

Sign in to reply to this post

anonymous

<?php require_once('Connections/ADPOPi.php'); ?>
<?php require_once('webassist/mysqli/rsobj.php'); ?>
<?php require_once('webassist/mysqli/authentication.php'); ?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$Authenticate = new WA_MySQLi_Auth($ADPOPi);
$Authenticate->Action = "authenticate";
$Authenticate->Name = "";
$Authenticate->Table = "sys_user";
$Authenticate->addFilter("usr_id", "=", "s", "".($rs_users->getColumnVal("usr_id")) ."");
$Authenticate->addFilter("usr_pwd", "=", "s", "".($rs_users->getColumnVal("usr_pwd")) ."");
$Authenticate->storeResult("usr_id", "usr");
$Authenticate->storeResult("usr_pwd", "pass");
$Authenticate->storeResult("usr_site_id", "site");
$Authenticate->AutoReturn = true;
$SuccessRedirect = "success.php";
$FailedRedirect = "failure.php";
if (function_exists("rel2abs")) $SuccessRedirect = $SuccessRedirect?rel2abs($SuccessRedirect,dirname(__FILE__)):"";
if (function_exists("rel2abs")) $FailedRedirect = $FailedRedirect?rel2abs($FailedRedirect,dirname(__FILE__)):"";
$Authenticate->SuccessRedirect = $SuccessRedirect;
$Authenticate->FailRedirect = $FailedRedirect;
$Authenticate->execute();
}
?>

<?php
$rs_users = new WA_MySQLi_RS("rs_users",$ADPOPi,1);
$rs_users->setQuery("SELECT * FROM sys_user");
$rs_users->execute();
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>/title>
<link href="CSS/adpop.css" rel="stylesheet" type="text/css">
</head>

<body id="loginbg">
<form METHOD="post" id="login" title="Login"><table class="centered" width="300" border="0" cellpadding="1">
<tbody>
<tr>
<td bgcolor="#000000"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td height="20"><font color="#CAC6C6" face="Gotham, Helvetica Neue, Helvetica, Arial, sans-serif" >&nbsp;Please Login </font></td>
</tr>
<tr>
<td bgcolor="#CAC6C6"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="26%">&nbsp;</td>
<td width="8%">&nbsp;</td>
<td width="66%" colspan="2">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;Username:</td>
<td width="8%">&nbsp;</td>
<td width="33%"><input type="text" name="user" id="user"></td>
<td width="33%" rowspan="2"><img src="images/aad_logo_v3_6001.png" width="150" height="55" alt=""/></td>
</tr>
<tr>
<td>&nbsp;Password:</td>
<td>&nbsp;</td>
<td><input type="password" name="pass" id="pass"></td>
</tr>
<tr>
<td colspan="4" height="3"></td>
</tr>
<tr>
<td colspan="1">&nbsp; <input type="submit" name="submit" id="submit" value="Log In"></td><td></td><td>&nbsp;</td><td align="center"><font size="-1" face="Gotham, Helvetica Neue, Helvetica, Arial, sans-serif">Forgot Password?</font></td>
</tr>
<tr>
<td colspan="4" height="3"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table></form>

</body>
</html>

Sign in to reply to this post

Jason ByrnesWebAssist

you are still using the recordset bindings on the Find Record tab:
$Authenticate->addFilter("usr_id", "=", "s", "".($rs_users->getColumnVal("usr_id")) ."");
$Authenticate->addFilter("usr_pwd", "=", "s", "".($rs_users->getColumnVal("usr_pwd")) ."");

These should be using the user and pass form element bindings instead of the recordset bindings.

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