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


PHP vmAccess::getBgManagerId方法代码示例

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


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

示例1: changeShopper

 /**
  * Change the shopper
  *
  * @author Maik Künnemann
  */
 public function changeShopper()
 {
     vRequest::vmCheckToken() or jexit('Invalid Token');
     $app = JFactory::getApplication();
     $redirect = vRequest::getString('redirect', false);
     if ($redirect) {
         $red = $redirect;
     } else {
         $red = JRoute::_('index.php?option=com_virtuemart&view=cart');
     }
     $id = vmAccess::getBgManagerId();
     $current = JFactory::getUser();
     $manager = vmAccess::manager('user');
     if (!$manager) {
         $app->enqueueMessage(vmText::sprintf('COM_VIRTUEMART_CART_CHANGE_SHOPPER_NO_PERMISSIONS', $current->name . ' (' . $current->username . ')'), 'error');
         $app->redirect($red);
         return false;
     }
     $userID = vRequest::getCmd('userID');
     if ($manager and !empty($userID) and $userID != $current->id) {
         if ($userID == $id) {
         } else {
             if (vmAccess::manager('user', $userID)) {
                 //if($newUser->authorise('core.admin', 'com_virtuemart') or $newUser->authorise('vm.user', 'com_virtuemart')){
                 $app->enqueueMessage(vmText::sprintf('COM_VIRTUEMART_CART_CHANGE_SHOPPER_NO_PERMISSIONS', $current->name . ' (' . $current->username . ')'), 'error');
                 $app->redirect($red);
             }
         }
     }
     $searchShopper = vRequest::getString('searchShopper');
     if (!empty($searchShopper)) {
         $this->display();
         return false;
     }
     //update session
     $session = JFactory::getSession();
     $adminID = $session->get('vmAdminID');
     if (!isset($adminID)) {
         if (!class_exists('vmCrypt')) {
             require VMPATH_ADMIN . DS . 'helpers' . DS . 'vmcrypt.php';
         }
         $session->set('vmAdminID', vmCrypt::encrypt($current->id));
     }
     $newUser = JFactory::getUser($userID);
     $session->set('user', $newUser);
     //update cart data
     $cart = VirtueMartCart::getCart();
     $usermodel = VmModel::getModel('user');
     $data = $usermodel->getUserAddressList(vRequest::getCmd('userID'), 'BT');
     if (isset($data[0])) {
         foreach ($data[0] as $k => $v) {
             $data[$k] = $v;
         }
     }
     $cart->BT['email'] = $newUser->email;
     $cart->ST = 0;
     $cart->STsameAsBT = 1;
     $cart->selected_shipto = 0;
     $cart->virtuemart_shipmentmethod_id = 0;
     $cart->saveAddressInCart($data, 'BT');
     $msg = vmText::sprintf('COM_VIRTUEMART_CART_CHANGED_SHOPPER_SUCCESSFULLY', $newUser->name . ' (' . $newUser->username . ')');
     if (empty($userID)) {
         $red = JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT');
         $msg = vmText::sprintf('COM_VIRTUEMART_CART_CHANGED_SHOPPER_SUCCESSFULLY', '');
     }
     $app->enqueueMessage($msg, 'info');
     $app->redirect($red);
 }
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:73,代码来源:cart.php

示例2: getUserList

 /**
  * Todo, works only for small stores, we need a new solution there with a bit filtering
  * For example by time, if already shopper, and a simple search
  * @return object list of users
  */
 function getUserList()
 {
     $result = false;
     if ($this->allowChangeShopper) {
         $this->adminID = vmAccess::getBgManagerId();
         $superVendor = vmAccess::isSuperVendor($this->adminID);
         if ($superVendor) {
             $uModel = VmModel::getModel('user');
             $result = $uModel->getSwitchUserList($superVendor, $this->adminID);
         }
     }
     if (!$result) {
         $this->allowChangeShopper = false;
     }
     return $result;
 }
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:21,代码来源:view.html.php

示例3: check

 function check()
 {
     if (empty($this->order_number)) {
         if (!class_exists('tsmartModelOrders')) {
             tmsModel::getModel('orders');
         }
         $this->order_number = tsmartModelOrders::genStdOrderNumber($this->tsmart_vendor_id);
     }
     if (empty($this->order_pass)) {
         if (!class_exists('tsmartModelOrders')) {
             tmsModel::getModel('orders');
         }
         $this->order_pass = tsmartModelOrders::genStdOrderPass();
     }
     if ($adminID = vmAccess::getBgManagerId()) {
         $this->created_by = $adminID;
     }
     return parent::check();
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:19,代码来源:orders.php


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