Esempio n. 1
0
 function error()
 {
     require 'controllers/error.php';
     $controller = new Errors();
     $controller->index();
     return false;
 }
Esempio n. 2
0
 /**
  * Add errors from Errors object
  * @param Errors $object
  * @param bool $saveKey
  * @return $this
  */
 public function addErrorObject(Errors $object, $saveKey = false)
 {
     $errors = $object->getErrors(true);
     foreach ($errors as $key => $error) {
         $this->addError($error['name'], $saveKey ? $key : '', $error['data']);
     }
     return $this;
 }
Esempio n. 3
0
 /**
  * Test for invalid reserved codes
  *
  * @expectedException \RuntimeException
  * @expectedExceptionMessage The reserved codes for factory "FivePercent\Component\Error\ThirdErrorFactoryWithInvalidReservedDiapason" [15 - 30] superimposed on "FivePercent\Component\Error\SecondErrorFactory" factory [10 - 19].
  */
 public function testWithInvalidReservedDiapason()
 {
     $errors = new Errors();
     $errors->addFactory(new FirstErrorFactory());
     $errors->addFactory(new SecondErrorFactory());
     $errors->addFactory(new ThirdErrorFactoryWithInvalidReservedDiapason());
     $errors->checkReservedCodes();
 }
 /**
  * Constructs a validation exception
  *
  * @param Errors $errors The validation errors
  */
 public function __construct(Errors $errors)
 {
     $this->errors = $errors;
     if (!$errors->hasErrors()) {
         parent::__construct('No errors');
     } else {
         parent::__construct($errors->toString());
     }
 }
Esempio n. 5
0
 /**
  * 带有col布局的select (后台使用).
  *
  * @param string $name    表单name
  * @param array  $list    值列表 (值 => 标签)
  * @param Errors $errors  错误对象
  * @param string $label   label
  * @param mixed  $value   默认值
  * @param array  $options 其他附属参数
  */
 public function colSelect($name, $list = array(), $errors, $label = '', $selected = null, $options = [])
 {
     $attributes = array_merge(['class' => 'form-control'], $options);
     $hasError = $errors->has($name) ? 'has-error' : '';
     $label = $label ? $this->label($name, $label, ['class' => 'col-sm-2 control-label']) : '';
     $string = '<div class ="form-group ' . $hasError . '">';
     $string .= $label;
     $string .= '<div class="col-sm-6">';
     $string .= call_user_func_array(['Form', 'select'], [$name, $list, $selected, $attributes]);
     $string .= $errors->first($name, '<small class="help-block">:message</small>');
     $string .= '</div></div>';
     return $string;
 }
