本文整理汇总了PHP中Am_Controller::setCookie方法的典型用法代码示例。如果您正苦于以下问题:PHP Am_Controller::setCookie方法的具体用法?PHP Am_Controller::setCookie怎么用?PHP Am_Controller::setCookie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Am_Controller
的用法示例。
在下文中一共展示了Am_Controller::setCookie方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initSetupForm
protected function _initSetupForm(Am_Form_Setup $form)
{
$url = 'https://auth.aweber.com/1.0/oauth/authorize_app/' . self::APP_ID;
$el = $form->addTextarea('auth', array('cols' => 80, 'rows' => 4))->setLabel("aWeber App Authorization Code\n" . "get it on <a target='_blank' href='{$url}'>aWeber Website</a>");
$el->addRule('regex', 'Invalid value', '/^[a-zA-Z0-9]+\\|[a-zA-Z0-9]+\\|[a-zA-Z0-9]+\\|[a-zA-Z0-9]+\\|[a-zA-Z0-9]+\\|\\s*$/');
if ($this->getConfig('auth') && !$this->getConfig('access.access_token')) {
if (!empty($_GET['oauth_token'])) {
$api = $this->getApi();
$api->user->tokenSecret = $_COOKIE['requestTokenSecret'];
$api->user->requestToken = $_GET['oauth_token'];
$api->user->verifier = $_GET['oauth_verifier'];
list($accessToken, $accessTokenSecret) = $api->getAccessToken();
$this->getDi()->config->saveValue('newsletter.aweber.access', array('access_token' => $accessToken, 'access_secret' => $accessTokenSecret));
Am_Controller::redirectLocation(REL_ROOT_URL . "/admin-setup/aweber");
return;
} else {
$api = $this->getApi();
$callbackUrl = Am_Controller::getFullUrl();
try {
list($requestToken, $requestTokenSecret) = $api->getRequestToken($callbackUrl);
Am_Controller::setCookie('requestTokenSecret', $requestTokenSecret);
$form->addStatic()->setLabel('Access Tokens')->setContent(sprintf('Access tokens are empty or expired, %sclick this link%s to update', '<a href="' . Am_Controller::escape($api->getAuthorizeUrl()) . '">', '</a>'));
} catch (Exception $e) {
$this->getDi()->errorLogTable->logException($e);
$form->addStatic()->setLabel('Access Tokens')->setContent('Plugin configuration error. Got an error from API: ' . $e->getMessage());
}
}
}
$fields = $this->getDi()->userTable->getFields(true);
unset($fields['email']);
unset($fields['name_f']);
unset($fields['name_l']);
$ff = $form->addMagicSelect('fields')->setLabel("Pass additional fields to AWeber\nfields must be configured in AWeber with exactly same titles\nelse API calls will fail and users will not be added\n\nBy default the plugin passes \"email\" and \"name\"\nfields to Aweber, so usually you do not need to select \nthat fields to send as additional fields.\n");
$ff->loadOptions(array_combine($fields, $fields));
}
示例2: wp_clear_auth_cookie
function wp_clear_auth_cookie()
{
$cookie_domain = @$_SERVER['HTTP_HOST'];
Am_Controller::setCookie($this->AUTH_COOKIE, ' ', time() - 31536000, $this->ADMIN_COOKIE_PATH, $cookie_domain);
Am_Controller::setCookie($this->SECURE_AUTH_COOKIE, ' ', time() - 31536000, $this->ADMIN_COOKIE_PATH, $cookie_domain);
Am_Controller::setCookie($this->AUTH_COOKIE, ' ', time() - 31536000, $this->PLUGINS_COOKIE_PATH, $cookie_domain);
Am_Controller::setCookie($this->SECURE_AUTH_COOKIE, ' ', time() - 31536000, $this->PLUGINS_COOKIE_PATH, $cookie_domain);
Am_Controller::setCookie($this->LOGGED_IN_COOKIE, ' ', time() - 31536000, $this->COOKIE_PATH, $cookie_domain);
Am_Controller::setCookie($this->LOGGED_IN_COOKIE, ' ', time() - 31536000, $this->SITECOOKIEPATH, $cookie_domain);
// Old cookies
Am_Controller::setCookie($this->AUTH_COOKIE, ' ', time() - 31536000, $this->COOKIE_PATH, $cookie_domain);
Am_Controller::setCookie($this->AUTH_COOKIE, ' ', time() - 31536000, $this->SITECOOKIEPATH, $cookie_domain);
Am_Controller::setCookie($this->SECURE_AUTH_COOKIE, ' ', time() - 31536000, $this->COOKIE_PATH, $cookie_domain);
Am_Controller::setCookie($this->SECURE_AUTH_COOKIE, ' ', time() - 31536000, $this->SITECOOKIEPATH, $cookie_domain);
}
示例3: onAuthAfterLogout
function onAuthAfterLogout(Am_Event_AuthAfterLogout $event)
{
$this->deleteCookieFiles();
Am_Controller::setCookie(self::NR_COOKIE, null, time() - 36000, '/', $this->getDi()->request->getHttpHost());
}
示例4: onAuthAfterLogout
function onAuthAfterLogout(Am_Event_AuthAfterLogout $event)
{
Am_Controller::setCookie('fbsr_' . $this->getConfig('app_id'), null, time() - 3600 * 24, "/");
Am_Controller::setCookie('fbs_' . $this->getConfig('app_id'), null, time() - 3600 * 24, "/");
$this->getSession()->unsetAll();
}
示例5: setCookie
function setCookie(User $aff, $banner, $aff_click_id = null)
{
$tm = $this->getDi()->time + $this->getDi()->config->get('aff.cookie_lifetime', 30) * 3600 * 24;
$val = base64_encode($aff->login);
$val .= '-' . ($banner ? $banner->pk() : "0");
if ($aff_click_id) {
$val .= '-' . $this->encodeClickId($aff_click_id);
}
Am_Controller::setCookie(self::COOKIE_NAME, $val, $tm, '/', $_SERVER['HTTP_HOST']);
}
示例6: onAuthAfterLogout
function onAuthAfterLogout(Am_Event_AuthAfterLogout $event)
{
$domain = Zend_Controller_Front::getInstance()->getRequest()->getHttpHost();
Am_Controller::setCookie('fbsr_' . $this->getConfig('app_id'), null, time() - 3600 * 24, "/");
Am_Controller::setCookie('fbm_' . $this->getConfig('app_id'), null, time() - 3600 * 24, "/");
Am_Controller::setCookie('fbsr_' . $this->getConfig('app_id'), null, time() - 3600 * 24, "/", $domain, false);
Am_Controller::setCookie('fbm_' . $this->getConfig('app_id'), null, time() - 3600 * 24, "/", $domain, false);
$event->getUser()->data()->set(self::FACEBOOK_LOGOUT, true)->update();
}
示例7: wp_clear_auth_cookie
function wp_clear_auth_cookie()
{
Am_Controller::setCookie($this->AUTH_COOKIE, ' ', time() - 31536000, $this->ADMIN_COOKIE_PATH);
Am_Controller::setCookie($this->SECURE_AUTH_COOKIE, ' ', time() - 31536000, $this->ADMIN_COOKIE_PATH);
Am_Controller::setCookie($this->AUTH_COOKIE, ' ', time() - 31536000, $this->PLUGINS_COOKIE_PATH);
Am_Controller::setCookie($this->SECURE_AUTH_COOKIE, ' ', time() - 31536000, $this->PLUGINS_COOKIE_PATH);
Am_Controller::setCookie($this->LOGGED_IN_COOKIE, ' ', time() - 31536000, $this->COOKIE_PATH);
Am_Controller::setCookie($this->LOGGED_IN_COOKIE, ' ', time() - 31536000, $this->SITECOOKIEPATH);
// Old cookies
Am_Controller::setCookie($this->AUTH_COOKIE, ' ', time() - 31536000, $this->COOKIE_PATH);
Am_Controller::setCookie($this->AUTH_COOKIE, ' ', time() - 31536000, $this->SITECOOKIEPATH);
Am_Controller::setCookie($this->SECURE_AUTH_COOKIE, ' ', time() - 31536000, $this->COOKIE_PATH);
Am_Controller::setCookie($this->SECURE_AUTH_COOKIE, ' ', time() - 31536000, $this->SITECOOKIEPATH);
}
示例8: setKeywordCookie
function setKeywordCookie(User $aff, $keyword = null)
{
$tm = $this->getDi()->time + $this->getDi()->config->get('aff.cookie_lifetime', 30) * 3600 * 24;
if (!is_null($keyword)) {
Am_Controller::setCookie(sprintf("%s-%s", self::COOKIE_NAME, md5($aff->login)), base64_encode($keyword), $tm, '/', $_SERVER['HTTP_HOST']);
}
}
示例9: onInitFinished
public function onInitFinished()
{
// Do not track anything for admin pages or if tracking is disabled.
if (defined('AM_ADMIN') || !$this->getConfig('ecommerce_tracking')) {
return;
}
// mailchimp send two variables via get: mc_cid, and mc_eid both should be set in cookies.
if ($mc_cid = $this->getDi()->request->getFiltered('mc_cid')) {
Am_Controller::setCookie('mc_cid', $mc_cid, time() + 3600 * 24 * 30);
}
if ($mc_eid = $this->getDi()->request->getFiltered('mc_eid')) {
Am_Controller::setCookie('mc_eid', $mc_eid, time() + 3600 * 24 * 30);
}
}