? GR0V Shell

GR0V shell

Linux www.koreapackagetour.com 2.6.32-042stab145.3 #1 SMP Thu Jun 11 14:05:04 MSK 2020 x86_64

Path : /home/admin/public_html/old/administrator/components/com_xijc/controllers/
File Upload :
Current File : /home/admin/public_html/old/administrator/components/com_xijc/controllers/blacklist.php

<?php
// no direct access
defined('_JEXEC') or die('Restricted access');

class XiJCControllerBlacklist extends JController
{

	function __construct($config = array())
	{
		parent::__construct($config);
	}

	function display()
	{
		parent::display();
	}

	function edit()
	{
		$id = JRequest::getVar('editId', 0 , 'GET');
		$viewName	= JRequest::getCmd( 'view' , 'blacklist' );

		// Get the document object
		$document	=& JFactory::getDocument();

		// Get the view type
		$viewType	= $document->getType();

		$view		=& $this->getView( $viewName , $viewType );
		$layout		= JRequest::getCmd( 'layout' , 'blacklist.edit' );
		$view->setLayout( $layout );
		echo $view->edit($id);

	}



	function save()
	{
		global $mainframe;
		// Check for request forgeries
		JRequest::checkToken() or jexit( 'Invalid Token' );

		$post	= JRequest::get('post');
		//$cid	= JRequest::getVar( 'cid', array(0), 'post', 'array' );
		//$post['id'] = (int) $cid[0];

		$user	=& JFactory::getUser();
		if ( $user->get('guest')) {
			JError::raiseError( 403, JText::_('ACCESS FORBIDDEN') );
			return;
		}

		$urlparamstring = XiJCManager::getParamsInArray();
		
		/*
		 * Insert the data in #__xipc_blacklist.
		 */

		JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'tables');
		$row	=& JTable::getInstance( 'blacklist' , 'XiJCTable' );
		$row->load( $post['id'] );
		$row->rulename = JRequest::getVar('rulename','','POST');		
		$row->option = JRequest::getVar('selectedoption','','POST');
		$row->enable = JRequest::getVar('enable',0,'POST');
		$row->params = $urlparamstring;

		if($storedId = $row->store())
			$msg = JText::_('BLACKLIST SAVED');
		else
			$msg = JText::_('UNABLE TO SAVE BLACKLIST');
			
		$link = JRoute::_('index.php?option=com_xijc&view=blacklist&task=display', false);
		$mainframe->redirect($link, $msg);
	}



	function remove()
	{
		global $mainframe;
		// Check for request forgeries
		JRequest::checkToken() or jexit( 'Invalid Token' );

		$ids	= JRequest::getVar( 'cid', array(0), 'post', 'array' );

		//$post['id'] = (int) $cid[0];
		JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'tables');
		$row	=& JTable::getInstance( 'blacklist' , 'XiJCTable' );
		$i = 1;

		if(!empty($ids))
		{
			foreach( $ids as $id )
			{
				$row->load( $id );
				//Delete the record from #__xijc_blacklist table.
				
				if(!$row->delete( $id ))
				{
					// If there are any error when deleting, we just stop and redirect user with error.
					$message	= JText::_('ERROR IN REMOVING BLACKLIST');
					$mainframe->redirect( 'index.php?option=com_xijc&view=blacklist' , $message);
					exit;
				}
				$i++;
			}
		}

		$count = $i - 1;

		$cache = & JFactory::getCache('com_content');
		$cache->clean();
		$message	= $count.' '.JText::_('BLACKLIST REMOVED');
		$link = JRoute::_('index.php?option=com_xijc&view=blacklist', false);
		$mainframe->redirect($link, $message);
	}


	function publish()
	{
		global $mainframe;
		// Check for request forgeries
		JRequest::checkToken() or jexit( 'Invalid Token' );
		// Initialize variables
		$ids		= JRequest::getVar( 'cid', array(0), 'post', 'array' );
		$total		= count( $ids );

		if (empty( $ids )) {
			return JError::raiseWarning( 500, JText::_( 'NO ITEMS SELECTED' ) );
		}

		$bModel	= XiJCFactory::getModel( 'blacklist' );
		$counter = 0;
		foreach($ids as $id){
			$success = $bModel->updateEnable($id,1);
			if($success)
				$counter++;
		}

		$msg = sprintf(JText::_('ITEMS ENABLED'),$counter);
		$link = JRoute::_('index.php?option=com_xijc&view=blacklist', false);
		$mainframe->redirect($link, $msg);
	}

	function unpublish()
	{
		global $mainframe;
		// Check for request forgeries
		JRequest::checkToken() or jexit( 'Invalid Token' );
		// Initialize variables
		$ids		= JRequest::getVar( 'cid', array(0), 'post', 'array' );
		$total			= count( $ids );

		if (empty( $ids )) {
			return JError::raiseWarning( 500, JText::_( 'No items selected' ) );
		}

		$bModel	= XiJCFactory::getModel( 'blacklist' );
		$counter = 0;
		foreach($ids as $id){
			$success = $bModel->updateEnable($id,0);
			if($success)
				$counter++;
		}

		$msg = sprintf(JText::_('ITEMS DISABLED'),$counter);
		$link = JRoute::_('index.php?option=com_xijc&view=blacklist', false);
		$mainframe->redirect($link, $msg);
	}
}

T1KUS90T
  root-grov@210.1.60.28:~$