Skip to content

Commit

Permalink
Fixed a variety of issues raised by issue #36.
Browse files Browse the repository at this point in the history
  • Loading branch information
cubiclesoft committed May 4, 2022
1 parent dd6e3b3 commit 3a9f6e5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion endpoint.php
Expand Up @@ -126,7 +126,7 @@ function SSO_EndpointError($msg, $info = "")
else
{
$info = explode(":", $sso_apikey_info["key"]);
if (count($info) < 3) return array("success" => false, "error" => SSO_Translate("Invalid secret key."));
if (count($info) < 3) SSO_EndpointError("Invalid secret key.");

$sso_apikey_info["keyinfo"]["mode"] = $info[0];
$sso_apikey_info["keyinfo"]["key"] = pack("H*", $info[1]);
Expand Down
4 changes: 2 additions & 2 deletions providers/sso_facebook/index.php
Expand Up @@ -300,7 +300,7 @@ public function ProcessFrontend()
else if (isset($profile["first_name"]) && isset($profile["last_name"])) $profile["username"] = $profile["first_name"] . @substr($profile["last_name"], 0, 1);
else if (isset($profile["name"]))
{
$name = explode(" ", $name);
$name = explode(" ", $profile["name"]);
$profile["username"] = $name[0] . @substr($name[count($name) - 1], 0, 1);
}
else $profile["username"] = (string)$id;
Expand Down Expand Up @@ -377,7 +377,7 @@ public function ProcessFrontend()
// Convert specialized fields into strings.
if (isset($profile["age_range"]))
{
$profile["age_range"] = trim($item->min . "-" . $item->max);
foreach ($profile["age_range"] as $item) $profile["age_range"] = trim($item->min . "-" . $item->max);
}
if (isset($profile["education"]))
{
Expand Down
2 changes: 1 addition & 1 deletion providers/sso_login/index.php
Expand Up @@ -2299,7 +2299,7 @@ public function ProcessFrontend()

// Two-factor authentication dropdown.
$outputmap2 = array();
$method = SSO_FrontendFieldValue("update_two_factor_method", (isset($updateinfo["two_factor_method"]) ? $updateinfo["two_factor_method"] : ""));
$method = SSO_FrontendFieldValue("update_two_factor_method", (isset($userinfo["two_factor_method"]) ? $userinfo["two_factor_method"] : ""));
foreach ($this->activemodules as $key => &$instance)
{
$name = $instance->GetTwoFactorName();
Expand Down
2 changes: 1 addition & 1 deletion providers/sso_login/modules/sso_remember_me.php
Expand Up @@ -265,7 +265,7 @@ public function LoginAddMap(&$mapinfo, $userrow, &$userinfo, $admin)
$token2 = $sso_rng->GenerateString();
$salt = $sso_rng->GenerateString();
$data = $salt . ":" . $token2;
$passwordinfo = sso_login::HashPasswordInfo($data);
$passwordinfo = sso_login::HashPasswordInfo($data, "password_hash_bcrypt", 1024);
if ($passwordinfo["success"])
{
// Add temporary session data to user information.
Expand Down

0 comments on commit 3a9f6e5

Please sign in to comment.