This topic is locked
[SOLVED]

 Changing the page people are sent to on activation

4/27/2014 6:20:55 PM
PHPRunner General questions
jwoker author

Changing the page people are sent to on activation?
When using phprunner's built-in email verification system, how do I Change the page people are sent to on activation process?
Thanks

jwoker author 5/15/2014

On my site, when a user clicks the activation link their account is activated and the page displays an empty box. What is supposed to happen?
Here is the code from register.php that is implicated:

if(@$_GET["a"]=="activate")

{

$username = base64_decode(@$_GET["u"]);

$code = @$_GET["code"];

if($cipherer->isFieldEncrypted("email"))

$strUsername = $cipherer->MakeDBValue("email",$username,"","",true);

else

$strUsername = make_db_value("email",$username);
$sql = "select ".GetFullFieldName("password","users",false)." as ".AddFieldWrappers("password")." from `users` where ".GetFullFieldName("email",$strTableName,false)."=".$strUsername;

$rs = db_query($sql,$conn);

$verified = false;

if(!$rs)

{

echo "Invalid validation code.";

return;

}

$data = $cipherer->DecryptFetchedArray($rs);

if(!$data)

{

echo "Invalid validation code.";

return;

}

$usercode = $username.md5($data["password"]);

if($code!=md5($usercode))

{

echo "Invalid validation code.";

return;

}

$sql = "update `users` set `active`=1 where ".GetFullFieldName("email",$strTableName,false)."=".$strUsername;

db_exec($sql,$conn);
$pageObject->updatePageLayoutAndCSS('', 'success');



$pageObject->body["begin"].= "<form method=\"POST\" action=\"".GetTableLink("login")."\" name=\"loginform\">

<input type=\"Hidden\" name=username value=\"".runner_htmlspecialchars($username)."\">";

$pageObject->body["begin"].= "<input type=\"Hidden\" name=password value=\"".runner_htmlspecialchars($data["password"])."\">";

$pageObject->body["begin"].= "</form>";

$xt->assign("body",$pageObject->body);

$xt->assign("registered_block",true);

$xt->assign("loginlink_attrs","onclick=\"document.forms.loginform.submit();return false;\" id=\"ProceedToLogin\"");

return $pageObject->display(GetTemplateName("", "register_success")); // return $pageObject->display for .net compatibility
Sergey Kornilov admin 5/16/2014

Here is the screenshot that shows what you supposed to see after confirming your registration