Esempio n. 6
0
 /**
  * Ставим хук на вызов неизвестного метода
  * @param string [component|module]_[method]
  * @param array $aArgs
  * @return unknown
  */
 public function __call($sName, $aArgs = array())
 {
     //Ищем среди прикрепленный компонентов
     if ($this->_c !== null) {
         $aArgsRef = array();
         foreach ($aArgs as $key => $v) {
             $aArgsRef[] =& $aArgs[$key];
         }
         //$sName == [component name]_[method name]
         $aName = explode("_", $sName, 2);
         if (sizeof($aName) == 2) {
             $sComponent = mb_strtolower($aName[0]);
             $sMethod = $aName[1];
             if (!empty($sMethod) && isset($this->_c[$sComponent])) {
                 if (method_exists($this->_c[$sComponent], $sMethod)) {
                     return call_user_func_array(array($this->_c[$sComponent], $sMethod), $aArgsRef);
                 }
                 Errors::i()->set("Компонент не имеет требуемого метода <b>{$sComponent}" . '->' . $sMethod . '()</b>')->autohide(false);
                 return null;
             }
         }
         //$sName == [method name]
         foreach ($this->_c as $name => $component) {
             if (method_exists($component, $sName)) {
                 return call_user_func_array(array($component, $sName), $aArgsRef);
             }
         }
     }
     return null;
 }
 /**
  * Process a single feed
  *
  * @param array $feed Feed information (required elements are 'name' for error reporting, 'feed' for the feed URL and 'id' for the feed's unique internal ID)
  * @return int Number of items added
  */
 public static function process_single($feed)
 {
     do_action('iu-feed-start', $feed);
     $sp =& self::load_feed($feed);
     if ($error = $sp->error()) {
         self::log(sprintf(_r('An error occurred with "%2$s": %1$s'), $error, $feed['name']), Errors::get_code('api.itemupdater.itemerror'));
         do_action('iu-feed-finish', $feed);
         return -1;
     }
     $count = 0;
     $items = $sp->get_items();
     foreach ($items as $item) {
         $new_item = self::normalise($item, $feed['id']);
         $new_item = apply_filters('item_data_precache', $new_item, $feed);
         if (Items::get_instance()->check_item($new_item)) {
             $count++;
             do_action('iu-item-add', $new_item, $feed);
         } else {
             do_action('iu-item-noadd', $new_item, $feed);
         }
     }
     $sp->__destruct();
     unset($sp);
     do_action('iu-feed-finish', $feed);
     return $count;
 }
 /**
  * Sort parameters by order specified in method declaration
  *
  * Takes a callback and a list of available params, then filters and sorts
  * by the parameters the method actually needs, using the reflection APIs
  *
  * @author Morten Fangel <*****@*****.**>
  * @param callback $callback
  * @param array $params
  * @return array
  */
 protected function _sortArgs($callback, $params)
 {
     // Takes a callback and a list or params and filter and
     // sort the list by the parameters the method actually needs
     if (is_array($callback)) {
         $ref_func = new ReflectionMethod($callback[0], $callback[1]);
     } else {
         $ref_func = new ReflectionFunction($callback);
     }
     // Create a reflection on the method
     $ref_parameters = $ref_func->getParameters();
     // finds the parameters needed for the function via Reflections
     $ordered_parameters = array();
     foreach ($ref_parameters as $ref_parameter) {
         // Run through all the parameters we need
         if (isset($params[$ref_parameter->getName()])) {
             // We have this parameters in the list to choose from
             $ordered_parameters[] = $params[$ref_parameter->getName()];
         } elseif ($ref_parameter->isDefaultValueAvailable()) {
             // We don't have this parameter, but it's optional
             $ordered_parameters[] = $ref_parameter->getDefaultValue();
         } else {
             // We don't have this parameter and it wasn't optional, abort!
             throw new Exception('Missing parameter ' . $ref_parameter->getName() . '', Errors::get_code('admin.ajax.missing_param'));
             $ordered_parameters[] = null;
         }
     }
     return $ordered_parameters;
 }
Esempio n. 9
0
 public function post($request)
 {
     // to Receive POST Params (use $this->params)
     parent::post($request);
     $folderID = $this->getParam('folderID');
     $msgID = $this->getParam('msgID');
     $attachmentID = $this->getParam('attachmentID');
     if ($this->isLoggedIn()) {
         if ($folderID && $msgID && $attachmentID) {
             $dir = PHPGW_INCLUDE_ROOT . "/expressoMail/inc";
             if ($this->getExpressoVersion() != "2.2") {
                 $_GET['msgFolder'] = $folderID;
                 $_GET['msgNumber'] = $msgID;
                 $_GET['indexPart'] = $attachmentID;
                 include "{$dir}/get_archive.php";
             } else {
                 $_GET['msg_folder'] = $folderID;
                 $_GET['msg_number'] = $msgID;
                 $_GET['msg_part'] = $attachmentID;
                 $_GET['idx_file'] = $this->getParam('attachmentIndex');
                 $_GET['newfilename'] = $this->getParam('attachmentName');
                 $_GET['encoding'] = $this->getParam('attachmentEncoding');
                 include "{$dir}/gotodownload.php";
             }
             // Dont modify header of Response Method to 'application/json'
             $this->setCannotModifyHeader(true);
             return $this->getResponse();
         } else {
             Errors::runException("MAIL_ATTACHMENT_NOT_FOUND");
         }
     }
 }
