Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Dev Section Scripting / API
  • Search

Create new FTP User

Questions regarding the API
Application Programming Interface
Locked
  • Print view
Advanced search
3 posts • Page 1 of 1
Kawamintai
Posts: 1
Joined: Tue Feb 10, 2015 12:46 pm

Create new FTP User

Post by Kawamintai » Tue Feb 10, 2015 12:50 pm

Hi. I'm from Poland and have problem. I have this code and doesn't perform on my command.

Code: Select all

<?php
if(isset($_POST['send_ftp'])) {
$domain = addslashes($_POST['domain']);
$ftpuser = addslashes($_POST['ftpuser']);
$ftppass = addslashes($_POST['ftppass']);
$connection = ssh2_connect('188.68.238.3', 22);
ssh2_auth_password($connection, 'root', 'sshpassword');
ssh2_exec($connection, 'v-add-web-domain-ftp admin $domain $ftpuser $ftppass public_html');
}
?>
 <form action="test.php" method="post">
    <input type="text" name="domain" value="domain">
        <input type="text" name="ftpuser" value="ftpuser">
        <input type="password" name="ftppass" value="ftppass">
        <input name="send_ftp" type="submit" class="btn btn-primary" value="Add">
 </form>
Just don't execute commands and doesn't add ftp account.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Create new FTP User

Post by skurudo » Sun Mar 15, 2015 10:32 pm

ssh2_exec($connection, 'v-add-web-domain-ftp admin $domain $ftpuser $ftppass public_html');

not "sudo v-add-web-domain-ftp" ?
May be script don't have enough permission?
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Create new FTP User

Post by skurudo » Fri Sep 23, 2016 12:32 pm

API documentation and examples:
http://vestacp.com/docs/API.pdf

CLI commands list and descriptions:
http://vestacp.com/docs/CLI.txt

-> viewtopic.php?f=18&t=12610
Top


Locked
  • Print view

3 posts • Page 1 of 1

Return to “Scripting / API”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password