예제 #1
0
 } elseif (!empty($_REQUEST['id']) && !empty($_REQUEST['page']) && ($N = manual_notes_load($_REQUEST['page'])) && array_key_exists($_REQUEST['id'], $N) && !empty($_REQUEST['vote']) && ($_REQUEST['vote'] === 'up' || $_REQUEST['vote'] === 'down')) {
     if (!empty($_POST['challenge']) && !empty($_POST['func']) || empty($_POST['arga']) || empty($_POST['argb'])) {
         if (!test_answer($_POST['func'], $_POST['arga'], $_POST['argb'], $_POST['challenge'])) {
             $error = "Incorrect answer! Please try again.";
         } else {
             if ($_REQUEST['vote'] == 'up') {
                 $N[$_REQUEST['id']]['votes']['up']++;
             } elseif ($_REQUEST['vote'] == 'down') {
                 $N[$_REQUEST['id']]['votes']['down']++;
             }
             $update = $N[$_REQUEST['id']]['votes']['up'] - $N[$_REQUEST['id']]['votes']['down'];
             $hash = substr(md5($_REQUEST['page']), 0, 16);
             $notes_file = $_SERVER['DOCUMENT_ROOT'] . "/backend/notes/" . substr($hash, 0, 2) . "/{$hash}";
             if (file_exists($notes_file)) {
                 $data = array("noteid" => $_REQUEST['id'], "sect" => $_REQUEST['page'], "vote" => $_REQUEST['vote'], "ip" => $_SERVER['REMOTE_ADDR']);
                 if (($r = posttohost($master_url, $data)) !== null && strpos($r, "failed to open socket to") === false) {
                     $r = json_decode($r);
                     if (json_last_error() == JSON_ERROR_NONE && isset($r->status) && $r->status && isset($r->votes)) {
                         $thankyou = true;
                     } else {
                         $error = "Invalid request.";
                     }
                 } else {
                     $error = "Invalid request.";
                 }
             } else {
                 $error = "Invalid request.";
             }
         }
     } else {
         $error = "You did not answer the spam challenge question.";
예제 #2
0
 $created_at = gmdate('Y-m-d H:i');
 $sth = $dbh->prepare("INSERT INTO users \n                    (handle, name, email, password, registered, showemail, homepage, userinfo, from_site, active, created)\n                    VALUES(?, ?, ?, ?, 0, ?, ?, ?, 'pecl', 0, ?)");
 $res = $dbh->execute($sth, array($handle, $name, $email, $md5pw, $showemail, $homepage, $userinfo, $created_at));
 if (DB::isError($res)) {
     //constraint violation, only email and handle(username) is unique
     if ($res->getCode() == -3) {
         display_error("Username or Email already taken");
     } else {
         display_error("{$handle}: " . DB::errorMessage($res));
     }
     $jumpto = "handle";
     break;
 }
 /* Now do the SVN stuff */
 if ($needsvn) {
     $error = posttohost('http://master.php.net/entry/svn-account.php', array("username" => $handle, "name" => $name, "email" => $email, "passwd" => $password, "note" => $purpose, "group" => 'pecl', "yesno" => 'yes'));
     if ($error) {
         display_error("Problem submitting the php.net account request: {$error}");
         break;
     }
 }
 $display_form = false;
 $msg = "Requested from:   {$_SERVER['REMOTE_ADDR']}\n" . "Username:         {$handle}\n" . "Real Name:        {$name}\n" . "Email:            {$email}" . (@$showemail ? " (show address)" : " (hide address)") . "\n" . "Need php.net Account: " . (@$needsvn ? "yes" : "no") . "\n" . "Purpose:\n" . "{$purpose}\n\n" . "To handle: http://" . PEAR_CHANNELNAME . "/admin/?acreq={$handle}\n";
 if ($moreinfo) {
     $msg .= "\nMore info:\n{$moreinfo}\n";
 }
 $xhdr = "From: {$name} <{$email}>";
 $subject = "PECL Account Request: {$handle}";
 $ok = mail("*****@*****.**", $subject, $msg, $xhdr, "-f noreply@php.net");
 response_header("Account Request Submitted");
 if ($ok) {
예제 #3
0
        if ($edate < time()) {
            $errors[] = "You must specify an end date that is in the future.";
        } elseif ($edate < $sdate) {
            $errors[] = "You must specify an end date that is after the start date.";
        }
    }
    if ($_POST['type'] == 'recur' && !($_POST['recur'] && $_POST['recur_day'])) {
        $errors[] = "You must specify a valid day of the month for a recurring event.";
    }
    // Spam question
    if ($_POST["sane"] != 3) {
        $errors[] = "It's OK. I'm not real either";
    }
    if (isset($_POST['action']) && $_POST['action'] === 'Submit' && empty($errors)) {
        // Submit to master.php.net
        $result = posttohost("http://master.php.net/entry/event.php", $_POST);
        if ($result) {
            $errors[] = "There was an error processing your submission: {$result}";
        }
        if (count($errors) === 0) {
            echo "<p>\n Thank you for your submission! You should hear back soon\n" . " as to whether your event has been accepted for inclusion in\n" . " our calendar.\n</p>";
            site_footer();
            exit;
        }
    }
    if (count($errors) === 0) {
        echo "<p>\n The following is a preview of your event submission.\n" . " Please double-check it to make sure all of the information is correct.\n</p>";
    }
} else {
    echo "<p>\n Have an upcoming PHP user group meeting?\n" . " Submit your event here, and after it has been approved, it will be listed in\n" . " our event calendar.\n</p>";
    echo "<p>Please note that conference submissions should be emailed to php-webmaster@lists.php.net</p>\n";
예제 #4
0
     $error = "Your note is too short. Trying to test the notes system? Save us the trouble of deleting your test, and don't. It works.";
 } else {
     // Split the note by whitespace, and check length
     foreach (preg_split("/\\s+/", $note) as $chunk) {
         if (strlen($chunk) > 120) {
             $error = "Your note contains a bit of text that will result in a line that is too long, even after using wordwrap().";
             break;
         }
     }
 }
 // No error was found, and the submit action is required
 if (!$error && strtolower($_POST['action']) != "preview") {
     $redirip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : (isset($_SERVER['HTTP_VIA']) ? $_SERVER['HTTP_VIA'] : '');
     // Post the variables to the central user note script
     // ($MQ is defined in prepend.inc)
     $result = posttohost("http://master.php.net/entry/user-note.php", array('user' => $MQ ? stripslashes($user) : $user, 'note' => $MQ ? stripslashes($note) : $note, 'sect' => $MQ ? stripslashes($_POST['sect']) : $_POST['sect'], 'ip' => $_SERVER['REMOTE_ADDR'], 'redirip' => $redirip));
     // If there is any non-header result, then it is an error
     if ($result) {
         if (strpos($result, '[TOO MANY NOTES]') !== FALSE) {
             print "<p class=\"formerror\">As a security precaution, we only allow a certain number of notes to be submitted per minute. At this time, this number has been exceeded. Please re-submit your note in about a minute.</p>";
         } else {
             if (($pos = strpos($result, '[SPAMMER]')) !== FALSE) {
                 $ip = trim(substr($result, $pos + 9));
                 $spam_url = $ip_spam_lookup_url . $ip;
                 print '<p class="formerror">Your IP is listed in one of the spammers lists we use, which aren\'t controlled by us. More information is available at <a href="' . $spam_url . '">' . $spam_url . '</a>.</p>';
             } else {
                 if (strpos($result, '[SPAM WORD]') !== FALSE) {
                     echo '<p class="formerror">Your note contains a prohibited (usually SPAM) word. Please remove it and try again.</p>';
                 } else {
                     if (strpos($result, '[CLOSED]') !== FALSE) {
                         echo '<p class="formerror">Due to some technical problems this service isn\'t currently working. Please try again later. Sorry for any inconvenience.</p>';
예제 #5
0
    }
    if (empty($_POST['email']) || !is_emailable_address($cleaned['email'])) {
        $error .= "You must supply a proper email address. <br>";
    }
    if (empty($_POST['yesno']) || $_POST['yesno'] != 'yes') {
        $error .= "You did not fill the form out correctly. <br>";
    }
    if (empty($_POST['group']) || $_POST['group'] === 'none' || !isset($groups[$_POST['group']])) {
        $error .= "You did not fill out where to send the request. <br>";
    }
    if (!isset($_POST['guidelines']) || !$_POST['guidelines']) {
        $error .= "You did not agree to follow the contribution guidelines. <br>";
    }
    // Post the request if there is no error
    if (!$error) {
        $error = posttohost("http://master.php.net/entry/svn-account.php", array("username" => $cleaned['id'], "name" => $cleaned['fullname'], "email" => $cleaned['email'], "passwd" => $cleaned['password'], "note" => $cleaned['realpurpose'], "yesno" => $cleaned['yesno'], "group" => $cleaned['group']));
        // Error while posting
        if ($error) {
            $error = "An error occurred when trying to create the account: {$error}.";
        }
    }
    // Some error was found, while checking or submitting the data
    if ($error) {
        echo "<div class=\"warning\"><p>{$error}</p></div>";
    } else {
        ?>
<p>
 Thank you. Your request has been sent. You should hear something within the
 next week or so. If you haven't heard anything by around <?php 
        echo date('l, F jS', time() + 604800);
        ?>
예제 #6
0
if (isset($_POST['maillist'])) {
    // No error found yet
    $error = "";
    // Check email address
    if (empty($_POST['email']) || $_POST['email'] == '*****@*****.**' || $_POST['email'] == '*****@*****.**' || !is_emailable_address($_POST['email'])) {
        $error = "You forgot to specify an email address to be added to the list, or specified an invalid address." . "<br>Please go back and try again.";
    } else {
        // Decide on request mode, email address part and IP address
        $request = strtolower($_POST['action']);
        if ($request != "subscribe" && $request != "unsubscribe") {
            $request = "subscribe";
        }
        $sub = str_replace("@", "=", $_POST['email']);
        $remote_addr = i2c_realip();
        // Get in contact with master server to [un]subscribe the user
        $result = posttohost("http://master.php.net/entry/subscribe.php", array("request" => $request, "email" => $_POST['email'], "maillist" => $_POST['maillist'], "remoteip" => $remote_addr, "referer" => $MYSITE . "mailing-lists.php"));
        // Provide error if unable to [un]subscribe
        if ($result) {
            $error = "We were unable to subscribe you due to some technical problems.<br>" . "Please try again later.";
        }
    }
    // Give error information or success report
    if (!empty($error)) {
        echo "<p class=\"formerror\">{$error}</p>";
    } else {
        ?>
<p>
 A request has been entered into the mailing list processing queue. You
 should receive an email at <?php 
        echo $_POST['email'];
        ?>
예제 #7
0
$MSGCONTENT = base64_encode($MSGCONTENT);
$MSGLEN = strlen($MSGCONTENT);
//已经记录交易,发回信息
$nowtime = date('YmdHi', time());
$SENDTIME = $nowtime;
$DESTTERMID = $SRCTERMID;
$FEETERMID = $SRCTERMID;
$SRCTERMID = $SRCTERMID;
$returl = $jieqiPayset[JIEQI_PAY_TYPE]['payurl'];
$retdata = '<?xml version="1.0" encoding="utf-8"?><ROOT><USER>' . $USER . '</USER><PASS>' . $PASS . '</PASS><MT><MOID>' . $MOID . '</MOID><MSGCONTENT>' . $MSGCONTENT . '</MSGCONTENT><MSGLEN>' . $MSGLEN . '</MSGLEN><SRCTERMID>' . $SRCTERMID . '</SRCTERMID><DESTTERMID>' . $DESTTERMID . '</DESTTERMID><SERVICEID>' . $SERVICEID . '</SERVICEID><FEETERMID>' . $FEETERMID . '</FEETERMID><MSGFORMAT>' . $MSGFORMAT . '</MSGFORMAT><MOUSEID>' . $MOUSEID . '</MOUSEID><MOUSEPACKAGEID>' . $MOUSEPACKAGEID . '</MOUSEPACKAGEID><CITYID>' . $CITYID . '</CITYID><PROVINCEID>' . $PROVINCEID . '</PROVINCEID><GATEWAYID>' . $GATEWAYID . '</GATEWAYID><CLASSID>' . $CLASSID . '</CLASSID><SMTYPEID>' . $SMTYPEID . '</SMTYPEID><ISIMBALANCE>' . $ISIMBALANCE . '</ISIMBALANCE><ATTIME>' . $ATTIME . '</ATTIME><SENDTIME>' . $SENDTIME . '</SENDTIME><MTTYPE>' . $MTTYPE . '</MTTYPE><SPNUMBER>' . $SPNUMBER . '</SPNUMBER><LINKID>' . $LINKID . '</LINKID><REMARK>' . $REMARK . '</REMARK></MT></ROOT>';
if ($logflag) {
    jieqi_writefile(JIEQI_ROOT_PATH . '/cache/tomorrowsend.txt', $retdata, 'ab');
}
include_once JIEQI_ROOT_PATH . '/include/changecode.php';
$retdata = jieqi_gb2utf8($retdata);
$ret = posttohost($returl, $retdata);
if ($logflag) {
    jieqi_writefile(JIEQI_ROOT_PATH . '/cache/tomorrowret.txt', $ret, 'ab');
}
function xml_getvaluebytag($source = '', $tag = '')
{
    $ret = '';
    if (!empty($tag)) {
        $pregstr = '/' . jieqi_pregconvert('<' . $tag . '>') . '([^\\<\\>]*)' . jieqi_pregconvert('</' . $tag . '>') . '/is';
        $matches = array();
        preg_match($pregstr, $source, $matches);
        if (is_array($matches) && count($matches) > 0) {
            $ret = $matches[count($matches) - 1];
        }
    }
    return $ret;