Esempio n. 10
0
 public function setNewServer($host, $user, $password, $database, $faild = self::EXCEPTION_FAILD_MODE)
 {
     //$this->server=null;
     //
     if ($host == "" and $user == "" and $database == "") {
         throw new DatabaseArgumentsException();
     } else {
         Database::$server = mysqli_connect($host, $user, $password, $database);
         //
         if (!Database::$server) {
             if ($faild == 2 && Config::get('panel.configured')) {
                 throw new DatabaseConnectionException();
             } else {
                 if ($faild == 1) {
                     \Errors::r_db();
                 }
             }
         }
         //
         mysqli_query(Database::$server, "SET NAMES " . Config::get("database.charset"));
         //
         Database::$serverData = ['host' => $host, "username" => $user, "password" => $password, "database" => $database];
         //
         //
         return Database::$server;
     }
 }
Esempio n. 11
0
 public static function process()
 {
     header('Content-Type: text/plain; charset=utf-8');
     require_once LILINA_INCPATH . '/contrib/simplepie.class.php';
     $updated = false;
     foreach (self::$feeds as $feed) {
         do_action('iu-feed-start', $feed);
         $sp = self::load_feed($feed);
         if ($error = $sp->error()) {
             self::log(sprintf(_r('An error occurred with "%2$s": %1$s'), $error, $feed['name']), Errors::get_code('api.itemupdater.itemerror'));
             continue;
         }
         $count = 0;
         $items = $sp->get_items();
         foreach ($items as $item) {
             $new_item = self::normalise($item, $feed['id']);
             $new_item = apply_filters('item_data_precache', $new_item);
             if (Items::get_instance()->check_item($new_item)) {
                 $count++;
                 $updated = true;
             }
         }
         do_action('iu-feed-finish', $feed);
     }
     Items::get_instance()->sort_all();
     if ($updated) {
         Items::get_instance()->save_cache();
     }
 }
Esempio n. 12
0
 /**
  * Возвращаем данные столика
  * @param $arData
  * @return CDBResult|CIBlockResult|string
  */
 function getInfo($tableID, $arData = false, $GetNext = false)
 {
     $arFilterTable = array("IBLOCK_ID" => IB_TABLE_ID, "PROPERTY_CLUB" => $this->clubID, "ID" => intval($tableID));
     $arSelectTable = array("ID");
     $arOrderTable = array();
     $arOrder = is_array($arData["arSelect"]) ? array_merge($arData["arOrder"], $arOrderTable) : $arOrderTable;
     $arGroupBy = is_array($arData["arGroupBy"]) ? array_merge($arData["arGroupBy"], array()) : false;
     $arNavStartParams = is_array($arData["arGroupBy"]) ? array_merge($arData["arNavStartParams"], array()) : false;
     $arSelect = is_array($arData["arSelect"]) ? array_merge($arData["arSelect"], $arSelectTable) : $arSelectTable;
     $arFilter = is_array($arData["arFilter"]) ? array_merge($arData["arFilter"], $arFilterTable) : $arFilterTable;
     $res = CIBlockElement::GetList($arOrder, $arFilter, $arGroupBy, $arNavStartParams, $arSelect);
     if (!$res) {
         return Errors::run("404");
     }
     $ob = $GetNext ? $res->GetNext() : $res->Fetch();
     if (isset($ob["PREVIEW_PICTURE"])) {
         $arFile = CFile::GetFileArray($ob["PREVIEW_PICTURE"]);
         $ob["PREVIEW_PICTURE"] = $arFile["SRC"];
     }
     if (isset($ob["PROPERTY_PRICE_GROUP_VALUE"])) {
         $res = CIBlockElement::GetList(array(), array("ID" => intval($ob["PROPERTY_PRICE_GROUP_VALUE"]), "IBLOCK_ID" => IB_PRICE_GROUP), false, false, array("NAME", "ID", "PROPERTY_PRICE"));
         $ob["PROPERTY_PRICE_GROUP"] = $res->Fetch();
     }
     return $ob;
 }
