diff --git a/config.toml b/config.toml index 6cf880f..89a17a3 100644 --- a/config.toml +++ b/config.toml @@ -1,4 +1,4 @@ -baseurl = "http://pmpc.mehl.mx/" +baseurl = "/" title = "Public Money, Public Code" theme = "hugo-creative-theme" DefaultContentLanguage = "en" diff --git a/static/cgi-bin/sign.php b/static/cgi-bin/sign.php index 62a2de0..6de880b 100644 --- a/static/cgi-bin/sign.php +++ b/static/cgi-bin/sign.php @@ -1,3 +1,69 @@ $id, + "name" => $name, + "email" => $email, + "country" => $country, + "zip" => $zip, + "perm" => $perm, + "code" => $code); + $data[] = $newsig; // newsig is a separated variable for debugging purposes + + // Encode to JSON again and write to file + $allsig = json_encode($data, JSON_PRETTY_PRINT); + file_put_contents($db, $allsig, LOCK_EX); + unset($allsig); + + // Send email asking for confirmation + $to = $email; + $subject = "One step left to sign the open letter"; + $message = "Please confirm $code"; + $headers = "From: noreply@mehl.mx" . "\r\n" . + "Message-ID: confirmation-$code@fsfe.org" . "\r\n" . + "X-Mailer: PHP/" . phpversion(); + + mail($to, $subject, $message, $headers); +} + +echo "
";
+print_r($data);
+echo "
"; +unset($data); ?>