本文整理汇总了PHP中sfWebRequest::isSecure方法的典型用法代码示例。如果您正苦于以下问题:PHP sfWebRequest::isSecure方法的具体用法?PHP sfWebRequest::isSecure怎么用?PHP sfWebRequest::isSecure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfWebRequest
的用法示例。
在下文中一共展示了sfWebRequest::isSecure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeWidgetOuter
public function executeWidgetOuter(sfWebRequest $request)
{
$this->fetchWidget();
$petition = $this->widget['Petition'];
/* @var $petition Petition */
$petition_text = $this->widget['PetitionText'];
/* @var $petition_text PetitionText */
$this->count = $petition->getCount(60);
$this->target = $this->count . '-' . Petition::calcTarget($this->count, $this->widget->getPetition()->getTargetNum());
$image_prefix = ($request->isSecure() ? 'https://' : 'http://') . $request->getHost() . '/' . $request->getRelativeUrlRoot() . 'images/';
$this->kind = $this->widget->getPetition()->getKind();
$this->lang = $this->widget->getPetitionText()->getLanguageId();
$this->getUser()->setCulture($this->lang);
$this->label_mode = $this->widget->getPetition()->getLabelMode();
$stylings = json_decode($this->widget->getStylings(), true);
if (!is_array($stylings)) {
$stylings = array();
}
$widget_colors = $petition->getWidgetIndividualiseDesign();
foreach (array('title_color', 'body_color', 'button_color', 'bg_left_color', 'bg_right_color', 'form_title_color') as $style) {
if (!$widget_colors || !isset($stylings[$style]) || !$stylings[$style]) {
$stylings[$style] = $petition['style_' . $style];
}
}
$this->stylings = $stylings;
$this->keyvisual = $this->widget->getPetition()->getKeyVisual() ? $image_prefix . 'keyvisual/' . $this->widget->getPetition()->getKeyVisual() : null;
$this->sprite = $image_prefix . 'policat.spr.png';
$this->url = $this->getContext()->getRouting()->generate('sign', array('id' => $this->widget['id'], 'hash' => $this->widget->getLastHash(true)), true);
$this->getResponse()->setContentType('text/javascript');
$this->setLayout(false);
$title = $this->widget->getTitle();
if (!$petition->getWidgetIndividualiseText()) {
$title = $petition_text->getTitle();
}
$this->title = Util::enc($title);
}
示例2: executeVncviewer
public function executeVncviewer(sfWebRequest $request)
{
if ($request->getParameter('sleep')) {
$tsleep = $request->getParameter('sleep');
sleep($tsleep);
}
$etva_server = EtvaServerPeer::retrieveByPk($request->getParameter('id'));
if (!$etva_server) {
return sfView::NONE;
}
$etva_node = $etva_server->getEtvaNode();
$user = $this->getUser();
$tokens = $user->getGuardUser()->getEtvaVncTokens();
$this->username = $tokens[0]->getUsername();
$this->token = $tokens[0]->getToken();
$proxyhost1 = $request->getHost();
$proxyhost1_arr = split(':', $proxyhost1);
$proxyhost1 = $proxyhost1_arr[0];
$proxyport1 = $request->isSecure() ? 443 : 80;
//$proxyport1 = 80;
if ($proxyhost1_arr[1]) {
$proxyport1 = $proxyhost1_arr[1];
}
$this->proxyhost1 = $proxyhost1;
$this->proxyport1 = $proxyport1;
$this->socketFactory = $request->isSecure() ? 'AuthHTTPSConnectSSLSocketFactory' : 'AuthHTTPConnectSocketFactory';
$this->host = $etva_node->getIp();
//if host is localhost address then is the same machine
if ($this->host == '127.0.0.1') {
$this->host = $proxyhost1;
}
$this->port = $etva_server->getVncPort();
$response = $this->getResponse();
$response->setTitle($etva_server->getName() . ' :: Console');
}