close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Question about preset for security assist wizard

Thread began 12/19/2012 10:28 am by mrs | Last modified 12/21/2012 10:03 am by Jason Byrnes | 884 views | 8 replies |

mrs

Question about preset for security assist wizard

Hi, I am just going through the double opt in tutorial to create an erm... double opt in believe it or not, and I have just got a question about one of the presets that has come with the Create Security Assist Pages wizard.

I've used the preset PowerStore V4 and had it create the table and there is a couple of columns there called 'UserEmailVerified' and 'UserVerificationCode'... can I use these columns for the part tutorial at 6 minutes 30 seconds of this video: watch?v=JBH2NpPUbaE&list=PL1F359A82D04D2329&index=7

Just a thought, does this setting already have email verification built into the preset, or are these two fields there awaiting the application of double opt in?

Thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

Yes, you can use those columns.

no the preset does not already have double opt in applied, those columns are, as you say "awaiting the application of double opt in"

Sign in to reply to this post

mrs

Just working my way through the tutorial, and I've come across a hitch for the resend verification link.

When it's clicked I am getting a 404 error! I followed the video tutorial second by second stopping at each point to complete the next step; is there any reason why? Do I need to create a show region that is displayed when send=true? If so, how do I do that?

I'm testing this on my localhost prior to uploading to a live server.

Sign in to reply to this post

Jason ByrnesWebAssist

a 404 error means page not found.

it means the link in your email is not pointing to a valid page.

when you register, what is the full address in the address bar?

when you get to the 404 page, what is the full address in the address bar?

how are you configuring the link in the email?

Sign in to reply to this post

mrs

Yeah, I know 404 is a missing page, but I assumed that the clicking of a link userupdate.php?send=true would create some sort of updated URL just as a call on a recordset does. Perhaps it doesn't.

So I have this as my link as explained in the video:
userupdate.php?send=true

I have a session:
?php
if (!session_id()) session_start();
if((isset($_GET['send']) && $_GET['send'] != "")) {
$_SESSION["rpw"] = "".WA_RandomPassword(10, false, true, true, "") ."";
}
?

AND I also have this towards the bottom of my document just before the closing body tag (are they in the right place?):

