diff --git a/www-api/app/Controllers/WrenchAuth.php b/www-api/app/Controllers/WrenchAuth.php index 308449e3..c9b09612 100644 --- a/www-api/app/Controllers/WrenchAuth.php +++ b/www-api/app/Controllers/WrenchAuth.php @@ -22,14 +22,20 @@ class WrenchAuth extends BaseController // $out = $this->getCache($endpoint); // try find in cache $ret = $this->wrenchboard->wrenchboard_api($in, $out); $out['internal_return'] = $ret; + log_message('critical', "***** ***** WrenchAuth::userLogin Ret = ".$ret ); if ( $out['internal_return'] == 100 ){ - $endpoint = "USER_SESSION-"; + $endpoint = "USER_SESSION-". str_pad($out["member_id"], 12, "0", STR_PAD_LEFT) ."-"; + log_message('critical', "***** ***** WrenchAuth::userLogin USER_SESSION = ".$endpoint ); $this->saveCache($endpoint,$out,15000); }else { - $outF["username"] = $in["username"]; + // make safe for redis + $outF["username"] = str_replace("@", "_", $in["username"]); + $outF["username"] = str_replace(".", "_", $outF["username"]); + $outF["loc"] = $in["loc"]; $endpoint = "LOGIN_FAILED-".$outF["username"]."-"; + log_message('critical', "***** ***** WrenchAuth::userLogin USER_SESSION = ".$endpoint ); $this->saveCache($endpoint,$outF,15000); } // }