Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Aug 2000
Posts: 53
Member
Member
Offline
Joined: Aug 2000
Posts: 53
OK, I have about 5 scripts that I use along with my forum. I have a link script, review script, and some other scripts that I use to let users interact more with my site. When I wrote these, I was hoping to be able to verify the username and password of the poster. So if someone wanted to add a link to their page on the link script, they must be registered. I looked through Dave's Login Script, and I have narrowed the code that verifies it down to both ubblibrary.pl scripts. Anyone have an easier way to do this? Any help will be appreciated!


* Insert cliche' quote/sentence/image here *
Sponsored Links
Joined: Aug 2000
Posts: 335
Member
Member
Offline
Joined: Aug 2000
Posts: 335
If you know Perl, it's not hard to do.

Use memberslist.cgi to map the username to the 8-digit user number, construct the member's profile filename from the number (e.g., 00000123.cgi), then get the password from that file.

What was more challenging was to do this from a script running on a server different from the one the UBB is on [Linked Image]

Joined: Aug 2000
Posts: 53
Member
Member
Offline
Joined: Aug 2000
Posts: 53
Damn, your a genius! I will do it tonight, have a dentist appointment right now. Thanks!

Edit: Here is what I have so far:

Code
code:

It works fine. Is there any way to improve it?

This message has been edited by Scud Muffin on January 16, 2001 at 02:08 PM


* Insert cliche' quote/sentence/image here *
Joined: May 2000
Posts: 243
Member
Member
Offline
Joined: May 2000
Posts: 243
well I see something that needs improved. I see that after you find the user number you open the member file, but then you use a foreach to check each line with $FORM{'password'}, that's not secure at all. I think the password is on line 2. so you need to do this:

Code
code:

also I suggest you use CGI pm to parse your forms:

Code
code:

that will give you the same results as and it's better:

Code
code:

Mark B. just posted a thread about the use of -wT and other usefull things in perl. It's a very info filled article. I recommend you take a look at it if you want to increase your perl knowledge

Joined: Aug 2000
Posts: 53
Member
Member
Offline
Joined: Aug 2000
Posts: 53
Ahhh poo ... I had it working on my old server, I moved it to my new one, and now it doesn't work. I need some help here guys. The problem that I get is it only checks the last line of the memberslist.cgi in the Members directory. The code in the above post is pretty old, here is my new code (this is just a sub):

Code
code:

I am reading the article you recommended. I have heard of tainting and stuff before, just never knew what it did. I would be really grateful if someone could help me out soon. I have dealine to have over 19 scripts for my site done by Feb 1st. The only thing holding me up is this username and password veryfication. [Linked Image] I will give you a cookie if you help!

This message has been edited by Scud Muffin on January 26, 2001 at 10:54 PM


* Insert cliche' quote/sentence/image here *
Sponsored Links
Joined: May 2000
Posts: 243
Member
Member
Offline
Joined: May 2000
Posts: 243
because you took an if else statement out of your foreach loop, and you spelled chomp wrong [Linked Image]

this code should work just fine:

Code
code:

------------------
Powered by ZCom Bulletin Boards

Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
Quote
quote:
no reason to loop. One swift motion:

my %FORM = map {$_ => $obj->param($_)} $obj->param;

Personally, I prefer to just work with the objects, rather then move them into a hash, as you already have the values in the object and are thus duplicating data.

As for the rest of the code, i'll try to look later on to see other improvements, if any [Linked Image]

--mark


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
Joined: Aug 2000
Posts: 53
Member
Member
Offline
Joined: Aug 2000
Posts: 53
God I love this board. Every time I think I am getting good, I realize I suck, or just ponder the enormity of knowledge I don't possess. You guys are life savers (not the hard candy). I will try the code now and report back.

This message has been edited by Scud Muffin on January 27, 2001 at 06:37 PM


* Insert cliche' quote/sentence/image here *
Joined: Aug 2000
Posts: 53
Member
Member
Offline
Joined: Aug 2000
Posts: 53
OK, I am back. There is one problem with the code. The username works great, but the password doesn't. It is still opening the last file in memberslist.cgi, not the one adjacent to the username specified in the form. Here is what I am using to verify the username and password (it is a short sub):

Code
code:

Any way to fix this?


* Insert cliche' quote/sentence/image here *
Joined: Dec 2000
Posts: 595
Member
Member
Offline
Joined: Dec 2000
Posts: 595
Code
code:

i like this one. change $dado{'USER'} and $dado{'PASS'} for something you are using to get the form inputs. then open a loop

Code
code:

------------------

sleepless

Sponsored Links
Joined: Aug 2000
Posts: 53
Member
Member
Offline
Joined: Aug 2000
Posts: 53
*Hails to the king Copycat*

Works great, I am so damn happy!


* Insert cliche' quote/sentence/image here *
Joined: Dec 2000
Posts: 595
Member
Member
Offline
Joined: Dec 2000
Posts: 595
me too, actually.. [Linked Image]

------------------

sleepless


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)