Hi,
I'm trying to automatically create a Login key for users on my server through the API using the examples and the HTTPSocket class.
After a bit of experimenting I've managed to turn the Login keys option on through the API for any given user. Using the login-as method, I was hoping to create these without having to know my users passwords
This should be possible if I'm interpreting this page correctly: https://www.directadmin.com/features.php?id=1298
Reading that I came to the following:
However all I'm getting in return is some information about a LoginKey my reseller account has and no key is made in my user account.
Can anyone tell me how to generate a key for my user account?
I'm trying to automatically create a Login key for users on my server through the API using the examples and the HTTPSocket class.
After a bit of experimenting I've managed to turn the Login keys option on through the API for any given user. Using the login-as method, I was hoping to create these without having to know my users passwords
This should be possible if I'm interpreting this page correctly: https://www.directadmin.com/features.php?id=1298
Reading that I came to the following:
PHP:
$sock = new HTTPSocket;
$sock->connect('mailserver',2222);
$sock->set_login('reseller|user', 'password');
$sock->query('/CMD_API_LOGIN_KEYS', [
'keyname' => 'akeyname',
'key' => 'whatever',
'key2' => 'whatever',
'never_expires' => 'yes',
//'expiry_timestamp' => ?,
'max_uses' => 0,
'clear_key' => ' no',
'allow_html' => 'yes',
'passwd' => 'password',
'select_allow0' => 'ALL_USER',
]);
$result = $sock->fetch_parsed_body();
print_r($result);
However all I'm getting in return is some information about a LoginKey my reseller account has and no key is made in my user account.
Can anyone tell me how to generate a key for my user account?