当前位置: 首页>>代码示例>>PHP>>正文


PHP Director::forceSSL方法代码示例

本文整理汇总了PHP中Director::forceSSL方法的典型用法代码示例。如果您正苦于以下问题:PHP Director::forceSSL方法的具体用法?PHP Director::forceSSL怎么用?PHP Director::forceSSL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Director的用法示例。


在下文中一共展示了Director::forceSSL方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 /**
  * Force SSL on live site.
  */
 public function init()
 {
     if (Director::isLive()) {
         Director::forceSSL();
     }
     parent::init();
 }
开发者ID:helpfulrobot,项目名称:govtnz-replicant,代码行数:10,代码来源:ReplicantController.php

示例2: init

 /**
  * Initialisierung
  *
  * @return void
  *
  * @author Sascha Koehler <skoehler@pixeltricks.de>
  * @since 02.12.2010
  */
 public function init()
 {
     if (SilvercartConfig::EnableSSL()) {
         Director::forceSSL();
     }
     parent::init();
 }
开发者ID:silvercart,项目名称:silvercart,代码行数:15,代码来源:SilvercartPaymentNotification.php

示例3: testForceSSLAlternateDomain

 public function testForceSSLAlternateDomain()
 {
     Config::inst()->update('Director', 'alternate_base_url', '/');
     $_SERVER['REQUEST_URI'] = Director::baseURL() . 'admin';
     $output = Director::forceSSL(array('/^admin/'), 'secure.mysite.com');
     $this->assertEquals($output, 'https://secure.mysite.com/admin');
 }
开发者ID:maent45,项目名称:redefine_renos,代码行数:7,代码来源:DirectorTest.php

示例4: testForceSSLWithPatternDoesNotMatchOtherPages

 public function testForceSSLWithPatternDoesNotMatchOtherPages()
 {
     $_SERVER['REQUEST_URI'] = Director::baseURL() . 'normal-page';
     $output = Director::forceSSL(array('/^admin/'));
     $this->assertFalse($output);
     $_SERVER['REQUEST_URI'] = Director::baseURL() . 'just-another-page/sub-url';
     $output = Director::forceSSL(array('/^admin/', '/^Security/'));
     $this->assertFalse($output);
 }
开发者ID:normann,项目名称:sapphire,代码行数:9,代码来源:DirectorTest.php

示例5: init

 /**
  * statements to be called on object initialisation
  *
  * @author Roland Lehmann <rlehmann@pixeltricks.de>
  * @since 18.11.2010
  * @return void
  */
 public function init()
 {
     if (SilvercartConfig::EnableSSL()) {
         Director::forceSSL();
     }
     Session::clear("redirect");
     //if customer has been to the checkout yet this is set to direct him back to the checkout after address editing
     parent::init();
     $this->registerCustomHtmlForm('SilvercartLoginForm', new SilvercartLoginForm($this));
 }
开发者ID:silvercart,项目名称:silvercart,代码行数:17,代码来源:SilvercartMyAccountHolder.php

示例6:

global $project;
$project = 'mysite';
global $database;
//!!! YOU HAVE TO DEFINE YOUR DATABASE FIRST, MAN. !!!
$database = 'iowa-parents';
// Use _ss_environment.php file for configuration
require_once "conf/ConfigureFromEnv.php";
// Set the site locale
i18n::set_locale('en_US');
FulltextSearchable::enable();
// Enable nested URLs for this site (e.g. page/sub-page/)
if (class_exists('SiteTree')) {
    SiteTree::enable_nested_urls();
}
if (Director::isLive()) {
    Director::forceSSL();
}
Requirements::set_force_js_to_bottom(true);
// add a button to remove formatting
HtmlEditorConfig::get('cms')->insertButtonsBefore('styleselect', 'removeformat');
// tell the button which tags it may remove
HtmlEditorConfig::get('cms')->setOption('removeformat_selector', 'b,strong,em,i,span,ins');
//remove font->span conversion
HtmlEditorConfig::get('cms')->setOption('convert_fonts_to_spans', 'false,');
HtmlEditorConfig::get('cms')->setOptions(array('valid_elements' => "@[id|class|style|title],#a[id|rel|rev|dir|tabindex|accesskey|type|name|href|target|title|class],-strong/-b[class],-em/-i[class],-strike[class],-u[class],#p[id|dir|class|align|style],-ol[class],-ul[class],-li[class],br,img[id|dir|longdesc|usemap|class|src|border|alt=|title|width|height|align],-sub[class],-sup[class],-blockquote[dir|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|dir|id|style],-tr[id|dir|class|rowspan|width|height|align|valign|bgcolor|background|bordercolor|style],tbody[id|class|style],thead[id|class|style],tfoot[id|class|style],#td[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],-th[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],caption[id|dir|class],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|dir|class|align|style],hr[class],dd[id|class|title|dir],dl[id|class|title|dir],dt[id|class|title|dir],@[id,style,class],small", 'extended_valid_elements' => "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|usemap],#iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling],object[width|height|data|type],param[name|value],map[class|name|id],area[shape|coords|href|target|alt]"));
// TinyMCE cleanup on paste
HtmlEditorConfig::get('cms')->setOption('paste_auto_cleanup_on_paste', 'true');
HtmlEditorConfig::get('cms')->setOption('paste_remove_styles', 'true');
HtmlEditorConfig::get('cms')->setOption('paste_remove_styles_if_webkit', 'true');
HtmlEditorConfig::get('cms')->setOption('paste_strip_class_attributes', 'true');
GD::set_default_quality(80);
开发者ID:StudentLifeMarketingAndDesign,项目名称:iowa-parents,代码行数:31,代码来源:_config.php

示例7: force_ssl

 /**
  * Forces HTTPS mode if set in the configuration
  */
 private static function force_ssl()
 {
     $mode = self::config()->force_ssl;
     if (!is_bool($mode)) {
         user_error("Expected boolean in SSPSecurity::force_ssl", E_USER_ERROR);
     }
     if ($mode) {
         Director::forceSSL(null, $_SERVER['HTTP_HOST']);
     }
 }
开发者ID:helpfulrobot,项目名称:antons-silverstripe-ssp,代码行数:13,代码来源:SSPSecurity.php

示例8: init

 /**
  * Initializes the step form. Includes forms and requirements.
  *
  * @return void
  *
  * @author Sebastian Diel <sdiel@pixeltricks.de>,
  *         Sascha Koehler <skoehler@pixeltricks.de>
  * @since 15.11.2014
  */
 public function init()
 {
     $this->preferences['templateDir'] = PIXELTRICKS_CHECKOUT_BASE_PATH_REL . 'templates/Layout/';
     if (SilvercartConfig::EnableSSL()) {
         Director::forceSSL();
     }
     parent::init();
     // Inject payment and shippingmethods to shoppingcart, if available
     $member = SilvercartCustomer::currentUser();
     if ($member) {
         $stepData = $this->getCombinedStepData();
         $shoppingCart = $member->getCart();
         // If minimum order value is set and shoppingcart value is below we
         // have to redirect the customer to the shoppingcart page and set
         // an appropriate error message.
         if ($this->getCurrentStep() < 5 && SilvercartConfig::UseMinimumOrderValue() && SilvercartConfig::MinimumOrderValue() && SilvercartConfig::MinimumOrderValue()->getAmount() > $shoppingCart->getAmountTotalWithoutFees()->getAmount()) {
             $silvercartSessionErrors = Session::get('Silvercart.errors');
             $silvercartSessionErrors[] = sprintf(_t('SilvercartShoppingCart.ERROR_MINIMUMORDERVALUE_NOT_REACHED'), SilvercartConfig::MinimumOrderValue()->Nice());
             Session::set('Silvercart.errors', $silvercartSessionErrors);
             Session::save();
             $this->redirect(SilvercartPage_Controller::PageByIdentifierCode('SilvercartCartPage')->Link());
         }
         if (isset($stepData['ShippingMethod'])) {
             $shoppingCart->setShippingMethodID($stepData['ShippingMethod']);
         }
         if (isset($stepData['PaymentMethod'])) {
             $shoppingCart->setPaymentMethodID($stepData['PaymentMethod']);
         }
         $requestParams = $this->getRequest()->allParams();
         if ($requestParams['Action'] == 'editAddress') {
             $addressID = (int) $requestParams['ID'];
             $membersAddresses = SilvercartCustomer::currentUser()->SilvercartAddresses();
             $membersAddress = $membersAddresses->find('ID', $addressID);
             if ($membersAddress instanceof SilvercartAddress && $membersAddress->exists()) {
                 Session::set("redirect", $this->Link());
                 $preferences = array();
                 $preferences['submitAction'] = 'editAddress/' . $addressID . '/customHtmlFormSubmit';
                 $this->registerCustomHtmlForm('SilvercartEditAddressForm', new SilvercartEditAddressForm($this, array('addressID' => $addressID), $preferences));
             }
         } elseif ($requestParams['Action'] == 'addNewAddress') {
             Session::set("redirect", $this->Link());
             $preferences = array();
             $preferences['submitAction'] = 'addNewAddress/customHtmlFormSubmit';
             $this->registerCustomHtmlForm('SilvercartAddAddressForm', new SilvercartAddAddressForm($this, array(), $preferences));
         }
     }
 }
