Esempio n. 1
0
 public function saveImg()
 {
     Trace::output($this->traceID, "saveImg");
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = array("bool" => 1);
     //----------------------------------------------------------
     $img = str_replace('data:image/png;base64,', '', $this->img);
     $img = str_replace(' ', '+', $img);
     $data = base64_decode($img);
     $date = new DateTime();
     //----------------------------------------------------------
     if (is_null($imgName) || $encrypt) {
         $imgName = alphaID($date->getTimestamp()) . ".png";
     }
     //----------------------------------------------------------
     if (file_exists($this->dir)) {
         FileFolder::file_put_contents($this->dir . $imgName, $data);
         $chk["result"] = $this->fullURL . $imgName;
     } else {
         $chk['bool'] = false;
         $chk['message'] = $this->fullURL . " does no exist!!";
     }
     //----------------------------------------------------------
     return $chk;
 }
Esempio n. 2
0
 public static function getData($file)
 {
     Trace::output(self::$traceID, "getData");
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = array("bool" => true, 'traceID' => "getData");
     //----------------------------------------------------------
     $swfheader = new swfheader($file);
     $file_swf = new File_SWF($file);
     //----------------------------------------------------------
     if ($file_swf->is_valid()) {
         $stat = $file_swf->stat();
         $fileSize = $stat['fileSize'][0];
         $swfheader->size = $fileSize;
         $chk['result'] = $swfheader;
     } else {
         $chk['bool'] = false;
         $chk['error'] = true;
         $chk['message'] = "swf was no valid";
     }
     //----------------------------------------------------------
     $chk['output'] = Trace::$output;
     //----------------------------------------------------------
     return $chk;
 }
Esempio n. 3
0
function _insertContents($dirArray, $close = FALSE)
{
    Trace::output($this->traceID, "_insertContents");
    //----------------------------------------------------------
    //init var
    //----------------------------------------------------------
    $i;
    $queryString = "";
    $chk = array("bool" => true, 'function' => "_insertContents");
    //----------------------------------------------------------
    //INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);
    for ($i = 0; $i < sizeof($dirArray); $i++) {
        $queryString .= 'CALL insertVideo("' . $dirArray[$i]['path'] . '","' . $dirArray[$i]['title'] . '","' . $dirArray[$i]['hash'] . '","' . $dirArray[$i]['mp4'] . '","' . $dirArray[$i]['thumbnail_url'] . '"); ';
    }
    print_r($queryString);
    //----------------------------------------------------------
    //$chk = MySQL::getResult($queryString);
    //----------------------------------------------------------
    return $chk;
}
Esempio n. 4
0
 public function sendLink($email, $message, $url)
 {
     Trace::output($this->traceID, "sendLink");
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = array("bool" => true, "traceID" => "sendLink");
     //----------------------------------------------------------
     $chk = GenFun::error_CHK($obj);
     //----------------------------------------------------------
     $emailObj = array("emailTo" => $email, 'link' => "http://awwthentic.com/Modules/DOM/uber_src/server/werm/services/Download.php?url={$url}", 'linkTxt' => "Click here to download file.", "message" => $message, "subject" => $subject = $obj['sender'] . " sent you a file!!!");
     //----------------------------------------------------------
     if ($chk['bool']) {
         $chk = SendEmail_v0::sendDefault($emailObj);
     } else {
         return $chk;
     }
     //----------------------------------------------------------
     if ($chk['bool']) {
         $chk['message'] = "Email was successfully sent to {$email}";
     }
     //----------------------------------------------------------
     return $chk;
 }
