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


PHP CRM_Utils_System::redirectToSSL方法代码示例

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


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

示例1: edit

 /** 
  * This function is called when action is update or new 
  *  
  * return null 
  * @access public 
  */
 function edit()
 {
     // set https for offline cc transaction
     $mode = CRM_Utils_Request::retrieve('mode', 'String', $this);
     if ($mode == 'test' || $mode == 'live') {
         CRM_Utils_System::redirectToSSL();
     }
     // build associated contributions
     $this->associatedContribution();
     $controller =& new CRM_Core_Controller_Simple('CRM_Event_Form_Participant', 'Create Participation', $this->_action);
     $controller->setEmbedded(true);
     $controller->set('id', $this->_id);
     $controller->set('cid', $this->_contactId);
     return $controller->run();
 }
开发者ID:bhirsch,项目名称:civicrm,代码行数:21,代码来源:Tab.php

示例2: runItem

 /**
  * Given a menu item, call the appropriate controller and return the response
  *
  * @param array $item see CRM_Core_Menu
  * @return string, HTML
  */
 public static function runItem($item)
 {
     $config = CRM_Core_Config::singleton();
     if ($config->userFramework == 'Joomla' && $item) {
         $config->userFrameworkURLVar = 'task';
         // joomla 1.5RC1 seems to push this in the POST variable, which messes
         // QF and checkboxes
         unset($_POST['option']);
         CRM_Core_Joomla::sidebarLeft();
     }
     // set active Component
     $template = CRM_Core_Smarty::singleton();
     $template->assign('activeComponent', 'CiviCRM');
     $template->assign('formTpl', 'default');
     if ($item) {
         // CRM-7656 - make sure we send a clean sanitized path to create printer friendly url
         $printerFriendly = CRM_Utils_System::makeURL('snippet', FALSE, FALSE, CRM_Utils_Array::value('path', $item)) . '2';
         $template->assign('printerFriendly', $printerFriendly);
         if (!array_key_exists('page_callback', $item)) {
             CRM_Core_Error::debug('Bad item', $item);
             CRM_Core_Error::fatal(ts('Bad menu record in database'));
         }
         // check that we are permissioned to access this page
         if (!CRM_Core_Permission::checkMenuItem($item)) {
             CRM_Utils_System::permissionDenied();
             return;
         }
         // check if ssl is set
         if (CRM_Utils_Array::value('is_ssl', $item)) {
             CRM_Utils_System::redirectToSSL();
         }
         if (isset($item['title'])) {
             CRM_Utils_System::setTitle($item['title']);
         }
         if (isset($item['breadcrumb']) && !isset($item['is_public'])) {
             CRM_Utils_System::appendBreadCrumb($item['breadcrumb']);
         }
         $pageArgs = NULL;
         if (CRM_Utils_Array::value('page_arguments', $item)) {
             $pageArgs = CRM_Core_Menu::getArrayForPathArgs($item['page_arguments']);
         }
         $template = CRM_Core_Smarty::singleton();
         if (!empty($item['is_public'])) {
             $template->assign('urlIsPublic', TRUE);
         } else {
             $template->assign('urlIsPublic', FALSE);
             self::versionCheck($template);
         }
         if (isset($item['return_url'])) {
             $session = CRM_Core_Session::singleton();
             $args = CRM_Utils_Array::value('return_url_args', $item, 'reset=1');
             $session->pushUserContext(CRM_Utils_System::url($item['return_url'], $args));
         }
         $result = NULL;
         if (is_array($item['page_callback'])) {
             $newArgs = explode('/', $_GET[$config->userFrameworkURLVar]);
             require_once str_replace('_', DIRECTORY_SEPARATOR, $item['page_callback'][0]) . '.php';
             $result = call_user_func($item['page_callback'], $newArgs);
         } elseif (strstr($item['page_callback'], '_Form')) {
             $wrapper = new CRM_Utils_Wrapper();
             $result = $wrapper->run(CRM_Utils_Array::value('page_callback', $item), CRM_Utils_Array::value('title', $item), isset($pageArgs) ? $pageArgs : NULL);
         } else {
             $newArgs = explode('/', $_GET[$config->userFrameworkURLVar]);
             require_once str_replace('_', DIRECTORY_SEPARATOR, $item['page_callback']) . '.php';
             $mode = 'null';
             if (isset($pageArgs['mode'])) {
                 $mode = $pageArgs['mode'];
                 unset($pageArgs['mode']);
             }
             $title = CRM_Utils_Array::value('title', $item);
             if (strstr($item['page_callback'], '_Page')) {
                 $object = new $item['page_callback']($title, $mode);
             } elseif (strstr($item['page_callback'], '_Controller')) {
                 $addSequence = 'false';
                 if (isset($pageArgs['addSequence'])) {
                     $addSequence = $pageArgs['addSequence'];
                     $addSequence = $addSequence ? 'true' : 'false';
                     unset($pageArgs['addSequence']);
                 }
                 $object = new $item['page_callback']($title, true, $mode, null, $addSequence);
             } else {
                 CRM_Core_Error::fatal();
             }
             $result = $object->run($newArgs, $pageArgs);
         }
         CRM_Core_Session::storeSessionObjects();
         return $result;
     }
     CRM_Core_Menu::store();
     CRM_Core_Session::setStatus(ts('Menu has been rebuilt'), ts('Complete'), 'success');
     return CRM_Utils_System::redirect();
 }
