$send_email_confirmation=1; &find_mail; &get_input; &check_cookie; open(TL,"$path_to_lang/$thislang/basic_auth.txt"); while(){push(@LaNg,$_)} &exec_lang; ($un,$unx,$fld,$fldx)=split(/\|/,$Sign_Up_Member); $kryp=crypt($un,"ce"); $kryp=substr($kryp,2); $kryp=~s/\W//g; if($kryp ne $unx){&bad_member} $mkryp=crypt($fld,"ce"); $mkryp=substr($mkryp,2); $mkryp=~s/\W//g; if($mkryp ne $fldx){&bad_folder} if($folder_url){ $folder=$folder_url; $folder =~ s`http://$host`$path_to_domain`; } $htp=$folder."/.htpasswd"; if($member_name ne ""){ if($^O !~ /mswin32/i){ $salt=substr($pword,0,2); $pw=crypt($pword,$salt); }else{ $pw=$pword; } $entry="$member_name:$pw:$email"; open(HTP,"$htp"); while(){ if(/^$member_name\b/){ $user_fnd=1; last; } } if(!$user_fnd){ open(HTP,">>$htp"); print HTP "$entry\n"; close(HTP); $jsnote.="$jsnote1 - $member_name\\n"; }else{ $jsnote.="$jsnote5 - $member_name\\n"; } } if($folder_url && $user_fnd){ print "Content-type: text/html\n\n"; print qq~
$nu_username $htm_text25
~; exit } if($folder_url){ if($send_email_confirmation){&send_email} $date = time -10 * 86400 ; $cookie_expire = gmtime($date); print "Set-Cookie: Sign_Up_Member=;expires=$cookie_expire;path=/\n"; print "Location: $folder_url\n\n"; exit }else{ print "Content-type: text/html\n\n"; print qq~~; } sub send_email{ if($found_sendmail){ open(MAIL,"|$found_sendmail -t"); print MAIL "From: $host <$account_email>\n"; print MAIL "To: $email\n"; print MAIL "Subject: Welcome From $host\n\n"; print MAIL qq~Welcome to http://$ENV{'HTTP_HOST'}$folder Your Member Name Is: $member_name Your Password Is: $pword ~; }else{ $sm_recipient=$email; $sm_from=$account_email; $sm_subject="Welcome From $host"; $sm_message=qq~Welcome to http://$ENV{'HTTP_HOST'}$folder Your Member Name Is: $member_name Your Password Is: $pword ~; &sendemail; } }#send_email sub bad_member{ print "Content-type: text/html\n\n"; print qq~
$htm_error1 - $member_name
~; exit }#bad_member sub bad_folder{ print "Content-type: text/html\n\n"; print qq~
$htm_error2 - $folder_url
~; exit }#bad_folder sub find_mail{ eval "`which sendmail`"; if(!$@){ $found_sendmail = `which sendmail`; } if(!$found_sendmail){ $@ = undef; if(-e "/usr/sbin/sendmail"){ $found_sendmail="/usr/sbin/sendmail"; } elsif(-e "/usr/lib/sendmail"){ $found_sendmail="/usr/lib/sendmail"; } elsif(-e "/usr/bin/sendmail"){ $found_sendmail="/usr/bin/sendmail"; } elsif(-e "/usr/local/sbin/sendmail"){ $found_sendmail="/usr/local/sbin/sendmail"; } elsif(-e "/usr/local/lib/sendmail"){ $found_sendmail="/usr/local/lib/sendmail"; } elsif(-e "/usr/local/bin/sendmail"){ $found_sendmail="/usr/local/bin/sendmail"; } } }find_mail 1;