Esempio n. 5
0
 public static function error_CHK($valueArr, $traceID = NULL)
 {
     Trace::output(self::$traceID, "error_CHK");
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = $traceID != NULL ? array("bool" => true, "func" => $traceID . ": error_CHK") : array("bool" => true, "func" => ": error_CHK");
     //----------------------------------------------------------
     $keys = array_keys($valueArr);
     //----------------------------------------------------------
     foreach ($valueArr as $i => $value) {
         $valueArr[$i] = GenFun::varCHK($valueArr[$i]);
         if ($valueArr[$i] == NULL || !isset($valueArr[$i]) || empty($valueArr[$i])) {
             $chk = array_merge($chk, array("bool" => false, "error" => true, "message" => "'" . $i . "' is NULL or is'nt set"));
             break;
         }
     }
     //----------------------------------------------------------
     $chk["valueArr"] = $valueArr;
     //----------------------------------------------------------
     $chk["output"] = Trace::$output;
     //----------------------------------------------------------
     return $chk;
 }
Esempio n. 6
0
 private function updateAssets($id, $returnRow = true)
 {
     Trace::output($this->traceID, "updateAssets");
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = array("bool" => true, 'traceID' => "updateAssets");
     $insertID = GlobalMas::$mysqli->insert_id;
     //----------------------------------------------------------
     $chk = Update::go(Projects_const::TBL, array(Projects_const::CLM_ASSETS_ID => $insertID), array("id" => $id));
     //----------------------------------------------------------
     if ($returnRow) {
         $chk = MySQL::getTable(Assets_const::TBL, array(Assets_const::CLM_ID => $insertID));
     }
     //----------------------------------------------------------
     return $chk;
 }
Esempio n. 7
0
 private function _insertContents($dirArray, $close = FALSE)
 {
     Trace::output($this->traceID, "_insertContents");
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $i;
     $queryString = "";
     $chk = array("bool" => true, 'function' => "_insertContents");
     //----------------------------------------------------------
     for ($i = 0; $i < sizeof($dirArray); $i++) {
         $queryString .= 'CALL insertVideo("' . $dirArray[$i]['title'] . '","' . $dirArray[$i]['hash'] . '","' . $dirArray[$i]['mp4'] . '","' . $dirArray[$i]['thumbnail_url'] . '"); ';
     }
     //----------------------------------------------------------
     $chk = Result::go($queryString);
     krumo($chk);
     //----------------------------------------------------------
     return Constants::$mysqli->escape_string($queryString);
 }
Esempio n. 8
0
 public function emailForgotLink($linkHash)
 {
     Trace::output($this->traceID, "emailForgotLink");
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = array("bool" => true, "traceID" => "emailForgotLink");
     $emailObj;
     //----------------------------------------------------------
     $smarty = Smarty::getSmarty();
     $smarty->assign('forgot_url', Account_v0::$forgot_url);
     $smarty->assign('linkHash', $linkHash);
     $message = $smarty->fetch('forgot.tpl');
     //----------------------------------------------------------
     $emailObj = array("emailTo" => $this->email, "nameFrom" => Constants::$name, "emailFrom" => Constants::$email, "message" => $message, "subject" => "account registration");
     //----------------------------------------------------------
     $chk = $chk["bool"] ? SendEmail_v0::go($emailObj) : $chk;
     //----------------------------------------------------------
     return $chk;
 }
Esempio n. 9
0
 private function sendConfirmation($email, $categoryID, $linkHash, $type)
 {
     Trace::output($this->traceID, "sendConfirmation");
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = array("bool" => true, "traceID" => "sendConfirmation");
     $emailObj;
     $typeofs = $type == 0 ? 'terminate your subscription' : 'subscribe';
     //----------------------------------------------------------
     $message = '<div style = "padding:20px; width:500px; background-color:#999999; height:160px;font-family: arial; font-size:12px; color: #FFFFFF;">';
     $message .= 'This message was sent with the intention of verifiying your request to ' . $typeofs . ' to the following list: <br><br>';
     $message .= '<b>"' . strtoupper($this->categoryName) . '"</b><br><br> To confirm, please click the link below: <br><br>';
     $message .= '<a href = "http://awwthentic.com/Modules/DOM/examples/form/form_v2/confirmation.php?hash=' . $linkHash . '">click here to complete process</a></div>';
     $message = GenFun::html($message);
     $emailObj = array("emailTo" => $email, "nameFrom" => GlobalMas::NAME, "emailFrom" => GlobalMas::EMAIL, "message" => $message, "subject" => "mailinglist registration");
     //----------------------------------------------------------
     $chk = $chk["bool"] ? SendEmail_v0::go($emailObj) : $chk;
     //----------------------------------------------------------
     if ($chk["bool"]) {
         return $chk;
     }
 }
