Mensen van een voetbal vereniging vroegen aan me of ik de beheerder wilden worden van hun site.
Ik heb hierop ja gezegt.
met mijn enig php ervaring ben ik er achtergekomen dat de vereniging helemaal niks heeft gedaan aan bugs verhelpen. Dus ging ik kijken in de ftp server en kwam ik veel script fouten tegen.
Verder gebruikt de vereniging joomla 3.1.5 .
verolgens ben ik ook @ apen staartje tegen gekomen in het script.
De voetbal site onderdrukt fouten want er staan in sommige documenten een @ staartje terwijl het geen ccs bestand is. maar een php bestand waar alleen php script in voor mag komen.
verder heb ik ook een email gestuurd naar joomla.org.
het zijn er eigenlijk zoveel. Verder heb ik een paar documenten verbeterd maar dat verorzaakt een fout in een andere map of bestand. de webserver geeft de fout aan als
error notice unexpected end aan bij het hele script
<?php
/**
* @package Joomla.Administrator
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
if (version_compare(PHP_VERSION, '5.3.1', '<'))
{
die('Your host needs to use PHP 5.3.1 or higher to run this version of Joomla!');
}
/**
* Constant that is checked in included files to prevent direct access.
* define() is used in the installation folder rather than "const" to not error for PHP 5.2 and lower
*/
define('_JEXEC', 1);
if (file_exists(__DIR__ . '/defines.php'))
{
include_once __DIR__ . '/defines.php';
}
if (!defined('_JDEFINES'))
{
define('JPATH_BASE', __DIR__);
require_once JPATH_BASE.'/includes/defines.php';
}
require_once JPATH_BASE.'/includes/framework.php';
require_once JPATH_BASE.'/includes/helper.php';
require_once JPATH_BASE.'/includes/toolbar.php';
// Mark afterLoad in the profiler.
JDEBUG ? $_PROFILER->mark('afterLoad') : null;
// Instantiate the application.
$app = JFactory::getApplication('administrator');
// Initialise the application.
$app->initialise(
array('language' => $app->getUserState('application.lang'))
);
// Test for magic quotes
if (get_magic_quotes_gpc())
{
$lang = JFactory::getLanguage();
if ($lang->hasKey('JERROR_MAGIC_QUOTES'))
{
JFactory::getApplication()->enqueueMessage(JText::_('JERROR_MAGIC_QUOTES'), 'Error');
}
else
{
JFactory::getApplication()->enqueueMessage('Your host needs to disable magic_quotes_gpc to run this version of Joomla!', 'Error');
}
}
// Mark afterIntialise in the profiler.
JDEBUG ? $_PROFILER->mark('afterInitialise') : null;
// Route the application.
$app->route();
// Mark afterRoute in the profiler.
JDEBUG ? $_PROFILER->mark('afterRoute') : null;
// Dispatch the application.
$app->dispatch();
// Mark afterDispatch in the profiler.
JDEBUG ? $_PROFILER->mark('afterDispatch') : null;
// Render the application.
$app->render();
// Mark afterRender in the profiler.
JDEBUG ? $_PROFILER->mark('afterRender') : null;
// Return the response.
echo $app;
<?php
/**
* @package Joomla.Administrator
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/*
* Joomla! system checks.
*/
@ini_set('magic_quotes_runtime', 0);
/*
* Installation check, and check on removal of the install directory.
*/
if (!file_exists(JPATH_CONFIGURATION.'/configuration.php') || (filesize(JPATH_CONFIGURATION.'/configuration.php') < 10) || file_exists(JPATH_INSTALLATION.'/index.php'))
{
header('Location: ../installation/index.php');
exit();
}
//
// Joomla system startup.
//
// System includes.
require_once JPATH_LIBRARIES.'/import.legacy.php';
JError::setErrorHandling(E_NOTICE, 'message');
JError::setErrorHandling(E_WARNING, 'message');
JError::setErrorHandling(E_ERROR, 'message', array('JError', 'customErrorPage'));
// Botstrap the CMS libraries.
require_once JPATH_LIBRARIES.'/cms.php';
// Pre-Load configuration.
ob_start();
require_once JPATH_CONFIGURATION.'/configuration.php';
ob_end_clean();
// System configuration.
$config = new JConfig;
// Set the error_reporting
switch ($config->error_reporting)
{
case 'default':
case '-1':
break;
case 'none':
case '0':
error_reporting(0);
break;
case 'simple':
error_reporting(E_ERROR | E_WARNING | E_PARSE);
ini_set('display_errors', 1);
break;
case 'maximum':
error_reporting(E_ALL);
ini_set('display_errors', 1);
break;
case 'development':
error_reporting(-1);
ini_set('display_errors', 1);
break;
default:
error_reporting($config->error_reporting);
ini_set('display_errors', 1);
break;
}
define('JDEBUG', $config->debug);
unset($config);
/*
* Joomla! framework loading.
*/
// System profiler.
if (JDEBUG)
{
$_PROFILER = JProfiler::getInstance('Application');
}
hierboven hebben ze de ?>
vergeten maar ook een @ als ik dit weg haal krijg ik weer de error notice unexpected end.
<?php
/**
* @package Joomla.Administrator
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
//Global definitions.
//Joomla framework path definitions.
$parts = explode(DIRECTORY_SEPARATOR, JPATH_BASE);
array_pop($parts);
//Defines.
define('JPATH_ROOT', implode(DIRECTORY_SEPARATOR, $parts));
define('JPATH_SITE', JPATH_ROOT);
define('JPATH_CONFIGURATION', JPATH_ROOT);
define('JPATH_ADMINISTRATOR', JPATH_ROOT . '/administrator');
define('JPATH_LIBRARIES', JPATH_ROOT . '/libraries');
define('JPATH_PLUGINS', JPATH_ROOT . '/plugins');
define('JPATH_INSTALLATION', JPATH_ROOT . '/installation');
define('JPATH_THEMES', JPATH_BASE . '/templates');
define('JPATH_CACHE', JPATH_ROOT . '/cache');
define('JPATH_MANIFESTS', JPATH_ADMINISTRATOR . '/manifests');
<?php
/**
* @package Joomla.Administrator
* @subpackage com_login
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$input = JFactory::getApplication()->input;
$task = $input->get('task');
if ($task != 'login' && $task != 'logout')
{
$input->set('task', '');
$task = '';
}
$controller = JControllerLegacy::getInstance('Login');
$controller->execute($task);
$controller->redirect();
<?php
/**
* @package Joomla.Administrator
* @subpackage com_login
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Login Controller
*
* @package Joomla.Administrator
* @subpackage com_login
* @since 1.5
*/
class LoginController extends JControllerLegacy
{
/**
* Typical view method for MVC based architecture
*
* This function is provide as a default implementation, in most cases
* you will need to override it in your own controllers.
*
* @param boolean If true, the view output will be cached
* @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
* @return JController This object to support chaining.
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
// Special treatment is required for this component, as this view may be called
// after a session timeout. We must reset the view and layout prior to display
// otherwise an error will occur.
$this->input->set('view', 'login');
$this->input->set('layout', 'default');
parent::display();
}
/**
* Method to log in a user.
*
* @return void
*/
public function login()
{
// Check for request forgeries.
JSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN'));
$app = JFactory::getApplication();
$model = $this->getModel('login');
$credentials = $model->getState('credentials');
$return = $model->getState('return');
$result = $app->login($credentials, array('action' => 'core.login.admin'));
if (!($result instanceof Exception))
{
$app->redirect($return);
}
parent::display();
}
/**
* Method to log out a user.
*
* @return void
*/
public function logout()
{
JSession::checkToken('request') or jexit(JText::_('JInvalid_Token'));
$app = JFactory::getApplication();
$userid = $this->input->getInt('uid', null);
$options = array(
'clientid' => ($userid) ? 0 : 1
);
$result = $app->logout($userid, $options);
if (!($result instanceof Exception))
{
$model = $this->getModel('login');
$return = $model->getState('return');
$app->redirect($return);
}
parent::display();
}
}
?>
Ik wil graag weten wat je met de de @ini_set moet doen want als ik het verander in ini_set dan krijg ik error notice unexpected end