I was just about to follow this tutorial:
http://eureka.ykyuen.info/2011/03/03/rails-%E2%80%93-add-custom-fields-to-devise-user-model/
But then realized that my Devise needed some customizing. I am very new to Rails, so sorry for anything in advance.
What I am doing:
I need to create a site for a Minecraft server a friend and I are making. I set up devise with no extras, just an access level (admin, moderator, developer, ranks, etc.). I am using mongoid for everything here.
What's the problem? I need to make sure that the user really owns their minecraft account! The way I want to do it: In game you type /register [email], you are sent an email with a confirmation link, you click it and done, you are now registered.
What I am asking: Can someone guide me as to: What I need to do in Java, simply what's needed to be done, not the code (in PHP I've done this before, I opened up a connection to a page, I sent username and a hash as parameters), and what must be done in Rails (Change up some views, totally redo the insides of Devise, just what's needed, and some examples). I'm quite new to rails, so please be nice to my brain! Thanks!
I understand it's a big request for help, but if you have some idea of how this can be done, please help. Thank you for reading!
Edit:
Okay... I really am getting desperate here, I will make it as simple as I can:
How do I customize Devise confirmation? I want it like this: from JAVA I can create a user (with only his username and email) who can't log in because he hasn't confirmed yet. When the site gets this request to make an account, I want to dispatch an email with mailer with a confirmation link. From there, instead of just going ahead and verifying, I need them to type their password and reconfirm it, because remember: the account was created without the password, only username and email! After they fill in the form, their account is active!
Please help, I need this done quickly, my app is quickly growing and it will be a hassle to change this all. Until someone can help me, to make things better in user I am using a method to get what display name I want them to use, right now it's set to email, after someone helps me I can finally make it username!
Thank you for reading, please reply if you know the answer or upvote so someone can provide a good answer!
(Assuming that you already added the username field to the User model created by Devise)
What I would do:
Create a simple form, no Devise at all, just a standard form that takes the username and the email.
Email the user. This email will have the Devise form and/or a confirmation link.
If placing the Devise form in the mail is not possible, have it displayed in the page linked by the confirmation email. Of course, you can now auto-complete all the fields except for the password.
With this approach you don't have to dig in the guts of Devise. Use it out of the box, but until the second interaction with the user.
Related
I'm currently trying to extend the Liferay create account process so the user gets asked to provide his or hers telephone number and address during registration.
I know that Liferay supports the concepts of custom fields and I have managed to add them to the registration form and persist them to the database. However, out of the box, Liferay has support for phone numbers and addresses to be associated with an user account. I don't think it is a sound development technique to use custom fields for something that is already there.
Anyways my question is, what is the preferred technique to ask for an address and/or a phone number during registration? I tried hooking to the Struts registration action but I don't think that is the solution, in order to use the PhoneLocalService ot AddressLocalService I need a user ID and I get the user ID after I add the user to the database.
I admit hooking and extending Liferay is a bit of a mess for me right now, so any advice will be appreciated.
Unfortunately, the standard customization is quite limited (with a few properties you can turn on-off some features, like the captcha, or the prefix-postfix titles, etc., but nothing complicated).
The only way to customize registration JSP and the contacts JSP, mix them up and put it into the hook as the registration form.
I have done the exactly same thing as you need here, and I must say the handling of addresses and phones is a complete mess on first sight (it is done with auto forms, because you can have multiple ones). After throwing out the unnecessary code though it is quite straightforward to include a fix number of phone/address on the registration form.
Summary - Want to make a simple website form filler. The website is NOT mine and I cannot edit its source code. Don't know what tools/languages are needed. Would java, jsp, html be enough ?
Request - Please reconsider your decision to close or downvote. I only need to know if java is enough or not.
There is a form on a website, say for reserving a visit to only one dentist. You fill your details and the date and time you want to visit. Then, it tells you if an appointment can be made or not, somewhere in the webpage.
This web page is NOT protected by CAPTCHA. I don't want to enter my details all the time to look for a reservation. I want to make code to do it for me.
I want to make code which will -
1 - Fill the details into the form and "press" submit.
2 - Then, read the resulting page and find out if a reservation is
available or not. If yes, do something like maybe - pop up a GUI
message, send e-mail or whatever.
3 - Repeat the above steps every 5 hours or so.
What are the languages and tools I would need to do this job ? Would I need more than java, jsp and html (thats all i know now) to make such code ?
Thanks.
I will suggest you try CURL. That will make you solution more simple in my opinion.
You can execute HTTP GET/POST with CURL, which is enough to solve your problem. Give it a try, and if you get block you can ask a more specific question about CURL or HTTP.
Hope it helps.
IMO, If you really just want to fill up some forms to check a reservation, no need to code anything, why not just install a plugin, Selenium, record your actions there and just run it at specified times: http://docs.seleniumhq.org/
Sure.
You need a web server and a database on the back end.
Since you feel comfortable with Java, JSP/HTML would probably be an ideal solution.
IMHO...
I have a web app, which connects user to asterisk box via SIP and allow user to call any mobile or landlines number, Now I want to make it automatic, in current scenario User have to manually click on a html button called Dial to dial a number,
Now what I want to achieve is "as soon as user logged in, Asterisk will automatically call 3 nos from the campaign list which is allocated to the user and gives the user call only when the client connected to it. That means caller will be given the call only when receiver receives it.
Any configuration or java code will help, even any algorithm will help also, i know my English is poor so, sorry for any mistakes, I hope people will understand what I am trying to achieve from the above para.
I higly recomend you use dialler code. becuase there are much more issues you never thought about.
http://www.vicidial.org
or other.
If you still think you are qualified enought to write your own code, you can read this page:
http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out
Hi i'm working on play20 framework with java application.For that
i want to implement "remember me" functionality like gmail or facebook
without cookies . i don't know how to start .Can any one help me in
that ?
Thank you in Advance.
Why do you want it without cookies? If you'll remove all google.* cookies it will not remember you as well.
Of course you do not need to store credentials in the cookies to keep the user logged in. Most probably you need to save some kind of ID in the database for each logged user and then store this ID as a cookie. When user comes back you have to check if stored cookie fits any of the user and if it do, just consider the user is logged in.
Of course to avoid brute force attempts you should also create additional validation cookie(s) and each time check if sets of cookies matches each other with server-side comparison.
I think you definitely need cookies. However RememberMe isn't so trivial as it's looks. I implement one for permsec in play2.0. After finish it, I found this article, which shows a lot of problems with stolen cookies.
I don't think it is possible without using cookies. If you want to implement this functionality with cookies, when user clicks "remember me" just let the expire date be in a distant future.
I can make a log in for easily, so that's not the problem. What is my problem is that I don't know how to check if the user's name and password are correct. I had a few ideas so here they are:
1) Saved in game, update every time someone registers -> Not practical
2) A MySQL database with something -> I'm just too stupid for that.
3) A website (php) that asks for ?name= and &password= in the URL, if it exists it echoes true, else false and then when I want to login, I just try to connect to that website (the user won't see that, of course) and see what it returns. I think this is the best idea for me but I don't know how to connect to the website and read what it says.
Just to make it clear, I have a domain and a website.
You're correct that #1 is really impractical and #3 seems effectively the same as you'd need to store your collection of username / password pairs somewhere. You should really consider #2. At some point we all felt "too stupid" for something new, but check it out, do some tutorials, and I'm sure you'll be well on your way.
An appropriate solution should include password encryption (ideally with a salt). Since you mentioned PHP, check out crypt. Also, take a look at PDO, probably the best (in my opinion) MySQL interface for PHP. Again take a look at the official docs here.
You seem like you're quite new to this, so some of that may be over your head at first. If so, just Google around with those keywords and you'll be sure to find many great tutorials.