Esempio n. 10
0
 private function _send()
 {
     Trace::output($this->traceID, "_send");
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $headers = "";
     $chk = array("bool" => true, "func" => $this->traceID . ": _send");
     //----------------------------------------------------------
     $headers .= 'MIME-Version: 1.0' . "\r\n";
     $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
     //----------------------------------------------------------
     if ($this->nameFrom != NULL && $this->emailFrom != NULL) {
         $headers .= 'From: ' . $this->nameFrom . ' <' . $this->emailFrom . '>' . "\r\n";
     }
     //----------------------------------------------------------
     if (!is_null($this->ccArr)) {
         $headers .= "Cc: " . join(",", $this->ccArr);
     }
     //----------------------------------------------------------
     $chk["bool"] = mail($this->emailTo, $this->subject, $this->message, $headers) ? true : false;
     //----------------------------------------------------------
     $chk["message"] = $chk["bool"] ? "Your email has been sent" : "Your email did not go through";
     //----------------------------------------------------------
     if (GlobalMas::$debug) {
         $chk['output'] = Trace::$output;
     }
     //----------------------------------------------------------
     if (GlobalMas::$debug) {
         $chk['resultHistory'] = Result::$resultHistory;
     }
     //----------------------------------------------------------
     return $chk;
 }
Esempio n. 11
0
 public function getImages($returnType = "XML")
 {
     Trace::output($this->traceID, "getImages");
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = array("bool" => true, 'traceID' => "getImages");
     //----------------------------------------------------------
     $chk = MySQL::getTable(NicKelmanConst_v0::TBL_IMAGES);
     //----------------------------------------------------------
     if ($returnType == "XML") {
         if ($chk['bool']) {
             $chk = GenFun::json_to_xml(json_encode(array("item" => $chk['result'])), true);
         }
     }
     //----------------------------------------------------------
     return $chk;
 }
Esempio n. 12
0
 public function caca()
 {
     Trace::output($this->traceID, "caca");
 }
Esempio n. 13
0
 private static function traceFunction($id, $string, $type)
 {
     if (Trace::$html && is_null(Trace::$output)) {
         Trace::$output = "</br>";
     }
     Trace::$html ? $string = $type == "log" ? Trace::createString("Success = " . $id . ": " . $string) : Trace::createSpecialString("Success = " + $id . ": " . $string, $type) : ($string = "Success = " . $id . ": " . $string);
     //-------------------------------------------------------------------------------------
     Trace::$output .= Trace::$html ? $string . "</br>" : $string . "||||";
 }
