My site has allows people to post classified ads. However, users can only post ads if they are a member of the ‘Gold User’ role. If they do not belong to this role, then they can only view ads (and not post them).
I have set up EC Role to allow people to buy the ‘Gold User’ membership. Doing this causes them to stop becoming an authenticated user and instead become a ‘Gold User’.
However, when my members purchase the role, an error is generated in the logs which states:
“Could not remove purchased role "authenticated user" from user 15.”
The Administer >> User Management >> Users pages lists the member as a “gold user” . However, if they try to post a classified ad, they get a message stating “Access denied
You are not authorized to access this page.”
If I go to Administer >> User Management >> Users >> Gold User >> Edit permissions and click save permissions (even without making any changes), the user is then able to post a classified ad. However, it is very tedious to have to do this every time someone purchases the ”Gold User” membership.
Is there a fix for this? I have performed a search, but have found no solutions.
Comments
Comment #1
maceo commentedi also am having problems with this.
The only way that the permissions are granted is if I remove another role using the admin.
For Example: the user has both "Paid Admin" and "whatever" roles assigned. "Paid Admin" was assigned when the transaction was marked as "completed," but the permissions weren't assigned properly.
I go into the Administrator interface and remove the "whatever" role --> Now the permissions are assigned as expected.
Even if I reassign the "watever" role the permissions are fine. hope this helps. I am using the same version on drupal 5.2
Maceo
Comment #2
webbasics commentedDitto! A real spanner in the works this one :o)
Will try a previous version first as I'm sure this worked with initial testing and this functionality is necessary for my project to progress. But want to keep track of this issue.
Cheers.
Comment #3
webbasics commentedSo after reading through the fixes for previous versions I decided I really need a fix for this latest version. So after hours and hours of trawling the forums etc I have come up with something, albeit a temporary solution.
My temporary fix is to add the code shown below at the end of the purchase process, e.g. create a 'Thank You' page using PHP input format. The page should be displayed when the transaction has been successfully processed. I tried putting this in the ec_roles.module file, namely at the end of the 'ec_roles_atpurchase' function, but this didn't work either. Obviously something else is happening afterward to reset the permissions back or I'm just putting it in completely the wrong place.
Anyway, hope this is of some use to anybody else experiencing this problem :o)
Would also be interested to know of any reasons this code should not be used in this situation.
Cheers.
Comment #4
big_smile commentedHow would you do this?
Obviously the "cache_clear_all('*', 'cache_menu', TRUE);" code would go in the body field of a new page with the input format set to PHP Code. But, how would you get the new page to automatically displayed when the transaction has been successfully processed?
Thanks for any help.
Comment #5
gordon commentedThis has been fixed and will be available in the next release of e-Commerce v3.x
Comment #6
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.