Skip to content

Commit

Permalink
Merge pull request #362 from mambax7/master
Browse files Browse the repository at this point in the history
add Smarty variable check
  • Loading branch information
geekwright committed Jul 8, 2015
2 parents d617d40 + 7c9c3ed commit 3cb5b15
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 103 deletions.
4 changes: 2 additions & 2 deletions htdocs/modules/publisher/blocks/items_new.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function publisher_items_new_edit($options)
$orderEle->addOptionArray(array(
'datesub' => _MB_PUBLISHER_DATE,
'counter' => _MB_PUBLISHER_HITS,
'weight' => _MB_PUBLISHER_WEIGHT,
'weight' => _MB_PUBLISHER_WEIGHT
));

$showEle = new Xoops\Form\RadioYesNo(_MB_PUBLISHER_ORDER_SHOW, 'options[2]', $options[2]);
Expand All @@ -133,7 +133,7 @@ function publisher_items_new_edit($options)
'none' => XoopsLocale::NONE,
'article' => _MB_PUBLISHER_IMAGE_ARTICLE,
'category' => _MB_PUBLISHER_IMAGE_CATEGORY,
'avatar' => _MB_PUBLISHER_IMAGE_AVATAR,
'avatar' => _MB_PUBLISHER_IMAGE_AVATAR
));

$form->addElement($catEle);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/modules/publisher/class/rating.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class PublisherRatingHandler extends XoopsPersistableObjectHandler
/**
* @param null|Xoops\Core\Database\Connection $db
*/
public function __construct($db)
public function __construct(Connection $db = null)
{
parent::__construct($db, 'publisher_rating', 'PublisherRating', 'ratingid', 'itemid');
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/modules/system/templates/admin/admin_navigation.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<{if $xo_sys_navigation}>
<{if isset($xo_sys_navigation)}>
<div class="page-header">
<h3><img src="<{$xo_sys_navigation.icon}>" alt="" /><{$xo_sys_navigation.title}></h3>
</div>
<{/if}>
<{/if}>
7 changes: 4 additions & 3 deletions htdocs/modules/xcaptcha/css/moduladmin.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.xo-moduleadmin-icon {
width: 100%!important;
max-width:39%;
width: 100% !important;
max-width: 39%;
}

.xo-moduleadmin-box {
width: 60% !important;
}
}
20 changes: 10 additions & 10 deletions htdocs/modules/xcaptcha/language/english/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
* @version $Id$
*/

//define("_AM_XCAPTCHA_INDEX", "Configuration");
define("_AM_XCAPTCHA_FORM", "Configuration CAPTCHA");
define("_AM_XCAPTCHA_SAVED", "The configuration has been saved");
//define('_AM_XCAPTCHA_INDEX', 'Configuration');
define('_AM_XCAPTCHA_FORM', 'Configuration CAPTCHA');
define('_AM_XCAPTCHA_SAVED', 'The configuration has been saved');

define("_AM_XCAPTCHA_ACTIVATE", "Disable protection");
define("_AM_XCAPTCHA_ENABLE", "Yes");
define("_AM_XCAPTCHA_DISABLE", "No");
define('_AM_XCAPTCHA_ACTIVATE', 'Disable protection');
define('_AM_XCAPTCHA_ENABLE', 'Yes');
define('_AM_XCAPTCHA_DISABLE', 'No');

define("_AM_XCAPTCHA_PLUGINS", "Method");
define('_AM_XCAPTCHA_PLUGINS', 'Method');

define("_AM_XCAPTCHA_NAME", "CAPTCHA Variable name ");
define('_AM_XCAPTCHA_NAME', 'CAPTCHA Variable name ');

define("_AM_XCAPTCHA_SKIPMEMBER", "Deactivate for members");
define('_AM_XCAPTCHA_SKIPMEMBER', 'Deactivate for members');

define("_AM_XCAPTCHA_MAXATTEMPTS", "Maximum attempts");
define('_AM_XCAPTCHA_MAXATTEMPTS', 'Maximum attempts');
18 changes: 9 additions & 9 deletions htdocs/modules/xcaptcha/language/english/help.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@
* @version $Id$
*/

