コード例 #1
0
 public function save(Request $request)
 {
     $config = array('host' => \Config::get('plesk.url'), 'username' => \Config::get('plesk.username'), 'password' => \Config::get('plesk.password'));
     $params = array('contact_name' => $request->get('contact_name'), 'address' => $request->get('address'), 'city' => $request->get('city'), 'phone' => $request->get('phone'), 'username' => $request->get('plesk_username'), 'password' => $request->get('plesk_password'), 'email' => $request->get('department_name'));
     $request = new \pmill\Plesk\CreateClient($config, $params);
     $info = $request->process();
     echo "<pre>";
     var_dump($info);
     echo "/<pre>";
     echo "<BR>Created client id: " . $request->id;
 }
コード例 #2
0
ファイル: complete_run.php プロジェクト: QuibaX/php-plesk
$plans = $request->process();
foreach ($plans as $plan) {
    if (strtolower($plan['name']) == 'unlimited') {
        $data['unlimited_plan_id'] = $plan['id'];
        echo "Unlimited Service Plan found: " . $data['unlimited_plan_id'] . "<BR>";
        break;
    }
}
if (!isset($data['unlimited_plan_id'])) {
    throw new Exception("Couldn't find unlimited service plan");
}
/*
 * 4. Creates a new client (CreateClient)
 */
$data['client_username'] = strtolower(random_string());
$request = new \pmill\Plesk\CreateClient($config, array('contact_name' => random_string(), 'username' => $data['client_username'], 'password' => random_string(16) . "1!"));
$request->process();
$data['client_id'] = $request->id;
echo "Client created: " . $data['client_username'] . "<BR>";
try {
    /*
     * 5. Get new client from server (GetClient)
     */
    $request = new \pmill\Plesk\GetClient($config, array('username' => $data['client_username']));
    $info = $request->process();
    echo "Client found: " . $data['client_username'] . "<BR>";
    /*
     * 6. Update client information (UpdateClient)
     */
    $request = new \pmill\Plesk\UpdateClient($config, array('username' => $data['client_username'], 'phone' => random_string(), 'email' => random_string() . '@example.com'));
    $info = $request->process();
コード例 #3
0
ファイル: create_client.php プロジェクト: ghermans/php-plesk
<?php

require_once "../config.php";
$params = array('contact_name' => 'name', 'username' => 'username', 'password' => 'password1!');
$request = new \pmill\Plesk\CreateClient($config, $params);
$info = $request->process();
var_dump($info);
echo "<BR>Created client id: " . $request->id;