public function connect($config = []) { $this->config = $config; $dsn = 'host=' . $this->config['host'] . ' '; if (!empty($this->config['port'])) { $dsn .= 'port=' . $this->config['port'] . ' '; } if (!empty($this->config['database'])) { $dsn .= 'dbname=' . $this->config['database'] . ' '; } if (!empty($this->config['user'])) { $dsn .= 'user='******'user'] . ' '; } if (!empty($this->config['password'])) { $dsn .= 'password='******'password'] . ' '; } if (!empty($this->config['dsn'])) { $dsn = $this->config['dsn']; } $dsn = rtrim($dsn); $this->connect = $this->config['pconnect'] === true ? @pg_pconnect($dsn) : @pg_connect($dsn); if (empty($this->connect)) { die(getErrorMessage('Database', 'connectError')); } if (!empty($this->config['charset'])) { pg_set_client_encoding($this->connect, $this->config['charset']); } }
public function connect(array $settings = NULL) { $config = \Config::get('IndividualStructures', 'cache')['driverSettings']; $config = !empty($settings) ? $settings : $config['redis']; $this->redis = new \Redis(); try { if ($config['socketType'] === 'unix') { $success = $this->redis->connect($config['socket']); } else { $success = $this->redis->connect($config['host'], $config['port'], $config['timeout']); } if (empty($success)) { die(getErrorMessage('IndividualStructures', 'cache:connectionRefused', 'Connection')); } } catch (RedisException $e) { die(getErrorMessage('IndividualStructures', 'cache:connectionRefused', $e->getMessage())); } if (isset($config['password'])) { if (!$this->redis->auth($config['password'])) { die(getErrorMessage('IndividualStructures', 'cache:authenticationFailed')); } } $serialized = $this->redis->sMembers('ZNRedisSerialized'); if (!empty($serialized)) { $this->serialized = array_flip($serialized); } return true; }
public function __construct() { if (!isPhpVersion('5.5.0')) { die(getErrorMessage('Error', 'invalidVersion', ['%' => 'password_', '#' => '5.5.0'])); } parent::__construct(); }
public static function run() { // INI AYARLAR YAPILANDIRILIYOR... $iniSet = Config::get('Ini', 'settings'); if (!empty($iniSet)) { Config::iniSet($iniSet); } // ---------------------------------------------------------------------- // HTACCESS DOSYASI OLUŞTURULUYOR... if (Config::get('Htaccess', 'createFile') === true) { createHtaccessFile(); } // ---------------------------------------------------------------------- // COMPOSER DOSYASI OLUŞTURULUYOR... $composer = Config::get('Composer', 'autoload'); if ($composer === true) { $path = 'vendor/autoload.php'; if (file_exists($path)) { require_once $path; } else { report('Error', getMessage('Error', 'fileNotFound', $path), 'AutoloadComposer'); die(getErrorMessage('Error', 'fileNotFound', $path)); } } elseif (file_exists($composer)) { require_once $composer; } elseif (!empty($composer)) { report('Error', getMessage('Error', 'fileNotFound', $composer), 'AutoloadComposer'); die(getErrorMessage('Error', 'fileNotFound', $composer)); } // ---------------------------------------------------------------------- }
public function connect($config = array()) { $this->config = $config; $this->connect = $this->config['pconnect'] === true ? @sqlite_popen($this->config['database'], 0666, $error) : @sqlite_open($this->config['database'], 0666, $error); if (!empty($error)) { die(getErrorMessage('Database', 'mysqlConnectError')); } }
public function connect($config = array()) { $this->config = $config; $this->connect = $this->config['pconnect'] === true ? @ibase_pconnect($this->config['host'] . ':' . $this->config['database'], $this->config['user'], $this->config['password'], $this->config['charset']) : @ibase_connect($this->config['host'] . ':' . $this->config['database'], $this->config['user'], $this->config['password'], $this->config['charset']); if (empty($this->connect)) { die(getErrorMessage('Database', 'mysqlConnectError')); } }
public function connect($config = array()) { $this->config = $config; $this->connect = empty($this->config['user']) ? @cubrid_connect($this->config['host'], $this->config['port'], $this->config['database']) : @cubrid_connect($this->config['host'], $this->config['port'], $this->config['database'], $this->config['user'], $this->config['password']); if (empty($this->connect)) { die(getErrorMessage('Database', 'mysqlConnectError')); } }
public function connect($config = array()) { $this->config = $config; $this->connect = $this->config['pconnect'] === true ? @fbsql_pconnect($this->config['host'], $this->config['user'], $this->config['password']) : @fbsql_connect($this->config['host'], $this->config['user'], $this->config['password']); if (empty($this->connect)) { die(getErrorMessage('Database', 'mysqlConnectError')); } fbsql_select_db($this->config['database'], $this->connect); }
public function connect($config = array()) { $this->config = $config; try { $this->connect = !empty($this->config['password']) ? new SQLite3($this->config['database'], SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, $this->config['password']) : new SQLite3($this->config['database']); } catch (Exception $e) { die(getErrorMessage('Database', 'mysqlConnectError')); } }
public function connect($config = array()) { $this->config = $config; $dsn = !empty($this->config['dsn']) ? $this->config['dsn'] : 'DRIVER=' . $this->config['host'] . ';SERVER=' . $this->config['server'] . ';DATABASE=' . $this->config['database']; $this->connect = $this->config['pconnect'] === true ? @odbc_pconnect($dsn, $this->config['user'], $this->config['password']) : @odbc_connect($dsn, $this->config['user'], $this->config['password']); if (empty($this->connect)) { die(getErrorMessage('Database', 'mysqlConnectError')); } }
public function connect(array $settings = NULL) { $config = \Config::get('IndividualStructures', 'cache')['driverSettings']; $config = !empty($settings) ? $settings : $config['memcache']; $connect = @memcache_add_server($config['host'], $config['port'], $config['weight']); if (empty($connect)) { die(getErrorMessage('IndividualStructures', 'cache:unsupported', 'Memcache')); } return true; }
function deleteCategoryById($id) { $app = \Slim\Slim::getInstance(); try { $app->response->write(json_encode(CategoriesDAO::delete($id))); return json_encode($app->response->getBody()); } catch (Exception $e) { $app->response->setStatus(404); $app->response->setBody(getErrorMessage($e)); return json_encode($app->response->getBody()); } }
protected function _is($type, $file) { $file = $this->rpath($file); $validType = $this->methods[$type] ?? NULL; if (!function_exists($validType) || $validType === NULL) { die(getErrorMessage('Error', 'undefinedFunction', Classes::onlyName(get_called_class()) . '::' . $type . '()')); } if ($validType($file)) { return true; } return false; }
public function run($library = '', $driver = '') { $config = Config::get(ucwords(strtolower($library))); $driver = !empty($driver) ? $driver : $config['driver']; if (!empty($driver)) { $drv = ucwords($driver) . 'Driver'; $var = new $drv(); return $var; } else { die(getErrorMessage('Error', 'driverError', $driver)); } }
public function connect($config = array()) { $this->config = $config; $server = !empty($this->config['server']) ? $this->config['server'] : $this->config['host']; if (!empty($this->config['port'])) { $server .= ', ' . $this->config['port']; } $connection = array('UID' => $this->config['user'], 'PWD' => $this->config['password'], 'Database' => $this->config['database'], 'ConnectionPooling' => 0, 'CharacterSet' => $this->config['charset'], 'Encrypt' => $this->config['encode'], 'ReturnDatesAsStrings' => 1); $this->connect = @sqlsrv_connect($server, $connection); if (empty($this->connect)) { die(getErrorMessage('Database', 'mysqlConnectError')); } }
public function connect($config = []) { $this->config = $config; $dsn = !empty($this->config['dsn']) ? $this->config['dsn'] : $this->config['host']; if ($this->config['pconnect'] === true) { $this->connect = empty($this->config['charset']) ? @oci_pconnect($this->config['user'], $this->config['password'], $dsn) : @oci_pconnect($this->config['user'], $this->config['password'], $dsn, $this->config['charset']); } else { $this->connect = empty($this->config['charset']) ? @oci_connect($this->config['user'], $this->config['password'], $dsn) : @oci_connect($this->config['user'], $this->config['password'], $dsn, $this->config['charset']); } if (empty($this->connect)) { die(getErrorMessage('Database', 'connectError')); } }
function levelOneProcess($input) { //get the input form the previous step if ($input['latest_message'] == 1) { $reply = getSafaricomMenu(); } elseif ($input['latest_message'] == 2) { //MPESA menu $reply = getMpesaMenu(); } else { $reply = getErrorMessage(); echo "END " . $reply; exit; } return $reply; }
/** * Uses user access token to become never-expiring page access token. * * @param string $userToken * * @return bool|string (page access token) */ private function getPageAccessToken($userToken) { $fb = initFb(); try { $response = $fb->get('/' . config('crm-launcher.facebook_credentials.facebook_page_id') . '?fields=access_token', $userToken); $response = json_decode($response->getBody()); if (isset($response->access_token)) { return $response->access_token; } getErrorMessage('login_right_account'); } catch (Exception $e) { getErrorMessage('permission'); return false; } }
function uselib(string $class, array $parameters = []) { if (!class_exists($class)) { $classInfo = ZN\Autoloader\Autoloader::getClassFileInfo($class); $class = $classInfo['namespace']; if (!class_exists($class)) { die(getErrorMessage('Error', 'classError', $class)); } } if (!isset(zn::$use->{$class})) { if (!is_object(zn::$use)) { zn::$use = new stdClass(); } zn::$use->{$class} = new $class(...$parameters); } return zn::$use->{$class}; }
public function connect($config = []) { $this->config = $config; $this->connect = mysqli_connect($this->config['host'], $this->config['user'], $this->config['password'], $this->config['database']); if (empty($this->connect)) { die(getErrorMessage('Database', 'connectError')); } if (!empty($this->config['charset'])) { $this->query("SET NAMES '" . $this->config['charset'] . "'"); } if (!empty($this->config['charset'])) { $this->query('SET CHARACTER SET ' . $this->config['charset']); } if (!empty($this->config['collation'])) { $this->query('SET COLLATION_CONNECTION = "' . $this->config['collation'] . '"'); } }
public function connect($config = array()) { $this->config = $config; $this->connect = $this->config['pconnect'] === true ? @mysql_pconnect($this->config['host'], $this->config['user'], $this->config['password']) : @mysql_connect($this->config['host'], $this->config['user'], $this->config['password']); if (empty($this->connect)) { die(getErrorMessage('Database', 'mysqlConnectError')); } mysql_select_db($this->config['database'], $this->connect); if (!empty($this->config['charset'])) { $this->query("SET NAMES '" . $this->config['charset'] . "'", $this->connect); } if (!empty($this->config['charset'])) { $this->query('SET CHARACTER SET ' . $this->config['charset'], $this->connect); } if (!empty($this->config['collation'])) { $this->query('SET COLLATION_CONNECTION = "' . $this->config['collation'] . '"', $this->connect); } }
/** * Check if twitter settings are valid * @return boolean */ public function validTwitterSettings() { if ($this->config->exists() && $this->config->first()->linked_twitter) { return true; } try { $client = initTwitter(); $verification = $client->get('account/verify_credentials.json'); $verification = json_decode($verification->getBody(), true); if ($this->config->exists() && $this->config->first()->exists()) { $this->config->insertTwitterId($verification); } return true; } catch (\GuzzleHttp\Exception\ClientException $e) { if ($e->getCode() == self::TOO_MANY_REQUEST_CODE) { getErrorMessage($e->getResponse()->getStatusCode()); } return false; } }
function __construct($orderInfo, $pgwParams, $testMode = false) { parent::__construct(); $this->orderInfo = $orderInfo; $this->test = $testMode; if ($testMode) { $this->eWayCustomerID = '87654321'; $this->eWayUsername = '******'; $this->eWayPassword = '******'; $this->soap_link = 'https://www.eway.com.au/gateway/rebill/test/managerebill_test.asmx'; } else { $currency = oseObject::getValue($this->orderInfo, 'payment_currency'); $this->eWayCustomerID = oseObject::getValue($pgwParams, "eWayCustomerID_{$currency}"); $this->eWayUsername = oseObject::getValue($pgwParams, "eWayUsername_{$currency}"); $this->eWayPassword = oseObject::getValue($pgwParams, "eWayPassword_{$currency}"); $this->soap_link = 'https://www.eway.com.au/gateway/rebill/managerebill.asmx'; } if (empty($this->eWayCustomerID)) { oseExit(getErrorMessage('cc', 00, 'Since the currency you are going to pay is not supported, the transaction will be aborted!')); } }
/** * Payment link. * * @param $params * @return string */ function checkoutjs_link($params) { $Api = CheckoutApi_Api::getApi(array('mode' => $params['modetype'])); $model = new model_methods_creditcard(); $paymentToken = $model->getPaymentToken($params); $publicKey = $params['publickey']; $email = $params['clientdetails']['email']; $amount = $params['amount']; $currencyCode = $params['currency']; $amountCents = $Api->valueToDecimal($amount, $currencyCode); $customerName = $params['clientdetails']['firstname'] . " " . $params['clientdetails']['lastname']; $returnUrl = $params['systemurl'] . '/modules/gateways/callback/checkoutjs_callback.php?cko-card-token='; $address1 = $params['clientdetails']['address1']; $address2 = $params['clientdetails']['address2']; $city = $params['clientdetails']['city']; $postcode = $params['clientdetails']['postcode']; $country = $params['clientdetails']['countrycode']; $state = $params['clientdetails']['state']; $logoUrl = $params['logoUrl']; $themeColor = $params['themeColor']; $iconColor = $params['iconColor']; $buttonColor = $params['buttonColor']; $useCurrencyCode = $params['useCurrencyCode'] ? 'true' : 'false'; $title = $params['title']; $widgetColor = $params['widgetColor']; $buttonLabelColor = $params['buttonLabelColor']; $formButtonColor = $params['formButtonColor']; $formButtonColorLabel = $params['formButtonColorLabel']; $overlayShade = $params['overlayShade']; $overlayOpacity = $params['overlayOpacity']; $showMobileIcons = $params['showMobileIcons']; $widgetIconSize = $params['widgetIconSize']; $url = $params['modetype'] == 'Live' ? model_methods_creditcard::CHECKOUT_NON_PCI_JS_URL_LIVE : model_methods_creditcard::CHECKOUT_NON_PCI_JS_URL_SANDBOX; $errorMessage = getErrorMessage(); $code = @"\n <div style='width:150px; margin:0 auto;'>\n <script src='https://code.jquery.com/jquery-1.11.0.min.js'></script>\n <script src={$url}></script>\n <script>\n Checkout.render({\n debugMode : true,\n publicKey : '{$publicKey}',\n paymentToken : '{$paymentToken}',\n customerEmail : '{$email}',\n customerName : '{$customerName}',\n value : '{$amountCents}',\n currency : '{$currencyCode}',\n paymentMode : 'card',\n forceRedirect : false,\n //payButtonSelector : '#payNow',\n cardFormMode : 'cardTokenisation',\n billingDetails: {\n 'addressLine1' : '{$address1}',\n 'addressLine2' : '{$address2}',\n 'postcode' : '{$postcode}',\n 'country' : '{$country}',\n 'city' : '{$city}',\n 'state' : '{$state}'\n },\n logoUrl :'{$logoUrl}',\n renderMode : 1,\n themeColor :'{$themeColor}',\n buttonColor :'{$buttonColor}',\n iconColor :'{$iconColor}',\n useCurrencyCode :'{$useCurrencyCode}',\n title :'{$title}',\n widgetColor :'{$widgetColor}',\n buttonLabelColor :'{$buttonLabelColor}',\n styling : {\n formButtonColor : '{$formButtonColor}',\n formButtonColorLabel : '{$formButtonColorLabel}',\n overlayShade : '{$overlayShade}',\n overlayOpacity : '{$overlayOpacity}',\n showMobileIcons : '{$showMobileIcons}',\n widgetIconSize : '{$widgetIconSize}'\n },\n ready: function (event) {\n if(document.getElementById('whmcsorderfrm')){\n document.getElementsByClassName('alert')[0].style.visibility='hidden';\n document.getElementsByClassName('textcenter')[0].style.visibility='hidden';\n }\n },\n widgetRendered: function (){\n if(document.getElementById('whmcsorderfrm')){\n //document.getElementById('cko-widget').style.visibility='hidden';\n }\n },\n cardTokenised: function(event) {\n if(document.getElementById('whmcsorderfrm')){\n document.getElementById('cko-widget').style.visibility='hidden';\n document.getElementsByClassName('textcenter')[0].style.visibility='visible';\n }\n window.location.href = '{$returnUrl}'+event.data.cardToken;\n }\n });\n </script>\n </div>\n "; if ($errorMessage) { $code .= "<div><p style='color:red;'>{$errorMessage}</p></div>"; } return $code; }
// neue Instanz des PHPMailer anlegen $mail = new PHPMailer(); // Absender eintragen $mail->From = '*****@*****.**'; $mail->FromName = 'Aero Club Butzbach e.V.'; // eMail-Adresse des Empfängers hinzufügen $mail->AddAddress($email['email']); // Betreffzeile definieren $mail->Subject = sprintf('Abrechnung aus ameAVIA %s/%s', $dir_monat, $dir_jahr); // eMail-Text $mail->Body = $nachricht; // Abrechnung als Anhang der eMailadresse hinzufügen $mail->AddAttachment($pfad . $pdf); if (!$mail->send()) { // ein Fehler ist aufgetreten $html_msg = getErrorMessage(); } else { // eine Infomeldung für den Anwender einblenden, falls // der eMailversand erfolgreich durchgeführt wurde $html_msg = getInfoMessage(); } } } } /**************************************************************************************************************************/ /* ------------------------------------------- ENDE : FILTER NACH POST-BEFEHL ------------------------------------------- */ /**************************************************************************************************************************/ ?> <!-- ENDE: SKRIPT --> <!-- BEGINN: AUSGABE --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
/** * Get profile picture of user on Facebook * @param integer $id * @return view */ function getProfilePicture($id) { $fb = initFb(); $token = Configuration::FbAccessToken(); try { $picture = $fb->get('/' . $id . '/picture?redirect=false&type=large', $token); $picture = json_decode($picture->getBody()); return $picture->data->url; } catch (Exception $e) { getErrorMessage($e->getCode()); return back(); } }
public function __call($method = '', $param = '') { die(getErrorMessage('Error', 'undefinedFunction', "Permission::{$method}()")); }
case "do_update": case "do_delete": if (!$gui->canManage) { break; } case "edit": case "create": $op = $action($args, $gui, $platform_mgr); $of->Value = $gui->notes; break; } if ($op->status == 1) { $default_template = $op->template; $gui->user_feedback['message'] = $op->user_feedback; } else { $gui->user_feedback['message'] = getErrorMessage($op->status, $args->name); $gui->user_feedback['type'] = 'ERROR'; } $gui->platforms = $platform_mgr->getAll(array('include_linked_count' => true)); $gui->notes = $of->CreateHTML(); $smarty->assign('gui', $gui); $smarty->display($templateCfg->template_dir . $default_template); /** * * */ function init_args(&$dbHandler) { $args = new stdClass(); $_REQUEST = strings_stripSlashes($_REQUEST); $source = sizeof($_POST) ? "POST" : "GET";
dsetcookie('con_request_token'); dsetcookie('con_request_token_secret'); $conuin = $response['oauth_token']; $conuinsecret = $response['oauth_token_secret']; $conopenid = strtoupper($response['openid']); if (!$conuin || !$conuinsecret || !$conopenid) { showmessage('qqconnect:connect_get_access_token_failed_code', $referer); } } else { if ($_GET['state'] != md5(FORMHASH)) { showmessage('qqconnect:connect_get_access_token_failed', $referer); } try { $response = $connectOAuthClient->connectGetOpenId_V2($_G['cookie']['con_request_uri'], $_GET['code']); } catch (Exception $e) { showmessage('qqconnect:connect_get_access_token_failed_code', $referer, array('codeMessage' => getErrorMessage($e->getmessage()), 'code' => $e->getmessage())); } dsetcookie('con_request_token'); dsetcookie('con_request_token_secret'); $conuintoken = $response['access_token']; $conopenid = strtoupper($response['openid']); if (!$conuintoken || !$conopenid) { showmessage('qqconnect:connect_get_access_token_failed', $referer); } } loadcache('connect_blacklist'); if (in_array($conopenid, array_map('strtoupper', $_G['cache']['connect_blacklist']))) { $change_qq_url = $_G['connect']['discuz_change_qq_url']; showmessage('qqconnect:connect_uin_in_blacklist', $referer, array('changeqqurl' => $change_qq_url)); } if ($params['uin']) {
function publishNewRating() { $app = \Slim\Slim::getInstance(); try { $app->response->setBody(json_encode(RatingsDAO::create($app->request->getBody()))); $app->response->setStatus(201); return json_encode($app->response->getBody()); } catch (Exception $e) { $app->response->setStatus(404); $app->response->setBody(getErrorMessage($e)); return json_encode($app->response->getBody()); } }