summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2015-01-20 21:45:18 +0100
committerBenny Baumann <BenBE@geshi.org>2015-01-20 21:45:18 +0100
commit8b0230a357ffdd904457b408aa1f4621b4b5a9e7 (patch)
treed97d9061abbf0fa2ff0cb80f05cb7c72dba2335e
parent2283bc4fff6e0d3c66b0636c3150de7bae360cb6 (diff)
parent41ace6dc77532a5d982af220e14a29714e0ab34b (diff)
downloadcacert-devel-8b0230a357ffdd904457b408aa1f4621b4b5a9e7.tar.gz
cacert-devel-8b0230a357ffdd904457b408aa1f4621b4b5a9e7.tar.xz
cacert-devel-8b0230a357ffdd904457b408aa1f4621b4b5a9e7.zip
Merge branch 'bug-1354' into testserver-stable
-rw-r--r--www/gpg.php23
1 files changed, 14 insertions, 9 deletions
diff --git a/www/gpg.php b/www/gpg.php
index 5a73e32..b3a4787 100644
--- a/www/gpg.php
+++ b/www/gpg.php
@@ -455,15 +455,20 @@ function verifyName($name)
{
if($name == "") return 0;
- if(compareName($name, $_SESSION['profile']['fname']." ".$_SESSION['profile']['lname'])) return 1; // John Doe
- if(compareName($name, $_SESSION['profile']['fname']." ".$_SESSION['profile']['mname']." ".$_SESSION['profile']['lname'])) return 1; // John Joseph Doe
- if(compareName($name, $_SESSION['profile']['fname']." ".$_SESSION['profile']['mname'][0]." ".$_SESSION['profile']['lname'])) return 1; // John J Doe
- if(compareName($name, $_SESSION['profile']['fname']." ".$_SESSION['profile']['mname'][0].". ".$_SESSION['profile']['lname'])) return 1; // John J. Doe
-
- if(compareName($name, $_SESSION['profile']['fname']." ".$_SESSION['profile']['lname']." ".$_SESSION['profile']['suffix'])) return 1; // John Doe Jr.
- if(compareName($name, $_SESSION['profile']['fname']." ".$_SESSION['profile']['mname']." ".$_SESSION['profile']['lname']." ".$_SESSION['profile']['suffix'])) return 1; //John Joseph Doe Jr.
- if(compareName($name, $_SESSION['profile']['fname']." ".$_SESSION['profile']['mname'][0]." ".$_SESSION['profile']['lname']." ".$_SESSION['profile']['suffix'])) return 1; //John J Doe Jr.
- if(compareName($name, $_SESSION['profile']['fname']." ".$_SESSION['profile']['mname'][0].". ".$_SESSION['profile']['lname']." ".$_SESSION['profile']['suffix'])) return 1; //John J. Doe Jr.
+ $q = mysql_query("SELECT CONVERT(fname USING UTF8), CONVERT(mname USING UTF8), CONVERT(lname USING UTF8), CONVERT(suffix USING UTF8) FROM users WHERE id='" . intval($_SESSION["profile"]["id"]) . "'");
+ if( false === ($row = mysql_fetch_assoc($q)) ) {
+ return 0;
+ }
+
+ if(compareName($name, $row['fname']." ".$row['lname'])) return 1; // John Doe
+ if(compareName($name, $row['fname']." ".$row['mname']." ".$row['lname'])) return 1; // John Joseph Doe
+ if(compareName($name, $row['fname']." ".$row['mname'][0]." ".$row['lname'])) return 1; // John J Doe
+ if(compareName($name, $row['fname']." ".$row['mname'][0].". ".$row['lname'])) return 1; // John J. Doe
+
+ if(compareName($name, $row['fname']." ".$row['lname']." ".$row['suffix'])) return 1; // John Doe Jr.
+ if(compareName($name, $row['fname']." ".$row['mname']." ".$row['lname']." ".$row['suffix'])) return 1; //John Joseph Doe Jr.
+ if(compareName($name, $row['fname']." ".$row['mname'][0]." ".$row['lname']." ".$row['suffix'])) return 1; //John J Doe Jr.
+ if(compareName($name, $row['fname']." ".$row['mname'][0].". ".$row['lname']." ".$row['suffix'])) return 1; //John J. Doe Jr.
return 0;
}