ElkArte Community

Title: reply by email thinks admin account don't have permission
Post by: stanstrup on June 10, 2016, 08:44:36 am
Hi,

I got the post by email feature setup using IMAP and it seems to work except that emails get rejected.

Using the admin account I replied to a topic but got:
"Failure Reason: The poster does not have post by email permissions on this board"

How is that possible? Shouldn't the admin account have all permissions? Also I enabled the permission for the regular user group.
Title: Re: reply by email thinks admin account don't have permission
Post by: Spuds on June 10, 2016, 09:09:05 am
Thats a bug that I fixed in 1.1, and should be backported to 1.0.8

In /controllers/Emailpost.controller.php
Code: (find) [Select]
	// Validate they have permission to reply
$becomesApproved = true;
if (!in_array('postby_email', $pbe['user_info']['permissions']))

Code: (replace) [Select]
	// Validate they have permission to reply
$becomesApproved = true;
if (!in_array('postby_email', $pbe['user_info']['permissions']) && !$pbe['user_info']['admin'])


Title: Re: reply by email thinks admin account don't have permission
Post by: stanstrup on June 10, 2016, 09:29:38 am
OK... I put your fix manually but it didn't seem to fix the problem. I tried again with same result.
Title: Re: reply by email thinks admin account don't have permission
Post by: Spuds on June 10, 2016, 07:55:43 pm
That is the only line that I know of that would generate that specific error, and the edit would bypass the check for an admin user.

There is a similar line in the function pbe_create_topic  but be sure to edit the one in the function pbe_create_post (its the only one with the comment I provided).

Does it work from a "normal" user that has permissions and just an admin user has a problem?

Title: Re: reply by email thinks admin account don't have permission
Post by: stanstrup on June 12, 2016, 02:52:58 pm
Just confirmed that it works from a normal user. Checked again that admin user doesn't work.
Title: Re: reply by email thinks admin account don't have permission
Post by: emanuele on June 12, 2016, 03:08:56 pm
Maybe is:
Code: [Select]
$pbe['user_info']['is_admin']
just a wild guess based on the usual way $user_info is filled. :)
Title: Re: reply by email thinks admin account don't have permission
Post by: stanstrup on June 12, 2016, 04:35:52 pm
You are correct Sir. That fixed the problem. Thanks!
Title: Re: reply by email thinks admin account don't have permission
Post by: emanuele on June 12, 2016, 05:35:09 pm
/me fixed a bug by Spuds! :P
Title: Re: reply by email thinks admin account don't have permission
Post by: Spuds on June 12, 2016, 07:32:50 pm
Nonsense ... that was just a typo :P (but you may want to fix that in 1.1 where I made the typo in my cough "fix"  O:-)
Title: Re: reply by email thinks admin account don't have permission
Post by: emanuele on June 13, 2016, 03:48:45 am
Fixed in 822d43c65472cd131ff8c3b9336075497b7ac602 :D