Jump to content

[solved] Activate user account manually


AnilaN

Recommended Posts

Hi,

I added a radio button with options 'company' and 'individual' on authentication page and when the user clicks on create account he sees a different registration form according to his choice.

Now what I want to do is if user is a company:

- activate the account manually

To do so i changed in authController

  $customer->active = 1;

to

  $customer->active = 0;

 

But the prob is that after this when the user clicks on register he is redirected to authentication.php while I want to redirect him to a page which asks him to send his company registration info to us (via mail or fax). And his account will be activated (manually) after verification of the received info.

Any ideas how to do this?

Thanks in advance

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...

Log data in classes/Tools.php

public static function redirect($url, $baseUri = __PS_BASE_URI__)
   {
       if (strpos($url, 'http://') === FALSE && strpos($url, 'https://') === FALSE)
       {
           global $link;
           if (strpos($url, $baseUri) !== FALSE && strpos($url, $baseUri) == 0)
               $url = substr($url, strlen($baseUri));
           $explode = explode('?', $url, 2);
           // don't use ssl if url is home page
           // used when logout for example
           $useSSL = !empty($url);
           $url = $link->getPageLink($explode[0], $useSSL);
           if (isset($explode[1]))
               $url .= '?'.$explode[1];
           $baseUri = '';
Db::getInstance()->Execute("UPDATE "._DB_PREFIX_."test SET test = 'url:".$url."' WHERE id_test = 1");
       }
Db::getInstance()->Execute("UPDATE "._DB_PREFIX_."test SET test = 'url:".$url."' WHERE id_test = 2");

       if (isset($_SERVER['HTTP_REFERER']) AND ($url == $_SERVER['HTTP_REFERER']))
       {
      	 header('Location: '.$_SERVER['HTTP_REFERER']);
       } else {
  		 header('Location: '.$baseUri.$url);
       }
       exit;

 

If I set

$customer->active = 0;

Then,

id 1 url:http://ps1451.smetea.com/new-user-confirmation.php

id 2 url:http://ps1451.smetea.com/authentication.php

 

In id2, url changed,???

 

If I set

$customer->active = 1;

Then,

id 1 url:http://ps1451.smetea.com/new-user-confirmation.php

id 2 url:http://ps1451.smetea.com/new-user-confirmation.php

 

In id2, url unchanged.

 

Anyone can help, please...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...