brindhans / activationbymail

Automatically exported from code.google.com/p/activationbymail
0 stars 0 forks source link

Link not working #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Customer signs up - gets email. Click email but gives Page Not Found
2. Customer can't log in as shop just returns customer to log-in page. No error 
displayed

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
Latest, with PrestaShop™ 1.5.6.1

Please provide any additional information below.

Original issue reported on code.google.com by ravnsbor...@gmail.com on 15 Dec 2013 at 5:57

GoogleCodeExporter commented 8 years ago
I found a solution. I have the problem, that the generated link leads to a "not 
found" page. This is because it is not considered that SEO URLs are in use. 
Appending the activation code as a GET parameter in form of a string with "&" 
does not work in that case, like it happens in the module. Instead, it is safe 
to provide the parameter(s) as an array to the method of the PrestaShop Link 
class that generates the link.

Within activationbymail.php in line 73 in the hookCreateAccount method:

$link = $this->context->link->getModuleLink($this->name, 'activation') . 
'&link=' . $activation_link;

Should become this:

$link = $this->context->link->getModuleLink($this->name, 'activation', 
array('link' => $activation_link));

This automatically takes care of using the right symbol for appending the 
parameter.

Original comment by peter.th...@gmail.com on 13 Feb 2014 at 8:05

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
#1 peter's post worked for me. I am using 1.5.4. However, on other related 
issue. When on the mobile site, the module only worked when I added the its 
contents a subfolder /en/. 

Original comment by dougadan...@gmail.com on 21 Feb 2014 at 10:37

GoogleCodeExporter commented 8 years ago
Insert in 73 line:
        $read = "SELECT value FROM ps_configuration WHERE name = 'PS_REWRITING_SETTINGS'";
$connect = @mysqli_connect(_DB_SERVER_, _DB_USER_, _DB_PASSWD_, _DB_NAME_);
if ($connect) {
    $res1 = mysqli_query($connect, $read);
    while ($row1 = mysqli_fetch_assoc($res1)){
             $config = $row1;
        }
} else {
   echo('Cannot connect to database...'); exit;
}
mysqli_close($connect);

if ($config['value'] == '0'){
$link = $this->context->link->getModuleLink($this->name, 'activation') . 
'&link=' . $activation_link;
} else {
$link = $this->context->link->getModuleLink($this->name, 'activation') . 
'?link=' . $activation_link;
}

Original comment by ferart...@gmail.com on 31 Oct 2014 at 10:00