use strict; use warnings; use CGI; #### use utf8; use CGI qw(-utf8); binmode(STDOUT, ":utf8"); #### #[Slightly sanitized and greatly truncated...] [Mon Mar 22 01:03:25.470815 2021] [cgi:error] [pid 1602] [client x.x.93.1:65279] AH01215: Variable "$DEBUG" is not imported at ../MyScript2021/MyScript_MySQL.pl line 6.: /var/www/[domain_name_redacted].com/cgi/MyScript-2021.pl [Mon Mar 22 01:03:25.471028 2021] [cgi:error] [pid 1602] [client x.x.93.1:65279] AH01215: Variable "$DEBUG" is not imported at ../MyScript2021/MyScript_MySQL.pl line 556.: /var/www/[domain_name_redacted].com/cgi/MyScript-2021.pl [Mon Mar 22 01:03:25.471169 2021] [cgi:error] [pid 1602] [client x.x.93.1:65279] AH01215: Variable "$newuserpass" is not imported at ../MyScript2021/MyScript_MySQL.pl line 560.: /var/www/[domain_name_redacted].com/cgi/MyScript-2021.pl [Mon Mar 22 01:03:25.471225 2021] [cgi:error] [pid 1602] [client x.x.93.1:65279] AH01215: Variable "$membertable" is not imported at ../MyScript2021/MyScript_MySQL.pl line 561.: /var/www/[domain_name_redacted].com/cgi/MyScript-2021.pl [Mon Mar 22 01:03:25.471363 2021] [cgi:error] [pid 1602] [client x.x.93.1:65279] AH01215: Variable "$newuserpass" is not imported at ../MyScript2021/MyScript_MySQL.pl line 577.: /var/www/[domain_name_redacted].com/cgi/MyScript-2021.pl [Mon Mar 22 01:03:25.471415 2021] [cgi:error] [pid 1602] [client x.x.93.1:65279] AH01215: Variable "$membertable" is not imported at ../MyScript2021/MyScript_MySQL.pl line 578.: /var/www/[domain_name_redacted].com/cgi/MyScript-2021.pl [Mon Mar 22 01:03:25.471603 2021] [cgi:error] [pid 1602] [client x.x.93.1:65279] AH01215: Variable "$DEBUG" is not imported at ../MyScript2021/MyScript_MySQL.pl line 619.: /var/www/[domain_name_redacted].com/cgi/MyScript-2021.pl [Mon Mar 22 01:03:25.471690 2021] [cgi:error] [pid 1602] [client x.x.93.1:65279] AH01215: Variable "$username" is not imported at ../MyScript2021/MyScript_MySQL.pl line 630.: /var/www/[domain_name_redacted].com/cgi/MyScript-2021.pl [Mon Mar 22 01:03:25.471733 2021] [cgi:error] [pid 1602] [client x.x.93.1:65279] AH01215: Variable "$digest" is not imported at ../MyScript2021/MyScript_MySQL.pl line 631.: /var/www/[domain_name_redacted].com/cgi/MyScript-2021.pl [Mon Mar 22 01:03:25.471776 2021] [cgi:error] [pid 1602] [client x.x.93.1:65279] AH01215: Variable "$table" is not imported at ../MyScript2021/MyScript_MySQL.pl line 632.: /var/www/[domain_name_redacted].com/cgi/MyScript-2021.pl [Mon Mar 22 01:03:25.471820 2021] [cgi:error] [pid 1602] [client x.x.93.1:65279] AH01215: Variable "$language" is not imported at ../MyScript2021/MyScript_MySQL.pl line 633.: /var/www/[domain_name_redacted].com/cgi/MyScript-2021.pl #### use strict 'vars'; use utf8; use CGI qw(-utf8); binmode(STDOUT, ":utf8"); #import($DEBUG); # THIS DIDN'T WORK. #CURRENT SUBS IN THIS FILE sub usrupdatePassword; sub updatePassword; sub updateUserRank; sub connectdb; sub connectdb_login; sub create_login_table; sub query_login_table; sub login; 1; #---------------------------------------- sub usrupdatePassword { # A USER FUNCTION if (($DEBUG) && ($DEBUG<12)) { print qq|

SUB: usrupdatePassword\n

| }; my $user = shift @_; my $curpass = shift @_; my $newpass = shift @_; my $valid = &checkLogin_mysql($user,$curpass); my $salt = &getRandomSalt; if (($user) && ($newpass) && ($valid)) { $salt = crypt($newuserpass, $salt); my $statement = qq| UPDATE $membertable SET Password = '$salt' WHERE Username='$user'; |; &connectdb_login($statement,'updatePassword'); return "Password updated!"; } else { return "Sorry. Incorrect credentials."; } } #END SUB usrupdatePassword sub updatePassword { # AN ADMIN FUNCTION if (($DEBUG) && ($DEBUG<12)) { print qq|

SUB: updatePassword\n

| }; my $authuser = shift @_; my $newpass = shift @_; my $valid = &checkUserExists_mysql($authuser); my $salt = &getRandomSalt; if (($authuser) && ($newpass) && ($valid)) { $salt = crypt($newuserpass, $salt); my $statement = qq| UPDATE $membertable SET Password = '$salt' WHERE Username='$authuser'; |; &connectdb_login($statement,'updatePassword'); return "Password updated!"; } else { return "Sorry. Incorrect credentials."; } } #END SUB updatePassword # . . . [TRUNCATED]