$row) { $list[$key]['path'] = str_replace(ALTERNZ_BASE_PATH.Users::get('login'), '', $row['path']); } return $list; } public function delete($login) { if (!FTP_Accounts::checkLoginSyntax($login)) return false; DB::uQuery('DELETE FROM ftp_accounts WHERE uid="'.Users::get('uid').'" AND login="'.DB::esc($login).'";'); return true; } public function edit($login, $new_password, $new_path, $new_quota) { if (!FTP_Accounts::checkLoginSyntax($login)) return false; if (strpos($new_path, '..') === true) $new_path = ''; $new_path = ALTERNZ_BASE_PATH.Users::get('login').'/'.$new_path; DB::uQuery('UPDATE ftp_accounts SET password="'.DB::esc($new_password).'", path="'.DB::esc($new_path).'", quota_size="'.(int)$new_quota.'" WHERE uid="'.Users::get('uid').'" AND login="'.DB::esc($login).'";'); return true; } public function getByLogin($login) { $item = DB::aQuery('SELECT * FROM ftp_accounts WHERE uid="'.Users::get('uid').'" AND login="'.DB::esc($login).'";'); if (empty($item[0])) return false; $item = $item[0]; $item['path'] = str_replace(ALTERNZ_BASE_PATH.Users::get('login'), '', $item['path']); return $item; } } ?>