Example #1
0
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
    $m = "{$errstr}<hr width=100px align=left>{$errfile}<br>(line {$errline})";
    $ip = getenv(HTTP_X_FORWARDED_FOR) ? getenv(HTTP_X_FORWARDED_FOR) : getenv(REMOTE_ADDR);
    osLog("OS", "<font color=red>ERROR</font> ({$errno}) <br> ip: {$ip}", $m);
}
Example #2
0
 function onDoSignupBtn($info)
 {
     if ($info['email'] != "" && $info['password'] != "" && $info['passwordagain'] != "") {
         $u = new user("");
         $signup = $u->add($info['email'], $info['password'], $info['passwordagain'], $info['userName'], $info['Address'], $info['Country'], $info['PostalCode'], 'user');
         switch ($signup) {
             case 1:
                 //All set - user added and logged in!
                 $this->msg = "Please Check Your email!";
                 $this->_bookframe("frmMain");
                 break;
             case -1:
                 //user already exist
                 $this->msg = "user already exist";
                 $this->_bookframe("frmMain");
                 break;
             case -2:
                 //passwords didn't match...
                 $this->msg = "passwords didn't match...";
                 $this->_bookframe("frmMain");
                 break;
             default:
                 osLog('viewslogin', $this->_fullname, "##### weird...");
                 $this->_bookframe("frmMain");
                 break;
         }
     }
 }
function updateOrderstatus($order_id, $sts, $comment)
{
    osLog('GoCoin Callback', $comment);
    tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . $sts . "', last_modified = now() where orders_id = '" . (int) $order_id . "'");
    $sql_data_array = array('orders_id' => $order_id, 'orders_status_id' => $sts, 'date_added' => 'now()', 'customer_notified' => '0', 'comments' => $comment);
    tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
}
Example #4
0
                    $s = "INSERT INTO transaction_history (UID,date,type,amount,comments,txn_id) ";
                    $s .= " VALUE ('" . $_POST['custom'] . "','" . date("Y/m/d") . "','Charge','" . $amount . "','You paid " . $POST_payment_gross . " - " . $POST_payment_fee . "(paypal fee)','" . $txn_id . "');";
                    query($s);
                    $oslog .= "<br><font color=red>VERIFIED</font><hr>" . $s;
                } else {
                    // $_POST['custom'] NOT start with "RocketViews"
                    $oslog .= "<br><font color=red>NOT ROCKETVIEWS PAYMENT</font><hr>" . $s;
                }
            } else {
                //is not set $_POST['custom']
                $oslog .= "<br><font color=red>NOT ROCKETVIEWS PAYMENT</font><hr>" . $s;
            }
        } else {
            $oslog .= "<br><font color=red>VERIFIED - Already applied to DB</font><hr>" . $s;
        }
    } else {
        $oslog .= "<br><font color=red>INVALID</font>";
    }
    fclose($fp);
}
osLog("PayPal", "IPN", $oslog);
$mailheader = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/html; charset=iso-8859-1' . "\r\n" . 'From: paypa!@RocketViews.com' . "\r\n" . 'Reply-To: reza2mussavi@hotmail.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
$msg = <<<PHTML
\t\t\tHi,<br /><br />
\t\t\t<hr />
\t\t\t<br /><br />
\t\t\t{$oslog}
\t\t\t<br /><br />
\t\t\t<hr />
PHTML;
mail("*****@*****.**", "Paypal IPN", $msg, $mailheader);
Example #5
0
function osBackNode($FName)
{
    /*
    	Evaluate the given FullName
    */
    if (!isset($_SESSION['osNodes'][$FName])) {
        if ($_SESSION['logMessages']) {
            osLog("OS", "osBackNode", "Node not found : {$FName}");
        }
        return false;
    }
    /*
    	If node is constructed(awake)
    */
    if (isset($_SESSION['osNodes'][$FName]['node'])) {
        if (is_object($_SESSION['osNodes'][$FName]['node'])) {
            if ($_SESSION['logMessages']) {
                osLog("OS", "osBackNode", "Node is Awake : {$FName}");
            }
            return $_SESSION['osNodes'][$FName]['node'];
        }
    }
    /*
    	If node not awake, wake it up
    */
    $biz = $_SESSION['osNodes'][$FName]['biz'];
    if ($biz) {
        if ($_SESSION['logMessages']) {
            osLog("OS", "osBackNode", "Node Woked Up : {$FName}");
        }
        return new $biz($FName);
    }
    if ($_SESSION['logMessages']) {
        osLog("OS", "osBackNode", "Node ERROR : {$FName}");
    }
    return false;
}
Example #6
0
    query("INSERT " . $s);
}
/*
 *	Database functions
 */
function query($s)
{
    global $osdbcon, $result;
    $result = $osdbcon ? mysql_query($s, $osdbcon) : false;
    return $result;
}
function fetch()
{
    global $result;
    if (!$result) {
        return false;
    }
    return mysql_fetch_assoc($result);
}
/*
 *	OS functions
 */
function osLog($Message)
{
    $Biz = "Viewer";
    $NodeID = "Counter";
    $t = $_SERVER['REQUEST_TIME'];
    query("INSERT INTO os_log(TimeStamp,Biz,NodeID,Message) VALUES('{$t}','{$Biz}','{$NodeID}','{$Message}')");
}
osLog($log);
// echo $log;