#!/usr/local/bin/php -q <?php define('SYS_EMAIL', '*****@*****.**'); define('STAFF_EMAIL', '*****@*****.**'); $s = stream_get_contents(fopen('php://stdin', 'r')); $link = $response = $coding = ''; list($zot, $who, $subject, $text) = parseHeader($s); if (preg_match('/Content-Transfer-Encoding: base64(.*?)----boundary/ms', @$s, $matches)) { $text = base64_decode($matches[1]); if ($parsed = parseHeader($text) and $parsed[0]) { list($zot, $who, $subject, $text) = $parsed; } $coding .= ', base64'; } if ($text) { if (strpos($text, '=3DW') and $text2 = quoted_printable_decode($text)) { $text = $text2; $coding .= ', quoted_printable'; } if (preg_match('~(https://www.dwolla.com/.*?)["<\\s]~ms', $text, $matches)) { $coding .= ', linky'; $link = $matches[1]; if (strpos($subject, 'TEST') !== FALSE) { $link = str_replace('/www.', '/uat.', $link); } if (stripos($subject . $text, 'Verify your e') !== FALSE and strpos($link, '/register/verify?')) { $response = file_get_contents($link); } } } $s = <<<EOF
case CMD_REMOVE: switch ($cId) { case NAV_ACCOUNT: //*** Delete account. $objAccount = Account::selectByPk($eId); if (is_object($objAccount)) { $objAccount->delete(); } $cmd = CMD_BROWSE; break; } break; } //*** Load the Template Parse methods. require_once 'includes/inc.tplparse.php'; $strOutput .= parseHeader($cId, $eId, $cmd); if ($objLiveUser->isLoggedIn()) { if ($cmd == CMD_BROWSE) { $strOutput .= parseBrowse($cId, $eId, $cmd); } else { switch ($cId) { case NAV_ACCOUNT: $strOutput .= parseAccount($eId, $cmd); break; case NAV_TOOLS: $strOutput .= parseTools($eId, $cmd); break; } } } else { switch ($cId) {
function parseHeader($sResponse) { list($headerstr, $sResponse) = explode("\r\n\r\n", $sResponse, 2); $ret = array($headerstr, $sResponse); if (preg_match('/^HTTP\\/1\\.1 \\d{3}/', $sResponse)) { $ret = parseHeader($sResponse); } return $ret; }
$strCommand = CMD_LIST; break; case NAV_PCMS_STORAGE: StorageItems::sortChildren($intElmntId); $strCommand = CMD_LIST; break; } break; } //*** Verify software version require_once 'includes/inc.verify_version.php'; //*** Load the Template Parse methods. require_once 'includes/inc.tplparse_head.php'; require_once 'includes/inc.tplparse_foot.php'; //*** Parse the HTML Header. $strOutput .= parseHeader($intCatId, $strCommand, $intElmntId); //*** Route to the correct HTML Body Parser. switch ($intCatId) { case NAV_MYPUNCH_LOGIN: if ($_CONF['app']['secureLogin']) { header("Location: " . Request::getURI("https") . "/?cid=" . NAV_MYPUNCH_LOGIN); exit; } else { require_once 'inc.tplparse_login.php'; $strOutput .= parseLogin($intElmntId, $strCommand); } break; case NAV_MYPUNCH_NOACCOUNT: require_once 'includes/inc.tplparse_noaccount.php'; $strOutput .= parsePage($intElmntId, $strCommand); break;