本文整理汇总了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);
}
示例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;
}
示例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();
}