Esempio n. 13
0
 public function post($request)
 {
     // to Receive POST Params (use $this->params)
     parent::post($request);
     if ($this->isLoggedIn()) {
         $old_id = $this->getParam('folderID');
         $new_name = $this->getParam('folderName');
         if (!$this->getImap()->folder_exists($old_id)) {
             Errors::runException("MAIL_INVALID_OLD_FOLDER");
         }
         $default_folders = array_keys($this->defaultFolders);
         if (in_array($old_id, $default_folders)) {
             Errors::runException("MAIL_INVALID_OLD_FOLDER");
         }
         if (empty($new_name) || preg_match('/[\\/\\\\!\\@\\#\\$\\%\\&\\*\\(\\)]/', $new_name)) {
             Errors::runException("MAIL_INVALID_NEW_FOLDER_NAME");
         }
         $old_id_arr = explode($this->getImap()->imap_delimiter, $old_id);
         $new_id = implode($this->getImap()->imap_delimiter, array_slice($old_id_arr, 0, count($old_id_arr) - 1)) . $this->getImap()->imap_delimiter . $new_name;
         $params['current'] = $old_id;
         $params['rename'] = $new_id;
         $result = $this->getImap()->ren_mailbox($params);
         if ($result != 'Ok') {
             Errors::runException("MAIL_FOLDER_NOT_RENAMED");
         }
     }
     $this->setResult(array('folderID' => $new_id));
     //to Send Response (JSON RPC format)
     return $this->getResponse();
 }
Esempio n. 14
0
 public function addError($errorCode, array $params = [], $subReports = null, $schemaDescription = null)
 {
     $errorMessage = vsprintf(Errors::getMessage($errorCode), $params);
     $error = ['code' => $errorCode, 'params' => $params, 'message' => $errorMessage, 'path' => $this->getPath()];
     if ($schemaDescription !== null) {
         if (is_object($schemaDescription)) {
             if (isset($schemaDescription->description)) {
                 $error['description'] = $schemaDescription->description;
             } else {
                 if (isset($schemaDescription->id)) {
                     $error['description'] = $schemaDescription->id;
                 }
             }
         } else {
             if (is_string($schemaDescription)) {
                 $error['description'] = $schemaDescription;
             }
         }
     }
     if ($subReports !== null) {
         if (!is_array($subReports)) {
             $subReports = [$subReports];
         }
         $error['inner'] = [];
         foreach ($subReports as $subReport) {
             foreach ($subReport->errors as $subError) {
                 $error['inner'][] = $subError;
             }
         }
         if (empty($error['inner'])) {
             unset($error['inner']);
         }
     }
     $this->errors[] = $error;
 }
 public function post($request)
 {
     // to Receive POST Params (use $this->params)
     parent::post($request);
     if ($this->isLoggedIn()) {
         $msgBody = $this->getParam("message");
         $params['input_to'] = $GLOBALS['phpgw_info']['server']['sugestoes_email_to'];
         $params['input_cc'] = $GLOBALS['phpgw_info']['server']['sugestoes_email_cc'];
         $params['input_cc'] = $GLOBALS['phpgw_info']['server']['sugestoes_email_bcc'];
         $params['input_subject'] = lang("Suggestions");
         $params['body'] = $msgBody;
         $params['type'] = 'textplain';
         $GLOBALS['phpgw']->preferences->read_repository();
         $_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user'];
         $boemailadmin = CreateObject('emailadmin.bo');
         $emailadmin_profile = $boemailadmin->getProfileList();
         $_SESSION['phpgw_info']['expressomail']['email_server'] = $boemailadmin->getProfile($emailadmin_profile[0]['profileID']);
         $_SESSION['phpgw_info']['expressomail']['server'] = $GLOBALS['phpgw_info']['server'];
         $_SESSION['phpgw_info']['expressomail']['user']['email'] = $GLOBALS['phpgw']->preferences->values['email'];
         $expressoMail = CreateObject('expressoMail.imap_functions');
         $returncode = $expressoMail->send_mail($params);
         if (!$returncode || !(is_array($returncode) && $returncode['success'] == true)) {
             Errors::runException("MAIL_NOT_SENT");
         }
     }
     $this->setResult(true);
     //to Send Response (JSON RPC format)
     return $this->getResponse();
 }
