View Issue Details

IDProjectCategoryView StatusLast Update
0015607phplist applicationSubscribe Processpublic01-02-12 23:58
Reporterh2b2 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version2.10.12 
Target Version2.10.XFixed in Version2.10.17 
Summary0015607: Confirmation email not being sent due to issue with getUserConfig()
Descriptiondrmike reports the following:
=== Start Quote ===
In order to get the confirmation emails working I had to change function getUserConfig() of defaultconfig.inc (line 726ff) as follows:

    function getUserConfig($item, $userid = 0) {
       global $default_config, $tables, $domain, $website;
       $hasconf = Sql_Table_Exists($tables["config"]);
       if ($hasconf)
          $req = Sql_Query("select value from {$tables["config"]} where item = \"$item\"");
       if (!Sql_Affected_Rows() || !$hasconf)
          $value = (isset($default_config[$item][0]))?$default_config[$item][0]:"";
       else {
          $row = Sql_fetch_Row($req);
          $value = $row[0];
       }
       # if this is a subpage item, and no value was found get the global one
       if (!$value && preg_match("/:/", $item)) {
          list ($a, $b) = split(":", $item);
          $value = getUserConfig($a, $userid);
       }
       if ($userid) {
          $user_req = Sql_Fetch_Row_Query("select uniqid from {$tables["user"]} where id = $userid");
          $uniqid = $user_req[0];
          # parse for placeholders
          # do some backwards compatibility:
          # hmm, reverted back to old system
    /*
          $url = getConfig("unsubscribeurl");
          $sep = preg_match('/\?/', $url) ? '&' : '?';
          $value = preg_match('/\[UNSUBSCRIBEURL\]/i', $url . $sep . 'uid=' . $uniqid, $value);
          $url = getConfig("confirmationurl");
          $sep = preg_match('/\?/', $url) ? '&' : '?';
          $value = preg_replace('/\[CONFIRMATIONURL\]/i', $url . $sep . 'uid=' . $uniqid, $value);
          $url = getConfig("preferencesurl");
          $sep = preg_match('/\?/', $url) ? '&' : '?';
          $value = preg_match('/\[PREFERENCESURL\]/i', $url . $sep . 'uid=' . $uniqid, $value);
    */
          $search_for = array();
          $replace_with = array();
          $search_for[] = '[UNSUBSCRIBEURL]';
          $url = getConfig("unsubscribeurl");
          $sep = strpos($url, '?') ? '&' : '?';
          $replace_with[] = $url.$sep.'uid='.$uniqid;
          $search_for[] = '[CONFIRMATIONURL]';
          $url = getConfig("confirmationurl");
          $sep = strpos($url, '?') ? '&' : '?';
          $replace_with[] = $url.$sep.'uid='.$uniqid;
          $search_for[] = '[PREFERENCESURL]';
          $url = getConfig("preferencesurl");
          $sep = strpos($url, '?') ? '&' : '?';
          $replace_with[] = $url.$sep.'uid='.$uniqid;
          $value = str_replace($search_for, $replace_with, $value);
       }
       $subscribeurl = getConfig("subscribeurl");
       $search_for = array('[SUBSCRIBEURL]', '[DOMAIN]', '[WEBSITE]');
       $replace_with = array($subscribeurl, $domain, $websit);
       $value = str_replace($search_for, $replace_with, $value);
    /* $value = preg_match('/\[SUBSCRIBEURL\]/i', getConfig("subscribeurl"), $value);
       $value = preg_replace('/\[DOMAIN\]/i', $domain, $value); #@ID Should be done only in one place. Combine getConfig and this one?
       $value = preg_replace('/\[WEBSITE\]/i', $website, $value);*/
       if ($value == "0") {
          $value = false;
       }
       elseif ($value == "1") {
          $value = true;
       }
       return $value;
    }

In addition, I had to change line 556 of index.php to:
  $confirmationmessage = str_replace('[LISTS]', $lists, getUserConfig("confirmationmessage:$id", $userdata["id"]));

I hope this is of help to others, also.

PHP Version 5.3.3, MySQL Version: 5.1.33

=== End Quote ===
Source: http://forums.phplist.com/viewtopic.php?p=83199#p83199
Additional Informationhexmode provides a patch for the above: http://forums.phplist.com/viewtopic.php?p=83205#p83205
TagsNo tags attached.

Activities

michiel

04-05-11 14:27

manager   ~0051262


hard to see what changed, but sounds like it's an "ereg" fix for 5.3