# site you can set this to empty string, but warning this is a security hole as everybody
# can use awredir on your site to redirect to any web site (even non legal web sites).
$KEYFORMD5='YOURKEYFORMD5';
+# Put here url pattern you want to allow event if parameter key is not provided.
+$AUTHORIZEDWITHOUTKEY='';
+
#-------------------------------------------------------
# Functions
exit 0;
}
-if ($KEYFORMD5 eq 'YOURKEYFORMD5') {
+if ((! $AUTHORIZEDWITHOUTKEY) && ($KEYFORMD5 eq 'YOURKEYFORMD5')) {
error("Error: You must change value of constant KEYFORMD5 in awredir.pl script.");
}
if ($Url !~ /^http/i) { $Url = "http://".$Url; }
if ($DEBUG) { print LOGFILE "Url=$Url\n"; }
-if ($KEYFORMD5 && ($Key ne md5_hex($KEYFORMD5.$UrlParam))) {
+if ((! $AUTHORIZEDWITHOUTKEY || $UrlParam !~ /$AUTHORIZEDWITHOUTKEY/) && $KEYFORMD5 && ($Key ne md5_hex($KEYFORMD5.$UrlParam))) {
# error("Error: Bad value for parameter key=".$Key." to allow a redirect to ".$UrlParam." - ".$KEYFORMD5." - ".md5_hex($KEYFORMD5.$UrlParam) );
error("Error: Bad value for parameter key=".$Key." to allow a redirect to ".$UrlParam.". Key must be hexadecimal md5(KEYFORMD5.".$UrlParam.") where KEYFORMD5 is value hardcoded into awredir.pl. Note: You can remove use of key by setting KEYFORMD5 to empty string in script awredir.pl");
}
-
# Get date
($nowsec,$nowmin,$nowhour,$nowday,$nowmonth,$nowyear,$nowwday,$nowyday,$nowisdst) = localtime(time);
if ($nowyear < 100) { $nowyear+=2000; } else { $nowyear+=1900; }