Fixed a few minor bugs, improved revoked UID handling, but still needs some work
This commit is contained in:
parent
76232dc7fa
commit
c5e7a94b75
1 changed files with 42 additions and 19 deletions
61
www/gpg.php
61
www/gpg.php
|
@ -43,15 +43,16 @@
|
||||||
|
|
||||||
$keyid="";
|
$keyid="";
|
||||||
|
|
||||||
|
if(0)
|
||||||
//if($_SESSION["profile"]["id"] != 5897)
|
{
|
||||||
//{
|
if($_SESSION["profile"]["id"] != 5897)
|
||||||
// showheader(_("Welcome to CAcert.org"));
|
{
|
||||||
// echo "The OpenPGP signing system is currently shutdown due to a maintenance. We hope to get it fixed within the next few hours. We are very sorry for the inconvenience.";
|
showheader(_("Welcome to CAcert.org"));
|
||||||
//
|
echo "The OpenPGP signing system is currently shutdown due to a maintenance. We hope to get it fixed within the next few hours. We are very sorry for the inconvenience.";
|
||||||
// exit(0);
|
|
||||||
//}
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function verifyName($name)
|
function verifyName($name)
|
||||||
|
@ -156,7 +157,11 @@ function verifyEmail($email)
|
||||||
|
|
||||||
$resulttable.="<td bgcolor='#".($emailok?"c0ffc0":"ffc0c0")."'>$mail</td>";
|
$resulttable.="<td bgcolor='#".($emailok?"c0ffc0":"ffc0c0")."'>$mail</td>";
|
||||||
$uidok=0;
|
$uidok=0;
|
||||||
if($mail=="" and $name=="")
|
if($bits[1]=="r")
|
||||||
|
{
|
||||||
|
$rmessage=_("Error: UID is revoked");
|
||||||
|
}
|
||||||
|
elseif($mail=="" and $name=="")
|
||||||
{
|
{
|
||||||
$rmessage=_("Error: Both Name and Email address are empty");
|
$rmessage=_("Error: Both Name and Email address are empty");
|
||||||
}
|
}
|
||||||
|
@ -272,6 +277,11 @@ function verifyEmail($email)
|
||||||
$nocomment = 1;
|
$nocomment = 1;
|
||||||
$pos = strpos($bits[9], "<") - 1;
|
$pos = strpos($bits[9], "<") - 1;
|
||||||
}
|
}
|
||||||
|
if($pos < 0)
|
||||||
|
{
|
||||||
|
$pos = strlen($bits[9]);
|
||||||
|
}
|
||||||
|
|
||||||
$name = trim(hex2bin(trim(substr($bits[9], 0, $pos))));
|
$name = trim(hex2bin(trim(substr($bits[9], 0, $pos))));
|
||||||
$nameok=verifyName($name);
|
$nameok=verifyName($name);
|
||||||
if($nocomment == 0)
|
if($nocomment == 0)
|
||||||
|
@ -285,13 +295,26 @@ function verifyEmail($email)
|
||||||
} else {
|
} else {
|
||||||
$pos = strpos($bits[9], "<") + 1;
|
$pos = strpos($bits[9], "<") + 1;
|
||||||
}
|
}
|
||||||
$pos2 = strpos($bits[9], ">", $pos);
|
|
||||||
$mail = trim(hex2bin(trim(substr($bits[9], $pos, $pos2 - $pos))));
|
$mail="";
|
||||||
|
if (preg_match("/<([\w.-]*\@[\w.-]*)>/", $bits[9],$match)) {
|
||||||
|
//echo "Found: ".$match[1];
|
||||||
|
$mail = trim(hex2bin($match[1]));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//echo "Not found!\n";
|
||||||
|
}
|
||||||
|
|
||||||
$emailok=verifyEmail($mail);
|
$emailok=verifyEmail($mail);
|
||||||
|
|
||||||
$uidid=$bits[7];
|
$uidid=$bits[7];
|
||||||
|
|
||||||
if($mail=="" and $name=="")
|
if($bits[1]=="r")
|
||||||
|
{
|
||||||
|
$ToBeDeleted[]=$uidid;
|
||||||
|
}
|
||||||
|
elseif($mail=="" and $name=="")
|
||||||
{
|
{
|
||||||
//echo "$uidid will be deleted\n";
|
//echo "$uidid will be deleted\n";
|
||||||
$ToBeDeleted[]=$uidid;
|
$ToBeDeleted[]=$uidid;
|
||||||
|
@ -299,17 +322,17 @@ function verifyEmail($email)
|
||||||
elseif($emailok and $nameok)
|
elseif($emailok and $nameok)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
elseif($emailok and $name=="")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
elseif($nameok and $mail=="")
|
||||||
|
{
|
||||||
|
}
|
||||||
elseif(!$emailok and !$nameok)
|
elseif(!$emailok and !$nameok)
|
||||||
{
|
{
|
||||||
//echo "$uidid will be deleted\n";
|
//echo "$uidid will be deleted\n";
|
||||||
$ToBeDeleted[]=$uidid;
|
$ToBeDeleted[]=$uidid;
|
||||||
}
|
}
|
||||||
elseif($emailok and $name=="")
|
|
||||||
{
|
|
||||||
}
|
|
||||||
elseif($nameok and $mail="")
|
|
||||||
{
|
|
||||||
}
|
|
||||||
elseif(!$emailok)
|
elseif(!$emailok)
|
||||||
{
|
{
|
||||||
//echo "$uidid will be deleted\n";
|
//echo "$uidid will be deleted\n";
|
||||||
|
|
Loading…
Reference in a new issue