MantisBT - v2.4 Release (Closed)
View Issue Details
0000801v2.4 Release (Closed)[All Projects] Generalpublic2011-05-10 20:222011-08-16 23:37
Assigned Tocaseydk 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version2.4 
Summary0000801: Update key do not store in Database
DescriptionWhen edit contact, If select "Waiting Update?" then W2P will send email with a link to allow that person to edit his own information.

But when click on that link there will be permission deny.

"You are not authorized to use this page. If you should be authorized please contact ..."

I remember I raised this issue once but I forgot to have it in bug log. :( So in this version it still exists.
Additional InformationMy solution:

I found out that in "do_contact_aed.php" the updatekey token is generated after Contact is stored (line 23-34).

My solution at the moment is, move the generating block of updatekey to before store/del is called.

//moved block
if (!$del) {
        $updatekey = $obj->getUpdateKey();
        $notifyasked = w2PgetParam($_POST, 'contact_updateask', 0);
        if ($notifyasked && !$updatekey) {
            $rnow = new CDate();
            $obj->contact_updatekey = MD5($rnow->format(FMT_DATEISO));
            $obj->contact_updateasked = $rnow->format(FMT_DATETIME_MYSQL);
            $obj->contact_lastupdate = '';
        // $obj->updateNotify();
//end moved block

$action = ($del) ? 'deleted' : 'stored';
$result = ($del) ? $obj->delete($AppUI) : $obj->store($AppUI);

if (is_array($result)) {
    $AppUI->setMsg($result, UI_MSG_ERROR, true);
if ($result) {
    $AppUI->setMsg('Contact '.$action, UI_MSG_OK, true);

        if ($notifyasked && !$updatekey) {
TagsNo tags attached.
Attached Files

2011-05-30 21:21   
tweaked the store to happen a second time to pick up the key;
not great but sufficient;
resolved in r1940;

Issue History
2011-05-10 20:22nimbusNew Issue
2011-05-11 05:29caseydkStatusnew => assigned
2011-05-11 05:29caseydkAssigned To => caseydk
2011-05-21 22:27caseydkProjectv2.3 Release (Closed) => v2.4 Release (Closed)
2011-05-30 21:21caseydkNote Added: 0001956
2011-05-30 21:21caseydkStatusassigned => resolved
2011-05-30 21:21caseydkFixed in Version => 3.0
2011-05-30 21:21caseydkResolutionopen => fixed
2011-08-16 23:37caseydkStatusresolved => closed
2011-08-16 23:37caseydkFixed in Version => 2.4