5
* ZPanel - A Cross-Platform Open-Source Web Hosting Control panel.
9
* @author Bobby Allen - ballen@zpanelcp.com
10
* @copyright (c) 2008-2011 ZPanel Group - http://www.zpanelcp.com/
11
* @license http://opensource.org/licenses/gpl-3.0.html GNU Public License v3
13
* This program (ZPanel) is free software: you can redistribute it and/or modify
14
* it under the terms of the GNU General Public License as published by
15
* the Free Software Foundation, either version 3 of the License, or
16
* (at your option) any later version.
18
* This program is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
23
* You should have received a copy of the GNU General Public License
24
* along with this program. If not, see <http://www.gnu.org/licenses/>.
28
$result = $zdbh->query("SELECT * FROM x_settings WHERE so_name_vc='ftp_db'")->Fetch();
29
$ftp_db = $result['so_value_tx'];
30
include('cnf/db.php');
34
$ftp_db = new db_driver("mysql:host=localhost;dbname=$ftp_db", $z_db_user, $z_db_pass);
35
} catch (PDOException $e) {
39
foreach ($deletedclients as $deletedclient){
40
$sql = "SELECT COUNT(*) FROM x_ftpaccounts WHERE ft_acc_fk=" . $deletedclient . " AND ft_deleted_ts IS NULL";
41
if ($numrows = $zdbh->query($sql)) {
42
if ($numrows->fetchColumn() <> 0) {
43
$sql = $zdbh->prepare("SELECT * FROM x_ftpaccounts WHERE ft_acc_fk=" . $deletedclient . " AND ft_deleted_ts IS NULL");
45
while ($rowclient = $sql->fetch()) {
46
$fsql = $ftp_db->prepare("DELETE FROM ftpquotalimits
48
name='".$rowclient['ft_user_vc']."'");
50
$fsql = $ftp_db->prepare("DELETE FROM ftpuser
52
userid='".$rowclient['ft_user_vc']."'");
55
$sql = $zdbh->prepare("UPDATE x_ftpaccounts SET ft_deleted_ts=" . time() . " WHERE ft_acc_fk=".$deletedclient."");
b'\\ No newline at end of file'