Feng Forum

Support => Feng Office 2 => Topic started by: tverdouw on March 12, 2014, 07:54:33 am

Title: Can't change user permissions
Post by: tverdouw on March 12, 2014, 07:54:33 am
When I try to change user permissions the changes are not saved.
Please see the video where I show you.

youtu.be/SvaaztuTZ5w

Someone please help, as this is one of the most important options to work with a team.
Title: Re: Can't change user permissions
Post by: tverdouw on March 13, 2014, 05:50:56 pm
Could someone please help?
Title: Re: Can't change user permissions
Post by: franponce87 on March 17, 2014, 12:08:00 pm
Hi there!

The 2.5.1.2 version has been released on Friday. There are several improvements and bugfixes (some related to permissions) which may solve this matter.
I would suggest trying again after upgrading to it.

Best regards,
Francisco
Title: Re: Can't change user permissions
Post by: tverdouw on March 17, 2014, 12:41:54 pm
Hi Francisco,

I realy appreciate your answer!
I have installed a new installation with version 2.5.1.2 but the problem still excists.

I have noticed that the problem does not excist with a installation of version 2.5
Every newer version has this problem.

Please try it on a softaculous demo account and you will see that it is a general problem:
softaculous.com/demos/Feng_Office

I hope to hear from you soon.

Thanks!
Tim
Title: Re: Can't change user permissions
Post by: franponce87 on March 17, 2014, 02:36:27 pm
Hello Tim,

Thanks for your response and feedback. Rather unfortunate that the issue remains.
Pretty odd as well since in our demo (with 2.5.1.1 version) it does not happen: http://demo.fengoffice.com/

At least I was not able to reproduce it with the user in there called James Harrison nor with Alberta Anderson

Have you seen your Feng log or Apache log files just in case?
Also... did you make any user group or something as well?

Best regards,
Francisco
Title: Re: Can't change user permissions
Post by: tverdouw on March 17, 2014, 02:53:57 pm
Thanks for the quick response Francisco,

I will take a look at it this evening.
I haven't made any user groups yet? Do I need to do that first?

Many thanks,
Tim
Title: Re: Can't change user permissions
Post by: IGaDI on March 17, 2014, 03:11:32 pm
it's true I also very problem
Title: Re: Can't change user permissions
Post by: tverdouw on March 18, 2014, 06:05:58 am
Hi Francisco,

The log.php does not give me an error on this case.
A friend of my have installed feng office on his local machine and that worked fine.
Also he imported my database, and on his machine my database runs fine without the problem (all is saved well).
Do you have any other ideas? I have tried several webhostings and with all I bump into the same user permission problem. 
Can this be reported as a bug?

2d problem (less important to me) that only excists on a hosted server is the groups.
I have added a group, but I am unable to edit the group (it gives a error 500 Internal server error)
Again when doing this on a local installation everything works fine also after importing my database.
This problem generated a log file in the log.php

Session "default" started at 2014-03-18T08:52:57+0000
#1 ERROR: Error: Missing argument 3 for save_user_permissions_background(), called in /home/timprodu/public_html/crm/application/controllers/GroupController.class.php on line 99 and defined in '/home/timprodu/public_html/crm/application/helpers/permissions.php' on line 1207 (error code: 2)
#2 ERROR: Error: Undefined variable: is_guest in '/home/timprodu/public_html/crm/application/helpers/permissions.php' on line 1268 (error code: 8)
Time since start: 0.45739316940308 seconds
-------------------------------------------------------------------------------

(sorry, i was not authorised to apply the code tag)
Title: Re: Can't change user permissions
Post by: franponce87 on March 18, 2014, 09:57:22 am
Hi Tim,

Thank you very much for your response and feedback.
I will share that info with my colleagues, but taking into account all of the information provided, it seems like it is an issue in your server settings. May be it does not have enough memory?
The Error 500 stands for an error logged in the Apache server.
If you could please look into the Apache error log, that would be fantastic.

Concerning group permissions, just was being curious just in case. But it is not compulsory to use them.

Best regards,
Francisco
Title: Re: Can't change user permissions
Post by: franponce87 on March 18, 2014, 03:11:05 pm
Good news!
My colleagues have applied some changes for the upcoming 2.6 beta version that will solve the following error:
Session "default" started at 2014-03-18T08:52:57+0000
#1 ERROR: Error: Missing argument 3 for save_user_permissions_background(), called in /home/timprodu/public_html/crm/application/controllers/GroupController.class.php on line 99 and defined in '/home/timprodu/public_html/crm/application/helpers/permissions.php' on line 1207 (error code: 2)
#2 ERROR: Error: Undefined variable: is_guest in '/home/timprodu/public_html/crm/application/helpers/permissions.php' on line 1268 (error code: 8)
Time since start: 0.45739316940308 seconds
-------------------------------------------------------------------------------

Best regards,
Francisco
Title: Re: Can't change user permissions
Post by: tverdouw on March 18, 2014, 04:56:52 pm
Sounds good Francisco!!
Does this also solves the module permissions problem?
Title: Re: Can't change user permissions
Post by: tverdouw on March 19, 2014, 04:59:28 am
A friend of my found a temporary fix for the module permissions.
It looks like Feng office is acting different on several operating systems.
He found this line:

