summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorINOPIAE <inopiae@cacert.org>2013-05-14 22:59:46 +0200
committerINOPIAE <inopiae@cacert.org>2013-05-14 22:59:46 +0200
commit71d6d063bc6633d67133ccb53f67d5d27f9f5b99 (patch)
tree9c4a6ce385504664dbbb3025c51a2e086feabfdd /www
parent45ee203868aa194b242293102d96d5ef71f4a37c (diff)
downloadcacert-devel-71d6d063bc6633d67133ccb53f67d5d27f9f5b99.tar.gz
cacert-devel-71d6d063bc6633d67133ccb53f67d5d27f9f5b99.tar.xz
cacert-devel-71d6d063bc6633d67133ccb53f67d5d27f9f5b99.zip
bug 782: Added comment update for all certificate view pages
Diffstat (limited to 'www')
-rw-r--r--www/gpg.php43
1 files changed, 31 insertions, 12 deletions
diff --git a/www/gpg.php b/www/gpg.php
index fcc0742..132e522 100644
--- a/www/gpg.php
+++ b/www/gpg.php
@@ -52,7 +52,7 @@ if(0)
{
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);
}
}
@@ -143,7 +143,7 @@ function verifyEmail($email)
$uidformatwrong=0;
if(sizeof($bits)<10) $uidformatwrong=1;
-
+
if(preg_match("/\@.*\@/",$bits[9]))
{
showheader(_("Welcome to CAcert.org"));
@@ -248,7 +248,7 @@ function verifyEmail($email)
$resulttable.="</tr>\n";
if($emailok) $multiple++;
-
+
if(trim($_REQUEST['description']) == ""){
$description= trim(mysql_real_escape_string(stripslashes($_REQUEST['description'])));
}else{
@@ -286,7 +286,7 @@ function verifyEmail($email)
`level`='1',
`expires`='".mysql_real_escape_string($expires)."',
`multiple`='".mysql_real_escape_string($multiple)."',
- `keyid`='".mysql_real_escape_string($keyid)."',
+ `keyid`='".mysql_real_escape_string($keyid)."',
`description`='".mysql_real_escape_string($description)."'";
mysql_query($query);
$id = mysql_insert_id();
@@ -349,7 +349,7 @@ function verifyEmail($email)
{
//echo "Not found!\n";
}
-
+
$emailok=verifyEmail($mail);
$uidid=$bits[7];
@@ -403,14 +403,14 @@ function verifyEmail($email)
1 => array("pipe", "w"), // stdout is a pipe that the child will write to
2 => array("pipe", "w") // stderr is a file to write to
);
-
- $stderr = fopen('php://stderr', 'w');
+
+ $stderr = fopen('php://stderr', 'w');
//echo "Keyid: $keyid\n";
$process = proc_open("/usr/bin/gpg --homedir $cwd --no-tty --command-fd 0 --status-fd 1 --logger-fd 2 --edit-key $keyid", $descriptorspec, $pipes);
-
+
//echo "Process: $process\n";
//fputs($stderr,"Process: $process\n");
@@ -420,7 +420,7 @@ function verifyEmail($email)
// 0 => writeable handle connected to child stdin
// 1 => readable handle connected to child stdout
// Any error output will be appended to /tmp/error-output.txt
- while (!feof($pipes[1]))
+ while (!feof($pipes[1]))
{
$buffer = fgets($pipes[1], 4096);
//echo $buffer;
@@ -472,14 +472,14 @@ function verifyEmail($email)
}
//echo "Fertig\n";
fclose($pipes[0]);
-
+
//echo stream_get_contents($pipes[1]);
fclose($pipes[1]);
-
+
// It is important that you close any pipes before calling
// proc_close in order to avoid a deadlock
$return_value = proc_close($process);
-
+
//echo "command returned $return_value\n";
}
else
@@ -515,6 +515,25 @@ function verifyEmail($email)
exit;
}
+if($oldid == 2 && array_key_exists('change',$_REQUEST) && $_REQUEST['change'] != "")
+{
+ showheader(_("My CAcert.org Account!"));
+ foreach($_REQUEST as $id => $val)
+ {
+ if(substr($id,0,14)=="check_comment_")
+ {
+ $cid = intval(substr($id,14));
+ if(!empty($_REQUEST['check_comment_'.$cid])) {
+ $comment=trim(mysql_real_escape_string(stripslashes($_REQUEST['comment_'.$cid])));
+ mysql_query("update `gpg` set `description`='$comment' where `id`='$cid' and `memid`='".$_SESSION['profile']['id']."'");
+ }
+ }
+ }
+ echo(_("Certificate settings have been changed.")."<br/>\n");
+ showfooter();
+ exit;
+}
+
$id = intval($id);
showheader(_("Welcome to CAcert.org"));