Esempio n. 14
0
 private function _updateMessages($updateArr, $approve, $close = FALSE)
 {
     Trace::output($this->traceID, "_updateMessages");
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $i;
     $queryString = "";
     $chk = array("bool" => true, 'function' => "updateMessages");
     //----------------------------------------------------------
     $queryString .= "UPDATE " . GuestbookConst_v0::TBL_MESSAGES . " ";
     $queryString .= "SET " . GuestbookConst_v0::CLM_APPROVED . " = " . $approve . " ";
     $queryString .= "WHERE " . GuestbookConst_v0::CLM_ID . " IN (";
     //----------------------------------------------------------
     for ($i = 0; $i < sizeof($updateArr); $i++) {
         if ($i == 0) {
             $queryString .= $updateArr[$i]["id"];
         } else {
             $queryString .= ",";
             $queryString .= $updateArr[$i]["id"];
         }
     }
     //----------------------------------------------------------
     $queryString .= ")";
     //----------------------------------------------------------
     $result = GlobalMas::$mysqli->query($queryString);
     //----------------------------------------------------------
     $chk['query'] = $queryString;
     //----------------------------------------------------------
     if (sizeof($result) < 0) {
         $chk["bool"] = false;
         $chk["result"] = "queryString did not go through";
     } else {
         $chk["bool"] = true;
         $chk["result"] = "rows have been updated";
     }
     $chk["approve"] = $approve;
     //----------------------------------------------------------
     if ($close) {
         GlobalMas::$mysqli->close($this->conn);
     }
     //----------------------------------------------------------
     $chk['output'] = Trace::$output;
     //----------------------------------------------------------
     return $chk;
 }
Esempio n. 15
0
 private function tblConfirm_CHK($row)
 {
     Trace::output($this->traceID, "tblConfirm_CHK");
     if ($row['confirmed'] == 1) {
         $chk['bool'] = true;
         $chk['type'] = 1;
         $chk['message'] = "Subscription has already been confirmed";
     } else {
         if ($row['confirmed'] == 0) {
             $chk['bool'] = false;
             $chk['message'] = "Subscription is not confirmed";
         }
     }
     //----------------------------------------------------------
     Trace::output($this->traceID, "tblConfirm_CHK: " . $chk['message']);
     //----------------------------------------------------------
     return $chk;
 }
Esempio n. 16
0
 public function inviteConfirmationLink($email, $hash)
 {
     Trace::output($this->traceID, "inviteConfirmationLink");
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = array("bool" => true, "traceID" => "inviteConfirmationLink");
     $emailObj;
     //----------------------------------------------------------
     $message = '<div style = "padding:20px; width:500px; background-color:#999999; line-height:17px; height:100px;font-family: arial; font-size:15px; color: #FFFFFF;">';
     $message .= 'You have been invited by <a href = "http://www.awwthentic.com/Modules/DOM/examples/sites/pmbl/confirmation.php">"' . GlobalMas::$loggedIN['first'] . ' ' . GlobalMas::$loggedIN['last'] . '"</a> to participate in a <br> ' . $this->eventObj['name'] . ' tournament on ' . $this->eventObj['dateWritten'] . ' for a grand prize of $' . number_format($this->eventObj['prize']) . '<br><br>';
     $message .= '<a href = "http://www.awwthentic.com/Modules/DOM/examples/sites/pmbl/event_invite.php?hash=' . $hash . '">Click Here to accept invite</a></div>';
     $message = GenFun::html($message);
     $emailObj = array("emailTo" => $email, "nameFrom" => GlobalMas::NAME, "emailFrom" => GlobalMas::EMAIL, "message" => $message, "subject" => "account registration");
     //----------------------------------------------------------
     $chk = $chk["bool"] ? SendEmail_v0::go($emailObj) : $chk;
     //----------------------------------------------------------
     return $chk;
 }
Esempio n. 17
0
 public function _getVideoMatches($string, $filters = NULL, $returnQuery = false)
 {
     Trace::output($this->traceID, "_getVideoMatches");
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $resultObj = array_merge(array("chkForQuery" => true, 'returnQuery' => $returnQuery ? $returnQuery : false), $this->resultObj);
     //----------------------------------------------------------
     $string = StringUtil::removeWhiteSpace($string);
     $queryString = AddToQuery::go($this->_getVideos(NULL, true), array("{last}AND" => " videos.title LIKE '" . $string . "%' AND "));
     //----------------------------------------------------------
     if (!$returnQuery) {
         $chk = Result::go($queryString, $resultObj);
     } else {
         return $queryString;
     }
     //----------------------------------------------------------
     $chk['result'] = $this->encodeResult($chk['result']);
     //----------------------------------------------------------
     $chk['print'] = print_r($string, true);
     //----------------------------------------------------------
     return $chk;
 }
