Forum Moderators: open

Message Too Old, No Replies

Getting login name using JavaScript

need to know login name

         

cochranrg

8:35 pm on Mar 7, 2006 (gmt 0)

10+ Year Member



Is there a way to use Java to get the users login name? I can do it with Perl, but need to be able to do it from my HTML page.

I want to be able to check a login name, and if it is a certain name or group, re-direct the user to a page that will allow them to create a new one. If it is ok, then carry on with the current page.

Thanks,
Rob

DrDoc

8:40 pm on Mar 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's not necessarily that it cannot be done (although it is most likely absolutely impossible, depending on where the login name is stored) ...
It shouldn't be done, as it would leave a wide open security hole.

If anything, if you don't want to do it in Perl, use .htaccess and mod_rewrite (assuming you can get access to the login name).

cochranrg

8:45 pm on Mar 7, 2006 (gmt 0)

10+ Year Member



Getting a user name is not a security hole. Passwords yes, username no. Sheesh, most sites use Email addresses as usernames anyway.

Anyway, guess Java isn't up to the task. I'll go elsewhere.

DrDoc

8:49 pm on Mar 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Where would you pull the username from? If sensitive information is stored in the same place, one can easily look at the JavaScript code and get access to other things as well, possibly something that would compromise the system.

And, no, you're right ... JavaScript is really not up to the task.

Finally, it's JavaScript ... not Java. They have nothing in common and are no closer related than you and me.

khell

10:18 am on Mar 8, 2006 (gmt 0)

10+ Year Member



DrDoc, about your last statement: you never know. :)

DrDoc

5:14 pm on Mar 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



True, true ;)