Esempio n. 16
0
 protected static function init()
 {
     self::$codes = array();
     // 0-99 = admin.
     // 0-9 = admin.ajax.
     self::$codes['admin.ajax.unknown'] = 1;
     self::$codes['admin.ajax.no_method'] = 2;
     self::$codes['admin.ajax.missing_param'] = 3;
     // 10-19 = admin.feeds.
     self::$codes['admin.feeds.invalid_url'] = 10;
     self::$codes['admin.feeds.no_url'] = 11;
     self::$codes['admin.feeds.no_id_or_url'] = 12;
     self::$codes['admin.feeds.invalid_id'] = 13;
     self::$codes['admin.feeds.protocol_error'] = 13;
     // 20-39 = admin.importer.
     // 20-29 = admin.importer.greader.
     self::$codes['admin.importer.greader.invalid_auth'] = 20;
     // 40-49 = admin.plugins.
     self::$codes['admin.plugins.invalid_path'] = 40;
     self::$codes['admin.plugins.not_found'] = 41;
     // 100-199 = api.
     // 100-109 = api.itemupdater.
     self::$codes['api.itemupdater.itemerror'] = 100;
     self::$codes['api.itemupdater.ajax.unknown'] = 101;
     self::$codes['api.itemupdater.ajax.no_id'] = 102;
     self::$codes['api.itemupdater.ajax.action_unknown'] = 103;
     // 110-119 = api.items.
     self::$codes['api.items.no_method'] = 110;
     // 800-899 = auth.
     self::$codes['auth.none'] = 800;
     // 900-999 = update.
     self::$codes['update.core'] = 900;
     self::$codes['update.plugin'] = 901;
     self::$codes['update.theme'] = 902;
 }
Esempio n. 17
0
 public function post($request)
 {
     // to Receive POST Params (use $this->params)
     parent::post($request);
     if ($this->isLoggedIn()) {
         $msgID = $this->getParam('msgID');
         $folderID = $this->getParam('folderID');
         if (!$this->getImap()->folder_exists($folderID)) {
             Errors::runException("MAIL_INVALID_FOLDER");
         }
         if ($msgID == "") {
             Errors::runException("MAIL_INVALID_MESSAGE");
         }
         if (!$this->messageExists($folderID, $msgID)) {
             Errors::runException("MAIL_INVALID_MESSAGE");
         }
         $trash_folder = array_search(3, $this->defaultFolders);
         $params = array();
         $params['folder'] = $folderID;
         $params['msgs_number'] = $msgID;
         if ($folderID != $trash_folder && $this->getImap()->prefs['save_deleted_msg']) {
             if ($trash_folder == "") {
                 Errors::runException("MAIL_TRASH_FOLDER_NOT_EXISTS");
             }
             $params['new_folder'] = $trash_folder;
             $this->getImap()->move_messages($params);
         } else {
             $this->getImap()->delete_msgs($params);
         }
         $this->setResult(true);
     }
     return $this->getResponse();
 }