开发者ID:silvercart,项目名称:silvercart,代码行数:56,代码来源:SilvercartCheckoutStep.php

示例9: array

// Use _ss_environment.php file for configuration
require_once "conf/ConfigureFromEnv.php";
// Register custom site configuration extension
DataObject::add_extension('SiteConfig', 'CustomSiteConfig');
// Set the site locale
i18n::set_locale('en_US');
//Turn on Silverstripe Translation
Object::add_extension('SiteTree', 'Translatable');
Object::add_extension('SiteConfig', 'Translatable');
Translatable::set_allowed_locales(array('en_US', 'de_DE', 'es_ES', 'ja_JP'));
//Turn on Silverstripe Translation
// Search index for Orgs
Object::add_extension('Org', 'AutocompleteOrgDecorator');
// Enable SSL for specific subdomains
if (Director::isLive()) {
    Director::forceSSL(array('/^Security/', '/^profile/', '/^join/', '/^user-survey/', '/^summit/', '/^news-manage/', '/^vote-vancouver/'));
}
// Email errors and warnings
global $email_log;
SS_Log::add_writer(new SS_LogFileWriter(Director::baseFolder() . '/logs/site.log'), SS_Log::ERR);
$email_log_writer = new Custom_SS_LogEmailWriter($email_log);
$email_log_writer->setFormatter(new SS_CustomLogErrorEmailFormatter());
SS_Log::add_writer($email_log_writer, SS_Log::ERR, '<=');
// Default From address for email
global $email_from;
Config::inst()->update('Email', 'admin_email', $email_from);
//Register Shortcodes
ShortcodeParser::get()->register('Sched', array('Page', 'SchedShortCodeHandler'));
ShortcodeParser::get()->register('outlink', array('Page', 'ExternalLinkShortCodeHandler'));
ShortcodeParser::get()->register('icon', array('Page', 'IconShortCodeHandler'));
//cache configuration
开发者ID:Thingee,项目名称:openstack-org,代码行数:31,代码来源:_config.php

示例10: init

 /**
  * initialisation of the form object
  * logged in members get logged out
  *
  * @author Sascha Koehler <skoehler@pixeltricks.de> Roland Lehmann <rlehmann@pixeltricks.de>
  * @since 20.10.2010
  * @return void
  */
 public function init()
 {
     if (SilvercartConfig::EnableSSL()) {
         Director::forceSSL();
     }
     $this->registerCustomHtmlForm('SilvercartRegisterRegularCustomerForm', new SilvercartRegisterRegularCustomerForm($this));
     parent::init();
 }
开发者ID:silvercart,项目名称:silvercart,代码行数:16,代码来源:SilvercartRegistrationPage.php


注:本文中的Director::forceSSL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。