Denied changes for clients
Hi folks :)
Would it be possible (short-term) to implement the following:
If a client can not change some values of a website, like the php mode or php version, this input field or select box should be shown but disabled.
I have no clue what I would have to change to achieve this, so maybe someone who known can implement it - or give me some hints.
A client of mine tried to change the php version from default to php 5.4.5 (that I set up as an additional php version) but the setting switches back to default after saving without any message.
If I change the setting then it works.
I first thought it was an error but then I realized that on all other websites of this client he can change the php version without problems.
So I think it is because I created one of this websites as admin and he is not allowed to overwrite the settings, right? But then, there should be an error message or - even better - the fields should be disabled.
You can see the difference in permissions in the sys_perm_group field of the web_domain table. 'riud' indicates that the client can save the changes in the form while 'ru' indicates that he cant save the changes. The variable 'sys_perm_group' is available in the template if I remember correctly, so it should be possible to either show a a message in the template that its read only or to disable the fields with jquery. This message or field disabling should only happen to clients, so it should be combined with a "is_admin" if statement in the template.
What happens if I create a web site using the remoting lib?
Is it created with admin as owner, too?
I need to create all websites for the clients but they should be able to edit settings like php version.
Same with emails and ftp and so on.
The sys_perm_group variable was not available.
I realized that a tab can have a "readonly" setting so I added this to the template as "readonly_tab" via the tform class.
In the default theme the input fields now are disabled using jQuery if a client does not have edit rights (readonly tab).
Changes are online in svn rev 3371
|All times are GMT +2. The time now is 17:04.|
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.