Esempio n. 18
0
 public function post($request)
 {
     // to Receive POST Params (use $this->params)
     parent::post($request);
     if ($this->isLoggedIn()) {
         $parent_id = $this->getParam('parentFolderID');
         $parent_id = empty($parent_id) ? 'INBOX' : $parent_id;
         $new_name = $this->getParam('folderName');
         $all_folders = $this->getImap()->get_folders_list();
         if (!$all_folders) {
             return $this->getResponse();
         }
         $max_folders = $this->getImap()->prefs['imap_max_folders'];
         if (count($all_folders) == $max_folders) {
             Errors::runException("MAIL_FOLDER_LIMIT_REACHED");
         }
         if (empty($new_name) || preg_match('/[\\/\\\\!\\@\\#\\$\\%\\&\\*\\(\\)]/', $new_name)) {
             Errors::runException("MAIL_INVALID_NEW_FOLDER_NAME");
         }
         $new_id = $parent_id . $this->getImap()->imap_delimiter . $new_name;
         $params['newp'] = $new_id;
         $result = $this->getImap()->create_mailbox($params);
         if ($result != 'Ok') {
             Errors::runException("MAIL_FOLDER_NOT_ADDED");
         }
     }
     $this->setResult(array('folderID' => $new_id));
     //to Send Response (JSON RPC format)
     return $this->getResponse();
 }
Esempio n. 19
0
 /**
  * Add errors message to list
  *
  * @param string|Errors $msg_id
  */
 public function pushError($msg_id)
 {
     if ($msg_id instanceof Errors) {
         $ids = $msg_id->getErrorsIds();
     } else {
         $ids = array($msg_id);
     }
     foreach ($ids as $_id) {
         $item = Messages::getMessageArray(Messages::TYPE_ERROR, $_id);
         $this->_ids[] = $_id;
         if ($item !== null) {
             $this->_errors[$item['code']] = $item['text'];
         } else {
             $this->_errors[11111111] = 'Unknown error';
         }
     }
 }
Esempio n. 20
0
 protected function _initErrors()
 {
     register_shutdown_function(function () {
         $err = error_get_last();
         if (!empty($err)) {
             Errors::Error($err);
         }
     });
 }
Esempio n. 21
0
 public static function merge($error_array)
 {
     if (!is_array(self::$errors)) {
         self::$errors = $error_array;
     }
     if (is_array($error_array)) {
         self::$errors = array_merge(self::$errors, $error_array);
     }
 }
Esempio n. 22
0
 static function getOBonTheUserID($userID)
 {
     $clubID = self::getClubID($userID);
     if ($clubID) {
         return new self($clubID);
     } else {
         return Errors::run("404");
     }
 }
Esempio n. 23
0
 public function post($request)
 {
     // to Receive POST Params (use $this->params)
     parent::post($request);
     if ($this->isLoggedIn()) {
         // parametros recuperados conforme draft
         $msgForwardTo = $this->getParam("msgForwardTo");
         $originalMsgID = $this->getParam("originalMsgID");
         $originalUserAction = $this->getParam("originalUserAction");
         $params['input_subject'] = $this->getParam("msgSubject");
         $params['input_to'] = $this->getParam("msgTo");
         $params['input_cc'] = $this->getParam("msgCcTo");
         $params['input_cco'] = $this->getParam("msgBccTo");
         $params['input_replyto'] = $this->getParam("msgReplyTo");
         $params['body'] = $this->getParam("msgBody");
         $params['type'] = $this->getParam("msgType") ? $this->getParam("msgType") : "plain";
         $params['folder'] = $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder'] == "-1" ? "null" : $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder'];
         if (count($_FILES)) {
             $files = array();
             $totalSize = 0;
             foreach ($_FILES as $name => $file) {
                 $files[$name] = array('name' => $file['name'], 'type' => $file['type'], 'source' => base64_encode(file_get_contents($file['tmp_name'], $file['size'])), 'size' => $file['size'], 'error' => $file['error']);
                 $totalSize += $file['size'];
             }
             $uploadMaxFileSize = str_replace("M", "", $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['max_attachment_size']) * 1024 * 1024;
             if ($totalSize > $uploadMaxFileSize) {
                 Errors::runException("MAIL_NOT_SENT_LIMIT_EXCEEDED", $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['max_attachment_size']);
             }
             if ($this->getExpressoVersion() != "2.2") {
                 require_once __DIR__ . '/../../../prototype/api/controller.php';
                 Controller::addFallbackHandler(0, function ($e) {
                     throw $e;
                 });
                 $result = array();
                 $attachments_ids = array();
                 foreach ($files as $key => $value) {
                     $value['disposition'] = isset($value['disposition']) ? $value['disposition'] : 'attachment';
                     try {
                         $attachment = Controller::put(array('concept' => "mailAttachment"), $value);
                         $attachments_ids[] = $attachment[0]['id'];
                     } catch (Exception $e) {
                         Errors::runException($e->getMessage());
                     }
                 }
                 $params['attDisposition1'] = 'attachment';
                 $params['attachments'] = json_encode($attachments_ids);
             }
         }
         $returncode = $this->getImap()->send_mail($params);
         if (!$returncode || !(is_array($returncode) && $returncode['success'] == true)) {
             Errors::runException("MAIL_NOT_SENT");
         }
     }
     $this->setResult(true);
     //to Send Response (JSON RPC format)
     return $this->getResponse();
 }