define("_HELP_DESCRIPTION_TITLE", "Description");
define("_HELP_DEVELOPER_TITLE", "Developer");
define('_HELP_DESCRIPTION_TITLE', 'Description');
define('_HELP_DEVELOPER_TITLE', 'Developer');

define("_HELP_INSTALL_TITLE", "Install");
define("_HELP_INSTALL_CONTENT", "
define('_HELP_INSTALL_TITLE', 'Install');
define('_HELP_INSTALL_CONTENT', '
Extra, or non-core, modules are usually downloadable as compressed files (zip, tar). Always check if a text file with upload instructions is included in the downloaded package.
<ol>
<li> Unzip files in local computer.</li>
<li>FTP/upload all files to appropriate folders in your website directory. This is usually the /modules folder under the Xoops root directory, where all the other modules are found. However, some modules have extra files that need to be uploaded to other folders such as the /include and the /class folders.</li>
<li>After upload, go to your Modules Administration Page and check if the new module is included in the uninstalled modules table.</li>
<li>Follow the steps described above for installing core modules from the Modules Administration page.</li>
</ol>
");
');

define("_HELP_UNINSTALL_TITLE", "Uninstall");
define("_HELP_UNINSTALL_CONTENT", "");
define('_HELP_UNINSTALL_TITLE', 'Uninstall');
define('_HELP_UNINSTALL_CONTENT', '');

define("_HELP_TUTORIAL_TITLE", "Tutorial");
define("_HELP_TUTORIAL_CONTENT", "Coming soon");
define('_HELP_TUTORIAL_TITLE', 'Tutorial');
define('_HELP_TUTORIAL_CONTENT', 'Coming soon');
45 changes: 23 additions & 22 deletions htdocs/modules/xcaptcha/language/english/help/help.html
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
<link rel="stylesheet" type="text/css" media="screen" href="<{xoAppUrl 'modules/xcaptcha/css/help.css'}>" />
<link rel="stylesheet" type="text/css" media="screen" href="<{xoAppUrl 'modules/xcaptcha/css/help.css'}>"/>

<div class="help span12 txtcenter">
<div class="help-submenu floatright txtleft">
<ul>
<li><a href="#description" title=""><{$smarty.const._HELP_DESCRIPTION_TITLE}></a></li>
<li><a href="#developer" title=""><{$smarty.const._HELP_DEVELOPER_TITLE}></a></li>
<li><a href="#install" title=""><{$smarty.const._HELP_INSTALL_TITLE}></a></li>
<!--
<li><a href="#uninstall" title=""><{$smarty.const._HELP_UNINSTALL_TITLE}></a></li>
-->
<!--
<li><a href="#uninstall" title=""><{$smarty.const._HELP_UNINSTALL_TITLE}></a></li>
-->
<li><a href="#tutorial" title=""><{$smarty.const._HELP_TUTORIAL_TITLE}></a></li>
</ul>
</div>

<div class="floatleft">
<img src="<{$xoops_url}>/modules/<{$module->getVar('dirname')}>/<{$module->getInfo('image')}>" alt="<{$module->getVar('name')}>" title="<{$module->getVar('name')}>" />
<img src="<{$xoops_url}>/modules/<{$module->getVar('dirname')}>/<{$module->getInfo('image')}>" alt="<{$module->getVar('name')}>" title="<{$module->getVar('name')}>"/>
</div>

<div class="help-title floatcenter0 span8">
<h2><{$module->getVar('name')}></h2>
<{if $module->getInfo('paypal')}>
<form class="help-paypal" id="paypal-form" name="_xclick" action="https://www.paypal.com/fr/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<{foreach from=$module->getInfo('paypal') item=value key=key}>
<{if is_numeric($value)}>
<input type="hidden" name="<{$key}>" value=<{$value}>>
<{else}>
<input type="hidden" name="<{$key}>" value="<{$value}>">
<{/if}>
<{/foreach}>
<img src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" onclick="$('#paypal-form').submit()" alt="PayPal - The safer, easier way to pay online!" />
</form>
<form class="help-paypal" id="paypal-form" name="_xclick" action="https://www.paypal.com/fr/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<{foreach from=$module->getInfo('paypal') item=value key=key}>
<{if is_numeric($value)}>
<input type="hidden" name="<{$key}>" value=<{$value}>>
<{else}>
<input type="hidden" name="<{$key}>" value="<{$value}>">
<{/if}>
<{/foreach}>
<img src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" onclick="$('#paypal-form').submit()" alt="PayPal - The safer, easier way to pay online!"/>
</form>
<{/if}>
</div>
</div>
Expand All @@ -44,20 +44,21 @@ <h2><{$module->getVar('name')}></h2>
</div>
<div>
<{$module->getInfo('description')}>
<br />
Version : <{$module->getInfo('version')}>&nbsp;<{$module->getInfo('module_status')}>&nbsp;(<{$module->getInfo('release_date')}>)</div>
<br/>
Version : <{$module->getInfo('version')}>&nbsp;<{$module->getInfo('module_status')}>&nbsp;(<{$module->getInfo('release_date')}>)
</div>
</div>
</div>

<a name="Developer"></a>
<div class="help-item">
<div class="help-title">
<{$smarty.const._HELP_DEVELOPER_TITLE}>
</div>
<{if $module->getInfo('module_website_url')}>
<div class="spacer marg5">
<a href="http://<{$module->getInfo('module_website_url')}>" rel="external"><{$module->getInfo('module_website_name')}></a>
</div>
<div class="spacer marg5">
<a href="http://<{$module->getInfo('module_website_url')}>" rel="external"><{$module->getInfo('module_website_name')}></a>
</div>
<{/if}>
</div>

Expand Down Expand Up @@ -91,4 +92,4 @@ <h2><{$module->getVar('name')}></h2>
<div>
<{$smarty.const._HELP_TUTORIAL_CONTENT}>
</div>
</div>
</div>
40 changes: 20 additions & 20 deletions htdocs/modules/xcaptcha/language/english/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,30 @@
* @version $Id$
*/

define("_MI_XCAPTCHA_ADMENU_IMAGE", "Image");
define('_MI_XCAPTCHA_ADMENU_IMAGE', 'Image');

if ( !defined("_XCAPTCHA_IMAGE") ) {
define("_XCAPTCHA_FORM_IMAGE", "Configuration CAPTCHA : Image");
if (!defined('_XCAPTCHA_IMAGE')) {
define('_XCAPTCHA_FORM_IMAGE', 'Configuration CAPTCHA : Image');

if (!defined("_XCAPTCHA_NUM_CHARS")) {
define("_XCAPTCHA_NUM_CHARS", "Number of characters");
if (!defined('_XCAPTCHA_NUM_CHARS')) {
define('_XCAPTCHA_NUM_CHARS', 'Number of characters');
}
define("_XCAPTCHA_CASESENSITIVE", "Case insensitive");
define("_XCAPTCHA_FONTSIZE_MIN", "Minimum size of the font");
define("_XCAPTCHA_FONTSIZE_MAX", "Maximum size of the font");
define("_XCAPTCHA_BACKGROUND_TYPE", "Background type");
define('_XCAPTCHA_CASESENSITIVE', 'Case insensitive');
define('_XCAPTCHA_FONTSIZE_MIN', 'Minimum size of the font');
define('_XCAPTCHA_FONTSIZE_MAX', 'Maximum size of the font');
define('_XCAPTCHA_BACKGROUND_TYPE', 'Background type');

define("_XCAPTCHA_BACKGROUND_BAR", "Bars");
define("_XCAPTCHA_BACKGROUND_CIRCLE", "Circles");
define("_XCAPTCHA_BACKGROUND_LINE", "Lines");
define("_XCAPTCHA_BACKGROUND_RECTANGLE", "Rectangles");
define("_XCAPTCHA_BACKGROUND_ELLIPSE", "Ellipses");
define("_XCAPTCHA_BACKGROUND_POLYGONE", "Polygons");
define("_XCAPTCHA_BACKGROUND_IMAGE", "Image");
define('_XCAPTCHA_BACKGROUND_BAR', 'Bars');
define('_XCAPTCHA_BACKGROUND_CIRCLE', 'Circles');
define('_XCAPTCHA_BACKGROUND_LINE', 'Lines');
define('_XCAPTCHA_BACKGROUND_RECTANGLE', 'Rectangles');
define('_XCAPTCHA_BACKGROUND_ELLIPSE', 'Ellipses');
define('_XCAPTCHA_BACKGROUND_POLYGONE', 'Polygons');
define('_XCAPTCHA_BACKGROUND_IMAGE', 'Image');

define("_XCAPTCHA_BACKGROUND_NUM", "Number of \"drawing\"");
define("_XCAPTCHA_POLYGON_POINT", "Number of points for the polygon");
define("_XCAPTCHA_SKIP_CHARACTERS", "Ignore characters");
define('_XCAPTCHA_BACKGROUND_NUM', 'Number of \'drawing\'');
define('_XCAPTCHA_POLYGON_POINT', 'Number of points for the polygon');
define('_XCAPTCHA_SKIP_CHARACTERS', 'Ignore characters');

define("_XCAPTCHA_IMAGE", true);
define('_XCAPTCHA_IMAGE', true);
}
10 changes: 5 additions & 5 deletions htdocs/modules/xcaptcha/language/english/modinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
* @version $Id$
*/

define("_MI_XCAPTCHA_NAME", "Xcaptcha");
define("_MI_XCAPTCHA_DESC", "Xoops CAPTCHA configuration");
define('_MI_XCAPTCHA_NAME', 'Xcaptcha');
define('_MI_XCAPTCHA_DESC', 'Xoops CAPTCHA configuration');

define("_MI_XCAPTCHA_INDEX", "Index");
//define("_MI_XCAPTCHA_CONFIG", "CAPTCHA configuration");
define("_MI_XCAPTCHA_ABOUT", "About this module");
define('_MI_XCAPTCHA_INDEX', 'Index');
//define('_MI_XCAPTCHA_CONFIG', 'CAPTCHA configuration');
define('_MI_XCAPTCHA_ABOUT', 'About this module');
16 changes: 8 additions & 8 deletions htdocs/modules/xcaptcha/language/english/recaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
* @version $Id$
*/

define("_MI_XCAPTCHA_ADMENU_RECAPTCHA", "Recaptcha");
define('_MI_XCAPTCHA_ADMENU_RECAPTCHA', 'Recaptcha');

if ( !defined("_XCAPTCHA_RECAPTCHA") ) {
define("_XCAPTCHA_FORM_RECAPTCHA", "Configuration CAPTCHA : Recaptcha");
if (!defined('_XCAPTCHA_RECAPTCHA')) {
define('_XCAPTCHA_FORM_RECAPTCHA', 'Configuration CAPTCHA : Recaptcha');

define("_XCAPTCHA_PRIVATE_KEY", "Private key");
define("_XCAPTCHA_PUBLIC_KEY", "Public key");
define("_XCAPTCHA_THEME", "Theme");
define("_XCAPTCHA_LANG", "Language");
define('_XCAPTCHA_PRIVATE_KEY', 'Private key');
define('_XCAPTCHA_PUBLIC_KEY', 'Public key');
define('_XCAPTCHA_THEME', 'Theme');
define('_XCAPTCHA_LANG', 'Language');

define("_XCAPTCHA_RECAPTCHA", true);
define('_XCAPTCHA_RECAPTCHA', true);
}
12 changes: 6 additions & 6 deletions htdocs/modules/xcaptcha/language/english/text.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
* @author Laurent JEN (Aka DuGris)
* @version $Id$
*/
define("_MI_XCAPTCHA_ADMENU_TEXT", "Text");
define('_MI_XCAPTCHA_ADMENU_TEXT', 'Text');

if ( !defined("_XCAPTCHA_TEXT") ) {
define("_XCAPTCHA_FORM_TEXT", "Configuration CAPTCHA : Texte");
if (!defined("_XCAPTCHA_NUM_CHARS")) {
define("_XCAPTCHA_NUM_CHARS", "Number of characters");
if (!defined('_XCAPTCHA_TEXT')) {
define('_XCAPTCHA_FORM_TEXT', 'Configuration CAPTCHA : Texte');
if (!defined('_XCAPTCHA_NUM_CHARS')) {
define('_XCAPTCHA_NUM_CHARS', 'Number of characters');
}

define("_XCAPTCHA_TEXT", true);
define('_XCAPTCHA_TEXT', true);
}
37 changes: 23 additions & 14 deletions htdocs/modules/xcaptcha/plugins/recaptcha.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Xcaptcha extension module
* You may not change or alter any portion of this comment or credits
Expand All @@ -15,7 +16,6 @@
* @author Laurent JEN (Aka DuGris)
* @version $Id$
*/

class XcaptchaRecaptcha extends Xcaptcha
{
public $config = array();
Expand All @@ -25,40 +25,49 @@ class XcaptchaRecaptcha extends Xcaptcha
function __construct()
{
$this->xcaptcha_handler = Xcaptcha::getInstance();
$this->config = $this->xcaptcha_handler->loadConfig('recaptcha');
$this->plugin = 'recaptcha';
$this->config = $this->xcaptcha_handler->loadConfig('recaptcha');
$this->plugin = 'recaptcha';
}

function VerifyData()
{
$xoops = Xoops::getInstance();
$xoops = Xoops::getInstance();
$default_lang = array_search(ucfirst($xoops->getConfig('language')), $this->getLanguages());
$default_lang = (!$default_lang) ? 'en' : $default_lang;

$system = System::getInstance();
$config = array();
$system = System::getInstance();
$config = array();
$_POST['private_key'] = $system->cleanVars($_POST, 'private_key', 'Your private key', 'string');
$_POST['public_key'] = $system->cleanVars($_POST, 'public_key', 'Your public key', 'string');
$_POST['theme'] = $system->cleanVars($_POST, 'theme', 'red', 'string');
$_POST['lang'] = $system->cleanVars($_POST, 'lang', $default_lang, 'string');
$_POST['public_key'] = $system->cleanVars($_POST, 'public_key', 'Your public key', 'string');
$_POST['theme'] = $system->cleanVars($_POST, 'theme', 'red', 'string');
$_POST['lang'] = $system->cleanVars($_POST, 'lang', $default_lang, 'string');
foreach (array_keys($this->config) as $key) {
$config[$key] = $_POST[$key];
}

return $config;
}

function getThemes()
{
return array(
'red' => 'RED (default theme)', 'white' => 'WHITE', 'blackglass' => 'BLACKGLASS', 'clean' => 'CLEAN',
);
'red' => 'RED (default theme)',
'white' => 'WHITE',
'blackglass' => 'BLACKGLASS',
'clean' => 'CLEAN',);
}

function getLanguages()
{
return array(
'en' => 'English', 'nl' => 'Dutch', 'fr' => 'French', 'de' => 'German', 'it' => 'Italian', 'pt' => 'Portuguese',
'ru' => 'Russian', 'es' => 'Spanish', 'tr' => 'Turkish',
);
'en' => 'English',
'nl' => 'Dutch',
'fr' => 'French',
'de' => 'German',
'it' => 'Italian',
'pt' => 'Portuguese',
'ru' => 'Russian',
'es' => 'Spanish',
'tr' => 'Turkish',);
}
}
2 changes: 1 addition & 1 deletion htdocs/modules/xlanguage/class/xlanguage.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class XlanguageXlanguageHandler extends XoopsPersistableObjectHandler
/**
* @param null|Connection $db
*/
public function __construct($db)
public function __construct(Connection $db = null)
{
parent::__construct($db, 'xlanguage', 'XlanguageLanguage', 'xlanguage_id', 'xlanguage_name');
$this->loadConfig();
Expand Down

0 comments on commit 3cb5b15

Please sign in to comment.