PK ?\) form/.htaccessnu W+A
Order allow,deny
Deny from all
PK ?\;^ ^ form/rule/captcha.phpnu W+A tag for the form field object.
* @param mixed $value The form field value to validate.
* @param string $group The field name group control value. This acts as as an array container for the field.
* For example if the field has name="foo" and the group value is set to "bar" then the
* full field name would end up being "bar[foo]".
* @param JRegistry &$input An optional JRegistry object with the entire data set to validate against the entire form.
* @param JForm &$form The form object for which the field is being tested.
*
* @return boolean True if the value is valid, false otherwise.
*
* @since 2.5
*/
public function test(&$element, $value, $group = null, &$input = null, &$form = null)
{
$plugin = $element['plugin'] ? (string) $element['plugin'] : JFactory::getApplication()->getParams()->get('captcha', JFactory::getConfig()->get('captcha', 0));
$namespace = $element['namespace'] ? (string) $element['namespace'] : $form->getName();
// Use 0 for none
if ($plugin === 0 || $plugin === '0')
{
return true;
}
else
{
$captcha = JCaptcha::getInstance($plugin, array('namespace' => $namespace));
}
// Test the value.
if (!$captcha->checkAnswer($value))
{
$error = $captcha->getError();
if ($error instanceof Exception)
{
return $error;
}
else
{
return new JException($error);
}
}
return true;
}
}
PK ?\) form/rule/.htaccessnu W+A
Order allow,deny
Deny from all
PK ?\V form/rule/index.htmlnu W+A
PK ?\V form/index.htmlnu W+A
PK ?\$ form/field/user.phpnu W+A getGroups();
$excluded = $this->getExcluded();
$link = 'index.php?option=com_users&view=users&layout=modal&tmpl=component&field=' . $this->id
. (isset($groups) ? ('&groups=' . base64_encode(json_encode($groups))) : '')
. (isset($excluded) ? ('&excluded=' . base64_encode(json_encode($excluded))) : '');
// Initialize some field attributes.
$attr = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
$attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
// Initialize JavaScript field attributes.
$onchange = (string) $this->element['onchange'];
// Load the modal behavior script.
JHtml::_('behavior.modal', 'a.modal_' . $this->id);
// Build the script.
$script = array();
$script[] = ' function jSelectUser_' . $this->id . '(id, title) {';
$script[] = ' var old_id = document.getElementById("' . $this->id . '_id").value;';
$script[] = ' if (old_id != id) {';
$script[] = ' document.getElementById("' . $this->id . '_id").value = id;';
$script[] = ' document.getElementById("' . $this->id . '_name").value = title;';
$script[] = ' ' . $onchange;
$script[] = ' }';
$script[] = ' SqueezeBox.close();';
$script[] = ' }';
// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
// Load the current username if available.
$table = JTable::getInstance('user');
if ($this->value)
{
$table->load($this->value);
}
else
{
$table->name = JText::_('JLIB_FORM_SELECT_USER');
}
// Create a dummy text field with the user name.
$html[] = '
';
// Create the real field, hidden, that stored the user id.
$html[] = '';
return implode("\n", $html);
}
/**
* Method to get the filtering groups (null means no filtering)
*
* @return mixed array of filtering groups or null.
*
* @since 1.6.0
*/
protected function getGroups()
{
return null;
}
/**
* Method to get the users to exclude from the list of users
*
* @return mixed Array of users to exclude or null to to not exclude them
*
* @since 1.6.0
*/
protected function getExcluded()
{
return null;
}
}
PK ?\t form/field/helpsite.phpnu W+A value));
return $options;
}
}
PK ?\V form/field/index.htmlnu W+A
PK ?\9# form/field/captcha.phpnu W+A tag for the form field object.
* @param mixed $value The form field value to validate.
* @param string $group The field name group control value. This acts as as an array container for the field.
* For example if the field has name="foo" and the group value is set to "bar" then the
* full field name would end up being "bar[foo]".
*
* @return boolean True on success.
*
* @since 2.5
*/
public function setup(&$element, $value, $group = null)
{
$result = parent::setup($element, $value, $group);
$plugin = $this->element['plugin'] ? (string) $this->element['plugin'] : JFactory::getApplication()->getParams()->get('captcha', JFactory::getConfig()->get('captcha'));
if ($plugin === 0 || $plugin === '0' || $plugin === '' || $plugin === null)
{
$this->hidden = true;
}
else
{
// Force field to be required. There's no reason to have a captcha if it is not required.
// Obs: Don't put required="required" in the xml file, you just need to have validate="captcha"
$this->required = true;
$class = $this->element['class'];
if (strpos($class, 'required') === false)
{
$this->element['class'] = $class . ' required';
}
}
return $result;
}
/**
* Method to get the field input.
*
* @return string The field input.
*
* @since 2.5
*/
protected function getInput()
{
$class = $this->element['class'] ? (string) $this->element['class'] : '';
$plugin = $this->element['plugin'] ? (string) $this->element['plugin'] : JFactory::getApplication()->getParams()->get('captcha', JFactory::getConfig()->get('captcha'));
$namespace = $this->element['namespace'] ? (string) $this->element['namespace'] : $this->form->getName();
// Use 0 for none
if ($plugin === 0 || $plugin === '0' || $plugin === '' || $plugin === null)
{
return '';
}
else
{
if (($captcha = JCaptcha::getInstance($plugin, array('namespace' => $namespace))) == null)
{
return '';
}
}
return $captcha->display($this->name, $this->id, $class);
}
}
PK ?\jg
form/field/menu.phpnu W+A
Order allow,deny
Deny from all
PK ?\^
form/field/templatestyle.phpnu W+A element['client'] ? (string) $this->element['client'] : 'site';
$client = JApplicationHelper::getClientInfo($clientName, true);
// Get the template.
$template = (string) $this->element['template'];
// Get the database object and a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// Build the query.
$query->select('s.id, s.title, e.name as name, s.template');
$query->from('#__template_styles as s');
$query->where('s.client_id = ' . (int) $client->id);
$query->order('template');
$query->order('title');
if ($template)
{
$query->where('s.template = ' . $db->quote($template));
}
$query->join('LEFT', '#__extensions as e on e.element=s.template');
$query->where('e.enabled=1');
$query->where($db->quoteName('e.type') . '=' . $db->quote('template'));
// Set the query and load the styles.
$db->setQuery($query);
$styles = $db->loadObjectList();
// Build the grouped list array.
if ($styles)
{
foreach ($styles as $style)
{
$template = $style->template;
$lang->load('tpl_' . $template . '.sys', $client->path, null, false, true)
|| $lang->load('tpl_' . $template . '.sys', $client->path . '/templates/' . $template, null, false, true);
$name = JText::_($style->name);
// Initialize the group if necessary.
if (!isset($groups[$name]))
{
$groups[$name] = array();
}
$groups[$name][] = JHtml::_('select.option', $style->id, $style->title);
}
}
// Merge any additional groups in the XML definition.
$groups = array_merge(parent::getGroups(), $groups);
return $groups;
}
}
PK ?\'1y y schema/changeitemmysql.phpnu W+A checkStatus = -1; // change status to skipped
$result = null;
// remove any newlines
$this->updateQuery = str_replace("\n", '', $this->updateQuery);
// fix up extra spaces around () and in general
$find = array('#((\s*)\(\s*([^)\s]+)\s*)(\))#', '#(\s)(\s*)#');
$replace = array('($3)', '$1');
$updateQuery = preg_replace($find, $replace, $this->updateQuery);
$wordArray = explode(' ', $updateQuery);
// first, make sure we have an array of at least 6 elements
// if not, we can't make a check query for this one
if (count($wordArray) < 6) {
return; // done with method
}
// we can only make check queries for alter table and create table queries
$command = strtoupper($wordArray[0] . ' ' . $wordArray[1]);
if ($command === 'ALTER TABLE') {
$alterCommand = strtoupper($wordArray[3] . ' ' . $wordArray[4]);
if ($alterCommand == 'ADD COLUMN') {
$result = 'SHOW COLUMNS IN ' . $wordArray[2] .
' WHERE field = ' . $this->fixQuote($wordArray[5]);
$this->queryType = 'ADD_COLUMN';
$this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[5]));
}
elseif ($alterCommand == 'ADD INDEX' || $alterCommand == 'ADD UNIQUE') {
if ($pos = strpos($wordArray[5], '(')) {
$index = $this->fixQuote(substr($wordArray[5], 0, $pos));
} else {
$index = $this->fixQuote($wordArray[5]);
}
$result = 'SHOW INDEXES IN ' . $wordArray[2] . ' WHERE Key_name = ' . $index;
$this->queryType = 'ADD_INDEX';
$this->msgElements = array($this->fixQuote($wordArray[2]), $index);
}
elseif ($alterCommand == 'DROP INDEX') {
$index = $this->fixQuote($wordArray[5]);
$result = 'SHOW INDEXES IN ' . $wordArray[2] . ' WHERE Key_name = ' . $index;
$this->queryType = 'DROP_INDEX';
$this->checkQueryExpected = 0;
$this->msgElements = array($this->fixQuote($wordArray[2]), $index);
}
elseif (strtoupper($wordArray[3]) == 'MODIFY') {
// Kludge to fix problem with "integer unsigned"
$type = $this->fixQuote($wordArray[5]);
if (isset($wordArray[6])) {
$type = $this->fixQuote($this->fixInteger($wordArray[5], $wordArray[6]));
}
$result = 'SHOW COLUMNS IN ' . $wordArray[2] . ' WHERE field = '
. $this->fixQuote($wordArray[4]) . ' AND type = ' . $type;
$this->queryType = 'CHANGE_COLUMN_TYPE';
$this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[4]), $type);
}
elseif (strtoupper($wordArray[3]) == 'CHANGE') {
// Kludge to fix problem with "integer unsigned"
$type = $this->fixQuote($this->fixInteger($wordArray[6], $wordArray[7]));
$result = 'SHOW COLUMNS IN ' . $wordArray[2] . ' WHERE field = ' .
$this->fixQuote($wordArray[4]) . ' AND type = ' . $type;
$this->queryType = 'CHANGE_COLUMN_TYPE';
$this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[4]), $type);
}
}
if ($command == 'CREATE TABLE') {
if (strtoupper($wordArray[2].$wordArray[3].$wordArray[4]) == 'IFNOTEXISTS') {
$table = $wordArray[5];
}
else {
$table = $wordArray[2];
}
$result = 'SHOW TABLES LIKE ' . $this->fixQuote($table);
$this->queryType = 'CREATE_TABLE';
$this->msgElements = array($this->fixQuote($table));
}
// set fields based on results
if ($this->checkQuery = $result) {
$this->checkStatus = 0; // unchecked status
}
else {
$this->checkStatus = -1; // skipped
}
}
/**
* Fix up integer. Fixes problem with MySQL integer descriptions.
* If you change a column to "integer unsigned" it shows
* as "int(10) unsigned" in the check query.
*
* @param string $type1 the column type
* @param string $type2 the column attributes
*
* @return string The original or changed column type.
*
* @since 2.5
*/
private function fixInteger($type1, $type2)
{
$result = $type1;
if (strtolower($type1) == "integer" && strtolower(substr($type2, 0, 8)) == 'unsigned') {
$result = 'int(10) unsigned';
}
return $result;
}
/**
*
* Fixes up a string for inclusion in a query.
* Replaces name quote character with normal quote for literal.
* Drops trailing semi-colon. Injects the database prefix.
*
* @param string $string The input string to be cleaned up.
* @return string The modified string.
*
* @since 2.5
*/
private function fixQuote($string)
{
$string = str_replace('`', '', $string);
$string = str_replace(';', '', $string);
$string = str_replace('#__', $this->db->getPrefix(), $string);
return $this->db->quote($string);
}
}
PK ?\) schema/.htaccessnu W+A
Order allow,deny
Deny from all
PK ?\
C6i i schema/changeset.phpnu W+A .
*
* @param JDatabase $db The current database object
* @param string $folder The full path to the folder containing the update queries
*
* @since 2.5
*/
public function __construct($db, $folder = null)
{
$this->db = $db;
$this->folder = $folder;
$updateFiles = $this->getUpdateFiles();
$updateQueries = $this->getUpdateQueries($updateFiles);
foreach ($updateQueries as $obj)
{
$this->changeItems[] = JSchemaChangeitem::getInstance($db, $obj->file, $obj->updateQuery);
}
}
/**
* Returns the existing JSchemaChangeset object if it exists.
* Otherwise, it creates a new one.
*
* @param JDatabase $db The current database object
* @param string $folder The full path to the folder containing the update queries
*
* @return JSchemaChangeSet The (possibly chached) instance of JSchemaChangeSet
*
* @since 2.5
*/
public static function getInstance($db, $folder)
{
static $instance;
if (!is_object($instance))
{
$instance = new JSchemaChangeSet($db, $folder);
}
return $instance;
}
/**
* Checks the database and returns an array of any errors found.
* Note these are not database errors but rather situations where
* the current schema is not up to date.
*
* @return array Array of errors if any.
*
* @since 2.5
*/
public function check()
{
$errors = array();
foreach ($this->changeItems as $item)
{
if ($item->check() === -2)
{
// Error found
$errors[] = $item;
}
}
return $errors;
}
/**
* Runs the update query to apply the change to the database
*
* @return void
*
* @since 2.5
*/
public function fix()
{
$this->check();
foreach ($this->changeItems as $item)
{
$item->fix();
}
}
/**
* Returns an array of results for this set
*
* @return array associative array of changeitems grouped by unchecked, ok, error, and skipped
*
* @since 2.5
*/
public function getStatus()
{
$result = array('unchecked' => array(), 'ok' => array(), 'error' => array(), 'skipped' => array());
foreach ($this->changeItems as $item)
{
switch ($item->checkStatus)
{
case 0:
$result['unchecked'][] = $item;
break;
case 1:
$result['ok'][] = $item;
break;
case -2:
$result['error'][] = $item;
break;
case -1:
$result['skipped'][] = $item;
break;
}
}
return $result;
}
/**
* Gets the current database schema, based on the highest version number.
* Note that the .sql files are named based on the version and date, so
* the file name of the last file should match the database schema version
* in the #__schemas table.
*
* @return string the schema version for the database
*
* @since 2.5
*/
public function getSchema()
{
$updateFiles = $this->getUpdateFiles();
$result = new SplFileInfo(array_pop($updateFiles));
return $result->getBasename('.sql');
}
/**
* Get list of SQL update files for this database
*
* @return array list of sql update full-path names
*
* @since 2.5
*/
private function getUpdateFiles()
{
// Get the folder from the database name
$sqlFolder = $this->db->name;
if (substr($sqlFolder, 0, 5) == 'mysql')
{
$sqlFolder = 'mysql';
}
// Default folder to core com_admin
if (!$this->folder)
{
$this->folder = JPATH_ADMINISTRATOR . '/components/com_admin/sql/updates/';
}
return JFolder::files($this->folder . '/' . $sqlFolder, '\.sql$', 1, true, array('.svn', 'CVS', '.DS_Store', '__MACOSX'),
array('^\..*', '.*~'), true);
}
/**
* Get array of SQL queries
*
* @param array $sqlfiles Array of .sql update filenames.
*
* @return array Array of stdClass objects where:
* file=filename,
* update_query = text of SQL update query
*
* @since 2.5
*/
private function getUpdateQueries(array $sqlfiles)
{
// Hold results as array of objects
$result = array();
foreach ($sqlfiles as $file)
{
$buffer = file_get_contents($file);
// Create an array of queries from the sql file
$queries = $this->db->splitSql($buffer);
foreach ($queries as $query)
{
if (trim($query))
{
$fileQueries = new stdClass;
$fileQueries->file = $file;
$fileQueries->updateQuery = $query;
$result[] = $fileQueries;
}
}
}
return $result;
}
}
PK ?\ schema/changeitem.phpnu W+A .
* These updates are run automatically if the site was updated using com_installer.
* However, it is possible that the program files could be updated without udpating
* the database (for example, if a user just copies the new files over the top of an
* existing installation).
*
* This is an abstract class. We need to extend it for each database and add a
* buildCheckQuery() method that creates the query to check that a DDL query has been run.
*
* @package CMS.Library
* @subpackage Schema
* @since 2.5
*/
abstract class JSchemaChangeitem extends JObject
{
/**
* Update file: full path file name where query was found
*
* @var string
*/
public $file = null;
/**
* Update query: query used to change the db schema (one line from the file)
*
* @var string
*/
public $updateQuery = null;
/**
* Check query: query used to check the db schema
*
* @var string
*/
public $checkQuery = null;
/**
* Check query result: expected result of check query if database is up to date
*
* @var string
*/
public $checkQueryExpected = 1;
/**
* JDatabase object
*
* @var string
*/
public $db = null;
/**
* Query type: To be used in building a language key for a
* message to tell user what was checked / changed
* Possible values: ADD_TABLE, ADD_COLUMN, CHANGE_COLUMN_TYPE, ADD_INDEX
*
* @var string
*
*/
public $queryType = null;
/**
* Array with values for use in a JText::sprintf statment indicating what was checked
*
* Tells you what the message should be, based on which elements are defined, as follows:
* For ADD_TABLE: table
* For ADD_COLUMN: table, column
* For CHANGE_COLUMN_TYPE: table, column, type
* For ADD_INDEX: table, index
*
* @var array
*/
public $msgElements = array();
/**
* Checked status
*
* @var int 0=not checked, -1=skipped, -2=failed, 1=succeeded
*/
public $checkStatus = 0;
/**
* Rerun status
*
* @var int 0=not rerun, -1=skipped, -2=failed, 1=succeeded
*/
public $rerunStatus = 0;
/**
* Constructor: builds check query and message from $updateQuery
*
* @param JDatabase $db
* @param string $file full path name of the sql file
* @param string $query text of the sql query (one line of the file)
* @param string $checkQuery
*
* @since 2.5
*/
public function __construct($db, $file, $updateQuery)
{
$this->updateQuery = $updateQuery;
$this->file = $file;
$this->db = $db;
$this->buildCheckQuery();
}
/**
*
* Returns an instance of the correct schemachangeitem for the $db
*
* @param JDatabase $db
* @param string $file full path name of the sql file
* @param string $query text of the sql query (one line of the file)
*
* @return JSchemaChangeItem for the $db driver
*
* @since 2.5
*/
public static function getInstance($db, $file, $query)
{
$instance = null;
// Get the class name (mysql and mysqli both use mysql)
$dbname = (substr($db->name, 0, 5) == 'mysql') ? 'mysql' : $db->name;
$path = dirname(__FILE__).'/' . 'changeitem' . $dbname . '.php' ;
$class = 'JSchemaChangeitem' . $dbname;
// If the file exists register the class with our class loader.
if (file_exists($path)) {
JLoader::register($class, $path);
$instance = new $class($db, $file, $query);
}
return $instance;
}
/**
* Runs the check query and checks that 1 row is returned
* If yes, return true, otherwise return false
*
* @return boolean true on success, false otherwise
*
* @since 2.5
*/
public function check()
{
$this->checkStatus = -1;
if ($this->checkQuery) {
$this->db->setQuery($this->checkQuery);
$rows = $this->db->loadObject();
if ($rows !== false) {
if (count($rows) === $this->checkQueryExpected) {
$this->checkStatus = 1;
} else {
$this->checkStatus = -2;
}
}
else {
$this->checkStatus = -2;
}
}
return $this->checkStatus;
}
/**
* Runs the update query to apply the change to the database
*
* @since 2.5
*/
public function fix()
{
if ($this->checkStatus === -2) {
// at this point we have a failed query
$this->db->setQuery($this->updateQuery);
if ($this->db->execute()) {
if ($this->check()) {
$this->checkStatus = 1;
$this->rerunStatus = 1;
} else {
$this->rerunStatus = -2;
}
} else {
$this->rerunStatus = -2;
}
}
}
}
PK ?\V schema/index.htmlnu W+A
PK ?\W/j schema/changeitemsqlazure.phpnu W+A checkStatus = -1; // change status to skipped
$result = null;
// remove any newlines
$this->updateQuery = str_replace("\n", '', $this->updateQuery);
// fix up extra spaces around () and in general
$find = array('#((\s*)\(\s*([^)\s]+)\s*)(\))#','#(\s)(\s*)#');
$replace = array('($3)', '$1');
$updateQuery = preg_replace($find, $replace, $this->updateQuery);
$wordArray = explode(' ', $updateQuery);
// first, make sure we have an array of at least 6 elements
// if not, we can't make a check query for this one
if (count($wordArray) < 6) {
return; // done with method
}
// we can only make check queries for alter table and create table queries
$command = strtoupper($wordArray[0] . ' ' . $wordArray[1]);
if ($command === 'ALTER TABLE') {
$alterCommand = strtoupper($wordArray[3] . ' ' . $wordArray[4]);//print_r($wordArray[4]);die();
if ($alterCommand == 'ADD') {
$result = 'SELECT * FROM INFORMATION_SCHEMA.Columns ' . $wordArray[2] .
' WHERE COLUMN_NAME = ' . $this->fixQuote($wordArray[5]);
$this->queryType = 'ADD';
$this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[5]));
}
elseif ($alterCommand == 'CREATE INDEX') {
$index = $this->fixQuote(substr($wordArray[5], 0, strpos($wordArray[5],'(')));
$result = 'SELECT * FROM SYS.INDEXES ' . $wordArray[2] . ' WHERE name = ' . $index;
$this->queryType = 'CREATE INDEX';
$this->msgElements = array($this->fixQuote($wordArray[2]), $index);
}
elseif (strtoupper($wordArray[3]) == 'MODIFY') {
$type = $this->fixQuote($wordArray[5]);
if (isset($wordArray[6])) {
$type = $this->fixQuote($this->fixInteger($wordArray[5], $wordArray[6]));
}
$result = 'SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = ' .$this->fixQuote($wordArray[2]) ;
$this->queryType = 'ALTER COLUMN COLUMN_NAME =' . $this->fixQuote($wordArray[4]);
$this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[4]));
}
elseif (strtoupper($wordArray[3]) == 'CHANGE') {
// Kludge to fix problem with "integer unsigned"
$type = $this->fixQuote($this->fixInteger($wordArray[6], $wordArray[7]));
$result = 'SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = ' .$this->fixQuote($wordArray[2]) ;
$this->fixQuote($wordArray[4]) ;
$this->queryType = 'ALTER COLUMN COLUMN_NAME =' . $this->fixQuote($wordArray[4]);
$this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[4]));
}
}
if ($command == 'CREATE TABLE') {
$table = $wordArray[5];
$result = 'SELECT * FROM sys.TABLES WHERE NAME = ' . $this->fixQuote($table);
$this->queryType = 'CREATE_TABLE';
$this->msgElements = array($this->fixQuote($table));
}
// set fields based on results
if ($this->checkQuery = $result) {
$this->checkStatus = 0; // unchecked status
}
else {
$this->checkStatus = -1; // skipped
}
}
/**
* Fix up integer. Fixes problem with MySQL integer descriptions.
* If you change a column to "integer unsigned" it shows
* as "int(10) unsigned" in the check query.
*
* @param string $type1 the column type
* @param string $type2 the column attributes
*
* @return string The original or changed column type.
*
* @since 2.5
*/
private function fixInteger($type1, $type2)
{
$result = $type1;
if (strtolower($type1) == "integer" && strtolower(substr($type2, 0, 8)) == 'unsigned') {
$result = 'int';
}
return $result;
}
/**
*
* Fixes up a string for inclusion in a query.
* Replaces name quote character with normal quote for literal.
* Drops trailing semi-colon. Injects the database prefix.
*
* @param string $string The input string to be cleaned up.
* @return string The modified string.
*
* @since 2.5
*/
private function fixQuote($string)
{
$string = str_replace('`', '', $string);
$string = str_replace(';', '', $string);
$string = str_replace('#__', $this->db->getPrefix(), $string);
return $this->db->quote($string);
}
}
PK ?\) captcha/.htaccessnu W+A
Order allow,deny
Deny from all
PK ?\y captcha/captcha.phpnu W+A _name = $captcha;
$this->_load($options);
}
/**
* Returns the global Captcha object, only creating it
* if it doesn't already exist.
*
* @param string $captcha The plugin to use.
* @param array $options Associative array of options.
*
* @return object The JCaptcha object.
*
* @since 2.5
*/
public static function getInstance($captcha, array $options = array())
{
$signature = md5(serialize(array($captcha, $options)));
if (empty(self::$_instances[$signature]))
{
try
{
self::$_instances[$signature] = new JCaptcha($captcha, $options);
}
catch (RuntimeException $e)
{
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
return null;
}
}
return self::$_instances[$signature];
}
/**
* @return boolean True on success
*
* @since 2.5
*/
public function initialise($id)
{
$args['id'] = $id ;
$args['event'] = 'onInit';
try
{
$this->_captcha->update($args);
}
catch (Exception $e)
{
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
return false;
}
return true;
}
/**
* Get the HTML for the captcha.
*
* @return the return value of the function "onDisplay" of the selected Plugin.
*
* @since 2.5
*/
public function display($name, $id, $class = '')
{
// Check if captcha is already loaded.
if (is_null($this->_captcha))
{
return;
}
// Initialise the Captcha.
if (!$this->initialise($id))
{
return;
}
$args['name'] = $name;
$args['id'] = $id ? $id : $name;
$args['class'] = $class ? 'class="'.$class.'"' : '';
$args['event'] = 'onDisplay';
return $this->_captcha->update($args);
}
/**
* Checks if the answer is correct.
*
* @return the return value of the function "onCheckAnswer" of the selected Plugin.
*
* @since 2.5
*/
public function checkAnswer($code)
{
//check if captcha is already loaded
if (is_null(($this->_captcha)))
{
return;
}
$args['code'] = $code;
$args['event'] = 'onCheckAnswer';
return $this->_captcha->update($args);
}
/**
* Load the Captcha plug-in.
*
* @param array $options Associative array of options.
*
* @return void
*
* @since 2.5
* @throws RuntimeException
*/
private function _load(array $options = array())
{
// Build the path to the needed captcha plugin
$name = JFilterInput::getInstance()->clean($this->_name, 'cmd');
$path = JPATH_PLUGINS . '/captcha/' . $name . '/' . $name . '.php';
if (!JFile::exists($path))
{
throw new RuntimeException(JText::sprintf('JLIB_CAPTCHA_ERROR_PLUGIN_NOT_FOUND', $name));
}
// Require plugin file
require_once $path;
// Get the plugin
$plugin = JPluginHelper::getPlugin('captcha', $this->_name);
if (!$plugin)
{
throw new RuntimeException(JText::sprintf('JLIB_CAPTCHA_ERROR_PLUGIN_NOT_FOUND', $name));
}
$params = new JRegistry($plugin->params);
$plugin->params = $params;
// Build captcha plugin classname
$name = 'plgCaptcha' . $this->_name;
$this->_captcha = new $name($this, (array)$plugin, $options);
}
/**
* Get the state of the JEditor object
*
* @return mixed The state of the object.
*
* @since 2.5
*/
public function getState()
{
return $this->_state;
}
/**
* Attach an observer object
*
* @param object $observer An observer object to attach
*
* @return void
*
* @since 2.5
*/
public function attach($observer)
{
if (is_array($observer))
{
if (!isset($observer['handler']) || !isset($observer['event']) || !is_callable($observer['handler']))
{
return;
}
// Make sure we haven't already attached this array as an observer
foreach ($this->_observers as $check)
{
if (is_array($check) && $check['event'] == $observer['event'] && $check['handler'] == $observer['handler'])
{
return;
}
}
$this->_observers[] = $observer;
end($this->_observers);
$methods = array($observer['event']);
}
else
{
if (!($observer instanceof JEditor))
{
return;
}
// Make sure we haven't already attached this object as an observer
$class = get_class($observer);
foreach ($this->_observers as $check)
{
if ($check instanceof $class)
{
return;
}
}
$this->_observers[] = $observer;
$methods = array_diff(get_class_methods($observer), get_class_methods('JPlugin'));
}
$key = key($this->_observers);
foreach ($methods as $method)
{
$method = strtolower($method);
if (!isset($this->_methods[$method]))
{
$this->_methods[$method] = array();
}
$this->_methods[$method][] = $key;
}
}
/**
* Detach an observer object
*
* @param object $observer An observer object to detach.
*
* @return boolean True if the observer object was detached.
*
* @since 2.5
*/
public function detach($observer)
{
// Initialise variables.
$retval = false;
$key = array_search($observer, $this->_observers);
if ($key !== false)
{
unset($this->_observers[$key]);
$retval = true;
foreach ($this->_methods as &$method)
{
$k = array_search($key, $method);
if ($k !== false)
{
unset($method[$k]);
}
}
}
return $retval;
}
}
PK ?\V captcha/index.htmlnu W+A
PK ?\) version/.htaccessnu W+A
Order allow,deny
Deny from all
PK ?\ΒV
V
version/version.phpnu W+A Joomla! is Free Software released under the GNU General Public License.';
/**
* Compares two a "PHP standardized" version number against the current Joomla version.
*
* @param string $minimum The minimum version of the Joomla which is compatible.
*
* @return bool True if the version is compatible.
*
* @see http://www.php.net/version_compare
* @since 1.0
*/
public function isCompatible($minimum)
{
return version_compare(JVERSION, $minimum, 'ge');
}
/**
* Method to get the help file version.
*
* @return string Version suffix for help files.
*
* @since 1.0
*/
public function getHelpVersion()
{
return '.' . str_replace('.', '', $this->RELEASE);
}
/**
* Gets a "PHP standardized" version string for the current Joomla.
*
* @return string Version string.
*
* @since 1.5
*/
public function getShortVersion()
{
return $this->RELEASE . '.' . $this->DEV_LEVEL;
}
/**
* Gets a version string for the current Joomla with all release information.
*
* @return string Complete version string.
*
* @since 1.5
*/
public function getLongVersion()
{
return $this->PRODUCT . ' ' . $this->RELEASE . '.' . $this->DEV_LEVEL . ' '
. $this->DEV_STATUS . ' [ ' . $this->CODENAME . ' ] ' . $this->RELDATE . ' '
. $this->RELTIME . ' ' . $this->RELTZ;
}
/**
* Returns the user agent.
*
* @param string $component Name of the component.
* @param bool $mask Mask as Mozilla/5.0 or not.
* @param bool $add_version Add version afterwards to component.
*
* @return string User Agent.
*
* @since 1.0
*/
public function getUserAgent($component = null, $mask = false, $add_version = true)
{
if ($component === null)
{
$component = 'Framework';
}
if ($add_version)
{
$component .= '/' . $this->RELEASE;
}
// If masked pretend to look like Mozilla 5.0 but still identify ourselves.
if ($mask)
{
return 'Mozilla/5.0 ' . $this->PRODUCT . '/' . $this->RELEASE . '.' . $this->DEV_LEVEL . ($component ? ' ' . $component : '');
}
else
{
return $this->PRODUCT . '/' . $this->RELEASE . '.' . $this->DEV_LEVEL . ($component ? ' ' . $component : '');
}
}
}
PK ?\V version/index.htmlnu W+A
PK ?\) .htaccessnu W+A
Order allow,deny
Deny from all
PK ?\H view/legacy.phpnu W+A
PK ?\) view/.htaccessnu W+A
Order allow,deny
Deny from all
PK ?\wf7
controller/legacy.phpnu W+A
Order allow,deny
Deny from all
PK ?\V controller/index.htmlnu W+A
PK ?\\wӱ html/icons.phpnu W+A authorise($button['access'][$i], $button['access'][$i+1]))
{
return '';
}
}
}
}
$html[] = '