X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Ffunctions.php;h=16d094c343f3f77707495616110c0f69b97affc5;hp=eca0155f3e2de43cc22cdb11b91c9d8e4907dd02;hb=76ce476d3c48709bf6a69b3cc5bd333c4593d66b;hpb=e2d7a3291f85403b4faf6f8be7e30caeefb0c1a3 diff --git a/include/functions.php b/include/functions.php index eca0155..16d094c 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,4 +1,23 @@ + * + * This file is part of e-DoKo. + * + * e-DoKo is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * e-DoKo is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with e-DoKo. If not, see . + * + */ + /* make sure that we are not called from outside the scripts, * use a variable defined in config.php to check this */ @@ -127,8 +146,8 @@ function sendmail($To,$Subject,$message) * change txt -> html */ $message = str_replace("\n","
\n",$message); - $message = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", - "\\0", $message); + $message = preg_replace("#(\w+://[^<>\s]+[\w/]*)#", + "$1", $message); echo "
To: $To
"; if($header != "") @@ -961,21 +980,21 @@ function display_table () else echo " \"wedding"; - if(ereg("solo",$GT) && $party=="re") + if( (strpos($GT,"solo")!==false) && $party=="re") { - if(ereg("queen",$GT)) + if(strpos($GT,"queen")!==false) echo " \"$GT\""; - else if(ereg("jack",$GT)) + else if(strpos($GT,"jack")!==false) echo " \"$GT\""; - else if(ereg("club",$GT)) + else if(strpos($GT,"club")!==false) echo " \"$GT\""; - else if(ereg("spade",$GT)) + else if(strpos($GT,"spade")!==false) echo " \"$GT\""; - else if(ereg("heart",$GT)) + else if(strpos($GT,"heart")!==false) echo " \"$GT\""; - else if(ereg("trumpless",$GT)) + else if(strpos($GT,"trumpless")!==false) echo " \"$GT\""; - else if(ereg("trump",$GT)) + else if(strpos($GT,"trump")!==false) echo " \"$GT\""; } @@ -1384,4 +1403,18 @@ function cancel_game($why,$gameid) return; } +function get_user_token($userid) +{ + + $token = NULL; + + $date = DB_get_user_creation_date($userid); + $name = DB_get_name('userid',$userid); + + if($date && $name) + $token = md5("token".$name.$date); + + return $token; +} + ?>