R
R
run1822017-02-23 01:32:41
ISPmanager
run182, 2017-02-23 01:32:41

How to change the rights to folders and files in ISPManager via API?

When executing func=file.upload, it uploads a file with root ownership, you need to change it via api, but I didn’t find such a function. Tried file.unixattr and file.attr - it doesn't work through them for some reason.
Here is the code I am using ($loginIsp = "root"):

"https://".$host."/billmgr?authinfo=".$loginBill.":".$passBill."
&func=register&username=".$login."&passwd=".$password."&confirm=".$password."
&email=".$email."&person=".$login."&ptype=pperson&country=182&sok=ok&out=json"

"https://".$host."/billmgr?authinfo=".$login.":".$password."
&func=vhost.order.5&domain=".$domen."&price=".$tarif."&promocode=promo
&elid=&noback=on&period=13&sok=ok&out=json"

"https://".$host."/ispmgr?authinfo=".$loginIsp.":".$passIsp."
&func=user.edit&elid=user".$_REQUEST["item_id"]."&passwd=".$_REQUEST["password"]."&confirm=".$_REQUEST["password"]."
&name=user".$_REQUEST["item_id"]."&disklimit=2000&maillimit=10000&ftplimit=4&
webdomainlimit=4&maildomainlimit=4&baselimit=4&baseuserlimit=4&ssi=on&cgi=on
&phpfcgi=on&phpmod=on&preset=lite-pro&shell=on&sok=ok&out=json"

"https://".$host."/ispmgr?authinfo=".$loginIsp.":".$passIsp."
&func=file.upload&plid=/var/www/user".$_REQUEST["item_id"]."/data/www/".$_REQUEST["domen"]

"https://".$host."/ispmgr?authinfo=".$loginIsp.":".$passIsp."
&func=file.extract&elid=/var/www/".$_REQUEST["login"]."/data/www/".$_REQUEST["domen"]."/archiv.zip&sok=ok&out=json"

Making Curl requests. Empirically, I found that in order for the requests to work, you need to additionally log in to the browser in ispmanager.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question