Author Topic: Help. I need Admin to enable Customer Registration - How?  (Read 30596 times)

jcaan

  • Beginner
  • *
  • Posts: 38
Help. I need Admin to enable Customer Registration - How?
« on: October 03, 2007, 16:56:37 pm »
Hi. I have a wholesale shop. I want people to register, but only allow Admin to enable them from the backend after reviewing their details. What settings do I have to enable/disable for me to get this functionality.

At the moment people register - click on an email confirmation, then they login, without Admin interaction - this is wrong for me. Please help.

jcaan

  • Beginner
  • *
  • Posts: 38
Re: Help. I need Admin to enable Customer Registration - How?
« Reply #1 on: October 04, 2007, 15:57:17 pm »
Anybody ?

Ok, what php files do I need to edit so that confirmation emails are not sent when someone registers, but an email is sent to say the "Admin will review your details within 24 hours ...If you have any questions etc etc."

Help is much appreciated.

zorkhh

  • Advanced
  • Jr. Member
  • *****
  • Posts: 245
    • vm-expert.com
Re: Help. I need Admin to enable Customer Registration - How?
« Reply #2 on: October 04, 2007, 23:52:19 pm »
Hello,

i didn't try this solution, but it might help to set the user to "blocked" by default. To do this, edit /administrator/components/com_virtuemart/classes/ps_user.php. Search

$row->registerDate = date( 'Y-m-d H:i:s' );

(should be around line 465) and add

$row->block='1';

after this line.

If you have allowed Joomla's registration, you will also have to edit /components/com_registration/registration.php. Find

$row->block = '1';

(around line 146) and copy this line out of the if-block. The result should look like this:

if ( $mosConfig_useractivation == 1 ) {
   $row->activation = md5( mosMakePassword() );
}
$row->block = '1';