开发者ID:TheCraftyCanvas,项目名称:aegir-platforms,代码行数:98,代码来源:Invoke.php

示例3: edit

 /**
  * This function is called when action is update or new
  *
  * return null
  * @access public
  */
 function edit()
 {
     // set https for offline cc transaction
     $mode = CRM_Utils_Request::retrieve('mode', 'String', $this);
     if ($mode == 'test' || $mode == 'live') {
         CRM_Utils_System::redirectToSSL();
     }
     $controller = new CRM_Core_Controller_Simple('CRM_Contribute_Form_Contribution', 'Create Contribution', $this->_action);
     $controller->setEmbedded(TRUE);
     $controller->set('id', $this->_id);
     $controller->set('cid', $this->_contactId);
     return $controller->run();
 }
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:19,代码来源:Tab.php

示例4: edit

 /**
  * This function is called when action is update or new
  *
  * return null
  * @access public
  */
 function edit()
 {
     // set https for offline cc transaction
     $mode = CRM_Utils_Request::retrieve('mode', 'String', $this);
     if ($mode == 'test' || $mode == 'live') {
         CRM_Utils_System::redirectToSSL();
     }
     if ($this->_action != CRM_Core_Action::ADD) {
         // get associated contributions only on edit/renew/delete
         $this->associatedContribution();
     }
     if ($this->_action & CRM_Core_Action::RENEW) {
         $path = 'CRM_Member_Form_MembershipRenewal';
         $title = ts('Renew Membership');
     } else {
         $path = 'CRM_Member_Form_Membership';
         $title = ts('Create Membership');
     }
     $controller = new CRM_Core_Controller_Simple($path, $title, $this->_action);
     $controller->setEmbedded(TRUE);
     $controller->set('BAOName', $this->getBAOName());
     $controller->set('id', $this->_id);
     $controller->set('cid', $this->_contactId);
     return $controller->run();
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:31,代码来源:Tab.php

示例5: edit

 /**
  * called when action is update or new.
  *
  * @return null
  */
 public function edit()
 {
     // set https for offline cc transaction
     $mode = CRM_Utils_Request::retrieve('mode', 'String', $this);
     if ($mode == 'test' || $mode == 'live') {
         CRM_Utils_System::redirectToSSL();
     }
     // build associated contributions ( note: this is called to show associated contributions in edit mode )
     if ($this->_action & CRM_Core_Action::UPDATE) {
         $this->assign('accessContribution', FALSE);
         if (CRM_Core_Permission::access('CiviContribute')) {
             $this->assign('accessContribution', TRUE);
             CRM_Member_Page_Tab::associatedContribution($this->_contactId, $this->_id);
             //show associated soft credit when contribution payment is paid by different person in edit mode
             if ($this->_id && $this->_contactId) {
                 $filter = " AND cc.id IN (SELECT contribution_id FROM civicrm_membership_payment WHERE membership_id = {$this->_id})";
                 $softCreditList = CRM_Contribute_BAO_ContributionSoft::getSoftContributionList($this->_contactId, $filter);
                 if (!empty($softCreditList)) {
                     $this->assign('softCredit', TRUE);
                     $this->assign('softCreditRows', $softCreditList);
                 }
             }
         }
     }
     if ($this->_action & CRM_Core_Action::RENEW) {
         $path = 'CRM_Member_Form_MembershipRenewal';
         $title = ts('Renew Membership');
     } else {
         $path = 'CRM_Member_Form_Membership';
         $title = ts('Create Membership');
     }
     $controller = new CRM_Core_Controller_Simple($path, $title, $this->_action);
     $controller->setEmbedded(TRUE);
     $controller->set('BAOName', $this->getBAOName());
     $controller->set('id', $this->_id);
     $controller->set('cid', $this->_contactId);
     return $controller->run();
 }
开发者ID:kidaa30,项目名称:yes,代码行数:43,代码来源:Tab.php

示例6: edit

 /**
  * This function is called when action is update or new
  *
  * return null
  * @access public
  */
 function edit()
 {
     // set https for offline cc transaction
     $mode = CRM_Utils_Request::retrieve('mode', 'String', $this);
     if ($mode == 'test' || $mode == 'live') {
         CRM_Utils_System::redirectToSSL();
     }
     // build associated contributions ( note: this is called to show associated contributions in edit mode )
     if ($this->_action & CRM_Core_Action::UPDATE) {
         $this->assign('accessContribution', FALSE);
         if (CRM_Core_Permission::access('CiviContribute')) {
             $this->assign('accessContribution', TRUE);
             CRM_Member_Page_Tab::associatedContribution($this->_contactId, $this->_id);
         }
     }
     if ($this->_action & CRM_Core_Action::RENEW) {
         $path = 'CRM_Member_Form_MembershipRenewal';
         $title = ts('Renew Membership');
     } else {
         $path = 'CRM_Member_Form_Membership';
         $title = ts('Create Membership');
     }
     $controller = new CRM_Core_Controller_Simple($path, $title, $this->_action);
     $controller->setEmbedded(TRUE);
     $controller->set('BAOName', $this->getBAOName());
     $controller->set('id', $this->_id);
     $controller->set('cid', $this->_contactId);
     return $controller->run();
 }
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:35,代码来源:Tab.php

示例7: edit

 /**
  * called when action is update or new.
  *
  * @return null
  */
 public function edit()
 {
     // set https for offline cc transaction
     $mode = CRM_Utils_Request::retrieve('mode', 'String', $this);
     if ($mode == 'test' || $mode == 'live') {
         CRM_Utils_System::redirectToSSL();
     }
     if ($this->_action != CRM_Core_Action::ADD) {
         // get associated contributions only on edit/delete
         $this->associatedContribution();
     }
     $controller = new CRM_Core_Controller_Simple('CRM_Event_Form_Participant', 'Create Participation', $this->_action);
     $controller->setEmbedded(TRUE);
     $controller->set('id', $this->_id);
     $controller->set('cid', $this->_contactId);
     return $controller->run();
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:22,代码来源:Tab.php

示例8: invoke

 /**
  * This is the main function that is called on every click action and based on the argument
  * respective functions are called
  *
  * @param $args array this array contains the arguments of the url 
  * 
  * @static
  * @access public
  */
 static function invoke($args)
 {
     require_once 'CRM/Core/I18n.php';
     require_once 'CRM/Utils/Wrapper.php';
     require_once 'CRM/Core/Action.php';
     require_once 'CRM/Utils/Request.php';
     require_once 'CRM/Core/Menu.php';
     require_once 'CRM/Core/Component.php';
     require_once 'CRM/Core/Permission.php';
     if ($args[0] !== 'civicrm') {
         return;
     }
     if (isset($args[1]) and $args[1] == 'menu' and isset($args[2]) and $args[2] == 'rebuild') {
         CRM_Core_Menu::store();
         CRM_Core_Session::setStatus(ts('Menu has been rebuilt'));
         // also reset navigation
         require_once 'CRM/Core/BAO/Navigation.php';
         CRM_Core_BAO_Navigation::resetNavigation();
         return CRM_Utils_System::redirect();
     }
     // first fire up IDS and check for bad stuff
     require_once 'CRM/Core/IDS.php';
     $ids = new CRM_Core_IDS();
     $ids->check($args);
     $config =& CRM_Core_Config::singleton();
     // also initialize the i18n framework
     $i18n =& CRM_Core_I18n::singleton();
     if ($config->userFramework == 'Standalone') {
         require_once 'CRM/Core/Session.php';
         $session =& CRM_Core_Session::singleton();
         if ($session->get('new_install') !== true) {
             require_once 'CRM/Core/Standalone.php';
             CRM_Core_Standalone::sidebarLeft();
         } else {
             if ($args[1] == 'standalone' && $args[2] == 'register') {
                 CRM_Core_Menu::store();
             }
         }
     }
     // get the menu items
     $path = implode('/', $args);
     $item =& CRM_Core_Menu::get($path);
     // we should try to compute menus, if item is empty and stay on the same page,
     // rather than compute and redirect to dashboard.
     if (!$item) {
         CRM_Core_Menu::store(false);
         $item =& CRM_Core_Menu::get($path);
     }
     if ($config->userFramework == 'Joomla' && $item) {
         $config->userFrameworkURLVar = 'task';
         require_once 'CRM/Core/Joomla.php';
         // joomla 1.5RC1 seems to push this in the POST variable, which messes
         // QF and checkboxes
         unset($_POST['option']);
         CRM_Core_Joomla::sidebarLeft();
     }
     // set active Component
     $template =& CRM_Core_Smarty::singleton();
     $template->assign('activeComponent', 'CiviCRM');
     $template->assign('formTpl', 'default');
     if ($item) {
         if (!array_key_exists('page_callback', $item)) {
             CRM_Core_Error::debug('Bad item', $item);
             CRM_Core_Error::fatal(ts('Bad menu record in database'));
         }
         // check that we are permissioned to access this page
         if (!CRM_Core_Permission::checkMenuItem($item)) {
             CRM_Utils_System::permissionDenied();
             return;
         }
         // check if ssl is set
         if (CRM_Utils_Array::value('is_ssl', $item)) {
             CRM_Utils_System::redirectToSSL();
         }
         if (isset($item['title'])) {
             CRM_Utils_System::setTitle($item['title']);
         }
         if (isset($item['breadcrumb']) && !isset($item['is_public'])) {
             CRM_Utils_System::appendBreadCrumb($item['breadcrumb']);
         }
         $pageArgs = null;
         if (CRM_Utils_Array::value('page_arguments', $item)) {
             $pageArgs = CRM_Core_Menu::getArrayForPathArgs($item['page_arguments']);
         }
         $template =& CRM_Core_Smarty::singleton();
         if (isset($item['is_public']) && $item['is_public']) {
             $template->assign('urlIsPublic', true);
         } else {
             $template->assign('urlIsPublic', false);
         }
         if (isset($item['return_url'])) {
//.........这里部分代码省略.........
开发者ID:ksecor,项目名称:civicrm,代码行数:101,代码来源:Invoke.php

示例9: _invoke

 protected static function _invoke($args)
 {
     if ($args[0] !== 'civicrm') {
         return;
     }
     require_once 'CRM/Core/I18n.php';
     $config = CRM_Core_Config::singleton();
     if (isset($args[1]) and $args[1] == 'menu' and isset($args[2]) and $args[2] == 'rebuild') {
         // ensure that the user has a good privilege level
         if (CRM_Core_Permission::check('administer CiviCRM')) {
             self::rebuildMenuAndCaches();
             CRM_Core_Session::setStatus(ts('Menu has been rebuilt'));
             return CRM_Utils_System::redirect();
         } else {
             CRM_Core_Error::fatal('You do not have permission to execute this url');
         }
     }
     // first fire up IDS and check for bad stuff
     if ($config->useIDS) {
         $ids = new CRM_Core_IDS();
         $ids->check($args);
     }
     // also initialize the i18n framework
     $i18n = CRM_Core_I18n::singleton();
     if ($config->userFramework == 'Standalone') {
         $session = CRM_Core_Session::singleton();
         if ($session->get('new_install') !== TRUE) {
             CRM_Core_Standalone::sidebarLeft();
         } elseif ($args[1] == 'standalone' && $args[2] == 'register') {
             CRM_Core_Menu::store();
         }
     }
     // get the menu items
     $path = implode('/', $args);
     $item = CRM_Core_Menu::get($path);
     // we should try to compute menus, if item is empty and stay on the same page,
     // rather than compute and redirect to dashboard.
     if (!$item) {
         CRM_Core_Menu::store(FALSE);
         $item = CRM_Core_Menu::get($path);
     }
     if ($config->userFramework == 'Joomla' && $item) {
         $config->userFrameworkURLVar = 'task';
         // joomla 1.5RC1 seems to push this in the POST variable, which messes
         // QF and checkboxes
         unset($_POST['option']);
         CRM_Core_Joomla::sidebarLeft();
     }
     // set active Component
     $template = CRM_Core_Smarty::singleton();
     $template->assign('activeComponent', 'CiviCRM');
     $template->assign('formTpl', 'default');
     if ($item) {
         // CRM-7656 - make sure we send a clean sanitized path to create printer friendly url
         $printerFriendly = CRM_Utils_System::makeURL('snippet', FALSE, FALSE, CRM_Utils_Array::value('path', $item)) . '2';
         $template->assign('printerFriendly', $printerFriendly);
         if (!array_key_exists('page_callback', $item)) {
             CRM_Core_Error::debug('Bad item', $item);
             CRM_Core_Error::fatal(ts('Bad menu record in database'));
         }
         // check that we are permissioned to access this page
         if (!CRM_Core_Permission::checkMenuItem($item)) {
             CRM_Utils_System::permissionDenied();
             return;
         }
         // check if ssl is set
         if (CRM_Utils_Array::value('is_ssl', $item)) {
             CRM_Utils_System::redirectToSSL();
         }
         if (isset($item['title'])) {
             CRM_Utils_System::setTitle($item['title']);
         }
         if (isset($item['breadcrumb']) && !isset($item['is_public'])) {
             CRM_Utils_System::appendBreadCrumb($item['breadcrumb']);
         }
         $pageArgs = NULL;
         if (CRM_Utils_Array::value('page_arguments', $item)) {
             $pageArgs = CRM_Core_Menu::getArrayForPathArgs($item['page_arguments']);
         }
         $template = CRM_Core_Smarty::singleton();
         if (isset($item['is_public']) && $item['is_public']) {
             $template->assign('urlIsPublic', TRUE);
         } else {
             $template->assign('urlIsPublic', FALSE);
         }
         if (isset($item['return_url'])) {
             $session = CRM_Core_Session::singleton();
             $args = CRM_Utils_Array::value('return_url_args', $item, 'reset=1');
             $session->pushUserContext(CRM_Utils_System::url($item['return_url'], $args));
         }
         // CRM_Core_Error::debug( $item ); exit( );
         $result = NULL;
         if (is_array($item['page_callback'])) {
             $newArgs = explode('/', $_GET[$config->userFrameworkURLVar]);
             require_once str_replace('_', DIRECTORY_SEPARATOR, $item['page_callback'][0]) . '.php';
             $result = call_user_func($item['page_callback'], $newArgs);
         } elseif (strstr($item['page_callback'], '_Form')) {
             $wrapper = new CRM_Utils_Wrapper();
             $result = $wrapper->run(CRM_Utils_Array::value('page_callback', $item), CRM_Utils_Array::value('title', $item), isset($pageArgs) ? $pageArgs : NULL);
         } else {
//.........这里部分代码省略.........
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:101,代码来源:Invoke.php


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