|
From: <be...@us...> - 2013-09-14 04:49:40
|
Revision: 12035
http://sourceforge.net/p/xoops/svn/12035
Author: beckmi
Date: 2013-09-14 04:49:34 +0000 (Sat, 14 Sep 2013)
Log Message:
-----------
standardizing include statements
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/captcha/image/scripts/image.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_configsite.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_moduleinstaller.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_tablescreate.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_tablesfill.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_theme.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/admin/header.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/admin/field.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/admin/step.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/admin/tplsets/jquery.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/admin/users/jquery.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/admin/admin_header.php
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/captcha/image/scripts/image.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/captcha/image/scripts/image.php 2013-09-14 04:38:02 UTC (rev 12034)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/captcha/image/scripts/image.php 2013-09-14 04:49:34 UTC (rev 12035)
@@ -18,7 +18,7 @@
* @subpackage CAPTCHA
*/
-include "../../../../mainfile.php";
+include '../../../../mainfile.php';
error_reporting(0);
$xoopsLogger->activated = false;
@@ -86,6 +86,7 @@
}
}
$this->captcha_handler->setCode($this->code);
+
return true;
}
@@ -94,6 +95,7 @@
if ($this->invalid) {
header("Content-type: image/gif");
readfile(XOOPS_ROOT_PATH."/images/subject/icon2.gif");
+
return;
}
@@ -115,12 +117,13 @@
require_once XOOPS_ROOT_PATH."/class/xoopslists.php";
$file_path = XOOPS_ROOT_PATH . "/class/captcha/image/{$name}";
$files = XoopsLists::getFileListAsArray($file_path);
- foreach( $files as $item ) {
+ foreach ($files as $item) {
if ( empty($extension) || preg_match("/(\.{$extension})$/i",$item) ) {
$items[] = $item;
}
}
XoopsCache::write("captcha_captcha_{$name}", $items);
+
return $items;
}
@@ -199,11 +202,11 @@
for ($i = 65; $i <= 90; $i++) {
$CharDetails = imageftbbox($FontSize, $Angle, $this->font, chr($i), array());
$_MaxCharWidth = abs($CharDetails[0] + $CharDetails[2]);
- if ($_MaxCharWidth > $MaxCharWidth ) {
+ if ($_MaxCharWidth > $MaxCharWidth) {
$MaxCharWidth = $_MaxCharWidth;
}
$_MaxCharHeight = abs($CharDetails[1] + $CharDetails[5]);
- if ($_MaxCharHeight > $MaxCharHeight ) {
+ if ($_MaxCharHeight > $MaxCharHeight) {
$MaxCharHeight = $_MaxCharHeight;
}
}
@@ -226,6 +229,7 @@
if ( $backgrounds = $this->getList("backgrounds", "(gif|jpg|png)") ) {
$RandBackground = XOOPS_ROOT_PATH . "/class/captcha/image/backgrounds/" . $backgrounds[array_rand($backgrounds)];
}
+
return $RandBackground;
}
@@ -236,7 +240,7 @@
{
if ( $RandImage = $this->loadBackground() ) {
$ImageType = @getimagesize($RandImage);
- switch ( @$ImageType[2] ) {
+ switch (@$ImageType[2]) {
case 1:
$BackgroundImage = imagecreatefromgif($RandImage);
break;
@@ -302,7 +306,7 @@
*/
function drawCircles()
{
- for($i = 1; $i <= $this->config["background_num"]; $i++) {
+ for ($i = 1; $i <= $this->config["background_num"]; $i++) {
$randomcolor = imagecolorallocate ($this->oImage, mt_rand(190, 255), mt_rand(190, 255), mt_rand(190, 255));
imagefilledellipse($this->oImage, mt_rand(0, $this->width - 10), mt_rand(0, $this->height - 3), mt_rand(10, 20), mt_rand(20, 30), $randomcolor);
}
@@ -352,7 +356,7 @@
*/
function drawEllipses()
{
- for ($i = 1; $i <= $this->config["background_num"]; $i++){
+ for ($i = 1; $i <= $this->config["background_num"]; $i++) {
$randomcolor = imagecolorallocate ($this->oImage, mt_rand(190, 255), mt_rand(190, 255), mt_rand(190, 255));
imageellipse($this->oImage, mt_rand(0, $this->width), mt_rand(0, $this->height), mt_rand(0, $this->width), mt_rand(0, $this->height), $randomcolor);
}
@@ -363,7 +367,7 @@
*/
function drawPolygons()
{
- for ($i = 1; $i <= $this->config["background_num"]; $i++){
+ for ($i = 1; $i <= $this->config["background_num"]; $i++) {
$randomcolor = imagecolorallocate ($this->oImage, mt_rand(190, 255), mt_rand(190, 255), mt_rand(190, 255));
$coords = array();
for ($j = 1; $j <= $this->config["polygon_point"]; $j++) {
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_configsite.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_configsite.php 2013-09-14 04:38:02 UTC (rev 12034)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_configsite.php 2013-09-14 04:49:34 UTC (rev 12035)
@@ -37,11 +37,11 @@
$pageHasHelp = true;
if (!@include_once "../modules/system/language/{$wizard->language}/admin.php") {
- include_once "../modules/system/language/english/admin.php";
+ include_once '../modules/system/language/english/admin.php';
}
if (!@include_once "../modules/system/language/{$wizard->language}/admin/preferences.php") {
- include_once "../modules/system/language/english/admin/preferences.php";
+ include_once '../modules/system/language/english/admin/preferences.php';
}
$config_handler = xoops_gethandler('config');
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_moduleinstaller.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_moduleinstaller.php 2013-09-14 04:38:02 UTC (rev 12034)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_moduleinstaller.php 2013-09-14 04:49:34 UTC (rev 12035)
@@ -21,10 +21,10 @@
defined('XOOPS_INSTALL') or die('XOOPS Installation wizard die');
if (!@include_once "../language/{$wizard->language}/global.php") {
- include_once "../language/english/global.php";
+ include_once '../language/english/global.php';
}
if (!@include_once "../modules/system/language/{$wizard->language}/admin/modulesadmin.php") {
- include_once "../modules/system/language/english/admin/modulesadmin.php";
+ include_once '../modules/system/language/english/admin/modulesadmin.php';
}
require_once '../class/xoopsformloader.php';
require_once '../class/xoopslists.php';
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_tablescreate.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_tablescreate.php 2013-09-14 04:38:02 UTC (rev 12034)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_tablescreate.php 2013-09-14 04:49:34 UTC (rev 12035)
@@ -34,7 +34,7 @@
$vars =& $_SESSION['settings'];
-include_once "../mainfile.php";
+include_once '../mainfile.php';
include_once './class/dbmanager.php';
$dbm = new db_manager();
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_tablesfill.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_tablesfill.php 2013-09-14 04:38:02 UTC (rev 12034)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_tablesfill.php 2013-09-14 04:49:34 UTC (rev 12035)
@@ -34,7 +34,7 @@
$vars =& $_SESSION['settings'];
-include_once "../mainfile.php";
+include_once '../mainfile.php';
include_once './class/dbmanager.php';
$dbm = new db_manager();
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_theme.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_theme.php 2013-09-14 04:38:02 UTC (rev 12034)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_theme.php 2013-09-14 04:49:34 UTC (rev 12035)
@@ -41,7 +41,7 @@
$pageHasHelp = false;
if (!@include_once "../modules/system/language/{$wizard->language}/admin/preferences.php") {
- include_once "../modules/system/language/english/admin/preferences.php";
+ include_once '../modules/system/language/english/admin/preferences.php';
}
$config_handler = xoops_gethandler('config');
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/admin/header.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/admin/header.php 2013-09-14 04:38:02 UTC (rev 12034)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/admin/header.php 2013-09-14 04:49:34 UTC (rev 12035)
@@ -17,7 +17,7 @@
* @version $Id$
*/
-require_once "../../../include/cp_header.php";
+require_once '../../../include/cp_header.php';
if (!isset($GLOBALS['xoopsTpl']) || !is_object($GLOBALS['xoopsTpl'])) {
include_once XOOPS_ROOT_PATH . '/class/template.php';
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/admin/field.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/admin/field.php 2013-09-14 04:38:02 UTC (rev 12034)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/admin/field.php 2013-09-14 04:49:34 UTC (rev 12035)
@@ -100,7 +100,7 @@
break;
case "new":
- include_once('../include/forms.php');
+ include_once '../include/forms.php';
$obj =& $profilefield_handler->create();
$form = profile_getFieldForm($obj);
$form->display();
@@ -111,7 +111,7 @@
if (!$obj->getVar('field_config') && !$obj->getVar('field_show') && !$obj->getVar('field_edit')) { //If no configs exist
redirect_header('field.php', 2, _PROFILE_AM_FIELDNOTCONFIGURABLE);
}
- include_once('../include/forms.php');
+ include_once '../include/forms.php';
$form = profile_getFieldForm($obj);
$form->display();
break;
@@ -191,7 +191,7 @@
if (!empty($_REQUEST['addOption'])) {
foreach ($_REQUEST['addOption'] as $option) {
- if (empty($option['value'])) continue;
+ if (empty($option['value'])) continue;
$options[$option['key']] = $option['value'];
$redirect_to_edit = true;
}
@@ -278,7 +278,7 @@
$url = $redirect_to_edit ? 'field.php?op=edit&id=' . $obj->getVar('field_id') : 'field.php';
redirect_header($url, 3, sprintf(_PROFILE_AM_SAVEDSUCCESS, _PROFILE_AM_FIELD));
}
- include_once('../include/forms.php');
+ include_once '../include/forms.php';
echo $obj->getHtmlErrors();
$form = profile_getFieldForm($obj);
$form->display();
@@ -331,5 +331,4 @@
}
}
-
-include 'admin_footer.php';
\ No newline at end of file
+include 'admin_footer.php';
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/admin/step.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/admin/step.php 2013-09-14 04:38:02 UTC (rev 12034)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/admin/step.php 2013-09-14 04:49:34 UTC (rev 12035)
@@ -3,7 +3,7 @@
* Extended User Profile
*
* You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
+ * of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,13 +22,13 @@
$indexAdmin = new ModuleAdmin();
$indexAdmin->addItemButton(_ADD . ' ' . _PROFILE_AM_STEP, 'step.php?op=new', 'add', '');
-echo $indexAdmin->addNavigation('step.php');
+echo $indexAdmin->addNavigation('step.php');
echo $indexAdmin->renderButton('right', '');
$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : (isset($_REQUEST['id']) ? "edit" : 'list');
$handler =& xoops_getmodulehandler('regstep');
-switch ($op ) {
+switch ($op) {
case "list":
$GLOBALS['xoopsTpl']->assign('steps', $handler->getObjects(null, true, false) );
$template_main = "profile_admin_steplist.html";
@@ -36,14 +36,14 @@
case "new":
$obj =& $handler->create();
- include_once "../include/forms.php";
+ include_once '../include/forms.php';
$form = profile_getStepForm($obj);;
$form->display();
break;
case "edit":
$obj =& $handler->get($_REQUEST['id']);
- include_once "../include/forms.php";
+ include_once '../include/forms.php';
$form = profile_getStepForm($obj);;
$form->display();
break;
@@ -79,7 +79,6 @@
}
break;
-
case 'toggle':
if (isset($_GET['step_id'])) {
$field_id=intval($_GET['step_id']);
@@ -103,9 +102,9 @@
$obj->setVar('step_save', $step_save);
if ($handler->insert($obj,true)) {
redirect_header('step.php', 1, _PROFILE_AM_SAVESTEP_TOGGLE_SUCCESS);
- }else {
+ } else {
redirect_header('step.php', 1, _PROFILE_AM_SAVESTEP_TOGGLE_FAILED);
}
}
-include 'admin_footer.php';
\ No newline at end of file
+include 'admin_footer.php';
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/admin/tplsets/jquery.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/admin/tplsets/jquery.php 2013-09-14 04:38:02 UTC (rev 12034)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/admin/tplsets/jquery.php 2013-09-14 04:49:34 UTC (rev 12035)
@@ -27,90 +27,90 @@
$GLOBALS['xoopsLogger']->activated = false;
if ( file_exists("./../../language/".$xoopsConfig['language']."/admin/tplsets.php") ) {
- include_once("./../../language/".$xoopsConfig['language']."/admin/tplsets.php");
+ include_once './../../language/'.$xoopsConfig['language']."/admin/tplsets.php");
} else {
- include_once("./../../language/english/admin/tplsets.php");
+ include_once './../../language/english/admin/tplsets.php';
}
if (isset($_REQUEST["op"])) {
- $op = $_REQUEST["op"];
+ $op = $_REQUEST["op"];
} else {
- @$op = "default";
+ @$op = "default";
}
$GLOBALS['xoopsLogger']->usePopup = true;
switch ($op) {
- // Display tree folder
- case "tpls_display_folder":
- $_REQUEST['dir'] = urldecode($_REQUEST['dir']);
- $root = XOOPS_THEME_PATH;
- if( file_exists($root . $_REQUEST['dir']) ) {
- $files = scandir($root . $_REQUEST['dir']);
- natcasesort($files);
- if( count($files) > 2 ) { /* The 2 accounts for . and .. */
- echo "<ul class=\"jqueryFileTree\" style=\"display: none;\">";
- // All dirs
- foreach( $files as $file ) {
+ // Display tree folder
+ case "tpls_display_folder":
+ $_REQUEST['dir'] = urldecode($_REQUEST['dir']);
+ $root = XOOPS_THEME_PATH;
+ if ( file_exists($root . $_REQUEST['dir']) ) {
+ $files = scandir($root . $_REQUEST['dir']);
+ natcasesort($files);
+ if ( count($files) > 2 ) { /* The 2 accounts for . and .. */
+ echo "<ul class=\"jqueryFileTree\" style=\"display: none;\">";
+ // All dirs
+ foreach ($files as $file) {
- if( file_exists($root . $_REQUEST['dir'] . $file) && $file != '.' && $file != '..' && is_dir($root . $_REQUEST['dir'] . $file) ) {
- //retirer .svn
- $file_no_valid = array('.svn', 'icons', 'img', 'images', 'language');
+ if ( file_exists($root . $_REQUEST['dir'] . $file) && $file != '.' && $file != '..' && is_dir($root . $_REQUEST['dir'] . $file) ) {
+ //retirer .svn
+ $file_no_valid = array('.svn', 'icons', 'img', 'images', 'language');
- if(!in_array($file, $file_no_valid))
- {
- echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . htmlentities($_REQUEST['dir'] . $file) . "/\">" . htmlentities($file) . "</a></li>";
- }
- }
- }
- // All files
- foreach( $files as $file )
- {
- if( file_exists($root . $_REQUEST['dir'] . $file) && $file != '.' && $file != '..' && !is_dir($root . $_REQUEST['dir'] . $file) && $file != 'index.html' ) {
- $ext = preg_replace('/^.*\./', '', $file);
+ if(!in_array($file, $file_no_valid))
+ {
+ echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . htmlentities($_REQUEST['dir'] . $file) . "/\">" . htmlentities($file) . "</a></li>";
+ }
+ }
+ }
+ // All files
+ foreach( $files as $file )
+ {
+ if ( file_exists($root . $_REQUEST['dir'] . $file) && $file != '.' && $file != '..' && !is_dir($root . $_REQUEST['dir'] . $file) && $file != 'index.html' ) {
+ $ext = preg_replace('/^.*\./', '', $file);
- $extensions = array('.html', '.htm', '.css');
- $extension_verif = strrchr($file, '.');
+ $extensions = array('.html', '.htm', '.css');
+ $extension_verif = strrchr($file, '.');
- if(in_array($extension_verif, $extensions)) {
- echo "<li class=\"file ext_$ext\"><a href=\"#\" onclick=\"tpls_edit_file('".htmlentities($_REQUEST['dir'].$file)."', '".htmlentities($_REQUEST['dir'])."', '".htmlentities($file)."', '".$ext."');\" rel=\"tpls_edit_file('".htmlentities($_REQUEST['dir'].$file)."', '".htmlentities($_REQUEST['dir'])."', '".htmlentities($file)."', '".$ext."');\">" . htmlentities($file) . "</a></li>";
- } else {
- //echo "<li class=\"file ext_$ext\">" . htmlentities($file) . "</li>";
- }
+ if (in_array($extension_verif, $extensions)) {
+ echo "<li class=\"file ext_$ext\"><a href=\"#\" onclick=\"tpls_edit_file('".htmlentities($_REQUEST['dir'].$file)."', '".htmlentities($_REQUEST['dir'])."', '".htmlentities($file)."', '".$ext."');\" rel=\"tpls_edit_file('".htmlentities($_REQUEST['dir'].$file)."', '".htmlentities($_REQUEST['dir'])."', '".htmlentities($file)."', '".$ext."');\">" . htmlentities($file) . "</a></li>";
+ } else {
+ //echo "<li class=\"file ext_$ext\">" . htmlentities($file) . "</li>";
+ }
- }
- }
- echo "</ul>";
- }
- }
- break;
+ }
+ }
+ echo "</ul>";
+ }
+ }
+ break;
// Edit File
- case 'tpls_edit_file':
- $path_file = realpath(XOOPS_ROOT_PATH.'/themes'.trim($_REQUEST['path_file']));
+ case 'tpls_edit_file':
+ $path_file = realpath(XOOPS_ROOT_PATH.'/themes'.trim($_REQUEST['path_file']));
$path_file = str_replace('\\','/',$path_file);
- //Button restore
- if(file_exists($path_file.'.back')){
- $restore = '<button class="ui-corner-all tooltip" type="button" onclick="tpls_restore(\''.$path_file.'\')" value="'._AM_SYSTEM_TEMPLATES_RESTORE.'" title="'._AM_SYSTEM_TEMPLATES_RESTORE.'">
+ //Button restore
+ if (file_exists($path_file.'.back')) {
+ $restore = '<button class="ui-corner-all tooltip" type="button" onclick="tpls_restore(\''.$path_file.'\')" value="'._AM_SYSTEM_TEMPLATES_RESTORE.'" title="'._AM_SYSTEM_TEMPLATES_RESTORE.'">
<img src="'.system_AdminIcons('revert.png').'" alt="'._AM_SYSTEM_TEMPLATES_RESTORE.'" />
</button>';
- }else{
- $restore = '';
- }
- xoops_load('XoopsFile');
+ } else {
+ $restore = '';
+ }
+ xoops_load('XoopsFile');
XoopsFile::load('file');
- $file = XoopsFile::getHandler('file', $path_file);
- $content = $file->read();
- if(empty($content)) {
- echo _AM_SYSTEM_TEMPLATES_EMPTY_FILE;
- }
- $ext = preg_replace('/^.*\./', '', $_REQUEST['path_file']);
+ $file = XoopsFile::getHandler('file', $path_file);
+ $content = $file->read();
+ if (empty($content)) {
+ echo _AM_SYSTEM_TEMPLATES_EMPTY_FILE;
+ }
+ $ext = preg_replace('/^.*\./', '', $_REQUEST['path_file']);
- echo '<form name="back" action="admin.php?fct=tplsets&op=tpls_save" method="POST">
- <table border="0">
- <tr>
- <td>
+ echo '<form name="back" action="admin.php?fct=tplsets&op=tpls_save" method="POST">
+ <table border="0">
+ <tr>
+ <td>
<div class="xo-btn-actions">
<div class="xo-buttons">
<button class="ui-corner-all tooltip" type="submit" value="'._AM_SYSTEM_TEMPLATES_SAVE.'" title="'._AM_SYSTEM_TEMPLATES_SAVE.'">
@@ -124,37 +124,37 @@
</div>
</div>
</td>
- </tr>
- <tr>
- <td><textarea id="code_mirror" name="templates" rows=24 cols=110>'.$content.'</textarea></td>
- </tr>
- </table>';
- echo '<input type="hidden" name="path_file" value="'.$path_file.'"><input type="hidden" name="file" value="'.trim($_REQUEST['file']).'"><input type="hidden" name="ext" value="'.$ext.'"></form>';
- break;
+ </tr>
+ <tr>
+ <td><textarea id="code_mirror" name="templates" rows=24 cols=110>'.$content.'</textarea></td>
+ </tr>
+ </table>';
+ echo '<input type="hidden" name="path_file" value="'.$path_file.'"><input type="hidden" name="file" value="'.trim($_REQUEST['file']).'"><input type="hidden" name="ext" value="'.$ext.'"></form>';
+ break;
- // Restore backup file
- case 'tpls_restore':
+ // Restore backup file
+ case 'tpls_restore':
$extensions = array('.html', '.htm', '.css');
//check if the file is inside themes directory
$valid_dir = stristr(realpath($_REQUEST['path_file']), realpath(XOOPS_ROOT_PATH . '/themes'));
- $old_file = $_REQUEST['path_file'].'.back';
- $new_file = $_REQUEST['path_file'];
+ $old_file = $_REQUEST['path_file'].'.back';
+ $new_file = $_REQUEST['path_file'];
$extension_verif = strrchr($new_file, '.');
- if($valid_dir && in_array($extension_verif, $extensions) && file_exists($old_file) && file_exists($new_file) )
- {
- if(unlink($new_file))
- {
- if(rename($old_file, $new_file))
- {
- xoops_result(_AM_SYSTEM_TEMPLATES_RESTORE_OK);
- exit();
- }
- }
- }
- xoops_error(_AM_SYSTEM_TEMPLATES_RESTORE_NOTOK);
+ if($valid_dir && in_array($extension_verif, $extensions) && file_exists($old_file) && file_exists($new_file) )
+ {
+ if(unlink($new_file))
+ {
+ if(rename($old_file, $new_file))
+ {
+ xoops_result(_AM_SYSTEM_TEMPLATES_RESTORE_OK);
+ exit();
+ }
+ }
+ }
+ xoops_error(_AM_SYSTEM_TEMPLATES_RESTORE_NOTOK);
break;
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/admin/users/jquery.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/admin/users/jquery.php 2013-09-14 04:38:02 UTC (rev 12034)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/system/admin/users/jquery.php 2013-09-14 04:49:34 UTC (rev 12035)
@@ -17,7 +17,7 @@
* @version $Id$
*/
-require('../../../../mainfile.php');
+require '../../../../mainfile.php';
require(XOOPS_ROOT_PATH.'/header.php');
if (!defined('XOOPS_ROOT_PATH')) { die('Error'); }
@@ -25,52 +25,52 @@
if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) exit( _NOPERM );
if (isset($_REQUEST["op"])) {
- $op = $_REQUEST["op"];
+ $op = $_REQUEST["op"];
} else {
- @$op = "default";
+ @$op = "default";
}
switch ($op) {
- // Display post
- case 'display_post':
- global $xoopsDB;
+ // Display post
+ case 'display_post':
+ global $xoopsDB;
$GLOBALS['xoopsLogger']->activated = false;
- include_once XOOPS_ROOT_PATH . '/include/comment_constants.php';
- include_once XOOPS_ROOT_PATH . '/kernel/module.php';
+ include_once XOOPS_ROOT_PATH . '/include/comment_constants.php';
+ include_once XOOPS_ROOT_PATH . '/kernel/module.php';
include_once XOOPS_ROOT_PATH . '/modules/system/include/functions.php';
- $tables = array();
- // Count comments (approved only: com_status == XOOPS_COMMENT_ACTIVE)
- $tables[] = array ('table_name' => 'xoopscomments', 'uid_column' => 'com_uid', 'criteria' => new Criteria('com_status', XOOPS_COMMENT_ACTIVE));
- // Count forum posts
- if (XoopsModule::getByDirname("newbb")) {
- $tables[] = array ('table_name' => 'bb_posts', 'uid_column' => 'uid');
- }
- $uid = system_CleanVars($_REQUEST, 'uid', int);
- $total_posts = 0;
- foreach ($tables as $table)
- {
- $criteria = new CriteriaCompo();
- $criteria->add (new Criteria($table['uid_column'], $uid ));
- if (!empty($table['criteria'])) {
- $criteria->add ($table['criteria']);
- }
- $sql = "SELECT COUNT(*) AS total FROM ".$xoopsDB->prefix($table['table_name']) . ' ' . $criteria->renderWhere();
- if ( $result = $xoopsDB->query($sql) ) {
- if ($row = $xoopsDB->fetchArray($result)) {
- $total_posts = $total_posts + $row['total'];
- }
- }
- }
+ $tables = array();
+ // Count comments (approved only: com_status == XOOPS_COMMENT_ACTIVE)
+ $tables[] = array ('table_name' => 'xoopscomments', 'uid_column' => 'com_uid', 'criteria' => new Criteria('com_status', XOOPS_COMMENT_ACTIVE));
+ // Count forum posts
+ if (XoopsModule::getByDirname("newbb")) {
+ $tables[] = array ('table_name' => 'bb_posts', 'uid_column' => 'uid');
+ }
+ $uid = system_CleanVars($_REQUEST, 'uid', int);
+ $total_posts = 0;
+ foreach ($tables as $table)
+ {
+ $criteria = new CriteriaCompo();
+ $criteria->add (new Criteria($table['uid_column'], $uid ));
+ if (!empty($table['criteria'])) {
+ $criteria->add ($table['criteria']);
+ }
+ $sql = "SELECT COUNT(*) AS total FROM ".$xoopsDB->prefix($table['table_name']) . ' ' . $criteria->renderWhere();
+ if ( $result = $xoopsDB->query($sql) ) {
+ if ($row = $xoopsDB->fetchArray($result)) {
+ $total_posts = $total_posts + $row['total'];
+ }
+ }
+ }
- $sql = "UPDATE ".$xoopsDB->prefix("users")." SET posts = '".$total_posts."' WHERE uid = '".$uid."'";
- if ( !$result = $xoopsDB->queryF($sql) ) {
- redirect_header("admin.php?fct=users",1,_AM_SYSTEM_USERS_CNUUSER);
- } else {
- echo $total_posts;
- }
- break;
+ $sql = "UPDATE ".$xoopsDB->prefix("users")." SET posts = '".$total_posts."' WHERE uid = '".$uid."'";
+ if ( !$result = $xoopsDB->queryF($sql) ) {
+ redirect_header("admin.php?fct=users",1,_AM_SYSTEM_USERS_CNUUSER);
+ } else {
+ echo $total_posts;
+ }
+ break;
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/admin/admin_header.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/admin/admin_header.php 2013-09-14 04:38:02 UTC (rev 12034)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/admin/admin_header.php 2013-09-14 04:49:34 UTC (rev 12035)
@@ -17,30 +17,27 @@
* @version $Id$
*/
-
//include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php';
include_once XOOPS_ROOT_PATH.'/mainfile.php';
//include_once XOOPS_ROOT_PATH . '/include/cp_functions.php';
-include("../../../include/cp_header.php");
+include '../../../include/cp_header.php';
//require_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['xoopsModule']->getVar('dirname') . '/include/functions.php';
-if ( file_exists($GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'))){
+if ( file_exists($GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'))) {
include_once $GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php');
//return true;
- }else{
- redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false);
+ } else {
+ redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false);
//return false;
}
$myts =& MyTextSanitizer::getInstance();
-
+
$moduleInfo =& $module_handler->get($xoopsModule->getVar('mid'));
$pathIcon16 = XOOPS_URL .'/'. $moduleInfo->getInfo('icons16');
$pathIcon32 = XOOPS_URL .'/'. $moduleInfo->getInfo('icons32');
-
-
if ($xoopsUser) {
$moduleperm_handler =& xoops_gethandler('groupperm');
if (!$moduleperm_handler->checkRight('module_admin', $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
@@ -57,7 +54,6 @@
$xoopsTpl = new XoopsTpl();
}
-
$xoopsTpl->assign('pathIcon16', $pathIcon16);
// Load language files
@@ -69,4 +65,4 @@
}
if (!@include_once(XOOPS_TRUST_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/" . $xoopsConfig['language'] . "/main.php")) {
include_once(XOOPS_TRUST_PATH."/modules/".$xoopsModule->getVar("dirname")."/language/english/main.php");
-}
\ No newline at end of file
+}
|