Need multiple tables mysqli log user
Need to used joins in the authentication
Need to used joins in the authentication
Maybe create a view from the joined tables and use that. Otherwise this is something I can help with in a premier support ticket.
Hey Ray, this is still Jason. I forgot to create this issue on the church's account. Sorry for the mid thread switch, but I want to make sure it's all on this account if possible.
Creating the view worked (mostly). I've just got one small hangup. Previously I was using the security assist user auth, and you had helped me write some custom changes to helper_php.php (see attached lines54-63). However, the redirects are not working with the new mysqli user auth. I'm guessing it's not using the same file or functions? Can you tell me how to do the same thing with the mysqli user auth?
I really don't remember well enough to know what might be different. I don't think those lines would need to be rewritten. I think you can just set the success redirect page to the '/includes/set_sessions.php' page in the new authentication server behavior. I think as long as they both set the same session variables it should work. If not I'd need a url, steps to reproduce, and ftp access to debug it further.
I compared var_dump($_SESSION) on the old and new versions. There are 2 missing variables on the new version, but I'm not sure where to set them. Can you tell me?
Old:
array(6) { ["WAENCRYPTEDRETURNUSED"]=> bool(false) ["WAENCRYPTEDRETURNSUCCESS"]=> bool(false) ["PCMS_ActivationError"]=> string(1) " " ["WASA_accesscheck"]=> string(39) "%2Falf%2Fcms%2Fdashboard%2Findex.php%3F" ["redirect"]=> string(1) "#" ["WAVT_login_Errors"]=> string(0) "" }
New:
array(4) { ["WAENCRYPTEDRETURNUSED"]=> bool(false) ["WAENCRYPTEDRETURNSUCCESS"]=> bool(false) ["WASA_accesscheck"]=> string(39) "%2Falf%2Fcms%2Fdashboard%2Findex.php%3F" ["redirect"]=> string(1) "#" }
Those variables aren't necessary. This looks like the Session before login? What are the two dumps of the sessions after a successful login?
Ok, I var_dumped those and found the missing variable. It's $_SESSION['redirectGoTo']. Where should this be getting set?
We were probably setting it on the login page after the logged in based on their profile? I'd look at the original login page and see if you can find and move the code over.
I believe it's being set in helper_php.php in the WA_AuthenticateUser function, but I can't find anywhere that the new behavior calls that function. Here's the updated behavior. Am I missing something or did I just not trace the behavior correctly?
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$Authenticate = new WA_MySQLi_Auth($local_i);
$Authenticate->Action = "authenticate";
$Authenticate->Name = "userlogin";
$Authenticate->Table = "login";
$Authenticate->addFilter("email_address", "=", "s", "".((isset($_POST["Log_In_group_Username"]))?$_POST["Log_In_group_Username"]:"") ."");
$Authenticate->addFilter("email_verified", "=", "i", "1");
$Authenticate->addFilter("verification_hash", "=", "s", "");
$Authenticate->addFilter("password", "=", "s", "".WA_SHA1Encryption(((isset($_POST["Log_In_group_2_Password"]))?$_POST["Log_In_group_2_Password"]:"")) ."");
$Authenticate->addFilter("active", "=", "i", "1");
$Authenticate->storeResult("person", "userlogin_id");
$Authenticate->storeResult("email_address", "username");
$Authenticate->AutoReturn = true;
$SuccessRedirect = "includes/set_sessions.php?loggedIn=1";
$FailedRedirect = "login.php?failedLogin=1";
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();
}
I think you need to find the reference to redirectGoTo in the old code. If you could show me that I could help translate it into the new.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.