public function init() { GlobalMas::$host = self::$host; GlobalMas::$pass = self::$pass; GlobalMas::$user = self::$user; GlobalMas::$database = self::$database; //UploadHandler::$rootFilesPath = "/upload/generated_files/"; }
public static function init() { GlobalMas::$host = 'mydatabase.ctla99hip1d5.us-west-2.rds.amazonaws.com:3306'; GlobalMas::$user = '******'; GlobalMas::$pass = '******'; GlobalMas::$database = "compiler"; //------------------------------------------------------ ProjectGlobal::$compileObj = array("compile" => array(array("save_path" => "", "compileType" => "inject", "outputContent" => array("saveas" => "index.html"), "imagesProp" => array("base64" => true, "fileProp" => array("fileTypeProp" => array("png" => array("quality" => 100), "jpeg" => array("quality" => 90)))), "files" => array("data.js" => array("base64" => false)), "getIncluded" => false, "minify" => true))); }
function __construct($conn = NULL, $database = NULL) { if (is_null(GlobalMas::$conn)) { GlobalMas::$conn = GenFun::hostConnect($database); } $this->filesRelPath = $_SERVER['DOCUMENT_ROOT'] . "/" . $this->projectPath . "files/"; $this->filesPath = GenFun::get_full_url($this->filesRelPath); $this->commentRatingMngr = new Rating('commentRatings', 'comments'); $this->commentMngr = new Comment(1, $this->filesPath); }
public static function init() { //GlobalMas::$host = 'mydatabase.ctla99hip1d5.us-west-2.rds.amazonaws.com:3306'; //GlobalMas::$user = '******'; //GlobalMas::$pass = '******'; //GlobalMas::$database = "compiler"; GlobalMas::$host = '127.0.0.1:9306'; //GlobalMas::$user = '******'; //GlobalMas::$pass = '******'; //GlobalMas::$database = "compiler"; ProjectGlobal::$compileObj = array("compile" => array(array("save_path" => "seperate/", "removeHTMLComments" => false, "outputContent" => array("saveas" => "index.html"), "imagesProp" => array("fileProp" => array("fileTypeProp" => array("png" => array("quality" => 100), "jpeg" => array("quality" => 100))), "save_dir" => "project/images/"), "getIncluded" => false, "minify" => false, "cssProp" => array("matchProp" => array("applyToFilesIn" => array("project/css/" => array("save_dir" => "project/css/"), "project/js/" => array("save_dir" => "project/css/"))), "save_dir" => "global/css/"), "tmplProp" => array("compileType" => "inject", "minify" => false)), array("save_path" => "single/", "compileType" => "inject", "outputContent" => array("saveas" => "index.html"), "imagesProp" => array("base64" => true, "save_dir" => "", "fileProp" => array("fileTypeProp" => array("png" => array("quality" => 1), "jpeg" => array("quality" => 40)))), "files" => array("data.js" => array("base64" => false)), "getIncluded" => false, "minify" => true))); }
public static function init() { GlobalMas::$host = 'mydatabase.ctla99hip1d5.us-west-2.rds.amazonaws.com:3306'; GlobalMas::$user = '******'; GlobalMas::$pass = '******'; GlobalMas::$database = "compiler"; GlobalMas::$filesPath_relative = "/Modules/generated_files/compiler/"; GlobalMas::$filesPath_absolute = $_SERVER["DOCUMENT_ROOT"] . GlobalMas::$filesPath_relative; GlobalMas::$filesPath_web = GenFun::get_full_url(GlobalMas::$filesPath_absolute) . "/"; //------------------------------------------------------ ProjectGlobal::$compileObj = array("compile" => array(array("save_path" => "", "compileType" => "inject", "outputContent" => array("saveas" => "index.html"), "imagesProp" => array("base64" => true, "fileProp" => array("fileTypeProp" => array("png" => array("quality" => 100), "jpeg" => array("quality" => 90)))), "files" => array("data.js" => array("base64" => false)), "getIncluded" => false, "minify" => true))); }
public static function init() { Compiler::init(array("css" => "min_single", "js" => "min_single", "getServices" => array("except" => Import::getImportPath() . "service.php"), "global" => array("copy" => array(Import::$uber_src_path . "service.php", Import::getImportPath() . "index.php"), "getImages" => true, "code" => array("tmpl" => array("replace" => array("replaceSrc" => false, "\${images}" => Import::$uber_src_path . "/global/images/")))), "compile" => array(array("id" => "min_single", "minify" => true, "copy" => array(), "code" => array("css" => array("singleFile" => true, "path" => "global/css/"), "js" => array("singleFile" => true, "path" => "global/js/"))), array("id" => "min_multi", "minify" => true, "code" => array("css" => array("singleFile" => false, "path" => "global/css/"), "js" => array("singleFile" => false, "path" => "global/js/"))), array("id" => "unmin", "code" => array("css" => array("singleFile" => false, "path" => "global/css/"), "js" => array("singleFile" => false, "path" => "global/js/"))), array("id" => "unmin_raw", "raw" => true)))); //------------------------------------------------ GlobalMas::$host = self::$host; GlobalMas::$pass = self::$pass; GlobalMas::$user = self::$user; GlobalMas::$database = self::$database; UploadHandler::$projectFilesPath = ProjectGlobal::$projectFilesPath; //UploadHandler::$rootFilesPath = "/upload/generated_files/"; self::$filesLocalPath = $_SERVER['DOCUMENT_ROOT'] . "/" . UploadHandler::$rootFilesPath . self::$projectFilesPath; self::$filesPath = GenFun::get_full_url(self::$filesLocalPath); }
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; }
private function getSession($userkey = NULL) { Trace::output($this->traceID, "getSession", func_get_args()); //---------------------------------------------------------- //init var //---------------------------------------------------------- $chk = array("bool" => true, 'traceID' => "getSession"); //---------------------------------------------------------- if (is_null($userkey)) { $userkey = $_COOKIE[$this->cookiePrefix . 'user']; } //---------------------------------------------------------- if (isset($userkey)) { $userKeyArr = explode("-", $userkey); //---------------------------------------------------------- if (session_id() == '') { session_start(); } //------------------------------------------------------ //$session_id = GenFun::encrypt(session_id().$this->salt.$userKeyArr[0]); //------------------------------------------------------- $queryString = "SELECT "; $queryString .= "accounts.*, "; $queryString .= "CONCAT('" . GlobalMas::$filesPath_web . "', files.hash,'/', files.name) as img_url "; $queryString .= "FROM "; $queryString .= "accounts, "; $queryString .= "files, "; $queryString .= "sessionLog "; $queryString .= "WHERE "; $queryString .= "sessionLog.accounts_id = accounts.id "; $queryString .= "AND files.id = accounts.profile_files_id "; $queryString .= "AND sessionLog.userKey='" . urldecode($userkey) . "' "; $queryString .= "AND sessionLog.disabled IS NULL "; $queryString .= "AND accounts.email='" . urldecode($userKeyArr[0]) . "'"; //--------------------------------------------------- $chk = Result::go($queryString, array("greaterZero" => true)); //--------------------------------------------------- } else { $chk['bool'] = false; } //------------------------------------------------------- if (!$chk['bool'] && !$chk['error']) { $chk['message'] = 'user not logged in'; } //------------------------------------------------------- GlobalMas::$getSession = $chk; //------------------------------------------------------- if ($chk['bool']) { GlobalMas::$loggedIN = $chk['result'][0]; } //------------------------------------------------------- return $chk; }
public static function init() { self::$filesPath_relative = "/Modules/generated_files/"; self::$filesPath_absolute = $_SERVER["DOCUMENT_ROOT"] . self::$filesPath_relative; self::$filesPath_web = GenFun::get_full_url(self::$filesPath_absolute) . "/"; }
$orig_functionName = $_REQUEST['functionName']; //---------------------------------------------------------- $_REQUEST['functionName'] = $object['string']; //---------------------------------------------------------- $object = $object['class']; //---------------------------------------------------------- //if (!file_exists($classPath) && is_null($object)) die($classPath." does not exist!!!!"); //---------------------------------------------------------- if (isset($_REQUEST['prop'])) { SetPublicProp::go($object, $_REQUEST['prop']); } //---------------------------------------------------------- if (GlobalMas::$loginCHK && isset($_COOKIE[Account_v0::getPrefix() . "user"])) { $loggedIN = Account_v0::getUserSession(); if (!$loggedIN['bool']) { GlobalMas::$loggedIN = NULL; } } //----------------------------------------------------------------------------- if (!isset($_REQUEST['params'])) { $_REQUEST['params'] = array(); } //---------------------------------------------------------- if (!method_exists($object, $_REQUEST['functionName'])) { $chk['bool'] = false; $chk['message'] = $orig_functionName . " does not exist in " . $_REQUEST['service']; } //---------------------------------------------------------- $chk = $chk["bool"] ? call_service($object, $_REQUEST['functionName'], $_REQUEST['params']) : $chk; //---------------------------------------------------------- if (!isset($_REQUEST['returnType'])) {
<?php //------------------------------------------------------------------------ require_once Import::$uber_src_path . "server/werm/services/Account_v0.php"; //-------------------------------------------------------------------- Account_v0::chk(); //-------------------------------------------------------------------- Import::services("bannerHub/BannerHub.php"); //-------------------------------------------------------------------- GlobalMas::$api = new BannerHub(); if (is_null(GlobalMas::$loggedIN) && $_SERVER["SCRIPT_FILENAME"] != Import::getImportPath() . "index.php") { header('Location: ' . Import::getImportPath(true)); } ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
public static function hostConnect($database = "{database}") { //---------------------------------------------------------- //init var //---------------------------------------------------------- $class = "GlobalMas"; //---------------------------------------------------------- $chk = self::constCHK($database); $mysqli = NULL; //---------------------------------------------------------- if (isset($chk['bool']) && !$chk['bool']) { return $chk; } else { $database = $chk; } //---------------------------------------------------------- if (is_null(GlobalMas::$mysqli) || !($chk = GlobalMas::$mysqli->select_db($database))) { //------------------------------------------------------ if (is_null($mysqli)) { $mysqli = new mysqli(ClassUtil::getStaticVal($class, "host")['constant'], ClassUtil::getStaticVal($class, "user")["constant"], ClassUtil::getStaticVal($class, "pass")['constant']); } //------------------------------------------------------ if ($mysqli->connect_error != null || $mysqli->host_info == null) { $chk = array("result" => $mysqli, "error" => true, "bool" => false, "host_info" => !GlobalMas::$debug ? NULL : $mysqli->host_info, "message" => $mysqli->connect_error); if (!GlobalMas::$debug) { $chk["loginInfo"] = array("host" => ClassUtil::getStaticVal($class, "host")['constant']); } return $chk; } //------------------------------------------------------ GlobalMas::$mysqli = $mysqli; } //---------------------------------------------------------- GlobalMas::$mysqli->select_db($database); //---------------------------------------------------------- if (GlobalMas::$mysqli->error != null) { $chk = array("result" => GlobalMas::$mysqli, "error" => true, "bool" => false, "message" => GlobalMas::$mysqli->error); if (!GlobalMas::$debug) { $chk["loginInfo"] = array("host" => ClassUtil::getStaticVal($class, "host")['constant']); } return $chk; } //---------------------------------------------------------- return GlobalMas::$mysqli; }
public function getResult() { if (is_null($this->mysqli)) { $this->mysqli = GlobalMas::$mysqli; } //---------------------------------------------------------- //init var //---------------------------------------------------------- $chk = array("bool" => true, 'traceID' => "getResult"); $update = false; //---------------------------------------------------------- if ($this->returnQuery) { return $this->queryString; } //---------------------------------------------------------- $chk = GenFun::debugChk($chk, array("queryString" => $this->queryString)); //---------------------------------------------------------- $debug = GlobalMas::$debug; //---------------------------------------------------------- if ($this->chkForQuery) { $query_chk = Result::go("SELECT queries.result, queries.last_update FROM queries WHERE queries.query = '" . $this->mysqli->escape_string($this->queryString) . "'"); //------------------------------------------------------ if (sizeof($query_chk['result']) > 0) { if (empty($query_chk['result'][0]['last_update']) || is_null($query_chk['result'][0]['last_update'])) { $update = true; } if (!$update) { $chk = json_decode($query_chk['result'][0]['result'], true); //---------------------------------------------- $chk = self::debug_chk($chk); //---------------------------------------------- return $chk; } } } //---------------------------------------------------------- $result = $this->multi ? $this->mysqli->multi_query($this->queryString) : $this->mysqli->query($this->queryString); //---------------------------------------------------------- if (!$result) { $chk['bool'] = false; $chk['error'] = false; $chk = GenFun::debugCHK($chk, array('message' => $this->mysqli->error)); if (strpos($chk['message'], "Duplicate") !== false) { return $chk['duplicate'] = true; } } //---------------------------------------------------------- if ($this->multi) { $result = $this->getMultiQueryResult($result); } else { $result = $this->getSingleQueryResult($result); //---------------------------------------------- if ($this->greaterZero) { if (sizeof($result) == 0) { $chk['bool'] = false; } } } $chk['result'] = $result; //---------------------------------------------------------- $this->insert_id = $this->mysqli->insert_id; $chk['insert_id'] = $this->insert_id; //-------------------------------------------------- if ($this->chkForQuery) { $queryString = $this->mysqli->real_escape_string($this->queryString); $resultString = $this->mysqli->real_escape_string(json_encode($chk)); if (!$update) { $query_chk = Result::go("INSERT INTO queries (query, result)\r\n\t\t\t\t SELECT * FROM (SELECT '" . $queryString . "', '" . $resultString . "') AS tmp\r\n\t\t\t\tWHERE NOT EXISTS (\r\n\t\t\t\t\tSELECT query FROM queries WHERE query = '" . $queryString . "'\r\n\t\t\t\t) LIMIT 1"); } else { $query_chk = Result::go("UPDATE queries SET queries.query = '" . $queryString . "', queries.result = '" . $resultString . "', queries.last_update = NOW() WHERE queries.query = '" . $queryString . "'"); } //---------------------------------------------- GlobalMas::$debug = $debug; } //------------------------------------------------------ $chk = self::debug_chk($chk); //------------------------------------------------------ if ($this->resetQueries) { $chk['resetQueries'] = Result::resetQueries(); } //------------------------------------------------------ return $chk; }