Author Topic: Can't change user permissions  (Read 19371 times)

tverdouw

  • Freshman
  • *
  • Posts: 10
    • View Profile
Can't change user permissions
« 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.

tverdouw

  • Freshman
  • *
  • Posts: 10
    • View Profile
Re: Can't change user permissions
« Reply #1 on: March 13, 2014, 05:50:56 pm »
Could someone please help?

franponce87

  • Administrator
  • Hero Member
  • *****
  • Posts: 1819
    • View Profile
    • Email
Re: Can't change user permissions
« Reply #2 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
Would you like to install Feng Office Professional or Enterprise Edition in your servers? No problem! Read this article!

tverdouw

  • Freshman
  • *
  • Posts: 10
    • View Profile
Re: Can't change user permissions
« Reply #3 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

franponce87

  • Administrator
  • Hero Member
  • *****
  • Posts: 1819
    • View Profile
    • Email
Re: Can't change user permissions
« Reply #4 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
Would you like to install Feng Office Professional or Enterprise Edition in your servers? No problem! Read this article!

tverdouw

  • Freshman
  • *
  • Posts: 10
    • View Profile
Re: Can't change user permissions
« Reply #5 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

IGaDI

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Can't change user permissions
« Reply #6 on: March 17, 2014, 03:11:32 pm »
it's true I also very problem

tverdouw

  • Freshman
  • *
  • Posts: 10
    • View Profile
Re: Can't change user permissions
« Reply #7 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)

franponce87

  • Administrator
  • Hero Member
  • *****
  • Posts: 1819
    • View Profile
    • Email
Re: Can't change user permissions
« Reply #8 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
Would you like to install Feng Office Professional or Enterprise Edition in your servers? No problem! Read this article!

franponce87

  • Administrator
  • Hero Member
  • *****
  • Posts: 1819
    • View Profile
    • Email
Re: Can't change user permissions
« Reply #9 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
Would you like to install Feng Office Professional or Enterprise Edition in your servers? No problem! Read this article!

tverdouw

  • Freshman
  • *
  • Posts: 10
    • View Profile
Re: Can't change user permissions
« Reply #10 on: March 18, 2014, 04:56:52 pm »
Sounds good Francisco!!
Does this also solves the module permissions problem?

tverdouw

  • Freshman
  • *
  • Posts: 10
    • View Profile
Re: Can't change user permissions
« Reply #11 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
« Last Edit: March 19, 2014, 05:02:55 am by tverdouw »

aSeptik

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
FIX - Can't change user permissions
« Reply #12 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
« Last Edit: March 19, 2014, 11:58:47 am by aSeptik »

franponce87

  • Administrator
  • Hero Member
  • *****
  • Posts: 1819
    • View Profile
    • Email
Re: Can't change user permissions
« Reply #13 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
Would you like to install Feng Office Professional or Enterprise Edition in your servers? No problem! Read this article!

sim

  • Freshman
  • *
  • Posts: 13
    • View Profile
Re: Can't change user permissions
« Reply #14 on: April 03, 2014, 03:18:34 am »
@aSeptik: Fix worked for me! Thank you!