create quotatallies entry if it not exists, fixes #885; correction in api-doc for Ftps.update ftp_password parameter, fixes #889
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -182,6 +182,17 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
|
|||||||
), true, true);
|
), true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create quotatallies entry if it not exists, refs #885
|
||||||
|
if ($result_stmt->rowCount() == 0) {
|
||||||
|
$stmt = Database::prepare("INSERT INTO `" . TABLE_FTP_QUOTATALLIES . "`
|
||||||
|
(`name`, `quota_type`, `bytes_in_used`, `bytes_out_used`, `bytes_xfer_used`, `files_in_used`, `files_out_used`, `files_xfer_used`)
|
||||||
|
VALUES (:name, 'user', '0', '0', '0', '0', '0', '0')
|
||||||
|
");
|
||||||
|
Database::pexecute($stmt, array(
|
||||||
|
"name" => $username
|
||||||
|
), true, true);
|
||||||
|
}
|
||||||
|
|
||||||
$group_upd_stmt = Database::prepare("
|
$group_upd_stmt = Database::prepare("
|
||||||
UPDATE `" . TABLE_FTP_GROUPS . "`
|
UPDATE `" . TABLE_FTP_GROUPS . "`
|
||||||
SET `members` = CONCAT_WS(',',`members`, :username)
|
SET `members` = CONCAT_WS(',',`members`, :username)
|
||||||
@@ -345,7 +356,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
|
|||||||
* @param string $username
|
* @param string $username
|
||||||
* optional, the username
|
* optional, the username
|
||||||
* @param string $ftp_password
|
* @param string $ftp_password
|
||||||
* password for the created database and database-user
|
* optional, update password if specified
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* destination path relative to the customers-homedir
|
* destination path relative to the customers-homedir
|
||||||
* @param string $ftp_description
|
* @param string $ftp_description
|
||||||
|
|||||||
Reference in New Issue
Block a user