Hello, I've tried to modify some of the modules in paypal.pl (not yet tested in Sandbox):
sub file_open { my $open_file = shift; my $open_str = shift; # open the file if (!open(FILE, "$open_str$open_file")) { error_notify("Unable to access: $open_file - $!\n", "open file", 1, +1); } # lock access to this file if (!flock(FILE, 2)) { error_notify("Unable to get lock on file: $open_file\n", "open file" +, 1, 1); } if (!seek(FILE, 0, 0)) { error_notify("Unable to seek to the start of the file: $open_file\n" +, "open file", 1, 1); } } sub file_close { my $close_file = shift; # unlock the file if (!flock(FILE, 8)) { error_notify("Unable to unlock file: $close_file\n", "close file", 1 +, 1); } if (!close(FILE)) { error_notify("Unable to close: $close_file - $!\n", "close file", 0, + 0); } } sub find_login { my $new = shift; my $login; my $password; my $remainder; # for each line, break into parts while(<FILE>) { chop; ($login, $password, $remainder) = split(/:/, $_, 3); if ($login eq $new) { return 1; } } return undef; } sub find_txn { my $new_txn = shift; # look for this txn id while(<FILE>) { if (/^$new_txn/) { return 1; } } return undef; } sub add_user { my $login = shift; my $password = shift; my $accnt = shift; # Aug. 6, 2007 change my $txn = shift; file_open($PASSWORD_FILE, "+<"); # check to see if this user already exists if (find_login($login)) { error_notify("Username: $login already exists", "add user", 0, 1); } else { # seek to the end of the file if (!seek(FILE, 0, 2)) { error_notify("Unable to seek to the end of the file: $PASSWORD_FILE +\n", "add user", 1, 1); } # add the necessary line print FILE "$login\:$password\:$accnt\n"; # REMOVE start ------------------------------------------- # hack to write paid usernames and non-encrypted passwords to a simp +le text file that will be used # to populate mysql USERS table file_open($USERS_FILE, "+<"); print FILE2 "$login\:$password\:$accnt\n"; file_close($USERS_FILE); # end of hack # REMOVE end Aug. 6 , 2007 ---------------------------------------- +--- } file_close($PASSWORD_FILE);
I need the script to keep track of type of membership (ex. gold, silver, bronze). I'd like to write username, password and accnt fields to a flat file without encryption so I can integrate with a mysql table : USERS. The other alternative is to write a funky Perl script to read contents of .htpasswd file. I understand that encryption of the password (salt : crypt or "whatever") will be the main obstacle. The big issue is the "work around" to make my php/mysql website work with Paypal IPN script that using Perl and sdome Apache server conventions.

In reply to Re^2: .htpasswd Hacks - Paypal IPN with Password Management by teacherguy
in thread .htpasswd Hacks - Paypal IPN with Password Management by teacherguy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.