Esempio n. 18
0
 public static function insertFile($name, $uploadResult = NULL)
 {
     Trace::output(self::$traceID, "insertFile", func_get_args());
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = array("bool" => true, 'result' => array(), "func" => "insertFile");
     $date = date("Y-m-d H:i:s");
     //----------------------------------------------------------
     if (!$chk['bool']) {
         return $chk;
     } else {
         $chk = InsertINTO::go("files", array('name' => $name, "hash" => '{hash}' . $date, "uploadResult" => $uploadResult), array("returnRow" => true, "resetQueries" => true));
     }
     //----------------------------------------------------------
     return $chk;
 }
Esempio n. 19
0
 public function sendLink($obj, $url, $fileName)
 {
     Trace::output($this->traceID, "sendLink");
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = array("bool" => true, "traceID" => "sendLink");
     //----------------------------------------------------------
     GlobalMas::$name = $obj['from'];
     //----------------------------------------------------------
     $message = $obj['from'] . " sent you a file!!!";
     //----------------------------------------------------------
     if ($obj['message'] != "") {
         $message .= "<br><br>" . $obj['message'];
     }
     $emailObj = array("emailTo" => $obj['email'], 'link' => $url, 'linkTxt' => $fileName, "message" => $message, "subject" => $subject = $obj['from'] . " sent you a file!!!");
     //----------------------------------------------------------
     if ($chk['bool']) {
         $chk = SendEmail_v0::sendDefault($emailObj);
     } else {
         return $chk;
     }
     //----------------------------------------------------------
     if ($chk['bool']) {
         $chk['message'] = "Email was successfully sent to " . $obj['email'];
     }
     //----------------------------------------------------------
     return $chk;
 }
Esempio n. 20
0
 public function changePassword($hash, $password)
 {
     Trace::output($this->traceID, "changePassword");
     //----------------------------------------------------------
     $chk = GenFun::error_chk(array($hash, $password));
     //----------------------------------------------------------
     $this->tblName = ForgotPwRequest_const::TBL;
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = array("bool" => true, "traceID" => "changePassword");
     //----------------------------------------------------------
     $chk = $this->getAccountRow($hash);
     //----------------------------------------------------------
     if (!$chk['bool']) {
         return $chk;
     }
     //----------------------------------------------------------
     if ($chk['result'][0]['confirmed'] == 1) {
         $chk['bool'] = false;
     }
     //----------------------------------------------------------
     if (sizeof($chk['result']) != 0 && $chk['bool']) {
         $chk = Update::go(Accounts_const::TBL, array("password" => GenFun::encrypt($password . $this->salt)), array("id" => $chk['result'][0]['accounts_id']));
         $chk = $this->confirm($hash, "forgotPwRequest");
     } else {
         $chk['bool'] = false;
         $chk['message'] = "This link has been disabled!!!";
     }
     //----------------------------------------------------------
     if ($chk['bool']) {
         $chk['message'] = "Password Updated!!!";
     }
     //----------------------------------------------------------
     return $chk;
 }
Esempio n. 21
0
 private static function traceFunction($id, $string, $arg, $type)
 {
     $arr = array();
     //---------------------------------------------------------
     if (!is_null($arg)) {
         $arr['arg'] = $arg;
     }
     if (Trace::$html && is_null(Trace::$output)) {
         Trace::$output = "</br>";
     }
     Trace::$html ? $string = $type == "log" ? Trace::createString("Success = " . $id . ": " . $string) : Trace::createSpecialString("Success = " + $id . ": " . $string, $type) : ($string = "Success = " . $id . ": " . $string);
     //---------------------------------------------------------
     $arr['output'] = Trace::$html ? $string . "</br>" : $string;
     //---------------------------------------------------------
     Trace::$output[] = !is_null($arg) ? $arr : $arr['output'];
 }