Page 1 of 1

Patch : force users to add subdomains to their existing main domains only

Posted: Sat Feb 13, 2016 5:14 pm
by orwah
VestaCP is great panel
i started using it from short time only.

i faced a small problem in VestaCP:
- normal Users can Add their own "web-domains" ,and Admin can not stop that .
- and they can add subdomains from Main-Domains that belong to OTHER users .

it's nice , but not suetable for all hosting cases .

So i made a small Patch:
thats when Users want to add a new web domain , the panel will force them to append one of their maindomains to the new domain , so it will be subdomain like this : newdomain.maindomain.ltd
so every new domain the user want to add , will be turned to subdomain from one of his existing domains chosen by him (and only from his existing domains) .

Users :
- can't add new web domain.
- can't add subdomain to other user main domain .
- can add subdomains to the one of their existing maindomain only .
- can chose from their main-domains list when adding subdomain .
- removing Aliases for Users .
- change "add web domain" button to "add sub domain".

Admins :
- no changes
- can add web domains to users , without any problems .

IMPORTANT
to try this you must log out from admin account and log in as normal user , if you log from admin account you will not see any change,even if login from Admin->as user , because we need Admin control still the same (so he can add new domains to Users) .

Patch include the old files Backups But it's better to take your own Backups before use, and try on your own responsibility .

tested on Vesta 0.9.8-15 .


* Maybe VestaCp team can try to find complete solution better than this quick & simple small attempt .


Screenshot:
Image

files :
https://bugs.vestacp.com/attachments/do ... omains.zip


regards

Re: Patch : force users to add subdomains to their existing main domains only

Posted: Fri Feb 19, 2016 2:47 am
by AFN
Seems nice, but how to I install it?

Re: Patch : force users to add subdomains to their existing main domains only

Posted: Sat Feb 20, 2016 12:47 pm
by mike08
AFN wrote:Seems nice, but how to I install it?
Copy the files from the vesta/web directory in the .zip file and paste them into:
/usr/local/vesta/web/
Make sure to backup any file that would be overwritten in case you want to go back to your previous state.
Regards,

Re: Patch : force users to add subdomains to their existing main domains only

Posted: Wed Mar 09, 2016 3:00 pm
by skamasle
Hi

File was deleted ?

I get 404.

Re: Patch : force users to add subdomains to their existing main domains only

Posted: Wed Feb 14, 2018 9:09 am
by skurudo
Closed due inactivity.