Code: [Select]
if (substr(php_uname(), 0, 7) == "Windows" || (defined('DONT_SAVE_PERMISSIONS_IN_BACKGROUND') && DONT_SAVE_PERMISSIONS_IN_BACKGROUND)){
It's to difficult for me to explain because I'm not a coder, but maybe he will give a reply later.

Anyway, to get a temporary fix you could do this:

on application/helpers/permissions.php at line 1252

change
Code: [Select]
save_user_permissions_background($user, $pg_id, $is_guest)to
Code: [Select]
save_user_permissions_background($user, $pg_id, $is_guest = false)

And on top of the same file add this piece of code:

Code: [Select]
define('DONT_SAVE_PERMISSIONS_IN_BACKGROUND', true);

This will force the code to behave like if it's in windows environment.

@Fransisco, can you confirm that we can work with this tempory solution until the problem is realy solved?

Thanks!
Tim
Title: FIX - Can't change user permissions
Post by: aSeptik on March 19, 2014, 11:42:19 am
Hi all,

I'm the friend of tverdouw

this is a real problem (bug) that occur only with fengoffice running under UNIX machine.

the bug is located in the /application/helpers/permissions.php file and affects two functions save_member_permissions_background and save_user_permissions_background

the problem is the call of the exec function without any check. infact if the function is disabled, does not exists or simply we don't have privileges to use it, the error occur.

a possible solution can be to add something like the code below at the top of the permissions.php file

https://gist.github.com/aSeptik/9643471

hope this help

Luca Filosofi
Title: Re: Can't change user permissions
Post by: franponce87 on March 20, 2014, 04:02:25 pm
Hello Luca & Tim,

Thank you both very much for your replies and feedback.
I have already shared them with my colleagues, and our developers have applied further changes for the upcoming 2.6 beta version.

Thanks again for it, really appreciated.

Best regards,
Francisco
Title: Re: Can't change user permissions
Post by: sim on April 03, 2014, 03:18:34 am
@aSeptik: Fix worked for me! Thank you!
Title: Re: Can't change user permissions
Post by: travisjohng on April 05, 2014, 01:39:53 am
aSseptic

Thank you so much for finding the cure.
I spent 2 days looking for the solution and your solution actually solved it.

I notice on latest upgrade, line 1252 has been changed as you said, but "define" was not added.
I just copied and paste define('DONT_SAVE_PERMISSIONS_IN_BACKGROUND', true); at the top of the permission.php
and it worked finally.

Thanks again



Title: Re: Can't change user permissions
Post by: franponce87 on May 09, 2014, 11:36:50 am
Just as a note, future reference and follow up, this fix has been applied some versions ago already. So whoever has servers that are not compatible with some settings should no longer experience this issue.

Thank you again once more for your findings, greatly appreciated! :)

Best regards,
Francisco
Title: Re: Can't change user permissions
Post by: tooliload on May 18, 2014, 11:25:14 am
@aSeptik: The only one Hero. Thank you. Your Fix work fine.
Title: Re: Can't change user permissions
Post by: sinan on August 12, 2014, 11:50:38 am
Hi,
@sSeptik Thank you very very much. Your fix work fine.

We  migrate fengofice from windows to linux suse platform. after this migration the issue occured.  feng office version is 2.6.3 but the issue is continue this last version.

Best Regards
sinan
Title: Re: Can't change user permissions
Post by: kientaoviet on September 08, 2014, 06:23:37 am
it's true I also very problem
Title: Re: FIX - Can't change user permissions
Post by: seofw on September 30, 2014, 09:48:46 am
Hi all,

I'm the friend of tverdouw

this is a real problem (bug) that occur only with fengoffice running under UNIX machine.

the bug is located in the /application/helpers/permissions.php file and affects two functions save_member_permissions_background and save_user_permissions_background

the problem is the call of the exec function without any check. infact if the function is disabled, does not exists or simply we don't have privileges to use it, the error occur.

a possible solution can be to add something like the code below at the top of the permissions.php file

https://gist.github.com/aSeptik/9643471

hope this help

Luca Filosofi

The problem still exists with version 2.7.1.1

With the suggested code at the top of the permissions file the module permissions are now saved.

it still has problems with workspace permissions though when editing permissions from a user. When I change the permission from one option of a workspace (expl. Read only to Read & Write for Time) it resets all other to Read Only. The only way I can make sure that all permissions are set correctly is to set all Workspace Options to Read Only, save, then modify the user's permissions again to set the correct/new workspace permissions. Alternatively, I can also set the correct permissions by setting them for each user inside the settings of a workspace instead of inside the permissions of a user.
Title: Re: Can't change user permissions
Post by: thinkevd on October 03, 2014, 03:08:13 pm
yes, that's wired.
Seem's the new user I added has a empty workspace.
I'm using 2.7.11, it's installed in Bluehost Cpanel.
Any suggestion?
Title: Re: Can't change user permissions
Post by: Stihotvor on December 06, 2014, 05:37:34 pm
It seems that there is no any improvement in new version... Should I do it in my file too? Cause I have the same problem...
Title: Re: Can't change user permissions
Post by: conrado on December 17, 2014, 01:47:26 pm
We made some changes on this setting for Feng Office 3.0.

Updated the wiki:
http://www.fengoffice.com/web/wiki/doku.php/installation:server_settings#performance_boostsaving_permissions_in_background

And made a sticky on this topic:
http://forum.fengoffice.com/index.php?topic=19956.0


Title: Re: Can't change user permissions
Post by: RayGauthier on December 17, 2014, 03:10:22 pm
@tverdouw  - just a quick note of thanks.  I'm using 3.0-beta and those fixes worked for me!