|
Joined: Aug 2000
Posts: 53
Member
|
Member
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 *
|
|
|
|
Joined: Aug 2000
Posts: 335
Member
|
Member
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]](https://ubbdev.com/ubb/smilies/smile.gif)
|
|
|
|
Joined: Aug 2000
Posts: 53
Member
|
Member
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: 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
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: also I suggest you use CGI pm to parse your forms: that will give you the same results as and it's better: 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
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): 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]](https://ubbdev.com/ubb/smilies/frown.gif) 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 *
|
|
|
|
Joined: May 2000
Posts: 243
Member
|
Member
Joined: May 2000
Posts: 243 |
because you took an if else statement out of your foreach loop, and you spelled chomp wrong ![[Linked Image]](https://ubbdev.com/ubb/smilies/smile.gif) this code should work just fine: ------------------ Powered by ZCom Bulletin Boards
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
Joined: Sep 2000
Posts: 755 |
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]](https://ubbdev.com/ubb/smilies/smile.gif) --mark
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
|
|
|
|
Joined: Aug 2000
Posts: 53
Member
|
Member
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
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): Any way to fix this?
* Insert cliche' quote/sentence/image here *
|
|
|
|
Joined: Dec 2000
Posts: 595
Member
|
Member
Joined: Dec 2000
Posts: 595 |
i like this one. change $dado{'USER'} and $dado{'PASS'} for something you are using to get the form inputs. then open a loop ------------------  sleepless
|
|
|
|
Joined: Aug 2000
Posts: 53
Member
|
Member
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
Joined: Dec 2000
Posts: 595 |
me too, actually.. ![[Linked Image]](https://ubbdev.com/ubb/smilies/biggrin.gif) ------------------  sleepless
|
|
|
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.
|
|
Posts: 87
Joined: December 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|