array_push($arFtpSiteIds, $ftpSiteId); $ftpPath = new FTPPath(); // For Base64 decoding $path = str_replace("_", "+", $path); $path = str_replace(".", "/", $path); $path = str_replace("-", "=", $path); //$ftpPath->setFtpPathId($_SESSION["ftpPathId"]); $ftpPath->setFtpSiteId($ftpSiteId); $ftpPath->setGroupId($groupId); $ftpPath->setPath(base64_decode($path)); /*$ftpPath->setPath($path);*/ $successful = FTPPathDB::save($ftpPath); } } if ($successful) { $cleanupRS = new dbRS(); if (sizeof($arFtpSiteIds) > 0) { $inString = ''; foreach ($arFtpSiteIds as $ftpSiteId) { if (strlen($inString) > 0) { $inString .= ','; } $inString .= $ftpSiteId; } $cleanupRS->execute(sprintf("delete from ftp_path where group_id = %s and ftp_site_id not in (%s)", dbUtil::encode($groupId) ,$inString));