private function _uninstallPackage($package)
 {
     $path = $package->path;
     if (!$_SESSION['ftp_password']) {
         $ftp_password = Context::get('ftp_password');
     } else {
         $ftp_password = $_SESSION['ftp_password'];
     }
     $ftp_info = Context::getFTPInfo();
     $isSftpSupported = function_exists(ssh2_sftp);
     if ($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported) {
         $oModuleInstaller = new SFTPModuleInstaller($package);
     } else {
         if (function_exists('ftp_connect')) {
             $oModuleInstaller = new PHPFTPModuleInstaller($package);
         } else {
             $oModuleInstaller = new FTPModuleInstaller($package);
         }
     }
     $oModuleInstaller->setServerUrl(_XE_DOWNLOAD_SERVER_);
     $oModuleInstaller->setPassword($ftp_password);
     $output = $oModuleInstaller->uninstall();
     if (!$output->toBool()) {
         return $output;
     }
     $this->_updateinfo();
     $this->setMessage('success_deleted', 'update');
     return new Object();
 }
 /**
  * Uninstall package
  *
  * @return Object
  */
 function procAutoinstallAdminUninstallPackage()
 {
     $package_srl = Context::get('package_srl');
     $oModel =& getModel('autoinstall');
     $package = $oModel->getPackage($package_srl);
     $path = $package->path;
     if (!$_SESSION['ftp_password']) {
         $ftp_password = Context::get('ftp_password');
     } else {
         $ftp_password = $_SESSION['ftp_password'];
     }
     $ftp_info = Context::getFTPInfo();
     $isSftpSupported = function_exists(ssh2_sftp);
     if ($ftp_info->sftp && $ftp_info->sftp == 'Y' && $isSftpSupported) {
         $oModuleInstaller = new SFTPModuleInstaller($package);
     } else {
         if (function_exists('ftp_connect')) {
             $oModuleInstaller = new PHPFTPModuleInstaller($package);
         } else {
             $oModuleInstaller = new FTPModuleInstaller($package);
         }
     }
     $oModuleInstaller->setServerUrl(_XE_DOWNLOAD_SERVER_);
     $oModuleInstaller->setPassword($ftp_password);
     $output = $oModuleInstaller->uninstall();
     if (!$output->toBool()) {
         return $output;
     }
     $this->_updateinfo();
     $this->setMessage('success_deleted', 'update');
     if (Context::get('return_url')) {
         $this->setRedirectUrl(Context::get('return_url'));
     } else {
         $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAutoinstallAdminInstalledPackages'));
     }
 }