AAAA.htaccess000066600000000177151372171400006354 0ustar00 Order allow,deny Deny from all tmpl/edit.php000066600000002313151372171400007162 0ustar00
	
    fileContentByLine as $line) echo "
  1. ".str_replace(array("
    ","
    "),"",$line)."
  2. "; ?>
    
    tmpl/index.html000066600000000000151372171400007510 0ustar00tmpl/.htaccess000066600000000177151372171400007330 0ustar00
    Order allow,deny
    Deny from all
    tmpl/default.php000066600000004423151372171400007665 0ustar00
    		logFiles) {
    			foreach ($this->logFiles as $logFile ) {
    				$addLink=false;
    				$fileSize = filesize($this->path.DS.$logFile);
    				$fileInfo= $finfo?$finfo->file($this->path.DS.$logFile):0;
    				$fileInfoMime=substr($fileInfo, 0 ,strlen("text/plain"));
    				if (!$finfo or strcmp("text/plain", $fileInfoMime)==0) {
    					$addLink=true;
    				}
    				?>
    				
    0 and $addLink) { ?> 0) { ?>
    addStandardHiddenToForm(); AdminUIHelper::endAdminArea(); ?> view.html.php000066600000003623151372171400007203 0ustar00get('log_path', JPATH_ROOT . "/log"); $layoutName = JRequest::getWord('layout', 'default'); VmConfig::loadJLang('com_virtuemart_log'); if ($layoutName == 'edit') { $logFile = JRequest::getString('logfile', ''); $this->SetViewTitle('LOG', $logFile); $fileContent = file_get_contents($log_path . DS . $logFile); $fileContentByLine = explode("\n", $fileContent); $this->assignRef('fileContentByLine', $fileContentByLine); JToolBarHelper::cancel(); } else { $logFiles = JFolder::files($log_path, $filter = '.', true, false, array('index.html')); $this->SetViewTitle('LOG'); $this->assignRef('logFiles', $logFiles); $this->assignRef('path', $log_path); } parent::display($tpl); } } //No Closing Tag index.html000066600000000037151372171400006546 0ustar00 loggers/messagequeue.php000066600000002712151372557660011437 0ustar00priority) { case JLog::EMERGENCY: case JLog::ALERT: case JLog::CRITICAL: case JLog::ERROR: JFactory::getApplication()->enqueueMessage($entry->message, 'error'); break; case JLog::WARNING: JFactory::getApplication()->enqueueMessage($entry->message, 'warning'); break; case JLog::NOTICE: JFactory::getApplication()->enqueueMessage($entry->message, 'notice'); break; case JLog::INFO: JFactory::getApplication()->enqueueMessage($entry->message, 'message'); break; default: // Ignore other priorities. break; } } } loggers/formattedtext.php000066600000015526151372557660011647 0ustar00 'EMERGENCY', JLog::ALERT => 'ALERT', JLog::CRITICAL => 'CRITICAL', JLog::ERROR => 'ERROR', JLog::WARNING => 'WARNING', JLog::NOTICE => 'NOTICE', JLog::INFO => 'INFO', JLog::DEBUG => 'DEBUG'); /** * Constructor. * * @param array &$options Log object options. * * @since 11.1 */ public function __construct(array &$options) { // Call the parent constructor. parent::__construct($options); // The name of the text file defaults to 'error.php' if not explicitly given. if (empty($this->options['text_file'])) { $this->options['text_file'] = 'error.php'; } // The name of the text file path defaults to that which is set in configuration if not explicitly given. if (empty($this->options['text_file_path'])) { $this->options['text_file_path'] = JFactory::getConfig()->get('log_path'); } // False to treat the log file as a php file. if (empty($this->options['text_file_no_php'])) { $this->options['text_file_no_php'] = false; } // Build the full path to the log file. $this->path = $this->options['text_file_path'] . '/' . $this->options['text_file']; // Use the default entry format unless explicitly set otherwise. if (!empty($this->options['text_entry_format'])) { $this->format = (string) $this->options['text_entry_format']; } // Build the fields array based on the format string. $this->parseFields(); } /** * Destructor. * * @since 11.1 */ public function __destruct() { if (is_resource($this->file)) { fclose($this->file); } } /** * Method to add an entry to the log. * * @param JLogEntry $entry The log entry object to add to the log. * * @return boolean True on success. * * @since 11.1 * @throws LogException */ public function addEntry(JLogEntry $entry) { // Initialise the file if not already done. if (!is_resource($this->file)) { $this->initFile(); } // Set some default field values if not already set. if (!isset($entry->clientIP)) { // Check for proxies as well. if (isset($_SERVER['REMOTE_ADDR'])) { $entry->clientIP = $_SERVER['REMOTE_ADDR']; } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $entry->clientIP = $_SERVER['HTTP_X_FORWARDED_FOR']; } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) { $entry->clientIP = $_SERVER['HTTP_CLIENT_IP']; } } // If the time field is missing or the date field isn't only the date we need to rework it. if ((strlen($entry->date) != 10) || !isset($entry->time)) { // Get the date and time strings in GMT. $entry->datetime = $entry->date->toISO8601(); $entry->time = $entry->date->format('H:i:s', false); $entry->date = $entry->date->format('Y-m-d', false); } // Get a list of all the entry keys and make sure they are upper case. $tmp = array_change_key_case(get_object_vars($entry), CASE_UPPER); // Decode the entry priority into an English string. $tmp['PRIORITY'] = $this->priorities[$entry->priority]; // Fill in field data for the line. $line = $this->format; foreach ($this->fields as $field) { $line = str_replace('{' . $field . '}', (isset($tmp[$field])) ? $tmp[$field] : '-', $line); } // Write the new entry to the file. if (!fputs($this->file, $line . "\n")) { throw new LogException; } } /** * Method to generate the log file header. * * @return string The log file header * * @since 11.1 */ protected function generateFileHeader() { // Initialize variables. $head = array(); // Build the log file header. // If the no php flag is not set add the php die statement. if (empty($this->options['text_file_no_php'])) { // blank line to prevent information disclose: https://bugs.php.net/bug.php?id=60677 $head[] = '#'; $head[] = '#'; } $head[] = '#Date: ' . gmdate('Y-m-d H:i:s') . ' UTC'; $head[] = '#Software: ' . JPlatform::getLongVersion(); $head[] = ''; // Prepare the fields string $head[] = '#Fields: ' . strtolower(str_replace('}', '', str_replace('{', '', $this->format))); $head[] = ''; return implode("\n", $head); } /** * Method to initialise the log file. This will create the folder path to the file if it doesn't already * exist and also get a new file header if the file doesn't already exist. If the file already exists it * will simply open it for writing. * * @return void * * @since 11.1 */ protected function initFile() { // If the file doesn't already exist we need to create it and generate the file header. if (!is_file($this->path)) { // Make sure the folder exists in which to create the log file. JFolder::create(dirname($this->path)); // Build the log file header. $head = $this->generateFileHeader(); } else { $head = false; } // Open the file for writing (append mode). if (!$this->file = fopen($this->path, 'a')) { // Throw exception. } if ($head) { if (!fputs($this->file, $head)) { throw new LogException; } } } /** * Method to parse the format string into an array of fields. * * @return void * * @since 11.1 */ protected function parseFields() { // Initialise variables. $this->fields = array(); $matches = array(); // Get all of the available fields in the format string. preg_match_all("/{(.*?)}/i", $this->format, $matches); // Build the parsed fields list based on the found fields. foreach ($matches[1] as $match) { $this->fields[] = strtoupper($match); } } } loggers/syslog.php000066600000005763151372557660010277 0ustar00 'EMERG', JLog::ALERT => 'ALERT', JLog::CRITICAL => 'CRIT', JLog::ERROR => 'ERR', JLog::WARNING => 'WARNING', JLog::NOTICE => 'NOTICE', JLog::INFO => 'INFO', JLog::DEBUG => 'DEBUG'); /** * Constructor. * * @param array &$options Log object options. * * @since 11.1 */ public function __construct(array &$options) { // Call the parent constructor. parent::__construct($options); // Ensure that we have an identity string for the SysLog entries. if (empty($this->options['sys_ident'])) { $this->options['sys_ident'] = 'Joomla Platform'; } // If the option to add the process id to SysLog entries is set use it, otherwise default to true. if (isset($this->options['sys_add_pid'])) { $this->options['sys_add_pid'] = (bool) $this->options['sys_add_pid']; } else { $this->options['sys_add_pid'] = true; } // If the option to also send SysLog entries to STDERR is set use it, otherwise default to false. if (isset($this->options['sys_use_stderr'])) { $this->options['sys_use_stderr'] = (bool) $this->options['sys_use_stderr']; } else { $this->options['sys_use_stderr'] = false; } // Build the SysLog options from our log object options. $sysOptions = 0; if ($this->options['sys_add_pid']) { $sysOptions = $sysOptions | LOG_PID; } if ($this->options['sys_use_stderr']) { $sysOptions = $sysOptions | LOG_PERROR; } // Open the SysLog connection. openlog((string) $this->options['sys_ident'], $sysOptions, LOG_USER); } /** * Destructor. * * @since 11.1 */ public function __destruct() { closelog(); } /** * Method to add an entry to the log. * * @param JLogEntry $entry The log entry object to add to the log. * * @return void * * @since 11.1 */ public function addEntry(JLogEntry $entry) { // Generate the value for the priority based on predefined constants. $priority = constant(strtoupper('LOG_' . $this->priorities[$entry->priority])); // Send the entry to SysLog. syslog($priority, '[' . $entry->category . '] ' . $entry->message); } } loggers/echo.php000066600000002231151372557660007660 0ustar00 'EMERGENCY', JLog::ALERT => 'ALERT', JLog::CRITICAL => 'CRITICAL', JLog::ERROR => 'ERROR', JLog::WARNING => 'WARNING', JLog::NOTICE => 'NOTICE', JLog::INFO => 'INFO', JLog::DEBUG => 'DEBUG'); /** * Method to add an entry to the log. * * @param JLogEntry $entry The log entry object to add to the log. * * @return void * * @since 11.1 */ public function addEntry(JLogEntry $entry) { echo $this->priorities[$entry->priority] . ': ' . $entry->message . (empty($entry->category) ? '' : ' [' . $entry->category . ']') . "\n"; } } loggers/database.php000066600000011052151372557660010507 0ustar00options['db_object']) && empty($this->options['db_driver'])) { $this->dbo = JFactory::getDBO(); $this->driver = JFactory::getConfig()->get('dbtype'); $this->host = JFactory::getConfig()->get('host'); $this->user = JFactory::getConfig()->get('user'); $this->password = JFactory::getConfig()->get('password'); $this->database = JFactory::getConfig()->get('db'); $this->prefix = JFactory::getConfig()->get('dbprefix'); } // We need to get the database connection settings from the configuration options. else { $this->driver = (empty($this->options['db_driver'])) ? 'mysql' : $this->options['db_driver']; $this->host = (empty($this->options['db_host'])) ? '127.0.0.1' : $this->options['db_host']; $this->user = (empty($this->options['db_user'])) ? 'root' : $this->options['db_user']; $this->password = (empty($this->options['db_pass'])) ? '' : $this->options['db_pass']; $this->database = (empty($this->options['db_database'])) ? 'logging' : $this->options['db_database']; $this->prefix = (empty($this->options['db_prefix'])) ? 'jos_' : $this->options['db_prefix']; } // The table name is independent of how we arrived at the connection object. $this->table = (empty($this->options['db_table'])) ? '#__log_entries' : $this->options['db_table']; } /** * Method to add an entry to the log. * * @param JLogEntry $entry The log entry object to add to the log. * * @return void * * @since 11.1 */ public function addEntry(JLogEntry $entry) { // Connect to the database if not connected. if (empty($this->dbo)) { $this->connect(); } // Convert the date. $entry->date = $entry->date->toSql(); $this->dbo->insertObject($this->table, $entry); } /** * Method to connect to the database server based on object properties. * * @return void * * @since 11.1 * @throws LogException */ protected function connect() { // Build the configuration object to use for JDatabase. $options = array( 'driver' => $this->driver, 'host' => $this->host, 'user' => $this->user, 'password' => $this->password, 'database' => $this->database, 'prefix' => $this->prefix); try { $db = JDatabase::getInstance($options); if ($db instanceof Exception) { throw new LogException('Database Error: ' . (string) $db); } if ($db->getErrorNum() > 0) { throw new LogException(JText::sprintf('JLIB_UTIL_ERROR_CONNECT_DATABASE', $db->getErrorNum(), $db->getErrorMsg())); } // Assign the database connector to the class. $this->dbo = $db; } catch (RuntimeException $e) { throw new LogException($e->getMessage()); } } } loggers/w3c.php000066600000002567151372557660007452 0ustar00 loggers/.htaccess000066600000000177151372557660010036 0ustar00 Order allow,deny Deny from all entry.php000066600000004240151372557660006443 0ustar00priorities}. * @param string $category Type of entry * @param string $date Date of entry (defaults to now if not specified or blank) * * @since 11.1 */ public function __construct($message, $priority = JLog::INFO, $category = '', $date = null) { $this->message = (string) $message; // Sanitize the priority. if (!in_array($priority, $this->priorities, true)) { $priority = JLog::INFO; } $this->priority = $priority; // Sanitize category if it exists. if (!empty($category)) { $this->category = (string) strtolower(preg_replace('/[^A-Z0-9_\.-]/i', '', $category)); } // Get the date as a JDate object. $this->date = new JDate($date ? $date : 'now'); } } logger.php000066600000002123151372557660006557 0ustar00options = & $options; } /** * Method to add an entry to the log. * * @param JLogEntry $entry The log entry object to add to the log. * * @return void * * @since 11.1 */ abstract public function addEntry(JLogEntry $entry); } log.php000066600000002362151372557660006066 0ustar00addEntry($errorlog); } break; case JAuthentication::STATUS_FAILURE : { $errorlog['status'] = $response['type'] . " FAILURE: "; if ($this->params->get('log_username', 0)) { $errorlog['comment'] = $response['error_message'] . ' ("' . $response['username'] . '")'; } else { $errorlog['comment'] = $response['error_message']; } $log->addEntry($errorlog); } break; default : { $errorlog['status'] = $response['type'] . " UNKNOWN ERROR: "; $errorlog['comment'] = $response['error_message']; $log->addEntry($errorlog); } break; } } } logexception.php000066600000000765151372557660010012 0ustar00 plg_system_log Joomla! Project April 2007 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 2.5.0 PLG_LOG_XML_DESCRIPTION log.php index.html en-GB.plg_system_log.ini en-GB.plg_system_log.sys.ini