Esempio n. 24
0
 function Project()
 {
     $this->loadlib();
     $this->db = $_SERVER['HTTP_HOST'] == "localhost" ? new Dblib("localhost", "artcmsdb", "root", "") : new Dblib(HOST, DBNAME, DBUSER, DBPASS);
     if ($this->db->err != "") {
         Errors::report($this->db->err);
     }
     $this->tp = new Template();
     session_start();
 }
Esempio n. 25
0
 private function _check_csrf()
 {
     if (!_is_post()) {
         return;
     }
     if (_post('form_key') !== Session::form_key()) {
         Log::write(chr(27) . '[41m' . chr(27) . '[37m** POSSIBLE CSRF **' . chr(27) . '[0m');
         Errors::show_404();
     }
 }
Esempio n. 26
0
 private function showResults()
 {
     if (Errors::hasErrors()) {
         $this->response['status'] = FALSE;
         $this->response['errors'] = Errors::getErrors();
         unset($this->response['results']);
     }
     echo json_encode($this->response);
     exit;
 }
Esempio n. 27
0
 public function reloadSettings()
 {
     // get the current settings from the database
     $this->settings = $this->qdb_object->getSettingsAll();
     // perform error checking
     if (isset($this->settings['ERRORS']) && $this->settings['ERRORS'] != '') {
         // fatal error as we need these settings for everything else to work
         $err = Errors::getInstance();
         $err->errorEvent(ERROR_SETTINGS, "Error reloading settings " . $this->settings['ERRORS']);
     }
 }
Esempio n. 28
0
 /**
  * (non-PHPdoc)
  * @see class/db/IDataBase#ExecuteQuery()
  */
 public function ExecuteQuery($query)
 {
     //echo "<br>query: $query";
     DataBase::$QUERY_COUNT++;
     $query = str_replace("#S#", $this->_schema, $query);
     $result = $this->PDO->query($query);
     if ($result == false) {
         Errors::LogError("MySql:ExecuteQuery", $this->LastError() . " ::: " . $query);
     }
     return $result;
 }
Esempio n. 29
0
 /**
  * (non-PHPdoc)
  * @see class/db/IDataBase#ExecuteQueryWithParams()
  */
 public function ExecuteQueryWithParams($query, $params)
 {
     $query = str_replace("#S#", $this->_schema, $query);
     $query = str_replace("\"", "", $query);
     $query = str_replace("`", "\"", $query);
     //echo "<br>query: $query";
     $result = pg_query_params($this->_link, $query, $params);
     if ($result == false) {
         Errors::LogError("PostgreSql:ExecuteQueryWithParams", $this->LastError());
     }
     return $result;
 }
Esempio n. 30
0
 public static function i(&$lang = array())
 {
     if (isset(self::$oInstance) and self::$oInstance instanceof self) {
     } else {
         self::$oInstance = new self();
         set_error_handler(array(self::$oInstance, 'triggerErrorHandler'), E_ALL);
     }
     if (!empty($lang)) {
         self::$oInstance->setLang($lang);
     }
     return self::$oInstance;
 }