function render() {
		$hdr_spotnntp = new SpotNntp($this->_settings->get('nntp_hdr'));

		# Controleer de users' rechten
		$this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_retrieve_nzb, '');

		/* Als de HDR en de NZB host hetzelfde zijn, zet geen tweede verbinding op */
		$settings_nntp_hdr = $this->_settings->get('nntp_hdr');
		$settings_nntp_nzb = $this->_settings->get('nntp_nzb');
		if ($settings_nntp_hdr['host'] == $settings_nntp_nzb['host']) {
			$nzb_spotnntp = $hdr_spotnntp;
		} else {
			$nzb_spotnntp = new SpotNntp($this->_settings->get('nntp_nzb'));
		} # else

		try {
			$spotNzb = new SpotNzb($this->_db, $this->_settings);
			$spotNzb->handleNzbAction($this->_messageid, $this->_currentSession,
							$this->_action, $hdr_spotnntp, $nzb_spotnntp);
			
			if ($this->_action != 'display') {
				echo "<div data-role=page><div data-role=content><p>NZB saved.</p><a href='" .$this->_settings->get('spotweburl') ."' rel=external data-role='button'>OK</a></div></div>";			
			} # if
		}
		catch(Exception $x) {
			echo "<div data-role=page><div data-role=content><p>" . $x->getMessage() . "</p><a href='". $this->_settings->get('spotweburl') ."' rel=external data-role='button'>OK</a></div></div>";
		} # catch
	} # render
Esempio n. 2
0
 function render()
 {
     $hdr_spotnntp = new SpotNntp($this->_settings->get('nntp_hdr'));
     # Controleer de users' rechten
     $this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_retrieve_nzb, '');
     # als het niet display is, check of we ook download integratie rechten hebben
     if ($this->_action != 'display') {
         $this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_download_integration, $this->_action);
     }
     # if
     /* Als de HDR en de NZB host hetzelfde zijn, zet geen tweede verbinding op */
     $settings_nntp_hdr = $this->_settings->get('nntp_hdr');
     $settings_nntp_nzb = $this->_settings->get('nntp_nzb');
     if ($settings_nntp_hdr['host'] == $settings_nntp_nzb['host']) {
         $nzb_spotnntp = $hdr_spotnntp;
     } else {
         $nzb_spotnntp = new SpotNntp($this->_settings->get('nntp_nzb'));
     }
     # else
     # NZB files mogen liever niet gecached worden op de client
     $this->sendExpireHeaders(true);
     try {
         $spotNzb = new SpotNzb($this->_db, $this->_settings);
         $spotNzb->handleNzbAction($this->_messageid, $this->_currentSession, $this->_action, $hdr_spotnntp, $nzb_spotnntp);
         if ($this->_action != 'display') {
             echo "<div data-role=page><div data-role=content><p>NZB saved.</p><a href='" . $this->_settings->get('spotweburl') . "' rel=external data-role='button'>OK</a></div></div>";
         }
         # if
     } catch (Exception $x) {
         echo "<div data-role=page><div data-role=content><p>" . $x->getMessage() . "</p><a href='" . $this->_settings->get('spotweburl') . "' rel=external data-role='button'>OK</a></div></div>";
     }
     # catch
 }
Esempio n. 3
0
	function makeSabnzbdUrl($spot) {
		$action = $this->_settings['nzbhandling']['action'];
		# geef geen url terug als we disabled zijn
		if ($action == 'disable') {
			return '';
		} # if
		
		# als de gebruiker gevraagd heeft om niet clientside handling, geef ons zelf dan terug 
		# met de gekozen actie
		if ($action == 'client-sabnzbd') {
			$spotNzb = new SpotNzb($this->_db, $this->_settings);
			return $spotNzb->generateSabnzbdUrl($spot, $action);
		} else {
			return $this->makeBaseUrl() . '?page=getnzb&amp;action=' . $action . '&amp;messageid=' . $spot['messageid'];
		} # else
	} # makeSabnzbdUrl
	function render() {
		$hdr_spotnntp = new SpotNntp($this->_settings['nntp_hdr']);

		/* Als de HDR en de NZB host hetzelfde zijn, zet geen tweede verbinding op */
		if ($this->_settings['nntp_hdr']['host'] == $this->_settings['nntp_nzb']['host']) {
			$nzb_spotnntp = $hdr_spotnntp;
		} else {
			$nzb_spotnntp = new SpotNntp($this->_settings['nntp_nzb']);
		} # else

		try {
			$spotNzb = new SpotNzb($this->_db, $this->_settings);
			$spotNzb->handleNzbAction($this->_messageid, $this->_action, $hdr_spotnntp, $nzb_spotnntp);
			
			if ($this->_action != 'display') {
				echo "<div data-role=page><div data-role=content><p>NZB saved.</p><a href='" .$this->_settings['spotweburl'] ."' rel=external data-role='button'>OK</a></div></div>";			
			} # if
		}
		catch(Exception $x) {
			echo "<div data-role=page><div data-role=content><p>" . $x->getMessage() . "</p><a href='". $this->_settings['spotweburl'] ."' rel=external data-role='button'>OK</a></div></div>";
		} # catch
	} # render
Esempio n. 5
0
 function render()
 {
     $hdr_spotnntp = new SpotNntp($this->_settings['nntp_hdr'], $this->_settings['use_openssl']);
     /* Als de HDR en de NZB host hetzelfde zijn, zet geen tweede verbinding op */
     if ($this->_settings['nntp_hdr']['host'] == $this->_settings['nntp_nzb']['host']) {
         $nzb_spotnntp = $hdr_spotnntp;
     } else {
         $nzb_spotnntp = new SpotNntp($this->_settings['nntp_nzb'], $this->_settings['use_openssl']);
     }
     # else
     try {
         $spotNzb = new SpotNzb($this->_db, $this->_settings);
         $spotNzb->handleNzbAction($this->_messageid, $this->_action, $hdr_spotnntp, $nzb_spotnntp);
         if ($this->_action != 'display') {
             echo "<xml><result>OK</result><msg></msg></xml>";
         }
         # if
     } catch (Exception $x) {
         echo "<xml><result>ERROR</result><msg>" . $x->getMessage() . "</msg></xml>";
     }
     # catch
 }