ISPConfig 3.0.5.4p3 Unable to add Shell Users via API

Discussion in 'Developers' Forum' started by snowfly, Sep 10, 2014.

  1. snowfly

    snowfly Member

    Since upgrading to ISPConfig 3.0.5.4p3 I have been unable to create new shell users via the remote API.

    I get the error: directory_error_notinweb

    A quick look shows this error comes from this location:
    Script = /usr/local/ispconfig/interface/lib/classes/validate_systemuser.inc.php
    Function = shelluser_dir

    And a bit of trial an error (and dumping the $app data to inspect it), it seems the following line always returns 0, so will always fail:
    PHP:
    $primary_id = (isset($app->tform->primary_id))?$app->tform->primary_id:$app->remoting_lib->primary_id;
    $app->tform->primary_id = 0
    $app->remoting_lib->primary_id = 0

    Adding a shell user in the ISPConfig control panel works fine, but I need it working via the remote API as we have built a separate control panel system that leverages the API.

    Any tips on how to get this to work?
    Thanks
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. Thrash Cardiom

    Thrash Cardiom New Member

    I'm getting exactly this error now and I'm using ispconfig 3.1.13. I have a script which runs through and creates the Client, Domain, Database user, and Database. It fails when trying to create the shell user:

    The variables $domain_id, $shell_username, $shell_password, $client_id are all set correctly

    Code:
    $shellParams = array(
        'server_id' => 1,
        'parent_domain_id' => $domain_id,
        'username' => $shell_username,
        'password' => $shell_password,
        'quota_size' => -1,
        'active' => 'y',
        'puser' => 'web' . $domain_id,
        'pgroup' => 'client' . $client_id,
        'shell' => '/bin/bash',
        'dir' => '/var/www/clients/client' . $client_id . '/web' . $domain_id;
        'chroot' => 'jailkit'
    );
    
    // Shell user
     $shell_user_id = $client->sites_shell_user_add( $session_id, $client_id, $shellParams );
    Any ideas on this would be welcome.
     

Share This Page