本文整理汇总了PHP中Encryption类 的典型用法代码示例。如果您正苦于以下问题:PHP Encryption类的具体用法?PHP Encryption怎么用?PHP Encryption使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Encryption类 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: callback
public function callback()
{
$this->load->library('encryption');
$encryption = new Encryption($this->config->get('config_encryption'));
$order_id = $encryption->decrypt(@$this->request->get['order_id']);
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($order_id);
if ($order_info) {
$req = 'cmd=_notify-validate';
foreach ($this->request->post as $key => $value) {
$req .= '&' . $key . '=' . urlencode(stripslashes($value));
}
$header = 'POST /cgi-bin/webscr HTTP/1.0' . "\r\n";
$header .= 'Content-Type: application/x-www-form-urlencoded' . "\r\n";
$header .= 'Content-Length: ' . strlen(utf8_decode($req)) . "\r\n\r\n";
if (!$this->config->get('paypal_test')) {
$fp = fsockopen('www.paypal.com', 80, $errno, $errstr, 30);
} else {
$fp = fsockopen('www.sandbox.paypal.com', 80, $errno, $errstr, 30);
}
if ($fp) {
fputs($fp, $header . $req);
while (!feof($fp)) {
$res = fgets($fp, 1024);
if (strcmp($res, 'VERIFIED') == 0) {
$this->model_checkout_order->confirm($order_id, $this->config->get('paypal_order_status_id'));
}
}
fclose($fp);
}
}
}
开发者ID:RepublicMaster, 项目名称:opencart, 代码行数:32, 代码来源:paypal.php
示例2: callback
public function callback()
{
$this->load->library('encryption');
$encryption = new Encryption($this->config->get('config_encryption'));
if (isset($this->request->post['custom'])) {
$order_id = $encryption->decrypt($this->request->post['custom']);
} else {
$order_id = 0;
}
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($order_id);
if ($order_info) {
$request = 'cmd=_notify-validate';
foreach ($this->request->post as $key => $value) {
$request .= '&' . $key . '=' . urlencode(stripslashes(html_entity_decode($value, ENT_QUOTES, 'UTF-8')));
}
if (extension_loaded('curl')) {
if (!$this->config->get('pp_standard_test')) {
$ch = curl_init('https://www.paypal.com/cgi-bin/webscr');
} else {
$ch = curl_init('https://www.sandbox.paypal.com/cgi-bin/webscr');
}
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
if (strcmp($response, 'VERIFIED') == 0 || $this->request->post['payment_status'] == 'Completed') {
$this->model_checkout_order->confirm($order_id, $this->config->get('pp_standard_order_status_id'));
} else {
$this->model_checkout_order->confirm($order_id, $this->config->get('config_order_status_id'));
}
curl_close($ch);
} else {
$header = 'POST /cgi-bin/webscr HTTP/1.0' . "\r\n";
$header .= 'Content-Type: application/x-www-form-urlencoded' . "\r\n";
$header .= 'Content-Length: ' . strlen(utf8_decode($request)) . "\r\n";
$header .= 'Connection: close' . "\r\n\r\n";
if (!$this->config->get('pp_standard_test')) {
$fp = fsockopen('www.paypal.com', 80, $errno, $errstr, 30);
} else {
$fp = fsockopen('www.sandbox.paypal.com', 80, $errno, $errstr, 30);
}
if ($fp) {
fputs($fp, $header . $request);
while (!feof($fp)) {
$response = fgets($fp, 1024);
if (strcmp($response, 'VERIFIED') == 0) {
$this->model_checkout_order->confirm($order_id, $this->config->get('pp_standard_order_status_id'));
} else {
$this->model_checkout_order->confirm($order_id, $this->config->get('config_order_status_id'));
}
}
fclose($fp);
}
}
}
}
开发者ID:josueaponte7, 项目名称:necotienda_standalone, 代码行数:60, 代码来源:pp_standard.php
示例3: callback
public function callback()
{
$this->load->library('encryption');
$encryption = new Encryption($this->config->get('config_encryption'));
if (isset($this->request->post['order_id'])) {
$order_id = $encryption->decrypt($this->request->post['order_id']);
} else {
$order_id = 0;
}
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($order_id);
if ($order_info) {
$this->model_checkout_order->confirm($order_id, $this->config->get('config_order_status_id'));
switch ($this->request->post['status']) {
case '2':
$this->model_checkout_order->update($order_id, $this->config->get('moneybookers_order_status_id'), '', TRUE);
break;
case '0':
$this->model_checkout_order->update($order_id, $this->config->get('moneybookers_order_status_pending_id'), '', TRUE);
break;
case '-1':
$this->model_checkout_order->update($order_id, $this->config->get('moneybookers_order_status_canceled_id'), '', TRUE);
break;
case '-2':
$this->model_checkout_order->update($order_id, $this->config->get('moneybookers_order_status_failed_id'), '', TRUE);
break;
case '-3':
$this->model_checkout_order->update($order_id, $this->config->get('moneybookers_order_status_chargeback_id'), '', TRUE);
break;
}
}
}
开发者ID:RepublicMaster, 项目名称:opencart, 代码行数:32, 代码来源:moneybookers.php
示例4: GeneratePrivateKey
function GeneratePrivateKey($a)
{
$auth = new Encryption();
$x = $auth->ReadFolder($a);
$y = $auth->PickRandomImages($x);
$z = $auth->GeneratePrivKey($y);
return $z;
}
开发者ID:brahimmachkouri, 项目名称:phpDHCPAdmin, 代码行数:8, 代码来源:class.encryption.php
示例5: reorder
protected function reorder()
{
$this->data['button_confirm'] = $this->language->get('button_reoder_confirm');
$this->data['button_back'] = $this->language->get('button_back');
$this->data['return'] = HTTPS_SERVER . 'index.php?route=account/paysuccess';
$this->load->library('encryption');
$encryption = new Encryption($this->config->get('config_encryption'));
//$order_id=$this->request->get['order_id'];
if (isset($this->request->get['order_id'])) {
$order_id = $this->request->get['order_id'];
} else {
$order_id = $this->session->data['zb_cart_orderid'];
}
$this->data['custom'] = $encryption->encrypt($order_id);
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($order_id);
$this->data['order_info'] = $order_info;
$currency_code = 'CNY';
$item_name = $this->config->get('config_title');
$first_name = $order_info['payment_firstname'];
$last_name = $order_info['payment_lastname'];
$cmdno = $this->config->get('tenpay_cmdno');
// 接口类型
$mch_type = $this->config->get('tenpay_mch_type');
// 虚拟物品还是实际物品
/* 平台商密钥 */
$key = $this->config->get('tenpay_key');
/* 平台商帐号 */
$chnid = $this->config->get('tenpay_bargainor_id');
/* 卖家 */
$seller = $this->config->get('tenpay_seller');
$total = $order_info['total'];
$currency_value = $this->currency->getValue($currency_code);
$amount = $total * $currency_value;
$amount = number_format($amount, 2, '.', '');
$charset = 2;
//编码类型 1:gbk 2:utf-8
$notify_url = HTTPS_SERVER . 'catalog/controller/payment/tenpay_callback.php';
$return_url = HTTPS_SERVER . 'index.php?route=account/paysuccess';
$data = array('bargainor_id' => $chnid, 'chnid' => $chnid, 'seller' => $seller, 'key' => $key, 'order_id' => $order_id, 'total_fee' => $amount * 100, 'store' => $item_name, 'callback' => $notify_url, 'return' => $return_url);
if ($cmdno == '12') {
// 中介担保支付
$action = $this->mediPay($data);
} else {
// 直接支付
$action = $this->pay($data);
}
$this->data['reorder'] = true;
$this->data['action'] = $action;
$this->id = 'payment';
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/tenpay.tpl')) {
$this->template = $this->config->get('config_template') . '/template/payment/tenpay.tpl';
} else {
$this->template = 'default/template/payment/tenpay.tpl';
}
$this->render();
}
开发者ID:myjavawork, 项目名称:shcoyee, 代码行数:57, 代码来源:tenpay.php
示例6: testEncrypt
/**
* Tests encryption
*/
public function testEncrypt()
{
$string = "this is a test string";
$enc = new Encryption();
$encrypted = $enc->encode($string);
$this->assertTrue($encrypted != $string);
$unencrypted = $enc->decode($encrypted);
$this->assertTrue($unencrypted == $string);
}
开发者ID:jawngee, 项目名称:HeavyMetal, 代码行数:12, 代码来源:encryptiontest.php
示例7: get_open
public function get_open()
{
global $ost, $cfg;
define('MY_DEBUG', isset($_GET['debug']) && $_GET['debug'] === '1');
$topic_names = Topic::getPublicHelpTopics();
if (isset($_GET['topics'])) {
$allowed_topics = [];
if (is_array($_GET['topics'])) {
$allowed_topics = $_GET['topics'];
} else {
$allowed_topics = [$_GET['topics']];
}
$topic_names = array_filter($topic_names, function ($name, $id) use($allowed_topics) {
return in_array($id, $allowed_topics) || in_array($name, $allowed_topics);
}, ARRAY_FILTER_USE_BOTH);
}
$formPrefix = $this->config->get('ajax_submission_form_prefix');
$csrf_token = $ost->getCSRF()->getToken();
$topics = [];
foreach ($topic_names as $id => $name) {
if (($topic = Topic::lookup($id)) && ($form = $topic->getForm()) && ($fields = $form->getForm()->getFields())) {
$topics[$id] = ['name' => $name, 'instructions' => $form->get('instructions'), 'fields' => []];
foreach ($fields as $field) {
$topics[$id]['fields'][$field->get('name')] = ['name' => $formPrefix . $field->get('name'), 'type' => $field->get('type')];
if ($field->get('type') === 'choices') {
$topics[$id]['fields'][$field->get('name')]['choices'] = $field->getChoices();
}
}
}
}
$captcha = null;
$useCaptcha = $this->config->get('ajax_submission_captcha');
if ($useCaptcha === 1) {
// built-in
$captcha = ['type' => 'osTicket'];
} elseif ($useCaptcha === 2) {
// recaptcha
$public = $this->config->get('ajax_recaptcha_site');
$private = $this->config->get('ajax_recaptcha_secret');
if ($public && $private) {
// Key creation based on https://github.com/google/recaptcha-java/blob/master/appengine/src/main/java/com/google/recaptcha/STokenUtils.java
$encrypter = new Encryption(substr(hash('sha1', $private, true), 0, 16));
$secure_token = json_encode(['session_id' => uniqid($csrf_token), 'ts_ms' => bcmul(microtime(true), 1000, 0)]);
$captcha = ['type' => 'reCaptcha', 'public_key' => $public, 'secure_token' => $encrypter->encrypt_aes_ecb_pkcs5($secure_token)];
} else {
throw new Exception('reCaptcha key not provided!');
}
}
$return = ['method' => 'POST', 'submit_url' => self::baseURL() . '/ajax.php/ajax-form/submit', 'form_groups' => ['backend' => ['hidden' => true, fields => ['csrf', 'action']], 'topic' => ['legend' => 'Help Topic', fields => ['topicId']], 'user' => ['legend' => 'Contact Information', fields => ['name', 'email', 'phone']], 'topic_details' => ['dynamic' => true, 'id' => $formPrefix . 'topic_details'], 'ticket' => ['legend' => 'Ticket Details', fields => ['summary', 'details']]], 'form_fields' => ['csrf' => ['type' => 'hidden', 'value' => $csrf_token, 'name' => $formPrefix . $ost->getCSRF()->getTokenName()], 'action' => ['type' => 'hidden', 'value' => 'open', 'name' => $formPrefix . 'a'], 'topicId' => ['label' => 'Select a Topic', 'required' => true, 'type' => 'choices', 'name' => $formPrefix . 'topicId', 'choices' => $topic_names], 'name' => ['label' => 'Full Name', 'required' => true, 'type' => 'text', 'name' => $formPrefix . 'name'], 'email' => ['label' => 'Email Address', 'required' => true, 'type' => 'text', 'name' => $formPrefix . 'email'], 'phone' => ['label' => 'Phone Number', 'required' => true, 'type' => 'text', 'name' => $formPrefix . 'phone'], 'summary' => ['label' => 'Issue Summary', 'required' => true, 'type' => 'text', 'name' => $formPrefix . 'summary'], 'details' => ['label' => 'Issue Details', 'required' => true, 'type' => 'textarea', 'name' => $formPrefix . 'details']], 'topics' => $topics, 'captcha' => $captcha];
header('Access-Control-Allow-Origin: ' . $this->config->get('ajax_cors_header'));
$json_flags = 0;
if (MY_DEBUG) {
$json_flags += JSON_PRETTY_PRINT;
}
return json_encode($return, $json_flags);
}
开发者ID:kohenkatz, 项目名称:OST-AJAX, 代码行数:56, 代码来源:AjaxFormController.php
示例8: getcookies
function getcookies()
{
$crypt = new Encryption();
$this->array = array();
if (isset($_COOKIE[$this->name])) {
foreach ($_COOKIE[$this->name] as $key => $value) {
$this->array[$key] = $crypt->decode($value);
}
}
}
开发者ID:CallBest, 项目名称:CallCenter-CIMS, 代码行数:10, 代码来源:cookie.php
示例9: __crypt
/**
* Encrypt/Decrypt input.
* @access private
*/
function __crypt($password, $encrypt = true)
{
require_once 'include/utils/encryption.php';
$cryptobj = new Encryption();
if ($encrypt) {
return $cryptobj->encrypt(trim($password));
} else {
return $cryptobj->decrypt(trim($password));
}
}
开发者ID:nouphet, 项目名称:vtigercrm-6.0.0-ja, 代码行数:14, 代码来源:MailScannerInfo.php
示例10: MailBox
function MailBox($mailbox = '', $p = '', $s = '')
{
global $current_user;
require_once 'include/utils/encryption.php';
$oencrypt = new Encryption();
$this->db = PearDatabase::getInstance();
$this->db->println("Entering MailBox({$mailbox})");
$this->mailbox = $mailbox;
$tmp = getMailServerInfo($current_user);
if ($this->db->num_rows($tmp) < 1) {
$this->enabled = 'false';
} else {
$this->enabled = 'true';
}
$this->boxinfo = $this->db->fetch_array($tmp);
$this->login_username = trim($this->boxinfo["mail_username"]);
$this->secretkey = $oencrypt->decrypt(trim($this->boxinfo["mail_password"]));
$this->imapServerAddress = gethostbyname(trim($this->boxinfo["mail_servername"]));
$this->mail_protocol = $this->boxinfo["mail_protocol"];
$this->ssltype = $this->boxinfo["ssltype"];
$this->sslmeth = $this->boxinfo["sslmeth"];
$this->box_refresh = trim($this->boxinfo["box_refresh"]);
$this->mails_per_page = trim($this->boxinfo["mails_per_page"]);
if ($this->mails_per_page < 1) {
$this->mails_per_page = 20;
}
$this->account_name = $this->boxinfo["account_name"];
$this->display_name = $this->boxinfo["display_name"];
//$this->imapServerAddress=$this->boxinfo["mail_servername"];
$this->db->println("Setting Mailbox Name");
if ($this->mailbox != "") {
$this->mailbox = $mailbox;
}
$this->db->println("Opening Mailbox");
if (!$this->mbox && $this->mailbox != "") {
$this->getImapMbox();
}
$this->db->println("Loading mail list");
$pa = $p;
$se = $s;
if ($this->mbox) {
if ($se != "") {
$this->mailList = $this->searchMailList($se, $pa);
} else {
if ($pa == "") {
$this->mailList = $this->customMailList(0);
} else {
$this->mailList = $this->customMailList($pa);
}
}
}
$this->db->println("Exiting MailBox({$mailbox})");
}
开发者ID:sacredwebsite, 项目名称:vtigercrm, 代码行数:53, 代码来源:MailBox.php
示例11: index
public function index()
{
$data['button_confirm'] = $this->language->get('button_confirm');
$data['button_back'] = $this->language->get('button_back');
$data['return'] = HTTPS_SERVER . 'index.php?route=checkout/success';
if ($this->request->get['route'] != 'checkout/guest_step_3') {
$data['cancel_return'] = HTTPS_SERVER . 'index.php?route=checkout/payment';
} else {
$data['cancel_return'] = HTTPS_SERVER . 'index.php?route=checkout/guest_step_2';
}
$this->load->library('encryption');
$encryption = new Encryption($this->config->get('config_encryption'));
$data['custom'] = $encryption->encrypt($this->session->data['order_id']);
if ($this->request->get['route'] != 'checkout/guest_step_3') {
$data['back'] = HTTPS_SERVER . 'index.php?route=checkout/payment';
} else {
$data['back'] = HTTPS_SERVER . 'index.php?route=checkout/guest_step_2';
}
$this->load->model('checkout/order');
$order_id = $this->session->data['order_id'];
$order_info = $this->model_checkout_order->getOrder($order_id);
$seller_email = $this->config->get('alipay_seller_email');
$security_code = $this->config->get('alipay_security_code');
$trade_type = $this->config->get('alipay_trade_type');
$partner = $this->config->get('alipay_partner');
$currency_code = 'CNY';
$item_name = $this->config->get('config_name');
$full_name = $order_info['payment_fullname'];
$total = $order_info['total'];
$currency_value = $this->currency->getValue($currency_code);
$amount = $total * $currency_value;
$amount = number_format($amount, 2, '.', '');
$_input_charset = "utf-8";
$sign_type = "MD5";
$transport = "http";
$notify_url = HTTP_SERVER . 'catalog/controller/payment/alipay_callback.php';
$return_url = HTTPS_SERVER . 'index.php?route=checkout/success';
$show_url = "";
$parameter = array("service" => $trade_type, "partner" => $partner, "return_url" => $return_url, "notify_url" => $notify_url, "_input_charset" => $_input_charset, "subject" => $item_name . ' Order:' . $order_id, "body" => 'Owner ' . $full_name, "out_trade_no" => $order_id, "price" => $amount, "payment_type" => "1", "quantity" => "1", "logistics_fee" => '0.00', "logistics_payment" => 'BUYER_PAY', "logistics_type" => 'EXPRESS', "show_url" => $show_url, "seller_email" => $seller_email);
$alipay = new alipay_service($parameter, $security_code, $sign_type);
$action = $alipay->build_url();
$data['action'] = $action;
//$this->id = 'payment';
// Save payment url address for pay later.
$this->model_checkout_order->setOrderPaymentUrl($order_id, $action);
// log_result("Alipay test 111111111111");
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/alipay.tpl')) {
return $this->load->view($this->config->get('config_template') . '/template/payment/alipay.tpl', $data);
} else {
return $this->load->view('default/template/payment/alipay.tpl', $data);
}
}
开发者ID:paul-dev, 项目名称:micro_cow, 代码行数:52, 代码来源:alipay.php
示例12: callback
public function callback()
{
$this->load->library('encryption');
$encryption = new Encryption($this->config->get('config_encryption'));
if (isset($this->request->post['order_id'])) {
$order_id = $encryption->decrypt($this->request->post['order_id']);
} else {
$order_id = 0;
}
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($order_id);
if ($order_info) {
$this->model_checkout_order->confirm($order_id, $this->config->get('config_order_status_id'));
$verified = true;
// md5sig validation
if ($this->config->get('moneybookers_secret')) {
$hash = $this->request->post['merchant_id'];
$hash .= $this->request->post['transaction_id'];
$hash .= strtoupper(md5($this->config->get('moneybookers_secret')));
$hash .= $this->request->post['mb_amount'];
$hash .= $this->request->post['mb_currency'];
$hash .= $this->request->post['status'];
$md5hash = strtoupper(md5($hash));
$md5sig = $this->request->post['md5sig'];
if ($md5hash != $md5sig) {
$verified = false;
}
}
if ($verified) {
switch ($this->request->post['status']) {
case '2':
$this->model_checkout_order->update($order_id, $this->config->get('moneybookers_order_status_id'), '', TRUE);
break;
case '0':
$this->model_checkout_order->update($order_id, $this->config->get('moneybookers_pending_status_id'), '', TRUE);
break;
case '-1':
$this->model_checkout_order->update($order_id, $this->config->get('moneybookers_canceled_status_id'), '', TRUE);
break;
case '-2':
$this->model_checkout_order->update($order_id, $this->config->get('moneybookers_failed_status_id'), '', TRUE);
break;
case '-3':
$this->model_checkout_order->update($order_id, $this->config->get('moneybookers_chargeback_status_id'), '', TRUE);
break;
}
} else {
$this->log->write('md5sig returned (' + $md5sig + ') does not match generated (' + $md5hash + '). Verify Manually. Current order state: ' . $this->config->get('config_order_status_id'));
}
}
}
开发者ID:raquelsa, 项目名称:OpenCartWeb, 代码行数:51, 代码来源:moneybookers.php
示例13: reorder
public function reorder()
{
$this->data['button_confirm'] = $this->language->get('button_reoder_confirm');
$this->data['button_back'] = $this->language->get('button_back');
$this->data['return'] = $this->url->link('checkout/success', '', 'SSL');
$this->load->library('encryption');
$encryption = new Encryption($this->config->get('config_encryption'));
if (isset($this->request->get['order_id'])) {
$order_id = $this->request->get['order_id'];
} else {
$order_id = $this->session->data['zb_cart_orderid'];
}
$this->data['custom'] = $encryption->encrypt($order_id);
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($order_id);
$this->data['order_info'] = $order_info;
$order_totals = $this->model_checkout_order->Gettotals($order_id);
$seller_email = $this->config->get('alipay_seller_email');
$security_code = $this->config->get('alipay_security_code');
$trade_type = $this->config->get('alipay_trade_type');
$partner = $this->config->get('alipay_partner');
$currency_code = 'CNY';
$item_name = $this->config->get('config_name');
$first_name = $order_info['payment_firstname'];
$last_name = $order_info['payment_lastname'];
$total = $order_info['total'];
$currency_value = $this->currency->getValue($currency_code);
$amount = $total * $currency_value;
$amount = number_format($amount, 2, '.', '');
$_input_charset = "utf-8";
$sign_type = "MD5";
$transport = "http";
$notify_url = HTTP_SERVER . 'catalog/controller/payment/alipay_notify.php';
$return_url = HTTPS_SERVER . 'index.php?route=checkout/success';
$show_url = "";
$parameter = array("service" => $trade_type, "partner" => $partner, "return_url" => $return_url, "notify_url" => $notify_url, "_input_charset" => $_input_charset, "subject" => $item_name . $this->language->get('text_order_no') . $order_id, "body" => $item_name, "out_trade_no" => $order_id, "price" => $amount, "payment_type" => "1", "quantity" => "1", "logistics_fee" => '0.00', "logistics_payment" => 'BUYER_PAY', "logistics_type" => 'EXPRESS', "show_url" => $show_url, "seller_email" => $seller_email);
$alipay = new alipay_service($parameter, $security_code, $sign_type);
$action = $alipay->build_url();
$this->data['reorder'] = true;
$this->data['action'] = $action;
$this->id = 'payment';
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/alipay.tpl')) {
$this->template = $this->config->get('config_template') . '/template/payment/alipay.tpl';
} else {
$this->template = 'default/template/payment/alipay.tpl';
}
$this->render();
}
开发者ID:myjavawork, 项目名称:shcoyee, 代码行数:48, 代码来源:alipay.php
示例14: executeViewEmail
public function executeViewEmail(sfWebRequest $request)
{
sfConfig::set('sf_web_debug', false);
$this->setLayout(false);
$reservation_id = $request->getParameter('id');
$template = $request->getParameter('template');
$type = $request->getParameter('type');
$reservation = Doctrine::getTable('Reservation')->find($reservation_id);
// $url = sprintf('http://%s/access/%s',
// sfConfig::get('app_domain_name', $_SERVER['SERVER_NAME']),
// Encryption::encodeUrl('reservation', 'access', array(
// 'user_id' => $reservation->Client->User->id,
// 'uniqid' => $reservation->uniqid
// ))
// );
$url = sprintf('http://%s/access/%s', sfConfig::get('app_domain_name', $_SERVER['SERVER_NAME']), Encryption::getEncryptedUrlFromUri('@reservation_show?uniqid=' . $reservation->uniqid, $reservation->Client->User->id));
$data['reservation'] = $reservation;
$data['url'] = $url;
$data['subject'] = 'Subject';
$filename = $template . '_' . $type;
$message = new esEmailMessage('Test Email');
$message->setFrom(sfConfig::get('app_email_from'));
$message->setTo('[email protected] ');
$message->setAutoEmbedImages(false);
$message->setBodyFromTemplate($this->getController(), 'reservation', $filename, $data, $type == 'html' ? 'email_layout' : 'none');
return $this->renderText($message->getBody());
}
开发者ID:jmiridis, 项目名称:atcsf1, 代码行数:27, 代码来源:actions.class.php
示例15: execute
/**
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @return int|void
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->detectContao($output, true);
if ($this->initContao()) {
// Username
if (($username = $input->getArgument('username')) === null) {
$dialog = $this->getHelperSet()->get('dialog');
$username = $dialog->ask($output, '<question>Username:</question>');
}
// Email
if (($email = $input->getArgument('email')) === null) {
$dialog = $this->getHelperSet()->get('dialog');
$email = $dialog->ask($output, '<question>Email:</question>');
}
// Password
if (($password = $input->getArgument('password')) === null) {
$dialog = $this->getHelperSet()->get('dialog');
$password = $dialog->ask($output, '<question>Password:</question>');
}
// Name
if (($name = $input->getArgument('name')) === null) {
$dialog = $this->getHelperSet()->get('dialog');
$name = $dialog->ask($output, '<question>Name:</question>');
}
// create new user
$user = new \UserModel();
$user->setRow(array('username' => $username, 'name' => $name, 'email' => $email, 'password' => \Encryption::hash($password), 'admin' => 1))->save();
$user->save();
$output->writeln('<info>User <comment>' . $username . '</comment> successfully created</info>');
}
}
开发者ID:iMi-digital, 项目名称:imi-conrun, 代码行数:36, 代码来源:CreateUserCommand.php
示例16: getInstance
/**
* Return the current object instance (Singleton)
* @return object
*/
public static function getInstance()
{
if (!is_object(self::$objInstance)) {
self::$objInstance = new Encryption();
}
return self::$objInstance;
}
开发者ID:Juuro, 项目名称:Dreamapp-Website, 代码行数:11, 代码来源:Encryption.php
示例17: execute
/**
* @param InputInterface $input
* @param OutputInterface $output
* @throws \Exception
* @return int|void
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->detectContao($output);
if ($this->initContao()) {
$dialog = $this->getHelperSet()->get('dialog');
if (($id = $input->getArgument('id')) == null) {
$id = $dialog->ask($output, '<question>Username or Email:</question>');
}
$user = \UserModel::findBy('username', $id);
if (!$user) {
$user = \UserModel::findBy('email', $id);
}
if (!$user) {
$output->writeln('<error>User was not found</error>');
return;
}
// Password
if (($password = $input->getArgument('password')) == null) {
$password = $dialog->ask($output, '<question>Password:</question>');
}
try {
$user->password = \Encryption::hash($password);
$user->save();
$output->writeln('<info>Password successfully changed</info>');
} catch (\Exception $e) {
$output->writeln('<error>' . $e->getMessage() . '</error>');
}
}
}
开发者ID:iMi-digital, 项目名称:imi-conrun, 代码行数:35, 代码来源:ChangePasswordCommand.php
示例18: setClientBy
/**
* Set client by id
*
* @param int $id
*
* @throws Exception
*/
public function setClientBy($id)
{
// Load Client from database
$objClient = \Database::getInstance()->prepare("SELECT * FROM tl_synccto_clients WHERE id = %s")->limit(1)->execute((int) $id);
// Check if a client was loaded
if ($objClient->numRows == 0) {
throw new Exception($GLOBALS['TL_LANG']['ERR']['unknown_client']);
}
// Clean url
$objClient->path = preg_replace("/\\/\\z/i", "", $objClient->path);
$objClient->path = preg_replace("/ctoCommunication.php\\z/i", "", $objClient->path);
// Build path
if ($objClient->path == "") {
$strUrl = $objClient->address . ":" . $objClient->port . "/ctoCommunication.php";
} else {
$strUrl = $objClient->address . ":" . $objClient->port . $objClient->path . "/ctoCommunication.php";
}
$this->setClient($strUrl, $objClient->apikey, $objClient->codifyengine);
if ($objClient->http_auth == true) {
$this->setHttpAuth($objClient->http_username, \Encryption::decrypt($objClient->http_password));
}
// Set debug modus for ctoCom.
if ($GLOBALS['TL_CONFIG']['syncCto_debug_mode'] == true) {
$this->setDebug(true);
$this->setMeasurement(true);
$this->setFileDebug($this->objSyncCtoHelper->standardizePath($GLOBALS['SYC_PATH']['debug'], "CtoComDebug.txt"));
$this->setFileMeasurement($this->objSyncCtoHelper->standardizePath($GLOBALS['SYC_PATH']['debug'], "CtoComMeasurement.txt"));
}
$this->arrClientData = array("title" => $objClient->title, "address" => $objClient->address, "path" => $objClient->path, "port" => $objClient->port);
return $this->arrClientData;
}
开发者ID:menatwork, 项目名称:synccto, 代码行数:38, 代码来源:SyncCtoCommunicationClient.php
示例19: run
public function run()
{
$columnsParameters = array(array('dbField' => 'SupportDiscussionsEntity.idObjet', 'dtField' => 'objet', 'formatter' => function ($d, $row) {
return \SupportObjetsHelper::getLibelle($d);
}), array('dbField' => 'AdminsEntity.name', 'dtField' => 'compte', 'formatter' => function ($d, $row) {
if ($this->isAdmin) {
return $row["user"];
} else {
return $d;
}
}), array('dbField' => 'AccountEntityUser.login', 'dtField' => 'user'), array('dbField' => 'SupportDiscussionsEntity.date', 'dtField' => 'date', 'formatter' => function ($d, $row) {
return \DateTimeHelper::dateTimeToFormatedString($d, "d/m/Y");
}), array('dbField' => 'SupportDiscussionsEntity.dateDernierMessage', 'dtField' => 'lastMessage', 'formatter' => function ($d, $row) {
$firstDate = date("Y-m-d");
$secondDate = $d->format('Y-m-d');
if ($firstDate == $secondDate) {
return \DateTimeHelper::dateTimeToFormatedString($d, "H:i:s");
} else {
return \DateTimeHelper::dateTimeToFormatedString($d);
}
}), array('dbField' => 'SupportMessagesEntity.id', 'dtField' => 'nonLuInDiscussion', 'formatter' => function ($d, $row) {
if ($d === null) {
return "";
} else {
return "lineGreen";
}
}), array('dbField' => 'SupportDiscussionsEntity.id', 'dtField' => 'actions', 'formatter' => function ($d, $row) {
$varButton = '<a class="btn btn-material btn-primary btn-sm" onclick="DiscussionOpen(\'' . \Encryption::encrypt($d) . '\')"><i class="material-icons md-icon-message"></i></a>';
$varButton .= '<a class="btn btn-material btn-warning btn-sm" onclick="DiscussionArchivage(\'' . \Encryption::encrypt($d) . '\', 1)"><i class="material-icons md-icon-archive"></i></a>';
return '<div class="btn-toolbar">' . $varButton . "</div>";
}));
$datatable = new \DataTable();
$datatable->setColumnsParameters($columnsParameters)->setRequest($_GET)->from("\\Site\\Entity\\SupportDiscussions", "SupportDiscussionsEntity")->innerJoin("\\Site\\Entity\\Admins", "AdminsEntity", "WITH", "AdminsEntity.idCompte = SupportDiscussionsEntity.idAdmin")->leftJoin("\\Account\\Entity\\Account", "AccountEntityUser", "WITH", "AccountEntityUser.id = SupportDiscussionsEntity.idCompte")->leftJoin("\\Site\\Entity\\SupportMessages", "SupportMessagesEntity", "WITH", "SupportMessagesEntity.idDiscussion = SupportDiscussionsEntity.id AND SupportMessagesEntity.etat = " . \SupportEtatMessageHelper::NON_LU . " AND SupportMessagesEntity.idCompte != " . $this->objAccount->getId() . "")->andWhere("SupportDiscussionsEntity.idCompte = " . $this->objAccount->getId() . " OR SupportDiscussionsEntity.idAdmin = " . $this->objAccount->getId() . "")->andWhere("SupportDiscussionsEntity.estArchive = 0")->groupBy("SupportDiscussionsEntity.id");
$datatable->getResult()->toJson();
}
开发者ID:SylvainSimon, 项目名称:Metinify, 代码行数:35, 代码来源:listMessagerieInbox.php
GitbookIO/gitbook:
阅读:970| 2022-08-17
** REJECT ** DO NOT USE THIS CANDIDATE NUMBER. ConsultIDs: none. Reason: This ca
阅读:856| 2022-07-29
juleswhite/mobile-cloud-asgn1
阅读:1047| 2022-08-30
Qualeams/Android-Face-Recognition-with-Deep-Learning-Library: Face Recognition l
阅读:991| 2022-08-15
kyamagu/matlab-json: Use official API: https://mathworks.com/help/matlab/json-fo
阅读:938| 2022-08-17
书名:墙壁眼睛膝盖 作者:温柔一刀 类别:欲望丛林,饮食男女。 簡介:Wall(我)Eye(爱)Kn
阅读:670| 2022-11-06
sevenjay/cpp-markdown: Cpp-Markdown is a freely-available Markdown text-to-HTML
阅读:596| 2022-08-18
A cross-site request forgery (CSRF) vulnerability in Jenkins Openstack Heat Plug
阅读:965| 2022-07-29
mathjax/MathJax-i18n: MathJax localization
阅读:392| 2022-08-16
众所周知,我们的身份证号码里面包含的信息有很多,如出生日期、性别和识别码等,如果
阅读:256| 2022-11-06
请发表评论