Skip to content

Commit 54f1581

Browse files
author
mcramer
committed
Fixed: FS#2314 - Reseller creation in remote API does not work properly (id_rsa and ssh_rsa)
1 parent 4e18bd4 commit 54f1581

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

interface/lib/classes/remoting.inc.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2651,6 +2651,12 @@ protected function klientadd($formdef_file, $reseller_id, $params)
26512651
}
26522652
*/
26532653

2654+
/* copied from the client_edit php */
2655+
exec('ssh-keygen -t rsa -C '.$username.'-rsa-key-'.time().' -f /tmp/id_rsa -N ""');
2656+
$app->db->query("UPDATE client SET created_at = ".time().", id_rsa = '".$app->db->quote(@file_get_contents('/tmp/id_rsa'))."', ssh_rsa = '".$app->db->quote(@file_get_contents('/tmp/id_rsa.pub'))."' WHERE client_id = ".$this->id);
2657+
exec('rm -f /tmp/id_rsa /tmp/id_rsa.pub');
2658+
2659+
26542660

26552661
//$app->uses('tform');
26562662
//* Save changes to Datalog

0 commit comments

Comments
 (0)