![]() |
|
"be consistent" | |
PerlMonks |
UBB find user id codeby LeGo (Chaplain) |
on Oct 09, 2001 at 22:34 UTC ( [id://117827]=perlquestion: print w/replies, xml ) | Need Help?? |
LeGo has asked for the wisdom of the Perl Monks concerning the following question:
in reference to this... Well I am going to post some code. I have a subroutine that will either return the users name or a message that will say the something to the fact "NOTLOGGEDIN" as I am assuming that no one will use that user name. If they do I will adjust. If you could check out the code and see if there are some things that you would change. Do note that this does run... if you see something that will functionally not work agian please let me know. Basically the way that UBB works (exclusively describing for this example), is that once a user post, the users name and password are stored in cookies. I grab these. Then I check to see if this person is an actual user. If not I return NOTLOGGEDIN. UBB stores the users info in a file, I get this file name from memberslist.cgi by splitting then getting user names and file names. If they match I then open the one that coincides with the cookie $id. This file has the user name and the user password. I compare these, if they match I return the user name, else NOTLOGGEDIN. It appears that this is very simple. I could expand to NOTAUSER, FAKEPASSWORD, but for my purpose now I don't need that functionality. Maybe the next version will have that. I understand this code could hinder the speed of the program becuase it does not break when the user is found. I have tried break but get an use strict not allowed error. Could someone help speed this up for me? Those are the types of things I am looking for help with. Much thanks. :) LeGo LeGo
Back to
Seekers of Perl Wisdom
|
|