GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 61-62 lines in 2 locations

component/admin/controllers/package.php 1 location

@@ 56-117 (lines=62) @@
53
	 *
54
	 * @return void
55
	 */
56
	public function download()
57
	{
58
		// Initialise variables.
59
		$app = JFactory::getApplication();
60
		$input = $app->input;
61
		$model   = $this->getModel();
62
63
		$data = $input->get('jform', array(), 'array');
64
		$model->download($data);
65
66
		// Redirect to the export view
67
		// todo: this feature is not finished.
68
69
		/*
70
		$app  = JFactory::getApplication();
71
		$name = $app->getUserState('com_localise.package.name');
72
		$path = JPATH_COMPONENT_ADMINISTRATOR . '/packages/' . $name . '.xml';
73
		$id   = LocaliseHelper::getFileId($path);
74
		*/
75
76
		// Check if the package exists
77
78
		/*
79
		if (empty($id))
80
		{
81
			$this->setRedirect(
82
				JRoute::_('index.php?option=' . $this->_option . '&view=packages', false),
83
				JText::sprintf('COM_LOCALISE_ERROR_DOWNLOADPACKAGE_UNEXISTING', $name),
84
				'error'
85
			);
86
		}
87
		else
88
		{
89
			$model   = $this->getModel();
90
			$package = $model->getItem();
91
92
			if (!$package->standalone)
93
			{
94
				$msg  = JText::sprintf('COM_LOCALISE_NOTICE_DOWNLOADPACKAGE_NOTSTANDALONE', $name);
95
				$type = 'notice';
96
			}
97
			else
98
			{
99
				$msg  = '';
100
				$type = 'message';
101
			}
102
103
			setcookie(JApplicationHelper::getHash($this->context . '.author'), $package->author, time() + 60 * 60 * 24 * 30);
104
			setcookie(JApplicationHelper::getHash($this->context . '.copyright'), $package->copyright, time() + 60 * 60 * 24 * 30);
105
			setcookie(JApplicationHelper::getHash($this->context . '.email'), $package->email, time() + 60 * 60 * 24 * 30);
106
			setcookie(JApplicationHelper::getHash($this->context . '.url'), $package->url, time() + 60 * 60 * 24 * 30);
107
			setcookie(JApplicationHelper::getHash($this->context . '.version'), $package->version, time() + 60 * 60 * 24 * 30);
108
			setcookie(JApplicationHelper::getHash($this->context . '.license'), $package->license, time() + 60 * 60 * 24 * 30);
109
110
			$this->setRedirect(
111
				JRoute::_('index.php?option=com_localise&tmpl=component&view=downloadpackage&name=' . $name . '&standalone=' . $package->standalone, false),
112
				$msg,
113
				$type
114
			);
115
		}
116
		*/
117
	}
118
119
	/**
120
	 * Method for uploading a file.

component/admin/controllers/packagefile.php 1 location

@@ 64-124 (lines=61) @@
61
	 *
62
	 * @return void
63
	 */
64
	public function download()
65
	{
66
		// Initialise variables.
67
		$app = JFactory::getApplication();
68
		$input = $app->input;
69
		$model   = $this->getModel();
70
71
		$data = $input->get('jform', array(), 'array');
72
		$model->download($data);
73
74
		// Redirect to the export view
75
76
		/*
77
		$app  = JFactory::getApplication();
78
		$name = $app->getUserState('com_localise.package.name');
79
		$path = JPATH_COMPONENT_ADMINISTRATOR . '/packages/' . $name . '.xml';
80
		$id   = LocaliseHelper::getFileId($path);
81
		*/
82
83
		// Check if the package exists
84
85
		/*
86
		if (empty($id))
87
		{
88
			$this->setRedirect(
89
				JRoute::_('index.php?option=' . $this->_option . '&view=packages', false),
90
				JText::sprintf('COM_LOCALISE_ERROR_DOWNLOADPACKAGE_UNEXISTING', $name),
91
				'error'
92
			);
93
		}
94
		else
95
		{
96
			$model   = $this->getModel();
97
			$package = $model->getItem();
98
99
			if (!$package->standalone)
100
			{
101
				$msg  = JText::sprintf('COM_LOCALISE_NOTICE_DOWNLOADPACKAGE_NOTSTANDALONE', $name);
102
				$type = 'notice';
103
			}
104
			else
105
			{
106
				$msg  = '';
107
				$type = 'message';
108
			}
109
110
			setcookie(JApplicationHelper::getHash($this->context . '.author'), $package->author, time() + 60 * 60 * 24 * 30);
111
			setcookie(JApplicationHelper::getHash($this->context . '.copyright'), $package->copyright, time() + 60 * 60 * 24 * 30);
112
			setcookie(JApplicationHelper::getHash($this->context . '.email'), $package->email, time() + 60 * 60 * 24 * 30);
113
			setcookie(JApplicationHelper::getHash($this->context . '.url'), $package->url, time() + 60 * 60 * 24 * 30);
114
			setcookie(JApplicationHelper::getHash($this->context . '.version'), $package->version, time() + 60 * 60 * 24 * 30);
115
			setcookie(JApplicationHelper::getHash($this->context . '.license'), $package->license, time() + 60 * 60 * 24 * 30);
116
117
			$this->setRedirect(
118
				JRoute::_('index.php?option=com_localise&tmpl=component&view=downloadpackage&name=' . $name . '&standalone=' . $package->standalone, false),
119
				$msg,
120
				$type
121
			);
122
		}
123
		*/
124
	}
125
}
126