本文整理汇总了PHP中filterId函数的典型用法代码示例。如果您正苦于以下问题:PHP filterId函数的具体用法?PHP filterId怎么用?PHP filterId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了filterId函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __call
public function __call($methodName, $args)
{
$pluginId = filterId($this->_request->getUserParam('plugin_id'));
$this->_request->setActionName(filterId($this->_request->getActionName()));
if (!$pluginId) {
throw new Am_Exception_InputError("Internal Error: wrong URL used - no plugin id");
}
switch ($type = $this->_request->getUserParam('type')) {
case self::PAYMENT:
case self::PROTECT:
case self::MISC:
break;
default:
throw new Am_Exception_InternalError("Wrong [type] requested");
}
$pluginMgr = $this->getDi()->plugins[$type];
if (!$pluginMgr->isEnabled($pluginId)) {
throw new Am_Exception_InputError("The [{$pluginId}] plugin is disabled");
}
$ps = $pluginMgr->loadGet($pluginId);
if (!$ps->isConfigured()) {
throw new Am_Exception_Configuration("The plugin [{$pluginId}] is not configured, directAction failed");
}
try {
return $ps->directAction($this->_request, $this->_response, $this->_invokeArgs);
} catch (Exception $e) {
$this->getDi()->errorLogTable->log($e);
throw $e;
}
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:30,代码来源:DirectController.php
示例2: indexAction
function indexAction()
{
$this->getDi()->plugins_payment->loadEnabled()->getAllEnabled();
$id = $this->_request->getFiltered('id');
if (empty($id)) {
$id = filterId(@$_GET['id']);
}
$this->invoice = null;
if ($id) {
$this->invoice = $this->getDi()->invoiceTable->findBySecureId($id, 'THANKS');
if (!$this->invoice) {
throw new Am_Exception_InputError("Invoice #{$id} not found");
}
$tm = max($this->invoice->tm_started, $this->invoice->tm_added);
if ($this->getDi()->time - strtotime($tm) > 48 * 3600) {
throw new Am_Exception_InputError("Link expired");
}
// Clean signup_member_login and signup_member_id to avoid duplicate signups with the same email address.
$this->getSession()->signup_member_id = null;
$this->getSession()->signup_member_login = null;
$this->view->invoice = $this->invoice;
foreach ($this->invoice->getPaymentRecords() as $p) {
$this->view->payment = $p;
}
if (!$this->invoice->tm_started) {
$this->view->show_waiting = true;
$this->view->refreshTime = "<span id='am-countdown'>00:10</span> " . ___("seconds");
}
$this->view->script = $this->getJs(10);
}
$this->getDi()->hook->call(Am_Event::THANKS_PAGE, array('controller' => $this, 'invoice' => $this->invoice));
$this->view->layoutNoMenu = true;
$this->view->display('thanks.phtml');
}
开发者ID:grlf,项目名称:eyedock,代码行数:34,代码来源:ThanksController.php
示例3: load
public function load($keyOrTicketId, $throwExceptions = true)
{
if (preg_match('/^\\d+$/', trim($keyOrTicketId), $matches)) {
return parent::load($matches[0], $throwExceptions);
} else {
$keyOrTicketId = filterId($keyOrTicketId);
$found = $this->findFirstByTicketMask($keyOrTicketId);
if (!$found && $throwExceptions) {
throw new Am_Exception_InternalError("Ticket with mask [{$keyOrTicketId}] not found");
}
return $found;
}
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:13,代码来源:HelpdeskTicket.php
示例4: splitPath
public function splitPath($path)
{
if (ctype_digit((string) $path)) {
return array('upload', $path, array());
}
list($id, $path) = explode('::', $path, 2);
$id = filterId($id);
@(list($path, $query) = explode('?', $path, 2));
$path = preg_replace('|[^A-Za-z0-9 _:\\\\/._-]|', '', $path);
if (strlen($query)) {
parse_str($query, $q);
$query = $q;
}
return array($id, $path, $query);
}
开发者ID:alexanderTsig,项目名称:arabic,代码行数:15,代码来源:Storage.php
示例5: setFromRequest
public function setFromRequest(array $input)
{
if (@$input[$this->getId()]['val'] != '') {
$id = $input[$this->getId()]['val'];
if (is_integer($id)) {
$user = Am_Di::getInstance()->userTable->load($id, false);
} else {
$user = Am_Di::getInstance()->userTable->findFirstByLogin(filterId($id));
}
if (!$user) {
return false;
}
$this->reseller_id = $user->pk();
$this->reseller_login = $user->login;
return true;
}
}
开发者ID:alexanderTsig,项目名称:arabic,代码行数:17,代码来源:SubuserAssignedTo.php
示例6: directAction
public function directAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
{
if ($request->getActionName() == 'cancelpaysafecart') {
// SEE par.3
@(list($id, $code) = explode('-', filterId($request->getFiltered('id')), 2));
$invoice = Am_Di::getInstance()->InvoiceTable->findFirstByPublicId(filterId($id));
if (!$invoice) {
throw new Am_Exception_InputError("No invoice found [{$id}]");
}
$invoice->setCancelled(true);
$a = new Am_Paysystem_Action_HtmlTemplate_Paysafecard($this->getDir(), 'payment-paysafecard-cancel.phtml');
$a->process(new Am_Controller($request, $response, $invokeArgs));
// see par.3
} else {
parent::directAction($request, $response, $invokeArgs);
}
}
开发者ID:grlf,项目名称:eyedock,代码行数:17,代码来源:paysafecard.php
示例7: setRequest
public function setRequest(Am_Request $request)
{
$this->completeRequest = $request;
$arr = array();
foreach ($request->toArray() as $k => $v) {
if (strpos($k, $this->id . '_') === 0) {
$k = substr($k, strlen($this->id) + 1);
if (!strlen($k)) {
continue;
}
$arr[$k] = $v;
}
}
$this->request = new Am_Request($arr);
$sort = $this->request->get('sort');
if (!empty($sort)) {
$sort = explode(' ', $sort, 2);
$this->getDataSource()->setOrder(filterId($sort[0]), !empty($sort[1]));
}
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:20,代码来源:ReadOnly.php
示例8: indexAction
public function indexAction()
{
/* @var $invoice Invoice */
$invoice = $this->getDi()->invoiceTable->findBySecureId($this->getParam('secure_id'), 'payment-link');
if (!$invoice || $invoice->status != Invoice::PENDING) {
throw new Am_Exception_InternalError(sprintf('Unknow invoice [%s] or invoice is already processed', filterId($this->getParam('secure_id'))));
}
if (!$invoice->due_date && sqlDate($invoice->tm_added) < sqlDate("-" . Invoice::DEFAULT_DUE_PERIOD . " days")) {
throw new Am_Exception_InputError(___('Invoice is expired'));
} elseif ($invoice->due_date && $invoice->due_date < sqlDate('now')) {
throw new Am_Exception_InputError(___('Invoice is expired'));
}
$form = new Am_Form();
if (!$invoice->paysys_id) {
$psOptions = array();
foreach (Am_Di::getInstance()->paysystemList->getAllPublic() as $ps) {
$psOptions[$ps->getId()] = $this->renderPaysys($ps);
}
$paysys = $form->addAdvRadio('paysys_id')->setLabel(___('Payment System'))->loadOptions($psOptions);
$paysys->addRule('required', ___('Please choose a payment system'));
if (count($psOptions) == 1) {
$paysys->toggleFrozen(true);
}
}
$form->addSaveButton(___('Pay'));
$this->view->invoice = $invoice;
$this->view->form = $form;
$form->setDataSources(array($this->getRequest()));
if ($form->isSubmitted() && $form->validate()) {
$vars = $form->getValue();
if (!$invoice->paysys_id) {
$invoice->setPaysystem($vars['paysys_id']);
$invoice->save();
}
$payProcess = new Am_Paysystem_PayProcessMediator($this, $invoice);
$result = $payProcess->process();
throw new Am_Exception_InternalError(sprintf('Error occurred while trying proccess invoice [%s]', filterId($invoice->public_id)));
}
$this->view->layoutNoMenu = true;
$this->view->display('pay.phtml');
}
开发者ID:grlf,项目名称:eyedock,代码行数:41,代码来源:PayController.php
示例9: __call
public function __call($methodName, $args)
{
$pluginId = filterId($this->_request->getUserParam('plugin_id'));
$this->_request->setActionName(filterId($this->_request->getActionName()));
if (!$pluginId) {
throw new Am_Exception_InputError("Internal Error: wrong URL used - no plugin id");
}
$type = $this->_request->getUserParam('type');
if (!$this->getDi()->plugins->offsetGet($type)) {
throw new Am_Exception_InternalError("Wrong [type] requested");
}
$pluginMgr = $this->getDi()->plugins[$type];
if (!$pluginMgr->isEnabled($pluginId)) {
throw new Am_Exception_InputError("The [{$pluginId}] plugin is disabled");
}
$ps = $pluginMgr->loadGet($pluginId);
if (!$ps->isConfigured()) {
throw new Am_Exception_Configuration("The plugin [{$pluginId}] is not configured, directAction failed");
}
return $ps->directAction($this->_request, $this->_response, $this->_invokeArgs);
}
开发者ID:grlf,项目名称:eyedock,代码行数:21,代码来源:DirectController.php
示例10: indexAction
public function indexAction()
{
$this->_request->setParam('page', 'cart');
$this->p = filterId($this->_request->getParam('page'));
$this->initSetupForms();
$this->form = $this->getForm($this->p, false);
$this->form->prepare();
if ($this->form->isSubmitted()) {
$this->form->setDataSources(array($this->_request));
if ($this->form->validate() && $this->form->saveConfig()) {
Am_Controller::redirectLocation($this->getUrl());
}
} else {
$this->form->setDataSources(array(new HTML_QuickForm2_DataSource_Array($this->getConfigValues()), new HTML_QuickForm2_DataSource_Array($this->form->getDefaults())));
}
$this->view->assign('p', $this->p);
$this->form->replaceDotInNames();
$this->view->assign('pageObj', $this->form);
$this->view->assign('form', $this->form);
$this->view->display('admin/cart/config.phtml');
}
开发者ID:grlf,项目名称:eyedock,代码行数:21,代码来源:AdminShoppingCartController.php
示例11: initLocale
/**
* Find out locale from the request, settings or session
* if language choice enabled, try the following:
* - REQUEST parameter "lang"
* - SESSION parameter "lang"
* - Am_App::getUser->lang
* - default in App
* - en_US
* else use latter 2
*/
static function initLocale(Am_Di $di)
{
if (defined('AM_ADMIN') && AM_ADMIN) {
Zend_Locale::setDefault('en_US');
} else {
$possibleLang = array();
if ($di->config->get('lang.display_choice')) {
$auth = $di->auth;
$user = $auth->getUserId() ? $auth->getUser() : null;
if (!empty($_REQUEST['_lang'])) {
$possibleLang[] = filterId($_REQUEST['_lang']);
} elseif (!empty($di->session->lang)) {
$possibleLang[] = $di->session->lang;
} elseif ($user && $user->lang) {
$possibleLang[] = $user->lang;
}
$br = Zend_Locale::getBrowser();
arsort($br);
$possibleLang = array_merge($possibleLang, array_keys($br));
}
$possibleLang[] = $di->config->get('lang.default', 'en_US');
$possibleLang[] = 'en_US';
// last but not least
// now choose the best candidate
$enabledLangs = $di->config->get('lang.enabled', array());
$checked = array();
foreach ($possibleLang as $lc) {
list($lang) = explode('_', $lc, 2);
if (!in_array($lc, $enabledLangs) && !in_array($lang, $enabledLangs)) {
continue;
}
if ($lc == $lang) {
// we have not got entire locale,guess it
if ($lc == 'en') {
$lc = 'en_US';
} elseif ($lc == 'sv') {
$lc = 'sv_SE';
} elseif ($lc == 'et') {
$lc = 'et_EE';
} elseif ($lc == 'vi') {
$lc = 'vi_VN';
} else {
$lc = Zend_Locale::getLocaleToTerritory($lang);
}
if (!$lc && $lang == 'ko') {
$lc = 'ko_KR';
}
if (!$lc && $lang == 'ja') {
$lc = 'ja_JP';
}
if (!$lc && $lang == 'nb') {
$lc = 'nb_NO';
}
if (!$lc && $lang == 'zh') {
$lc = 'zh_Hans';
}
if (!$lc && $lang == 'el') {
$lc = 'el_GR';
}
if (!$lc && $lang == 'he') {
$lc = 'he_IL';
}
if (!$lc && $lang == 'da') {
$lc = 'da_DK';
}
if (!$lc && $lang == 'cs') {
$lc = 'cs_CZ';
}
if (!$lc && $lang == 'sq') {
$lc = 'sq_AL';
}
if (!$lc) {
continue;
}
}
if (isset($checked[$lc])) {
continue;
}
$checked[$lc] = true;
// check if locale file is exists
$lc = preg_replace('/[^A-Za-z0-9_]/', '', $lc);
if (!Zend_Locale::isLocale($lc)) {
continue;
}
Zend_Locale::setDefault($lc);
// then update user if it was request
// and set to session
break;
}
if ($di->config->get('lang.display_choice') && !empty($_REQUEST['_lang'])) {
//.........这里部分代码省略.........
开发者ID:grlf,项目名称:eyedock,代码行数:101,代码来源:Locale.php
示例12: getFormByTitle
/** @return Am_Form_Setup */
function getFormByTitle($title)
{
foreach ($this->forms as $f) {
if ($f->getTitle() == $title) {
return $f;
}
}
$form = new Am_Form_Setup(strtolower(filterId($title)));
$form->setTitle($title);
$this->addForm($form);
return $form;
}
开发者ID:alexanderTsig,项目名称:arabic,代码行数:13,代码来源:AdminSetupController.php
示例13: setCvv
function setCvv($code)
{
$this->_cc_code = filterId($code);
}
开发者ID:irovast,项目名称:eyedock,代码行数:4,代码来源:CcRecord.php
示例14: filterId
/**
* Filter key value
*/
function filterId($id)
{
return $this->_keyIsInt ? intval($id) : filterId($id);
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:7,代码来源:Record.php
示例15: loadGet
function loadGet($name, $throwExceptions = true)
{
$name = filterId($name);
if ($this->isEnabled($name) && $this->load($name)) {
return $this->get($name);
}
if ($throwExceptions) {
throw new Am_Exception_InternalError("Could not loadGet([{$name}])");
}
}
开发者ID:alexanderTsig,项目名称:arabic,代码行数:10,代码来源:App.php
示例16: getPage
public function getPage($id)
{
$id = filterId($id);
if (!array_key_exists($id, $this->pages)) {
throw new Am_Exception_InternalError("Could not find page[{$id}]");
}
return $this->pages[$id];
}
开发者ID:grlf,项目名称:eyedock,代码行数:8,代码来源:Pages.php
示例17: getSessionIdFromCookie
/**
* Get Session ID from Cookie;
* @return string
*/
function getSessionIdFromCookie()
{
return ($session_id = filterId($this->getDi()->request->getCookie($this->getSessionCookieName()))) ? $session_id : null;
}
开发者ID:grlf,项目名称:eyedock,代码行数:8,代码来源:SessionTable.php
示例18: sendRequest
public function sendRequest($method, $params)
{
$this->vars = $params;
$this->vars['apikey'] = $this->plugin->getConfig('api_key');
$this->vars['method'] = $method;
list($_, $server) = explode('-', $this->plugin->getConfig('api_key'), 2);
$server = filterId($server);
if (empty($server)) {
throw new Am_Exception_Configuration("Wrong API Key set for MailChimp");
}
$url = sprintf('http://%s.api.mailchimp.com/1.3/', $server);
$url .= '?' . http_build_query($this->vars, '', '&');
$this->setUrl($url);
$ret = parent::send();
if ($ret->getStatus() != '200') {
throw new Am_Exception_InternalError("MailChimp API Error, is configured API Key is wrong");
}
$arr = json_decode($ret->getBody(), true);
if (!$arr) {
throw new Am_Exception_InternalError("MailChimp API Error - unknown response [" . $ret->getBody() . "]");
}
if (isset($arr['error'])) {
Am_Di::getInstance()->errorLogTable->log("MailChimp API Error - [" . $arr['error'] . "]");
return false;
}
return $arr;
}
开发者ID:grlf,项目名称:eyedock,代码行数:27,代码来源:mailchimp.php
示例19: autoCreate
protected function autoCreate()
{
try {
$invoiceId = $this->findInvoiceId();
if ($invoiceId === null) {
throw new Am_Exception_Paysystem_TransactionEmpty("Looks like an invalid IPN post - no Invoice# passed");
}
$invoiceId = filterId($invoiceId);
if (!strlen($invoiceId)) {
throw new Am_Exception_Paysystem_TransactionInvalid("Could not load Invoice related to this transaction, passed id is not a valid Invoice#[{$invoiceId}]");
}
if (!($this->invoice = $this->loadInvoice($invoiceId))) {
throw new Am_Exception_Paysystem_TransactionUnknown("Unknown transaction: related invoice not found #[{$invoiceId}]");
}
} catch (Am_Exception_Paysystem $e) {
if (!$this->plugin->getConfig('auto_create')) {
throw $e;
}
// try auto-create invoice
$invoice = $this->autoCreateInvoice();
if ($invoice) {
$this->invoice = $invoice;
} else {
throw $e;
}
}
$this->time = $this->findTime();
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:28,代码来源:Incoming.php
示例20: cancelPaymentAction
public function cancelPaymentAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
{
$id = $request->getFiltered('id');
if (!$id && isset($_GET['id'])) {
$id = filterId($_GET['id']);
}
$invoice = $this->getDi()->invoiceTable->findFirstByPublicId($id);
if (!$invoice) {
throw new Am_Exception_InputError("No invoice found [{$id}]");
}
if ($invoice->user_id != $this->getDi()->auth->getUserId()) {
throw new Am_Exception_InternalError("User tried to access foreign invoice: [{$id}]");
}
$this->invoice = $invoice;
// find invoice and redirect to default "cancel" page
$response->setRedirect($this->getCancelUrl());
}
开发者ID:grlf,项目名称:eyedock,代码行数:17,代码来源:CreditCard.php
注:本文中的filterId函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论