tbrehm
2012-10-25 dea37d1ae8574989f19222145f7b0608ac55374e
Fixed: FS#2314 - Reseller creation in remote API does not work properly
4 files modified
18 ■■■■■ changed files
interface/lib/classes/remoting.inc.php 2 ●●● patch | view | raw | blame | history
interface/lib/classes/remoting_lib.inc.php 4 ●●●● patch | view | raw | blame | history
remoting_client/examples/client_add.php 10 ●●●● patch | view | raw | blame | history
remoting_client/examples/mail_user_add.php 2 ●●● patch | view | raw | blame | history
interface/lib/classes/remoting.inc.php
@@ -2676,7 +2676,7 @@
        $this->id = $insert_id;
        $this->dataRecord = $params;
        
        $app->plugin->raiseEvent('client:' . ($reseller_id ? 'reseller' : 'client') . ':on_after_insert',$this);
        $app->plugin->raiseEvent('client:' . (isset($params['limit_client']) && $params['limit_client'] > 0 ? 'reseller' : 'client') . ':on_after_insert',$this);
        
        /*
        if($app->db->errorMessage != '') {
interface/lib/classes/remoting_lib.inc.php
@@ -825,6 +825,10 @@
            } else {
                $modules = $app->db->quote($params['modules']);
            }
            if(isset($params['limit_client']) && $params['limit_client'] > 0) {
                $modules .= ',client';
            }
            if(!isset($params['startmodule'])) {            
                $startmodule = 'dashboard';
            } else {                        
remoting_client/examples/client_add.php
@@ -15,7 +15,7 @@
    }
    
    //* Set the function parameters.
    $random_rs_id = 1;
    $reseller_id = 0; // this id has to be 0 if the client shall not be assigned to admin or if the client is a reseller
    $params = array(
            'company_name' => 'awesomecompany',
            'contact_name' => 'name',
@@ -33,7 +33,7 @@
            'internet' => '',
            'icq' => '111111111',
            'notes' => 'awesome',
            'dafault_mailserver' => 1,
            'default_mailserver' => 1,
            'limit_maildomain' => -1,
            'limit_mailbox' => -1,
            'limit_mailalias' => -1,
@@ -68,9 +68,9 @@
            'limit_cron_type' => 'url',
            'limit_cron_frequency' => 5,
            'limit_traffic_quota' => -1,
            'limit_client' => 0,
            'limit_client' => 0, // If this value is > 0, then the client is a reseller
            'parent_client_id' => 0,
            'username' => 'guy',
            'username' => 'guy3',
            'password' => 'brush',
            'language' => 'en',
            'usertheme' => 'default',
@@ -79,7 +79,7 @@
            'created_at' => 0
            );
    
    $affected_rows = $client->client_add($session_id, $random_rs_id, $params);
    $affected_rows = $client->client_add($session_id, $reseller_id, $params);
    
    echo "Client: ".$affected_rows."<br>";
remoting_client/examples/mail_user_add.php
@@ -25,7 +25,7 @@
            'uid' => 5000,
            'gid' => 5000,
            'maildir' => '/var/vmail/test.int/joe',
            'quota' => 1000,
            'quota' => 5242880,
            'cc' => '',
            'homedir' => '/var/vmail',
            'autoresponder' => 'n',