Creating users using e-mail address only - ruby on rails - ruby

I want to be able to create a user using only their e-mail address.
i.e. I want the admin to be able to enter a bunch of e-mail addresses, which will automatically create a new user and password and then e-mail the information to the address provided.
So I am hoping to figure out how to:
Create users using only e-mail addresses (rest can be randomly generated)
E-mail users their passwords and login details.
Any suggestions on a best way to approach this? I'm using authlogic for authentication.
Cheers!

I'd recommend using devise for this, as it handles generating confirmation emails, as well as the routes for confirming an email. A relevant tutorial for allowing users to sign up with just their email addresses: http://blog.devinterface.com/2011/05/two-step-signup-with-devise/
For having an admin create users, it'll be much the same, just generate random passwords+confirmations, and then call user.send_reset_password_instructions to send the email (which can be customized as in Ruby/Rails: How do you customize the mailer templates of Devise? )
see also: Rails Devise: Set password reset token and redirect user

Related

oracle apex email and sms authentication

I want to Create a user screen with Two authentications (SMS and Email)
User will receive email to verify and activate his account first.
After that he set password and he will receive SMS massage to verify the password.I want to do this in Oracle apex.I have tried Custom Authentication but i didn't found fruitful, Any one have some good idea to achieve this.
after u take care of the email and sms verification, u should store that data in the data base and create a function to use in your custom authentication that verifies if the user is already validated.
put the function in shared components -> authentication schemes -> settings -> Authentication Function Name
(the function must return true or false to allow the login)
I'm not a fan of using SMS for Two-Factor Authentication, but if you must, perhaps this might demo implementation for Time-based One Time Password (TOTP) might give you some ideas: https://github.com/fuzziebrain/orclapex-tfa-demo
I provided some background information here as well: https://fuzziebrain.com/content/id/1718/
Good luck!
I have achieved this in one of my APEX project but only with the e-mail. For the sms I use it in another context but you could still do it. You will need a smtp server ( you can run one on your server ) and for the sms you will need an external provider. In your oracle database, create a table called OTP ( one time password ).
This table contains a foreign key to a user. When the user creates an account, run a dynamic action in pl/sql that will generate a random 6 digit number that will be encrypt in your OTP table. This dynamic action will also send an email to the user with APEX_MAIL. The full documentation for how to use APEX-MAIL is here and it is pretty easy to use. You can send the user the password for authentication trough email.
Create a new session user called user_na (not authenticated) and make it so that when he connects, the only page he can see is a page with a text field to enter the password he receive through email. After he enters it, encrypt it the same way you did when he created an account and compare the password in the OTP table. If they match , change his account type to user and then he will be able to access every page that you made accessible for the users.
If you also want to send an sms, I recommend using this tutorial. The sms provider have a free trial if you want to test. If you have any questions don’t hesitate to ask I can easily help you with this.
NOTE: if you don’t want to create different session_users you can just add a column in your user table named authenticated. Set it to 0 by default and to 1 when he enters the email password. Then, when he log in, check if this value is 0 or 1 to know which page you should redirect him to.

How to send email from another address

So I was wondering, how would I send my email from another email address in Laravel. Currently I have this email address and domain. This is an example. Sender = test#domain.com
Now I have many auth()
users. I want to be able for them to send emails as well. So how would I do that? So for an example: Test#anotherdomain.com
My point is, currently the admin guard is able to send an email to the owner of the post who is user(). I have multi auth so admin is one guard and the other is the default.
So the admin is able to send email to test#domain.com
So how can I do it so that test#anotherdomain.com can send an email back to test#domain.com
Is this even possible?
Note: I am using mailgun.
You have two option in this situation:
1) use email clients independently like Phpmailer or Swiftmailer
2) change the config file and email credentials on the fly(make sure your config isn't cached)
Accessing Configuration Values

How to create a stormpath user without email?

Some users of my application do not have an email. I want them to register under a tenant. I couldn't find a way to make email field as non-mandatory while registration. The basic requirement of a stormpath account is an email and password.
Stormpath currently always requires a user's email AND password to create an account. In the future, we plan to remove this limitation.
For now, the only way to get around this is to fill in a dummy email address. Sorry!

Show plain password in joomla

I would need a readout of joomlas user password in plain style to give special users the ability to send a mail in a custom module with login details like:
https://mydomain/login?user=testuser
password = testuserpassword
For that reason I need the plain passowrd out of the DB. Is there a way to show/read out password from joomla-db in plain style?
Thx in advanced!
Joomla saves the passwords in the database using a one way encryption mechanism, which means that you cannot know what the password is.
I am sure what you're doing can be done in a different method - if you want to login users automatically once they click on a link then you can have a different authentication plugin that will use a random, unique, one-time-use, and time-sensitive hash that will be associated with a Joomla user account.
You need to create a plugin with function after joomla user save
you need to store password in another table with user id and then you can use with sql query to get password.
This is a bad idea for the following reasons:
email is sent in plain text
email often is stored on several systems along the way to your mailbox
email often is stored on your computer in plain text or other unencrypted format
many copies may exist in many places, even after "deletion"
even encrypted email can be broken in to, given enough computing time
your account's security may have been compromised even before you read your email (changing the password will not help in this case)
However, you definitely can email the user their password upon initial registration by going to Global Configuration > Users and setting Send Password to "Yes" (default setting in Joomla 3.x).
If you are looking for a way to send this password after the registration event, as others have mentioned, you are out of luck. What Joomla! provides is a secure password reset functionality to reset a password to something the user can remember. This will be the best approach for you, as well.
Resources: Sending Passwords in Email, Stop Joomla Sending Passwords in Emails

Magento: How to create an account with email and password only

I'm using Magento 1.7.
I would like to simplify the create account (register new user) to show and require only the email and a password.
The user would only fill in the other info (like name, address, etc) when making a purchase.
The idea behind is that every user would need to give out the email address in order to view the site content.
I'm already using this extension in order to make the the site available only to login users. I need a way to simplify the register process to include only email and password
app/design/frontend/default/{yourtheme}/template/customer/form/register.phtml
and comment out the fields that you don't want.
This is what you want, right?
You can try this extension from Magento Connect - Fast Registration it allow customer registration only with Email & Password

Resources