In the project of mine I made a component that creates a User for Joomla and Virtuemart via a form. Administrator requested that no group has to be assigned to the newly created user until administrator decides to. User has to be automatically activated too. Please don't ask me why, this what I have been asked to do :(
When Administrator assigns a userGroup to the user, an email should be sent to the user to notify the user of this action so user can login.
I couldnt find any solution for it, I cant find a trigger that notify me when user assigns to a UserGroup either so I make a plugin for it.
Joomla is 2.5.8
Thank you in advance.
You can use JUtility/sendMail to send emails.
Now where to triggre email using sendMail?
Go to /libraries/joomla/user/helper.php file.
Inside, there is a method public static function addUserToGroup($userId, $groupId).
Most probably this is the method which is called. You may extend/override this method to add a custom custom code to trigger an email if assigning a userid to groupid is successful.
You may put a check for boolean return value on this part.
// Store the user object.
$user->save();
So if it is successful, the email will be triggered!
Hope it helps! Any better ideas are welcome.
Related
I have read through
https://sitecore-community.github.io/docs/xDB/the-xdb-contact/ and https://doc.sitecore.net/sitecore_experience_platform/81/setting_up__maintaining/xdb/contacts/contact_tracking.
I would like to know whether Sitecore contact tracking will work for my client or not.
I have created a simple newsletter subscription functionality (without WFFM form submission). Once a user submits his information along with personal details and email, I send a confirmation email link. After confirming the email address, I am creating contacts through code. Thanks to Brian!
My application session state mode is InProc.
My question is, if user is interacting with the site with a new session after subscription (after submitting email):
Will Sitecore identify user as contact (and merge in existing anonymous contact) or will it create new anonymous contact each time?
I am NOT using any of the following services in my solution:
Device detection
GeoIp Service
FXM
Your approach
It seems to me that manually creating contacts is completely unnecessary in your case.
As I understand from your post, here's what happens:
A user visits your website.
Sitecore creates a new contact (ID: xxx).
The user browses the website and submits your form.
A confirmation email is sent to the user's email address.
The user clicks on the link in the email and hits a confirmation page on the site.
Your code creates a new contact in xDB (ID: yyy).
As a result, you have two separate contacts in xDB that are not related to each other, from Sitecore's perspective.
Now, to your question:
Will Sitecore identify user as contact (and merge in existing anonymous contact) or will it create new anonymous contact each time?
If the user is visiting from the same browser, Sitecore will recognize them as the original contact (ID: xxx) based on a cookie. Sitecore will not create a new contact in this case.
If the user is visiting from another browser or device, he will not be recognized as any of the existing contacts and a new anonymous contact will be created (ID: zzz).
As you can see, Sitecore has no way of automatically using the contact you created (ID: yyy).
Suggested solution
The only way to make Sitecore recognize a user as a specific contact is to use the identification API. In short, what you can do is this:
Sitecore.Analytics.Tracker.Current.Session.Identify(identifier);
Here's what I suggest you to do:
Do not create new contacts manually—there's just no need for that.
When the user has submitted the form, you invoke Identify() and pass the user's email address as the identifier. This will set the user's email address as the identifier of the current contact.
When the user comes back from the email link you sent, you invoke Identify() once again. This will make sure that, even if the user is coming from another device, the same xDB contact will be used in his session. You'll need to pass the same email address to Identify(), so make sure you have access to it—for example, you can include it in your email confirmation link as a query string parameter.
Use Sitecore.Analytics.Tracker.Current.Contact and populate the current contact's facets with the information you've collected about the user.
If you have a login functionality, remember to invoke Identify() on successful login attempts—again, this is to ensure that the same contact is used for all sessions of the same user.
How do I manage users of our tikiwiki?
The tiki process on the server is ran under my name. I am the user of the tikiwiki, but I am not sure I am an admin user.
Most likely not but question one is: How do I find that out?
(my Admin Menu is empty)
Some user contacted me saying her account is "Locked". It so happened that there is no one else to restore it, but me.
Can anyone help where to look? I only used my tikiwiki account to limited extent. Just wrote couple of articles. But never administered.
There is always a built in user in Tiki called "admin" and that is in a group called "Admins" which has permission to do everything, so it sounds like your user isn't in that group.
If the admin user was set up with a valid email account (and you know it and have access to it) then you can get the password reset and a link to make a new one will be emailed to that address. If you can access the installer or the database then there are various other options on how to recover the admin login here: https://doc.tiki.org/Lost+admin+password
Once you have done this and can administer the Tiki again you should add your usual user to the Admins group.
To unlock another user's account you will need to either access the user admin list (once you have admin login again) or if you can get to the database you should be able to clear the relevant field in the database directly using phpmyadmin or similar as a last resort (ask again if you need this much detail).
I want my rails app, which i use devise gem, not to give away the availability of an email in my database when a user requests to reset his/her password, after he/she has forgotten it while trying to login.
Please if possible you can also provide the link of the reference material for me to understand it better.
I assume you mean that you don't want the app to say that an account with that email address was found in your database in case this is used as a way to find account names to try and break into. If so, then devise has a paranoid setting which will mean that the messages for password reset, resend confirmation etc. are vague and say that an email will have been sent if that email address exists in the database, without actually saying if it does or not. (It doesn't do this for registerable because if someone tried to create an account with a duplicate email address, devise thinks they should be told the creation failed.) The line you need in your devise.rb initialiser is:
config.paranoid = true
It's probably already there, just commented out with a comment above explaining it.
Here's a link to the blog post announcing this feature:
http://blog.plataformatec.com.br/2013/11/e-mail-enumeration-in-devise-in-paranoid-mode/
I am looking to implement django-registration for a project but am not sure if it will work out of the box for this use case. I am creating users as soon as I have their e-mail address (whether or not they actually are creating an account). At some time later those same users will try to register for an actual account and set a password, but the activation link will fail if the time ACCOUNT_ACTIVATION_DAYS has expired. Since I have separated the times at which someone actually gets a user versus when they are actually registered, I would ideally like to re-activate the user account.
I have looked through the docs and the source, but don't see any methods to re-activate the account or reset the activation key. Is there any solution to this built in?
Thanks!
I'm using django-registration which somehow stopped working the way it should work. I'm completely lost on this and have no idea where to start looking for the error.
So what happens is, that whenever a user clicks on the activation link, he gets the activation.html template. Which should only be shown when there was an error.
But actually there is no error. The user gets activated and can log in.
Any thoughts on this will be greatly appreciated.
First of all, the subject of your post and the actual description are conflicting. The subject says django-registration always fails to activate the user, but then in your description you say the user gets activated and can log in. Which is it?
Secondly, clicking on the activation link should always send the user to activate.html. You will have a variable called account on that page. If the activation was successful, account will be populated with the User object, otherwise it will be False.
There is a big difference between 0.7 and 0.8:
in 0.7:
registration/activate.html is displayed when a user attempts to
activate his/her account.
in 0.8
registration/activate.html
Used if account activation fails.
Debugging registration.views.activate showed: if the success_url isn't set,
the backend.post_activation_redirect method is called. If you're using the default backend, that returns an empty context without the account variable which is queried in the template.
The solution could be to overwrite the default backend.
The only problem is that you cannot pass any objects to views over a redirect. Hence, you cannot pass the account to the template context. You could do it with get params if wanted to.
I decided to just change the activation template and remove the condition.