Hello,
Users without selling permissions can still see a selling tab when they visit their account. However, when the users click on any of the sub-tabs (products, settings) they get an access denied page.
1) Users who should not act as sellers have the permissions -- act as a seller, view own products, view own reports --UNCHECKED.
2) These same users can still see the selling tab under their account.
Thanks,
KH
PS: Just want to add that this is a great module, thanks so much! I will report bugs/issue as much as I can to help out (new to Drupal/PHP--:)
Comments
Comment #1
duckzland commentedI got the same issue
fixing can be done by a slight change in mp_products.module :
function mp_products_menu() {
$items = array();
$items['user/%user/selling'] = array(
'title' => 'Selling',
'description' => 'View and manage your products and orders.',
'page callback' => 'mp_products_selling_overview',
'page arguments' => array(1),
'access callback' => 'mp_products_can_view_seller',
'access arguments' => array('act as seller'), // change this from array(1)
'type' => MENU_LOCAL_TASK,
'file' => 'mp_products.admin.inc',
);
sorry I cannot provide proper patch, don't have linux running and don't have time to learn how to create patch in windows :>
EDIT: SCRATCH THE ABOVE instead just change the mp_products_can_view_seller function to below, and leave the above unchanged:
function mp_products_can_view_seller($seller) {
global $user;
return (((user_access('view own products') || arg(3) == '') && ($user->uid == arg(1))) || user_access('administer sellers'));
}
EDIT: A better fix for people who uses users/username as their path
function mp_products_can_view_seller($seller) {
global $user;
if (is_numeric(arg(1))) {
$current_page = arg(1);
} else {
$current_page = $seller->uid;
}
return (((user_access('view own products') || arg(3) == '') && ($user->uid == $current_page)) and user_access('act as seller') || user_access('administer sellers'));
}
Comment #2
syndicateStorm commentedComment #4
fehin commentedThis says fixed but my non sellers still have the selling tab.
Comment #5
syndicateStorm commentedMake sure you do not have "administer sellers" or "act as seller" checked. Let me know what you find out so we can close out this bug. Cheers.
Comment #6
fehin commentedI have "act as seller" checked only for roles that I want to be sellers and "administer sellers" for admin. Non seller roles still shows this tab.
Comment #7
syndicateStorm commentedI'm assuming you're seeing this under "My Account"?
If so, I can't duplicate the bug? I have two Drupal 6 installs with Marketplace and neither one shows the Selling tab. Maybe as a test you could uncheck "act as seller" for all roles? If you have any other ideas let me know, otherwise I'm not sure I'll be able to recreate this...
Comment #8
syndicateStorm commentedComment #9
fehin commentedAs user1, I see this tab on non-seller profiles but when I login as a non-seller it doesn't show so I guess it ok.
Comment #10
syndicateStorm commentedI see, I didn't quite grasp what you were saying. I wonder which way would be preferable? Do you have an opinion? I'll give this some thought myself, later tonight.
Well, I guess the user could have previously been a seller, but if they lost their selling rights, the admin should still be able to see their seller tab. Maybe we should leave it as is. Let me know if you disagree.
Comment #11
fehin commentedYou can leave it as is for history purpose.