As i said, i didn't test this. I don't know how virtuemart behaves when the result of a user-registration is a blocked user. Just try and check if it works for you. (Don't forget to backup the original files!)

Thomas


Virtuemart Professional Support at http://www.vm-expert.com

Visit the large Virtuemart Group on Joomla.org: http://people.joomla.org/groups/viewgroup/30-Virtuemart.html

jcaan

  • Beginner
  • *
  • Posts: 38
Re: Help. I need Admin to enable Customer Registration - How?
« Reply #3 on: October 05, 2007, 13:00:05 pm »
Thank you for your suggestion. I will try it out now.

Can anybody please tell me how I can disable the activation url link that is posted to the user's email address upon registration. I want this link to go to Admin email instead, so that Admin can click to activate it when finished reviewing customer details. Please help.

jcaan

  • Beginner
  • *
  • Posts: 38
Re: Help. I need Admin to enable Customer Registration - How?
« Reply #4 on: October 05, 2007, 16:17:36 pm »
I modified the following for my liking.

In administrator/components/com_virtuemart/language/english.php language file,
I removed the "%s" under this variable string:

var $_USEND_MSG_ACTIVATE =

Thank you for.....
To activate the account click on the following link or copy-paste it in your browser:
%s

After activation....

Username - %s
Password - %s

I removed the %s and chnaged the text according to my needs. This removed the activation link from the email. The admin gets an email anyway for new users who register. The user is blocked until admin unblocks them.

Really, that's all I wanted to do. Thx for your help.

salsababy

  • Jr. Member
  • **
  • Posts: 51
  • I luv VM
Re: Help. I need Admin to enable Customer Registration - How?
« Reply #5 on: November 12, 2007, 07:12:51 am »
^ I think this is what I need and it's an excellent suggestion.  I was searching endlessly for a practical solution to the exact situation as yours. Thanks so much for sharing that!!

It's a fairly easy method, just log into the back-end and go to VM's Admin  'User Manager' and check their sign-up details. Then, go into Joomla's admin to activate them. Well, that's what I'm presuming as I guess that's the best that can be done. I hope a one-step shopper activation can be done through administration in a future VM.

For a wholesale, I guess the 'Company Name' field should be set to be 'required' as well as the addition of 'Merchant/Tax ID #' required field.

This is a good way to check shopper's details and then allow full access to a wholesale site, because people can just put 'asdf' in most of the required fields and still gain access through the normal self-serve registration process.

I suppose the last thing to do is the customer's completed registration main page info:
" Registration Complete!Your account has been created and activation link has been sent to the e-mail address you entered. Note that you must activate the account by clicking on the activation link when you get the e-mail before you can login."
Also easy enough to do in the same folder:  /administrator/components/com_virtuemart/languages/english.php

Wonderful, thanks again!
~I heart VirtueMart | VirtueMart 1.0.15 Joomla 1.0.15 Stable~

salsababy

  • Jr. Member
  • **
  • Posts: 51
  • I luv VM
Re: Help. I need Admin to enable Customer Registration - How?
« Reply #6 on: November 12, 2007, 10:37:09 am »
How did you get rid of the registration link in a customer's email?

I tried what you did to remove the activation link '%s', but then in a test customer email, it still shows the activation link in place of the site login link, the site login link sits in place of the customer's username. It seems to omit the username only. Basically, it went all wonky.

I thought it was some inherited hierarchy of the '%s' placement, so I went into  /administrator/components/com_virtuemart/classes/ps_user.php and tried to see if I could omit the activation link placement, but I couldn't figure it out.

Any advice or direction would be great. I want to have everything in the customer's email except the activation link.

~I heart VirtueMart | VirtueMart 1.0.15 Joomla 1.0.15 Stable~

salsababy

  • Jr. Member
  • **
  • Posts: 51
  • I luv VM
Re: Help. I need Admin to enable Customer Registration - How?
« Reply #7 on: November 13, 2007, 09:52:14 am »
No worries, I think I figured it out after tearing out some hair. The method in itself is great, but I also had to omit some code to omit the activation link from the shopper's registration email. I figured the key was in ps_shopper.php, so I studied the code and pulled out a line that controls the actual activation.

/administrator/components/com_virtuemart/classes/ps_shopper.php

Code: [Select]
if ($mosConfig_useractivation=="1"){
$message = sprintf ($VM_LANG->_USEND_MSG_ACTIVATE, $name, $mosConfig_sitename, $mosConfig_live_site."/index.php?option=com_registration&task=activate&activation=".$row->activation, $mosConfig_live_site, $username, $pwd);

I modified the code like so:

Code: [Select]
if ($mosConfig_useractivation=="1"){
$message = sprintf ($VM_LANG->_USEND_MSG_ACTIVATE, $name, $mosConfig_live_site, $username, $pwd);

-This kills the call to include the activation link in the new shopper's registration e-mail. Then, you must do as jcaan did to remove the place setting of the activation link or you'll end up sending out blank emails!  Modify the language files to include relevant information, so the potential customer is fully aware of the operation.

I'm going to experiment and see if I can get the activation link to go into the admin mail, along with further relevant customer info to possibly make activation by admin notification email. I might be over my head, but I would like to try.

I know it's quite a tedious hack-up job, but it's good for a membership distributor based site. I approved the test account manually and put a test sale through, everything went smooth.
~I heart VirtueMart | VirtueMart 1.0.15 Joomla 1.0.15 Stable~

tmda

  • Beginner
  • *
  • Posts: 1
Re: Help. I need Admin to enable Customer Registration - How?
« Reply #8 on: January 23, 2009, 17:18:53 pm »
Hi there i have a similar situation,
im using joomla 1.5.8, and VM 1.1.2

I've tried to make the changes on ps_shopper and on english.php
and still is sending an blank email to customer ...

How can i solve this?!
Any help

Thanks

sonichead

  • Beginner
  • *
  • Posts: 5
Re: Help. I need Admin to enable Customer Registration - How?
« Reply #9 on: February 02, 2009, 19:41:07 pm »
I'm using the latest versions as well and I have the same issue with it still sending out blank emails to customers. Would be great to have a helping hand in this one. Thanks.

sonichead

  • Beginner
  • *
  • Posts: 5
Re: Help. I need Admin to enable Customer Registration - How?
« Reply #10 on: February 02, 2009, 21:53:05 pm »
Update: I made changes in the english.php file in the common directory. This gave me the ability to take out the activation link in the customers registration email as well as change the text in it. You can also find the area to change the text that shows on the website after they input their registration information. Good luck everyone.

sonichead

  • Beginner
  • *
  • Posts: 5
Re: Help. I need Admin to enable Customer Registration - How?
« Reply #11 on: February 02, 2009, 22:31:31 pm »
Update: Scratch my last comment. This is however the place to change text in an email or site. Deleting the $s out of the english.php file gave me an error logging in to VM through Joomla. Wish I knew PHP a litle more for this. Any help would be great..

sonichead

  • Beginner
  • *
  • Posts: 5
Re: Help. I need Admin to enable Customer Registration - How?
« Reply #12 on: February 02, 2009, 23:00:29 pm »
Looks like my first comment was right. This is the correct file to be working with. I didn't delete one (') and it through everything off.
 
Around line 755 or so I deleted the following and entered my own text.
-------
To activate the account click on the following link or copy-paste it in your browser:
%s

After activation you may login to %s using the following username and password:

Username - %s
Password - %s
---------

Please be sure that the text starting with hello begins with a (') and the ending of the text should end with a (') as well.

Now when a person registers, it tells them that the admin will activate their account. I do it manually and all is good.

I couldn't leave in the username and password information because it didn't come out right when it sent out the email. Would like a fix for that if possible.

Another solution that I'm looking for is how to send an activation link for the customer to the Admins mailbox or another email box.

Anyway...thought I would post this for others looking for somewhat of a solution.

Wiechardt

  • Beginner
  • *
  • Posts: 3
Re: Help. I need Admin to enable Customer Registration - How?
« Reply #13 on: July 15, 2009, 22:18:45 pm »
Hi sonichead, have you found a solution to the questions you asked in your last post:
1.  To fix the email issue with the username and password not displaying correctly when the activation link placeholder is removed
2.  Sending the activation link to an Admin Inbox

novator

  • Beginner
  • *
  • Posts: 30
Re: Help. I need Admin to enable Customer Registration - How?
« Reply #14 on: July 31, 2009, 22:33:52 pm »
I did some changes in code and result is

1)After registration client get email what he mus wait till admin activate account
(this part you can change in language file administrator/components/virtuemart/language/common/english.php)

line ~700

Code: [Select]
'USEND_MSG_ACTIVATE' => 'Hello %s,

Thank you for registering at %s. Your account is created and must be activated by admin before you can use it.

After activation you may login to %s using the following username and password:

Username - %s
Password - %s',
As you see, I delete %s with activation link

2)You must edit administrator/components/com_virtuemart/classes/ps_shopper.php

~789 line

Code: [Select]
$message = sprintf ($VM_LANG->_('USEND_MSG_ACTIVATE',false), $name, $mosConfig_sitename, $mosConfig_live_site, $username, $pwd);I delete $activation_link
After that changes user get email without activation link

3)Now we must edit again common/english.php (we will edit text which get admin and embed activation link in it)

~695 line

Code: [Select]
'ASEND_MSG' => 'Hello %s,

A new user has registered at %s.
This email contains their details:

Name - %s
e-mail - %s
Username - %s
Before user can login you must activate it. You can do it by pressing link below:
%s

Please do not respond to this message as it is automatically generated and is for information purposes only',

4) When again editing ps_shopper.php

~817 line
Code: [Select]
$message2 = sprintf ($VM_LANG->_('ASEND_MSG',false), $adminName2, $mosConfig_sitename, $name, $email, $username, $activation_link);
Now admin can activate user. Always look what sequence of %s will be same

The only problem which left for me, after admin activate account, user don't get notify email.
Will be great if someone advice me how to make it work