From: <luc...@us...> - 2015-02-03 22:11:14
|
Revision: 12963 http://sourceforge.net/p/xoops/svn/12963 Author: luciorota Date: 2015-02-03 22:11:05 +0000 (Tue, 03 Feb 2015) Log Message: ----------- changed directory structure xoops 2.5.7.1 compatible fixed bug in class/error.php Modified Paths: -------------- XoopsModules/xhttperror/branches/luciorota/xhttperror/class/error.php XoopsModules/xhttperror/branches/luciorota/xhttperror/docs/changelog.txt XoopsModules/xhttperror/branches/luciorota/xhttperror/include/common.php XoopsModules/xhttperror/branches/luciorota/xhttperror/xoops_version.php Added Paths: ----------- XoopsModules/xhttperror/branches/luciorota/xhttperror/class/common/ XoopsModules/xhttperror/branches/luciorota/xhttperror/class/common/session.php Removed Paths: ------------- XoopsModules/xhttperror/branches/luciorota/xhttperror/class/session.php Added: XoopsModules/xhttperror/branches/luciorota/xhttperror/class/common/session.php =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/class/common/session.php (rev 0) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/class/common/session.php 2015-02-03 22:11:05 UTC (rev 12963) @@ -0,0 +1,111 @@ +<?php +/* + 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 + 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 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +/** + * XhttperrorSession class + * + * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package Xhttperror + * @since 1.01 + * @author Lucio Rota <luc...@gm...> + * @author trabis <lus...@gm...> + * @author Harry Fuecks (PHP Anthology Volume II) + * @version $Id:$ + */ +defined('XOOPS_ROOT_PATH') || die('XOOPS root path not defined'); + +include_once dirname(dirname(__DIR__)) . '/include/common.php'; + +/** + * Class XhttperrorSession + */ +class XhttperrorSession +{ + /** + * Session constructor<br /> + * Starts the session with session_start() + * <strong>Note:</strong> that if the session has already started, + * session_start() does nothing + */ + protected function __construct() + { + @session_start(); + } + + /** + * Sets a session variable + * + * @param string $name name of variable + * @param mixed $value value of variable + * + * @return void + * @access public + */ + public function set($name, $value) + { + $_SESSION[$name] = $value; + } + + /** + * Fetches a session variable + * + * @param string $name name of variable + * + * @return mixed value of session variable + * @access public + */ + public function get($name) + { + if (isset($_SESSION[$name])) { + return $_SESSION[$name]; + } else { + return false; + } + } + + /** + * Deletes a session variable + * + * @param string $name name of variable + * + * @return void + * @access public + */ + public function del($name) + { + unset($_SESSION[$name]); + } + + /** + * Destroys the whole session + * + * @return void + * @access public + */ + public function destroy() + { + $_SESSION = array(); + session_destroy(); + } + + /** + * @return XhttperrorSession + */ + public static function &getInstance() + { + static $_sess; + if (!isset($_sess)) { + $_sess = new XhttperrorSession(); + } + + return $_sess; + } +} Modified: XoopsModules/xhttperror/branches/luciorota/xhttperror/class/error.php =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/class/error.php 2015-02-02 19:39:18 UTC (rev 12962) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/class/error.php 2015-02-03 22:11:05 UTC (rev 12963) @@ -22,9 +22,9 @@ defined('XOOPS_ROOT_PATH') || die('XOOPS root path not defined'); include_once dirname(__DIR__) . '/include/common.php'; -define('_XHTTPERROR_REDIRECT_NO', 0); -define('_XHTTPERROR_REDIRECT_URI', 1); -define('_XHTTPERROR_REDIRECT_PREVIOUS', 2); +define('XHTTPERROR_REDIRECT_NO', 0); +define('XHTTPERROR_REDIRECT_URI', 1); +define('XHTTPERROR_REDIRECT_PREVIOUS', 2); /** * Class XhttperrorError Deleted: XoopsModules/xhttperror/branches/luciorota/xhttperror/class/session.php =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/class/session.php 2015-02-02 19:39:18 UTC (rev 12962) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/class/session.php 2015-02-03 22:11:05 UTC (rev 12963) @@ -1,111 +0,0 @@ -<?php -/* - 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 - 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 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * XhttperrorSession class - * - * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @package Xhttperror - * @since 1.01 - * @author Lucio Rota <luc...@gm...> - * @author trabis <lus...@gm...> - * @author Harry Fuecks (PHP Anthology Volume II) - * @version $Id:$ - */ -defined('XOOPS_ROOT_PATH') || die('XOOPS root path not defined'); - -include_once dirname(dirname(__FILE__)) . '/include/common.php'; - -/** - * Class XhttperrorSession - */ -class XhttperrorSession -{ - /** - * Session constructor<br /> - * Starts the session with session_start() - * <strong>Note:</strong> that if the session has already started, - * session_start() does nothing - */ - protected function __construct() - { - @session_start(); - } - - /** - * Sets a session variable - * - * @param string $name name of variable - * @param mixed $value value of variable - * - * @return void - * @access public - */ - public function set($name, $value) - { - $_SESSION[$name] = $value; - } - - /** - * Fetches a session variable - * - * @param string $name name of variable - * - * @return mixed value of session variable - * @access public - */ - public function get($name) - { - if (isset($_SESSION[$name])) { - return $_SESSION[$name]; - } else { - return false; - } - } - - /** - * Deletes a session variable - * - * @param string $name name of variable - * - * @return void - * @access public - */ - public function del($name) - { - unset($_SESSION[$name]); - } - - /** - * Destroys the whole session - * - * @return void - * @access public - */ - public function destroy() - { - $_SESSION = array(); - session_destroy(); - } - - /** - * @return XhttperrorSession - */ - public static function &getInstance() - { - static $_sess; - if (!isset($_sess)) { - $_sess = new XhttperrorSession(); - } - - return $_sess; - } -} Modified: XoopsModules/xhttperror/branches/luciorota/xhttperror/docs/changelog.txt =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/docs/changelog.txt 2015-02-02 19:39:18 UTC (rev 12962) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/docs/changelog.txt 2015-02-03 22:11:05 UTC (rev 12963) @@ -6,11 +6,9 @@ ! Bug fix. o General comment. -version 1.01 (Released: 2014/11/26) +version 1.01 (Released: 2015/02/03) =================================== -+ delete multiple reports. -o Use native XoopsRequest (mamba) -o Upgraded to Xoops 2.5.7 coding standard. +o Upgraded to Xoops 2.5.7.1 coding standard. o Refactory all language definitions ! store wrong requested uri in reports (REDIRECT_URL, REDIRECT_QUERY_STRING) Modified: XoopsModules/xhttperror/branches/luciorota/xhttperror/include/common.php =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/include/common.php 2015-02-02 19:39:18 UTC (rev 12962) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/include/common.php 2015-02-03 22:11:05 UTC (rev 12963) @@ -21,6 +21,20 @@ defined('XOOPS_ROOT_PATH') || die('XOOPS root path not defined'); +// common Xoops stuff +xoops_load('XoopsRequest'); +xoops_load('XoopsUserUtility'); +xoops_load('XoopsLocal'); + +// MyTextSanitizer object +$myts = MyTextSanitizer::getInstance(); + +// Load Xoops handlers +$module_handler = xoops_gethandler('module'); +$member_handler = xoops_gethandler('member'); +$notification_handler = xoops_gethandler('notification'); +$groupperm_handler = xoops_gethandler('groupperm'); + // This must contain the name of the folder in which reside Xhttperror define("XHTTPERROR_DIRNAME", basename(dirname(dirname(__FILE__)))); define("XHTTPERROR_URL", XOOPS_URL . '/modules/' . XHTTPERROR_DIRNAME); @@ -35,14 +49,9 @@ include_once XHTTPERROR_ROOT_PATH . '/include/functions.php'; include_once XHTTPERROR_ROOT_PATH . '/include/constants.php'; -include_once XHTTPERROR_ROOT_PATH . '/class/session.php'; // XhttperrorSession class include_once XHTTPERROR_ROOT_PATH . '/class/xhttperror.php'; // XhttperrorXhttperror class +include_once XHTTPERROR_ROOT_PATH . '/class/common/session.php'; // XhttperrorSession class -xoops_load('XoopsUserUtility'); -xoops_load('XoopsLocal'); -// MyTextSanitizer object -$myts = MyTextSanitizer::getInstance(); - $debug = false; $xhttperror = XhttperrorXhttperror::getInstance($debug); @@ -54,9 +63,3 @@ // Find if the user is admin of the module $xhttperror_isAdmin = xhttperror_userIsAdmin(); } - -// Load Xoops handlers -$module_handler = xoops_gethandler('module'); -$member_handler = xoops_gethandler('member'); -$notification_handler = xoops_gethandler('notification'); -$groupperm_handler = xoops_gethandler('groupperm'); Modified: XoopsModules/xhttperror/branches/luciorota/xhttperror/xoops_version.php =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/xoops_version.php 2015-02-02 19:39:18 UTC (rev 12962) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/xoops_version.php 2015-02-03 22:11:05 UTC (rev 12963) @@ -40,8 +40,8 @@ include_once XOOPS_ROOT_PATH . '/modules/' . $modversion['dirname'] . '/include/constants.php'; // About -$modversion['module_status'] = 'RC1'; -$modversion['release_date'] = '2014/11/26'; // YYYY/mm/dd +$modversion['module_status'] = 'Beta'; +$modversion['release_date'] = '2015/02/03'; // YYYY/mm/dd $modversion['module_website_url'] = 'http://www.xoops.org/'; $modversion['module_website_name'] = 'XOOPS'; $modversion['min_php'] = '5.3.7'; |