. * **************************************************************/ // essential checks (do not remove!) if (! isset ($SECURE_CONNECTION)){ $SECURE_CONNECTION = "yes"; } if (! isset ($APACHE)){ $APACHE = 48; } if($_SERVER['HTTPS'] != "on") { die ("

This connection is not secured by SSL. Aborting.

"); } if ((! isset($AUTHREQUIRED)) or ($AUTHREQUIRED == "yes")) { require_once('wee-auth.php'); } // the $GPGDIR may have changed as a result of user authentication in wee-auth.php if (! is_dir($GPGDIR)){ die ("

Directory $GPGDIR does not exist.

"); } else { if (fileowner($GPGDIR) != $APACHE){ echo "

run: chown $APACHE $GPGDIR"; die("

Directory $GPGDIR is not owned by webserver user

"); } else { if (decbin(fileperms($GPGDIR)) != "100000111000000" ) { echo "

run: chmod 700 $GPGDIR"; die ("

Directory $GPGDIR has insecure permissions.

"); } } } // GLOBAL FUNCTIONS function unix($command) { // Executing a System Command with output $handle = popen("$command 2>&1", 'r'); $text = fread($handle, 2000000); pclose($handle); return $text; } function unix2($command,$dir) { // Executing a System Command with very large output but no input $rndhandle = fopen("/dev/urandom","r"); $RND = fread($rndhandle,20); fclose($rndhandle); $FILENAME = $dir."/".sha1($RND); $handle = popen("$command > ".$FILENAME." 2> ".$FILENAME, 'r'); $res = fread($handle, 20000000); pclose($handle); $handle = fopen($FILENAME, "r"); $text = fread($handle,20000000); fclose($handle); // destroy content of the plain text file unix("dd if=/dev/zero of=".$FILENAME." bs=1 count=".strlen($text)); unix("sync"); unix("rm ".$FILENAME); return $text; } function unixpipe($command,$input) { // Executing a System Command with no output to STDOUT but reading $input $handle = popen("$command 2>&1", 'w'); fwrite($handle, $input); pclose($handle); } function checkinput($input,$mode) { if ($mode == "none") { return $input; } else { if ($mode == "noscript") { //return addslashes($input); $filter = array('"'=>'', '\\'=>'', '\''=>'', ';'=>'', '('=>'', ')'=>'', '{'=>'', '}'=>'', '$'=>''); return strtr($input, $filter); } if ($mode == "html") { return htmlentities($input); } if ($mode == "url") { return rawurlencode($input); } } return "none"; } if (! isset($INPUT)){ $INPUT = "textarea"; } if (! isset($INPUTNAME)){ $INPUTNAME = "message"; } if (! isset($INPUTID)){ $INPUTID = "message"; } if (! isset($ENCRYPTIONTEXTAREA)){ $ENCRYPTIONTEXTAREA = "messagearea"; } if (! isset($DECRYPTIONINPUT)){ $DECRYPTIONINPUT = "textarea"; } if (! isset($DECRYPTIONINPUTNAME)){ $DECRYPTIONINPUTNAME = "message"; } if (! isset($DECRYPTIONINPUTID)){ $DECRYPTIONINPUTID = "message"; } if (! isset($DECRYPTIONTEXTAREA)){ $DECRYPTIONTEXTAREA = "messagearea"; } if (! isset($SIGINPUT)){ $SIGINPUT = "textarea"; } if (! isset($SIGINPUTNAME)){ $SIGINPUTNAME = "message"; } if (! isset($SIGINPUTID)){ $SIGINPUTID = "message"; } if (! isset($SIGTEXTAREA)){ $SIGTEXTAREA = "messagearea"; } if (! isset($VERIFYINPUT)){ $VERIFYINPUT = "textarea"; } if (! isset($VERIFYINPUTNAME)){ $VERIFYINPUTNAME = "message"; } if (! isset($VERIFYINPUTID)){ $VERIFYINPUTID = "message"; } if (! isset($VERIFYTEXTAREA)){ $VERIFYTEXTAREA = "messagearea"; } if (! isset($KEYSREADONLY)){ $KEYSREADONLY = "yes"; } if (! isset($KEYCREATION)){ $KEYCREATION = "no"; } if (! isset($DELETESECRETKEY)){ $DELETESECRETKEY = "no"; } if (! isset($FLEXIBLE)){ $FLEXIBLE = "no"; } if (! isset($ADDPRE)){ $ADDPRE = "no"; } if (! isset($FORYOUREYESONLY)){ $FORYOUREYESONLY = "no"; } if (! isset($REMOVEBR)){ $REMOVEBR = "no"; } /* -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iQIVAwUBU9mDxPv24sKOnJjdAQJ+Ag//U+sKA5V7jBFCuymkIEz9tw6NRrrmdqWe WZNJSEoMMWe4NgpCs7uiwhsxPYHwVq2X8GhGEObGtLbhbtuZW7KDgVXB1aTslIn9 Bf90bu3EqluVO4nzwlRJ+tAFJk57cCKI6eMP0m8FUMl/ksQduNLam2d5yBE/IWr5 pq8oCW+ZzwpMT4wUM4JkEDojpO9yVD9d9aNHEjGO7VhAPXON5gUg7jkjDJmWI9JY nhtvEb2/Js5FVDZo5QF6j3CMWGtlfWy5hMFAcOPHtz8AC1eaqBohYclie0YntiK7 0eZ6nyQGylR7ll6xq1FMdQ4f+YYMmx9FbTGfT+iwcTFhhVz26zevxk/0StxzN7q7 yPMQ8gM/BebOC3ydNbiSYp9qho1XDt1v/YqN+atmHNvNm/IizbSEhyxBwrQ+SuzV br73L4vqoc+aJwu4jdrW+frxQMcStVIuC5XV4ggopFNvjtmm2ytt+wuHRO0khAoo ODT+ctIAI2C5CLXzQ6F3+5Ygg/ZJkJnxI8Pkd9DxaCkjdMbPAcnuWq2v7QB+/TUT 7KlEH/HfmeNce+pFnwwCrGxgo7HimXonJE5xsNkhojNCmGX+CP7qbh3CiFnETPia B9DHoZLFBCaB8aBQTBtfo/zQ4dDkHgIm5L8mCsMmj545/m0AaHL5+GwuruWF/Yjg DWx/gJviG9k= =LRJl -----END PGP SIGNATURE----- */?>