Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 15th August 2012, 10:49
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 927
Thanks: 16
Thanked 261 Times in 208 Posts
Default 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.
__________________
Marius Cramer

pixcept KG
Reply With Quote
Sponsored Links
  #2  
Old 15th August 2012, 11:10
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 35,983
Thanks: 825
Thanked 5,372 Times in 4,219 Posts
Default

Quote:
So I think it is because I created one of this websites as admin and he is not allowed to overwrite the settings, right?
Yes, thats right. This is a feature in ISPConfig to protect the website. Sites that were created by a dmin for a client can only be changed by the admin while sites that had been created by the client himself can be changed by the client.

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 15th August 2012, 11:43
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 927
Thanks: 16
Thanked 261 Times in 208 Posts
Default

Thank you.

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.
__________________
Marius Cramer

pixcept KG
Reply With Quote
  #4  
Old 15th August 2012, 11:46
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 35,983
Thanks: 825
Thanked 5,372 Times in 4,219 Posts
Default

Quote:
What happens if I create a web site using the remoting lib?
Is it created with admin as owner, too?
You ca set the permissions in the way you want them with the remote lib, its alow level api, so you can control everything in detail. So it depends on your code which permissions are used for which record that you insert.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 17th August 2012, 17:51
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 927
Thanks: 16
Thanked 261 Times in 208 Posts
 
Default

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
__________________
Marius Cramer

pixcept KG
Reply With Quote
The Following User Says Thank You to Croydon For This Useful Post:
till (18th August 2012)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
link my domain to my server, impossible! 007007 Installation/Configuration 7 17th January 2012 13:59
Postfix doesn't have Nolan Installation/Configuration 5 13th April 2011 05:00
Forbidden 403; Samba access; config of maildeamon fawkes Installation/Configuration 4 14th January 2010 18:16
ISP Config hesitation when opening web pages frankb Installation/Configuration 7 15th December 2008 13:06
Questions in regards to ISP-Server Setup - Ubuntu 5.10 "Breezy Badger" rbrantley HOWTO-Related Questions 16 10th April 2006 18:26


All times are GMT +2. The time now is 00:04.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.