Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Vesta Web Interface
  • Search

API Suspened Users

Questions regarding the Web Interface
GUI
Post Reply
  • Print view
Advanced search
14 posts
  • Previous
  • 1
  • 2
elicast
Posts: 15
Joined: Mon Jul 20, 2015 12:09 am
Contact:
Contact elicast
Website

Re: API Suspened Users
  • Quote

Post by elicast » Fri Oct 02, 2015 2:43 pm

now I worked when I put 'do' along the lines of 'echo'

I really want to thank you for your attention

there is a small problem, the last User does not block, only blocks if I write to the end

http://prntscr.com/8mx0ug

but otherwise it is already working as I wanted, thank you
Top

elicast
Posts: 15
Joined: Mon Jul 20, 2015 12:09 am
Contact:
Contact elicast
Website

Re: API Suspened Users
  • Quote

Post by elicast » Sat Oct 03, 2015 7:37 pm

I'm trying to use around and is not working, only manually.
You have to help me.

Code: Select all

$vst_username = 'admin';
$vst_password = 'NmSmGFbqgH';
$vst_command = 'e-bloquear-users-revenda user1 user2';

    $postvars = array(
      'user' => $vst_username,
      'password' => $vst_password,
      'returncode' => 'yes',
      'cmd' => $vst_command
    );
    $postdata = http_build_query($postvars);

    // Send POST query via cURL
    $postdata = http_build_query($postvars);
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, 'https://66.85.180.37:8083/api/');
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
    $answer = curl_exec($curl);

    if ($answer == 0) {
        echo "ok";
    } else {
        echo "Query returned error code: " . $answer . "\n";
    }
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: API Suspened Users
  • Quote

Post by tjebbeke » Sun Oct 04, 2015 10:26 pm

what is the result of $answer? What problem do you have?
Top

elicast
Posts: 15
Joined: Mon Jul 20, 2015 12:09 am
Contact:
Contact elicast
Website

Re: API Suspened Users
  • Quote

Post by elicast » Sun Oct 04, 2015 10:49 pm

erro 1 E_ARGS Not enough arguments provided
Top


Post Reply
  • Print view

14 posts
  • Previous
  • 1
  • 2

Return to “Web Interface”



  • 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