?php
// WA DataAssist Update
if ((isset($_GET['send']) && $_GET['send'] != "")) // Trigger
{
$WA_connection = $conn_mrs;
$WA_table = "tbl_users";
$WA_redirectURL = "";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
$WA_keepQueryString = false;
$WA_indexField = "UserID";
$WA_fieldNamesStr = "randomString";
$WA_fieldValuesStr = "".$_SESSION['rpw'] ."";
$WA_columnTypesStr = "',none,''";
$WA_comparisonStr = "=";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode($WA_AB_Split, $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);

$WA_where_fieldValuesStr = "".$row_SecurityAssisttblusers['UserID'] ."";
$WA_where_columnTypesStr = "none,none,NULL";
$WA_where_comparisonStr = "=";
$WA_where_fieldNames = explode("|", $WA_indexField);
$WA_where_fieldValues = explode($WA_AB_Split, $WA_where_fieldValuesStr);
$WA_where_columns = explode("|", $WA_where_columnTypesStr);
$WA_where_comparisons = explode("|", $WA_where_comparisonStr);

$WA_connectionDB = $database_conn_mrs;
mysql_select_db($WA_connectionDB, $WA_connection);
@session_start();
$updateParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WhereObj = WA_AB_generateWhereClause($WA_where_fieldNames, $WA_where_columns, $WA_where_fieldValues, $WA_where_comparisons );
$WA_Sql = "UPDATE `" . $WA_table . "` SET " . $updateParamsObj->WA_setValues . " WHERE " . $WhereObj->sqlWhereClause . "";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?
?php
if (((isset($_GET['send']) && $_GET['send'] != ""))) {
//WA Universal Email object="mail"
@session_write_close();
set_time_limit(0);
$EmailRef = "waue_userupdate_1";
$BurstSize = 200;
$BurstTime = 1;
$WaitTime = 1;
$GoToPage = "";
$RecipArray = array();
$StartBurst = time();
$LoopCount = 0;
$TotalEmails = 0;
$RecipIndex = 0;
// build up recipients array
$CurIndex = sizeof($RecipArray);
$RecipArray[$CurIndex] = array();
$RecipArray[$CurIndex ][] = "".$row_SecurityAssisttblusers['UserEmail'] ."";
$TotalEmails += sizeof($RecipArray[$CurIndex]);
$RealWait = ($WaitTime<0.25)?0.25:($WaitTime+0.1);
$TimeTracker = Array();
$TotalBursts = floor($TotalEmails/$BurstSize);
$AfterBursts = $TotalEmails % $BurstSize;
$TimeRemaining = ($TotalBursts * $BurstTime) + ($AfterBursts*$RealWait);
if ($TimeRemaining < ($TotalEmails*$RealWait) ) {
$TimeRemaining = $TotalEmails*$RealWait;
}
writeUEProgress($EmailRef,0,$TotalEmails,$TimeRemaining);
while ($RecipIndex < sizeof($RecipArray)) {
$EnteredValue = is_string($RecipArray[$RecipIndex][0]);
$CurIndex = 0;
while (($EnteredValue && $CurIndex < sizeof($RecipArray[$RecipIndex])) || (!$EnteredValue && $RecipArray[$RecipIndex][0])) {
$starttime = microtime_float();
if ($EnteredValue) {
$RecipientEmail = $RecipArray[$RecipIndex][$CurIndex];
} else {
$RecipientEmail = $RecipArray[$RecipIndex][0][$RecipArray[$RecipIndex][2]];
}
$EmailsRemaining = ($TotalEmails- $LoopCount);
$BurstsRemaining = ceil(($EmailsRemaining-$AfterBursts)/$BurstSize);
$IntoBurst = ($EmailsRemaining-$AfterBursts) % $BurstSize;
if ($AfterBursts<$EmailsRemaining) $IntoBurst = 0;
$TimeRemaining = ($BurstsRemaining * $BurstTime * 60) + ((($AfterBursts<$EmailsRemaining)?$AfterBursts:$EmailsRemaining)*$RealWait) - (($AfterBursts>$EmailsRemaining)?0:($IntoBurst*$RealWait));
if ($TimeRemaining < ($EmailsRemaining*$RealWait) ) {
$TimeRemaining = $EmailsRemaining*$RealWait;
}
$CurIndex ++;
$LoopCount ++;
writeUEProgress($EmailRef,$LoopCount,$TotalEmails,round($TimeRemaining));
wa_sleep($WaitTime);
include("webassist/email/waue_userupdate_1.php");
$endtime = microtime_float();
$TimeTracker[] =$endtime - $starttime;
$RealWait = array_sum($TimeTracker)/sizeof($TimeTracker);
if ($LoopCount % $BurstSize == 0 && $CurIndex < sizeof($RecipArray[$RecipIndex])) {
$TimePassed = (time() - $StartBurst);
if ($TimePassed < ($BurstTime*60)) {
$WaitBurst = ($BurstTime*60) -$TimePassed;
wa_sleep($WaitBurst);
}
else {
$TimeRemaining = ($TotalEmails- $LoopCount)*$RealWait;
}
$StartBurst = time();
}
if (!$EnteredValue) {
$RecipArray[$RecipIndex][0] = mysql_fetch_assoc($RecipArray[$RecipIndex][1]);
}
}
$RecipIndex ++;
}
@session_start();
$_SESSION[$EmailRef."_Status"] = $GLOBALS[$EmailRef."_Status"];
$_SESSION[$EmailRef."_Index"] = $GLOBALS[$EmailRef."_Index"];
$_SESSION[$EmailRef."_From"] = $GLOBALS[$EmailRef."_From"];
$_SESSION[$EmailRef."_To"] = $GLOBALS[$EmailRef."_To"];
$_SESSION[$EmailRef."_Subject"] = $GLOBALS[$EmailRef."_Subject"];
$_SESSION[$EmailRef."_Body"] = $GLOBALS[$EmailRef."_Body"];
$_SESSION[$EmailRef."_Header"] = $GLOBALS[$EmailRef."_Header"];
$_SESSION[$EmailRef."_Log"] = $GLOBALS[$EmailRef."_Log"];
if (function_exists("rel2abs")) $GoToPage = $GoToPage?rel2abs($GoToPage,dirname(__FILE__)):"";
if ($GoToPage!="") {
header("Location: ".$GoToPage);
}
}
?

Sign in to reply to this post

Jason ByrnesWebAssist

what is the name of the update page that was created by the security assist wizard?

in the example pages created in the video tutorial, the update page was named userupdate.php

if the pages you created have different names, you will need to alter the page names used in your link.

That code that is before the closing body tag, should be in the head, before the doctype tag.

Sign in to reply to this post

Jason ByrnesWebAssist

what is the name of the update page that was created by the security assist wizard?

in the example pages created in the video tutorial, the update page was named userupdate.php

if the pages you created have different names, you will need to alter the page names used in your link.

That code that is before the closing body tag, should be in the head, before the doctype tag.

Sign in to reply to this post

mrs

The page created by the wizard is called userupdate.php, and in the video it is said to create a link to the page we're on and we're going to send a URL parameter so write ?send=true after userupdate.php in the Link box of the properties panel; i.e. userupdate.php?send=true.

After doing that, I then created a URL Variable in via the bindings panel called 'send'.

Should I just use the link of userupdate.php instead then?

Sign in to reply to this post

Jason ByrnesWebAssist

no, you need to include the URL parameter ?send=true. the URL parameter is used to trigger resending the verification email.

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