MySQL DB access receiving shoppergroup ID stopped working

Started by hans303, August 05, 2013, 17:09:20 PM

Previous topic - Next topic

hans303

Hello @all,
after updating from version 2.20b to 2.22a an error occurred.
I assume a new security fix is blogging the MySQL DB information.
On 2.20b everything works well.

The following Script doesn't forward any shoppergroup_id or userID :

// QTY - Business Customer x10

      $db = JFactory::getDbo(); // Joomla database class
      $user = JFactory::getUser(); // get User ID
      
      if($user->id) {  // User ID available?
      $userID = $user->id;
       

      // Retrieve ShopperID from database
// ============ CODE ERROR STARTS HERE ===================== //      
$getShopperID ="
            SELECT ".$db->nameQuote('virtuemart_shoppergroup_id')."
            FROM ".$db->nameQuote('#__virtuemart_vmuser_shoppergroups')."
            WHERE ".$db->nameQuote('virtuemart_user_id')." = ".$db->quote($userID).";
         ";
// ============ CODE ERROR ENDS HERE ===================== //   
   

      $db->setQuery($getShopperID);
      $shopperID = $db->loadResult();
      $categoryId = JRequest::getInt('virtuemart_category_id', false);
         if($shopperID == 3){
            if ($categoryId == 1)
            {
            echo "10";
            }

}?>"/>

Does anyone has a work around for the shown problem above?
Thanks in advance.
Hans