Login javascript?

Discuss Programming
JoeDude
administrator
administrator
Posts: 355
Joined: Sun Feb 08, 2004 1:41 pm
Location: Sutton Coldfield, UK
Contact:

Login javascript?

Post by JoeDude » Sun Jun 24, 2007 12:23 pm

Anyone know of a script that I can put in a web page that will produce a login popup window when a button is pressed, which will check a database for login and password creds, then once verified, move on to the protected content?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Sun Jun 24, 2007 7:07 pm

It has to be JavaScript? Never done it with JavaScript but I do it all the time with regular htaccess authentication or basic authentication within PHP scripts. Here is a page on htaccess:

http://www.apacheweek.com/features/userauth

Here is a PHP example:

http://us2.php.net/features.http-auth

Either of those methods can access username/passwords in a database.

Master of Reality
guru
guru
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Post by Master of Reality » Sun Jun 24, 2007 9:51 pm

Wouldn't you need server-side script to do that (as opposed to javascript)?

JoeDude
administrator
administrator
Posts: 355
Joined: Sun Feb 08, 2004 1:41 pm
Location: Sutton Coldfield, UK
Contact:

Post by JoeDude » Mon Jun 25, 2007 2:56 am

No, it doesn't have to be Jave, yes it would have to be serverside, or wherever the database is imported to actually.

It's a project I am working on at work. You remember when I was asking about a program for reporting incidents? Well that's it. They want me to build a web based reporting suite. The IT section have some guys who are good with Java, but when I asked about perl or...well anything else, they all just looked at me blank. After developing like 10 pages deep, worked out the bugs and coordinated and designed the database for it, Now I have been told I have to do it using all MS products (the hits just keep on coming) because they would like to use sharepoint stuff with it. So. it's gone froma fully interactive reporting suite to exactly what the specs call for, no more or less.

Now, apparently, I have to remove Apache from the server I was using to switch to an MS Server2003....

If they weren't paying me extra for this, I'd walk away right now, it's frustrating the amount of people who change thier minds and have nothing to do with the developement...

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon Jun 25, 2007 6:14 am

I guess that's where this thread ends then (M$). :)

User avatar
Calum
guru
guru
Posts: 1349
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland
Contact:

Post by Calum » Mon Jun 25, 2007 6:48 am

well, there's a first time for everything. i'd bet this isn't a time when we'll see the first MS Windows Server support thread in these forums though...

Incidentally, Java and Javascript are two different things, yes?

Master of Reality
guru
guru
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Post by Master of Reality » Mon Jun 25, 2007 9:23 am

Yep, java was/is developed by sun, where as javascript was originally developed by netscape, and i believe the actual standards-compliant name for javascript is ECMAScript or something.

JoeDude
administrator
administrator
Posts: 355
Joined: Sun Feb 08, 2004 1:41 pm
Location: Sutton Coldfield, UK
Contact:

Post by JoeDude » Mon Jun 25, 2007 2:21 pm

Would they know if I didn't use any of those things (like access and frontpage) to build and develope it, then put it on thier server anyway? I don't see how they would. It would just mean I would have to work it at home a lot...

Blieve me, I ain't gonna, nor do I ever intend to ask for MS help here. That's why I kept the script bit specific. I fully intend to make the IT guys earn thier money with the implementation of this thing. If I am successful, this reporting suite will be standard across all Security Sections at all NHS Hospitals.

Curious, what is a reasonable asking price? ;-)

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon Jun 25, 2007 2:40 pm

If you can convince them to run it on Linux I would be more than happy to help because right now my only solutions are PHP/htaccess + MySQL or PostgreSQL on Apache on Linux. As I said, if it's intended to be run on Windows then it doesn't belong here. Sorry man.

JoeDude
administrator
administrator
Posts: 355
Joined: Sun Feb 08, 2004 1:41 pm
Location: Sutton Coldfield, UK
Contact:

Post by JoeDude » Tue Jun 26, 2007 1:18 am

that's cool.

User avatar
Calum
guru
guru
Posts: 1349
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland
Contact:

Post by Calum » Tue Jun 26, 2007 6:23 am

i am disgusted that my taxes are going towards multiple microsoft licences for the NHS, a public service, to have security services.

How much money is being wasted on this? How much money could go towards healthcare? How much longer, by comparison, do I and others have to queue for elementary healthcare and doctors' appointments because of the money wasted on Microsoft software by the NHS? How much lower could the standard prescription charge be if the NHS used Free software instead?

Disgusting.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Jun 26, 2007 8:40 am

Heh heh, I'm sure that's a drop in the bucket Calum. :)

JoeDude
administrator
administrator
Posts: 355
Joined: Sun Feb 08, 2004 1:41 pm
Location: Sutton Coldfield, UK
Contact:

Post by JoeDude » Wed Jun 27, 2007 3:37 am

Not only that, but I'm disgusted that a hospital needs security at all. That's a real indicator of the times we live in, when you have to restrain people who need to be seen by a doctor or thieves praying on the hospitals equipment that is used to save lives.

User avatar
Calum
guru
guru
Posts: 1349
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland
Contact:

Post by Calum » Wed Jun 27, 2007 9:18 am

you're right about that!

i still think though that some civil servant somewhere in the department of health (or whatever it's called) should be looking to change a closed source and expensive infrastructure to an open and therefore by definition more robust and futureproof solution in the interests of economy as well as improved security.

JoeDude
administrator
administrator
Posts: 355
Joined: Sun Feb 08, 2004 1:41 pm
Location: Sutton Coldfield, UK
Contact:

Post by JoeDude » Wed Jun 27, 2007 11:00 pm

Well, they do have one redhat server. They won't let me on it right now. I have no idea what it's doing either...niether do most of them seem to know... I'm back at work today, I'll try and get at least some of the liberty back I had when we started this project. Problem is, It might be coming from our major Trusts' IT dept.

Post Reply