From: <wis...@us...> - 2011-12-18 18:04:01
|
Revision: 8518 http://xoops.svn.sourceforge.net/xoops/?rev=8518&view=rev Author: wishcraft Date: 2011-12-18 18:03:50 +0000 (Sun, 18 Dec 2011) Log Message: ----------- Xortify 3.03 (Stable) - Strict Mode Obeyed, Tested on SVN Copy of 2.6.0 - Client for Xortify Security Cloud - Spam, Harvesting and Hacking Prevention from pre-aware honey-pots. Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/access.list.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/current.bans.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/xortify.log.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/access.list.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/current.bans.png XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/xortify.log.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/preloads/xortify.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/admin/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/admin/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/admin/menu.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_curl.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_curl_provisionning.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_curlserialised.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_curlserialised_provisionning.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_curlxml.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_curlxml_provisionning.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_json.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_json_provisionning.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_soap.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_soap_provisionning.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_wgetserialised.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_wgetserialised_provisionning.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_wgetxml.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_wgetxml_provisionning.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/authfactory.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/curl.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/curlserialised.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/curlxml.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/json.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/log.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/soap.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/wgetserialised.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/wgetxml.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/cron/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/cron/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/cron/serverup.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/docs/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/docs/changelog.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/docs/credits.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/docs/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/docs/install.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/docs/lang_diff.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/docs/licence.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/docs/readme.txt XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/images/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/images/accessdenied.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/images/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/images/left_both.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/images/right_both.gif XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/images/xortify_slogo.png XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/include/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/include/JSON.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/include/forms.objects.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/include/forms.xortify.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/include/functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/include/install.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/include/post.header.addmeta.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/include/post.header.endcache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/include/post.loader.mainfile.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/include/pre.loader.mainfile.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/include/update.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/language/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/language/english/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/language/english/admin.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/language/english/ban.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/language/english/help/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/language/english/help/help.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/language/english/help/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/language/english/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/language/english/main.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/language/english/modinfo.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/language/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/plugin/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/plugin/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/plugin/projecthoneypot.org.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/plugin/protector.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/plugin/spiders.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/plugin/stopforumspam.com.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/plugin/xortify.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/preloads/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/preloads/core.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/preloads/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/projecthoneypot.org/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/projecthoneypot.org/post.loader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/protector/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/protector/footer.post.loader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/protector/header.post.loader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/protector/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/providers.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/spiders/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/spiders/post.loader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/stopforumspam.com/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/stopforumspam.com/post.loader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/xortify/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/xortify/footer.post.loader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/xortify/header.post.loader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/xortify/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/providers/xortify/post.loader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/sql/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/sql/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/sql/mysql.sql XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/templates/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/templates/admin/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/templates/admin/xortify_cpanel_bans.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/templates/admin/xortify_cpanel_log.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/templates/admin/xortify_cpanel_signup_form.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/templates/admin/xortify_cpanel_signup_nocommunication.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/templates/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/templates/xortify_banning_notice.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/xoops_version.php Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16 ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/access.list.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/access.list.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/current.bans.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/current.bans.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/xortify.log.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/16/xortify.log.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32 ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/access.list.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/access.list.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/current.bans.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/current.bans.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/xortify.log.png =================================================================== (Binary files differ) Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/moduleclasses/icons/32/xortify.log.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/preloads/xortify.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/preloads/xortify.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/preloads/xortify.php 2011-12-18 18:03:50 UTC (rev 8518) @@ -0,0 +1,55 @@ +<?php +/** + * @package xortify + * @subpackage module + * @description Sector Nexoork Security Drone + * @author Simon Roberts WISHCRAFT <si...@ch...> + * @author Richardo Costa TRABIS + * @copyright copyright (c) 2010-2013 XOOPS.org + * @licence GPL 2.0 - see docs/LICENCE.txt + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class SystemXortifyPreload extends XoopsPreloadItem +{ + + static function init() { + $xoops = Xoops::getInstance(); + $module_handler = $xoops->getHandler('module'); + $config_handler = $xoops->getHandler('config'); + $GLOBALS['xortifyModule'] = $module_handler->getByDirname('xortify'); + if (is_object($GLOBALS['xortifyModule'])) { + $GLOBALS['xortifyModuleConfig'] = $config_handler->getConfigList($GLOBALS['xortifyModule']->getVar('mid')); + } else { + $GLOBALS['xortifyModuleConfig']['fault_delay'] = 600; + } + XoopsLoad::load('xoopscache'); + } + + + static function eventCoreIncludeCommonEnd($args) + { + SystemXortifyPreload::init(); + $result = XoopsCache::read('xortify_core_include_common_end_cron'); + if ((isset($result['time'])?(float)$result['time']:0)<=microtime(true)) { + XoopsCache::write('xortify_core_include_common_end_cron', array('time'=>microtime(true)+$GLOBALS['xortifyModuleConfig']['fault_delay']), $GLOBALS['xortifyModuleConfig']['fault_delay']); + switch ($GLOBALS['xortifyModuleConfig']['crontype']) { + case 'preloader': + $read = XoopsCache::read('xortify_pause_preload'); + if ((isset($read['time'])?(float)$read['time']:0)<=microtime(true)) { + XoopsCache::write('xortify_pause_preload', array('time'=>microtime(true)+$GLOBALS['xortifyModuleConfig']['croninterval'])); + $GLOBALS['xortify_preloader']=true; + ob_start(); + include(XOOPS_ROOT_PATH.'/modules/xortify/cron/serverup.php'); + ob_end_clean(); + } + break; + } + XoopsCache::write('xortify_core_include_common_end_cron', array('time'=>microtime(true)), -1); + } + + } +} + +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/preloads/xortify.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/admin ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/admin/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/admin/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/admin/index.html 2011-12-18 18:03:50 UTC (rev 8518) @@ -0,0 +1,10 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Untitled Document</title> +</head> + +<body> +</body> +</html> Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/admin/index.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/admin/index.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/admin/index.php 2011-12-18 18:03:50 UTC (rev 8518) @@ -0,0 +1,455 @@ +<?php +/** + * @package xortify + * @subpackage module + * @description Sector Network Security Drone + * @author Simon Roberts WISHCRAFT <si...@ch...> + * @copyright copyright (c) 2010-2013 XOOPS.org + * @licence GPL 2.0 - see docs/LICENCE.txt + */ + + + include(dirname(dirname(dirname(dirname(__FILE__)))).'/include/cp_header.php'); + + $GLOBALS['xoops'] = Xoops::getInstance(); + + if (!defined('_CHARSET')) + define ("_CHARSET","UTF-8"); + if (!defined('_CHARSET_ISO')) + define ("_CHARSET_ISO","ISO-8859-1"); + + $GLOBALS['myts'] = MyTextSanitizer::getInstance(); + + $module_handler = $GLOBALS['xoops']->getHandler('module'); + $config_handler = $GLOBALS['xoops']->getHandler('config'); + $GLOBALS['xortifyModule'] = $module_handler->getByDirname('xortify'); + $GLOBALS['xortifyModuleConfig'] = $config_handler->getConfigList($GLOBALS['xortifyModule']->getVar('mid')); + + include_once $GLOBALS['xoops']->path('class'.DS.'cache'.DS.'xoopscache.php'); + include_once $GLOBALS['xoops']->path('class'.DS.'pagenav.php'); + include_once $GLOBALS['xoops']->path('class'.DS.'xoopslists.php'); + include_once $GLOBALS['xoops']->path('class'.DS.'xoopsmailer.php'); + include_once $GLOBALS['xoops']->path('class'.DS.'tree.php'); + include_once $GLOBALS['xoops']->path('class'.DS.'xoopsformloader.php'); + include_once $GLOBALS['xoops']->path('modules'.DS.'xortify'.DS.'class'.DS.'auth'.DS.'authfactory.php'); + include_once $GLOBALS['xoops']->path('modules'.DS.'xortify'.DS.'include'.DS.'functions.php'); + include_once $GLOBALS['xoops']->path('modules'.DS.'xortify'.DS.'include'.DS.'forms.xortify.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{ + echo $GLOBALS['xoops']->error("Error: You don't use the Frameworks \"admin module\". Please install this Frameworks"); + //return false; + } + $GLOBALS['xortifyImageIcon'] = XOOPS_URL .'/'. $GLOBALS['xortifyModule']->getInfo('icons16'); + $GLOBALS['xortifyImageAdmin'] = XOOPS_URL .'/'. $GLOBALS['xortifyModule']->getInfo('icons32'); + + $myts = MyTextSanitizer::getInstance(); + + if ($GLOBALS['xoopsUser']) { + $moduleperm_handler = $GLOBALS['xoops']->getHandler('groupperm'); + if (!$moduleperm_handler->checkRight('module_admin', $GLOBALS['xortifyModule']->getVar( 'mid' ), $GLOBALS['xoopsUser']->getGroups())) { + $GLOBALS['xoops']->redirect(XOOPS_URL, 1, _NOPERM); + exit(); + } + } else { + $GLOBALS['xoops']->redirect(XOOPS_URL . "/user.php", 1, _NOPERM); + exit(); + } + + $GLOBALS['xoops']->loadLanguage('admin', 'xortify'); + $GLOBALS['xoops']->loadLanguage('modinfo', 'xortify'); + + $GLOBALS['xoops']->header(); + $GLOBALS['xoops']->tpl->assign('pathImageIcon', $GLOBALS['xortifyImageIcon']); + $GLOBALS['xoops']->tpl->assign('pathImageAdmin', $GLOBALS['xortifyImageAdmin']); + + $op = isset($_REQUEST['op'])?$_REQUEST['op']:"dashboard"; + $fct = isset($_REQUEST['fct'])?$_REQUEST['fct']:""; + + switch($op) { + case "signup": + + switch ($fct) + { + case "save": + + $xortifyAuth = XortifyAuthFactory::getAuthConnection(false, $GLOBALS['xortifyModuleConfig']['protocol']); + $myts = MyTextSanitizer::getInstance(); + $uname = isset($_POST['uname']) ? $myts->stripSlashesGPC(trim($_POST['uname'])) : ''; + $email = isset($_POST['email']) ? $myts->stripSlashesGPC(trim($_POST['email'])) : ''; + $url = isset($_POST['url']) ? $myts->stripSlashesGPC(trim($_POST['url'])) : ''; + $pass = isset($_POST['pass']) ? $myts->stripSlashesGPC(trim($_POST['pass'])) : ''; + $vpass = isset($_POST['vpass']) ? $myts->stripSlashesGPC(trim($_POST['vpass'])) : ''; + $agree = (isset($_POST['agree']) && intval($_POST['agree'])) ? 1 : 0; + + if ($agree != 1) { + $stop .= _US_UNEEDAGREE . '<br />'; + } + + $validate = $xortifyAuth->validate($uname, $email, $pass, $vpass); + + if ($validate!=false) + $stop .= "User details didn't validate with Xortify.com<br/>$validate"; + + XoopsLoad::load("captcha"); + $xoopsCaptcha = XoopsCaptcha::getInstance(); + if (! $xoopsCaptcha->verify() ) { + $stop .= $xoopsCaptcha->getMessage(); + } + + if ($stop!='') { + + echo xortify_adminMenu(2); + echo "<p align='center' style='font-size: 15px; color: #FF0000;'>$stop</p>"; + $GLOBALS['xoops'] = Xoops::getInstance(); + $xortifyAuth = XortifyAuthFactory::getAuthConnection(false, $GLOBALS['xortifyModuleConfig']['protocol']); + $disclaimer = $xortifyAuth->network_disclaimer(); + if (strlen(trim($disclaimer))==0) + { + $disclaimer = _XOR_ADMIN_NONETWORKCOMM_DISCLAIMER; + } + if ($disclaimer != _XOR_ADMIN_NONETWORKCOMM_DISCLAIMER) { + $uname = new XoopsFormText('', "uname", 35, 128, (isset($_POST['uname'])?$_POST['uname']:'')); + $pass = new XoopsFormPassword('', "pass", 35, 128, (isset($_POST['pass'])?$_POST['pass']:'')); + $vpass = new XoopsFormPassword('', "vpass", 35, 128, (isset($_POST['vpass'])?$_POST['vpass']:'')); + $email = new XoopsFormText('', "email", 35, 128, (isset($_POST['email'])?$_POST['email']:'')); + $url = new XoopsFormText('', "url", 35, 128, (isset($_POST['url'])?$_POST['url']:'')); + $viewemail = new XoopsFormRadioYN('', "viewemail", (isset($_POST['viewemail'])?$_POST['viewemail']:false)); + $timezone = new XoopsFormSelectTimezone('', "timezone", (isset($_POST['timezone'])?$_POST['timezone']:'')); + $myts = MyTextSanitizer::getInstance(); + $disclaim = new XoopsFormLabel('', $myts->nl2br($disclaimer)); + $agree = new XoopsFormRadioYN('', "agree", false); + $captcha = new XoopsFormCaptcha('', 'xoopscaptcha', false); + $op = new XoopsFormHidden('op', 'signup'); + $fct = new XoopsFormHidden('fct', 'save'); + $submit = new XoopsFormButton('', 'submit', _XOR_FRM_REGISTER, 'submit'); + $GLOBALS['xoops']->tpl->assign('uname',$uname->render()); + $GLOBALS['xoops']->tpl->assign('pass',$pass->render()); + $GLOBALS['xoops']->tpl->assign('vpass',$vpass->render()); + $GLOBALS['xoops']->tpl->assign('email',$email->render()); + $GLOBALS['xoops']->tpl->assign('yoururl',$url->render()); + $GLOBALS['xoops']->tpl->assign('viewemail',$viewemail->render()); + $GLOBALS['xoops']->tpl->assign('timezone',$timezone->render()); + $GLOBALS['xoops']->tpl->assign('disclaimer',$disclaim->render()); + $GLOBALS['xoops']->tpl->assign('agree',$agree->render()); + $GLOBALS['xoops']->tpl->assign('captcha',$captcha->render()); + $GLOBALS['xoops']->tpl->assign('op',$op->render()); + $GLOBALS['xoops']->tpl->assign('fct',$fct->render()); + $GLOBALS['xoops']->tpl->assign('submit',$submit->render()); + $GLOBALS['xoops']->tpl->display('admin:xortify|xortify_cpanel_signup_form.html'); + xortify_footer_adminMenu(); + $GLOBALS['xoops']->footer(); + exit; + } else { + $GLOBALS['xoops']->tpl->assign('protocol', $GLOBALS['xortifyModuleConfig']['protocol']); + switch($GLOBALS['xortifyModuleConfig']['protocol']) { + case 'curlserialised': + case 'wgetserialised': + $GLOBALS['xoops']->tpl->assign('port', $GLOBALS['xortifyModuleConfig']['xortify_uriserial']); + break; + case 'curl': + case 'json': + $GLOBALS['xoops']->tpl->assign('port', $GLOBALS['xortifyModuleConfig']['xortify_urijson']); + break; + case 'curlxml': + case 'wgetxml': + $GLOBALS['xoops']->tpl->assign('port', $GLOBALS['xortifyModuleConfig']['xortify_urixml']); + break; + case 'soap': + $GLOBALS['xoops']->tpl->assign('port', $GLOBALS['xortifyModuleConfig']['xortify_urisoap']); + break; + } + $GLOBALS['xoops']->tpl->assign('error', $disclaimer); + $GLOBALS['xoops']->tpl->display('admin:xortify|xortify_cpanel_signup_nocommunication.html'); + } + } else { + @$xortifyAuth->create_user( $_POST['viewemail'], $uname, $email, $url, $actkey, + $pass, $_POST['timezone'], $_POST['mailok'], $xortifyAuth->check_siteinfo(array())); + + $moduleHandler = $GLOBALS['xoops']->getHandler('module'); + $configHandler = $GLOBALS['xoops']->getHandler('config'); + $GLOBALS['xortifyModule'] = $moduleHandler->getByDirname('xortify'); + $configs = $configHandler->getConfigs(new Criteria('conf_modid', $GLOBALS['xortifyModule']->mid()) ); + foreach($configs as $id => $config) + switch($config->getVar('conf_name')) { + case 'xortify_username': + $config->setVar('conf_value', $uname); + @$configHandler->insertConfig($config); + break; + case 'xortify_password': + $config->setVar('conf_value', $pass); + @$configHandler->insertConfig($config); + break; + } + + $GLOBALS['xoops']->redirect("index.php", 4, _XOR_USERCREATED_PLEASEACTIVATE); + exit(0); + } + break; + default: + case "signup": + + echo xortify_adminMenu(4); + $GLOBALS['xoops'] = Xoops::getInstance(); + + $disclaimer = XortifyAuthFactory::getAuthConnection(false, $GLOBALS['xortifyModuleConfig']['protocol'])->network_disclaimer(); + + if (strlen(trim($disclaimer))==0) + { + $disclaimer = _XOR_ADMIN_NONETWORKCOMM_DISCLAIMER; + } + if ($disclaimer != _XOR_ADMIN_NONETWORKCOMM_DISCLAIMER) { + + $uname = new XoopsFormText('', "uname", 35, 128, (isset($_POST['uname'])?$_POST['uname']:'')); + $pass = new XoopsFormPassword('', "pass", 35, 128, (isset($_POST['pass'])?$_POST['pass']:'')); + $vpass = new XoopsFormPassword('', "vpass", 35, 128, (isset($_POST['vpass'])?$_POST['vpass']:'')); + $email = new XoopsFormText('', "email", 35, 128, (isset($_POST['email'])?$_POST['email']:'')); + $url = new XoopsFormText('', "yoururl", 35, 128, (isset($_POST['url'])?$_POST['url']:'')); + $viewemail = new XoopsFormRadioYN('', "viewemail", (isset($_POST['viewemail'])?$_POST['viewemail']:false)); + $timezone = new XoopsFormSelectTimezone('', "timezone", (isset($_POST['timezone'])?$_POST['timezone']:'')); + $myts = MyTextSanitizer::getInstance(); + $disclaim = new XoopsFormLabel('', $myts->nl2br($disclaimer)); + $agree = new XoopsFormRadioYN('', "agree", false); + $captcha = new XoopsFormCaptcha('', 'xoopscaptcha', false); + $op = new XoopsFormHidden('op', 'signup'); + $fct = new XoopsFormHidden('fct', 'save'); + $submit = new XoopsFormButton('', 'submit', _XOR_FRM_REGISTER, 'submit'); + $GLOBALS['xoops']->tpl->assign('uname',$uname->render()); + $GLOBALS['xoops']->tpl->assign('pass',$pass->render()); + $GLOBALS['xoops']->tpl->assign('vpass',$vpass->render()); + $GLOBALS['xoops']->tpl->assign('email',$email->render()); + $GLOBALS['xoops']->tpl->assign('yoururl',$url->render()); + $GLOBALS['xoops']->tpl->assign('viewemail',$viewemail->render()); + $GLOBALS['xoops']->tpl->assign('timezone',$timezone->render()); + $GLOBALS['xoops']->tpl->assign('disclaimer',$disclaim->render()); + $GLOBALS['xoops']->tpl->assign('agree',$agree->render()); + $GLOBALS['xoops']->tpl->assign('captcha',$captcha->render()); + $GLOBALS['xoops']->tpl->assign('op',$op->render()); + $GLOBALS['xoops']->tpl->assign('fct',$fct->render()); + $GLOBALS['xoops']->tpl->assign('submit',$submit->render()); + $GLOBALS['xoops']->tpl->display('admin:xortify|xortify_cpanel_signup_form.html'); + + xortify_footer_adminMenu(); + $GLOBALS['xoops']->footer(); + exit; + } else { + + $GLOBALS['xoops']->tpl->assign('protocol', $GLOBALS['xortifyModuleConfig']['protocol']); + switch($GLOBALS['xortifyModuleConfig']['protocol']) { + case 'curlserialised': + case 'wgetserialised': + $GLOBALS['xoops']->tpl->assign('port', $GLOBALS['xortifyModuleConfig']['xortify_uriserial']); + break; + case 'curl': + case 'json': + $GLOBALS['xoops']->tpl->assign('port', $GLOBALS['xortifyModuleConfig']['xortify_urijson']); + break; + case 'curlxml': + case 'wgetxml': + $GLOBALS['xoops']->tpl->assign('port', $GLOBALS['xortifyModuleConfig']['xortify_urixml']); + break; + case 'soap': + $GLOBALS['xoops']->tpl->assign('port', $GLOBALS['xortifyModuleConfig']['xortify_urisoap']); + break; + } + $GLOBALS['xoops']->tpl->assign('error', $disclaimer); + $GLOBALS['xoops']->tpl->display('admin:xortify|xortify_cpanel_signup_nocommunication.html'); + + } + break; + } + break; + case "log": + echo xortify_adminMenu(3); + + include_once $GLOBALS['xoops']->path( "/class/pagenav.php" ); + + $log_handler = $GLOBALS['xoops']->getModuleHandler('log', 'xortify'); + + $ttl = $log_handler->getCount(NULL); + $limit = !empty($_POST['limit'])?intval($_POST['limit']):30; + $start = !empty($_POST['start'])?intval($_POST['start']):0; + $order = !empty($_POST['order'])?$_POST['order']:'DESC'; + $sort = !empty($_POST['sort'])?''.$_POST['sort'].'':'date'; + + $pagenav = new XoopsPageNav($ttl, $limit, $start, 'start', 'limit='.$limit.'&sort='.$sort.'&order='.$order.'&op='.$op); + $GLOBALS['xoops']->tpl->assign('pagenav', $pagenav->renderNav()); + + foreach (array( 'action','provider','date','uname','email','ip4','ip6','proxy-ip4', + 'proxy-ip6','network-addy','agent') as $id => $key) { + $GLOBALS['xoops']->tpl->assign(strtolower(str_replace('-','_',$key).'_th'), '<a href="'.$_SERVER['PHP_SELF'].'?start='.$start.'&limit='.$limit.'&sort='.str_replace('_','-',$key).'&order='.((str_replace('_','-',$key)==$sort)?($order=='DESC'?'ASC':'DESC'):$order).'&op='.$op.'">'.(defined('_XOR_AM_TH_'.strtoupper(str_replace('-','_',$key)))?constant('_XOR_AM_TH_'.strtoupper(str_replace('-','_',$key))):'_XOR_AM_TH_'.strtoupper(str_replace('-','_',$key))).'</a>'); + } + + $criteria = new Criteria('1','1'); + $criteria->setStart($start); + $criteria->setLimit($limit); + $criteria->setSort('`'.$sort.'`'); + $criteria->setOrder($order); + + $logs = $log_handler->getObjects($criteria, true); + foreach($logs as $id => $log) { + $GLOBALS['xoops']->tpl->append('log', $log->toArray()); + } + $GLOBALS['xoops']->tpl->display('admin:xortify|xortify_cpanel_log.html'); + + break; + case "list": + + echo xortify_adminMenu(2); + + XoopsLoad::load("xoopscache"); + if (!class_exists('XoopsCache')) + XoopsLoad::load("cache"); + XoopsLoad::load("pagenav"); + + if (!$bans = XoopsCache::read('xortify_bans_cache')) { + + require_once( XOOPS_ROOT_PATH.'/modules/xortify/class/'.$GLOBALS['xortifyModuleConfig']['protocol'].'.php' ); + + $func = strtoupper($GLOBALS['xortifyModuleConfig']['protocol']).'XortifyExchange'; + + ob_start(); + $soapExchg = new $func; + $bans = $soapExchg->retrieveBans(); + ob_end_flush(); + + XoopsCache::delete('xortify_bans_cache'); + XoopsCache::delete('xortify_bans_cache_backup'); + XoopsCache::write('xortify_bans_cache', $bans, $GLOBALS['xortifyModuleConfig']['xortify_seconds']); + XoopsCache::write('xortify_bans_cache_backup', $bans, ($GLOBALS['xortifyModuleConfig']['xortify_seconds'] * 1.45)); + } + + if ($bans['bans']==0) { + + echo _XS_AM_NOCACHEMSG; + } else { + + $limit = !empty($_REQUEST['limit'])?intval($_REQUEST['limit']):30; + $start = !empty($_REQUEST['start'])?intval($_REQUEST['start']):0; + + $pagenav = new XoopsPageNav($bans['bans'], $limit, $start, 'start', 'limit='.$limit.'&op='.$op); + $GLOBALS['xoops']->tpl->assign('pagenav', $pagenav->renderNav()); + $i=0; + $num=0; + foreach($bans['data'] as $key => $data) { + $i++; + if ($i>=$start&&$num<=$limit) { + $num++; + if (strlen($data['ip4'])>0) { + $ipaddy = $data['ip4']; + $iptype = _XS_IPTYPE_IP4; + } elseif (strlen($data['ip6'])>0) { + $ipaddy = $data['ip6']; + $iptype = _XS_IPTYPE_IP6; + } else { + $ipaddy = ''; + $iptype = _XS_IPTYPE_EMPTY; + } + + if (strlen($data['proxy-ip4'])>0) { + $proxyip = $data['proxy-ip4']; + $proxyiptype = _XS_IPTYPE_IP4; + } elseif (strlen($data['proxy-ip6'])>0) { + $proxyip = $data['proxy-ip6']; + $proxyiptype = _XS_IPTYPE_IP6; + } else { + $proxyip = ''; + $proxyiptype = ''; + } + + $GLOBALS['xoops']->tpl->append('bans', array('iptype' => $iptype, 'ipaddy' => $ipaddy, + 'proxyiptype' => $proxyiptype, 'ip' => $proxyip, + 'netaddy' => $data['network-addy']?$data['network-addy']:' ', + 'macaddy' => $data['mac-addy']?$data['mac-addy']:' ', + 'long' => $data['long']?$data['long']:' ')); + } + } + $GLOBALS['xoops']->tpl->display('admin:xortify|xortify_cpanel_bans.html'); + } + + + break; + case "dashboard": + default: + + echo xortify_adminMenu(1); + + $log_handler = $GLOBALS['xoops']->getModuleHandler('log', 'xortify'); + + $indexAdmin = new ModuleAdmin(); + + $indexAdmin->addInfoBox(_XOR_ADMIN_COUNTS); + $indexAdmin->addInfoBoxLine(_XOR_ADMIN_COUNTS, "<label>"._XOR_ADMIN_THEREARE_BANNED."</label>", $log_handler->getCountByField('action','banned'), 'Green'); + $indexAdmin->addInfoBoxLine(_XOR_ADMIN_COUNTS, "<label>"._XOR_ADMIN_THEREARE_BLOCKED."</label>", $log_handler->getCountByField('action','blocked'), 'Green'); + $indexAdmin->addInfoBoxLine(_XOR_ADMIN_COUNTS, "<label>"._XOR_ADMIN_THEREARE_MONITORED."</label>", $log_handler->getCountByField('action','monitored'), 'Green'); + $indexAdmin->addInfoBoxLine(_XOR_ADMIN_COUNTS, "<label>"._XOR_ADMIN_THEREARE_PROJECTHONEYPOTORG."</label>", $log_handler->getCountByField('provider','projecthoneypot.org'), 'Green'); + $indexAdmin->addInfoBoxLine(_XOR_ADMIN_COUNTS, "<label>"._XOR_ADMIN_THEREARE_PROTECTOR."</label>", $log_handler->getCountByField('provider','protector'), 'Green'); + $indexAdmin->addInfoBoxLine(_XOR_ADMIN_COUNTS, "<label>"._XOR_ADMIN_THEREARE_SPIDERS."</label>", $log_handler->getCountByField('provider','spiders'), 'Green'); + $indexAdmin->addInfoBoxLine(_XOR_ADMIN_COUNTS, "<label>"._XOR_ADMIN_THEREARE_STOPFORUMSPAMCOM."</label>", $log_handler->getCountByField('provider','stopforumspam.com'), 'Green'); + $indexAdmin->addInfoBoxLine(_XOR_ADMIN_COUNTS, "<label>"._XOR_ADMIN_THEREARE_XORTIFY."</label>", $log_handler->getCountByField('provider','xortify'), 'Green'); + + XoopsLoad::load('xoopscache'); + if (!class_exists('XoopsCache')) { + // XOOPS 2.4 Compliance + XoopsLoad::load('cache'); + if (!class_exists('XoopsCache')) { + include_once XOOPS_ROOT_PATH.DS.'class'.DS.'cache'.DS.'xoopscache.php'; + } + } + + if ($bans = XoopsCache::read('xortify_bans_cache')) { + $indexAdmin->addInfoBoxLine(_XOR_ADMIN_COUNTS, "<label>"._XOR_ADMIN_THEREARE_CLOUDEDBANS."</label>", count($bans), 'Green'); + } + + echo $indexAdmin->renderIndex(); + + break; + case "about": + + echo xortify_adminMenu(5); + + $paypalitemno='XORTIFY302'; + $aboutAdmin = new ModuleAdmin(); + $about = $aboutAdmin->renderabout($paypalitemno, false); + + $donationform = array( 0 => '<form name="donation" id="donation" action="http://www.chronolabs.coop/modules/xpayment/" method="post" onsubmit="return xoopsFormValidate_donation();">', + 1 => '<table class="outer" cellspacing="1" width="100%"><tbody><tr><th colspan="2">'._XOR_ADMIN_MAKEDONATE.'</th></tr><tr align="left" valign="top"><td class="head"><div class="xoops-form-element-caption-required"><span class="caption-text">Donation Amount</span><span class="caption-marker">*</span></div></td><td class="even"><select size="1" name="item[A][amount]" id="item[A][amount]" title="Donation Amount"><option value="5">5.00 AUD</option><option value="10">10.00 AUD</option><option value="20">20.00 AUD</option><option value="40">40.00 AUD</option><option value="60">60.00 AUD</option><option value="80">80.00 AUD</option><option value="90">90.00 AUD</option><option value="100">100.00 AUD</option><option value="200">200.00 AUD</option></select></td></tr><tr align="left" valign="top"><td class="head"></td><td class="even"><input class="formButton" name="submit" id="submit" value="'._SUBMIT.'" title="'._SUBMIT.'" type="submit"></td></tr></tbody></table>', + 2 => '<input name="op" id="op" value="createinvoice" type="hidden"><input name="plugin" id="plugin" value="donations" type="hidden"><input name="donation" id="donation" value="1" type="hidden"><input name="drawfor" id="drawfor" value="Chronolabs Co-Operative" type="hidden"><input name="drawto" id="drawto" value="%s" type="hidden"><input name="drawto_email" id="drawto_email" value="%s" type="hidden"><input name="key" id="key" value="%s" type="hidden"><input name="currency" id="currency" value="AUD" type="hidden"><input name="weight_unit" id="weight_unit" value="kgs" type="hidden"><input name="item[A][cat]" id="item[A][cat]" value="XDN%s" type="hidden"><input name="item[A][name]" id="item[A][name]" value="Donation for %s" type="hidden"><input name="item[A][quantity]" id="item[A][quantity]" value="1" type="hidden"><input name="item[A][shipping]" id="item[A][shipping]" value="0" type="hidden"><input name="item[A][handling]" id="item[A][handling]" value="0" type="hidden"><input name="item[A][weight]" id="item[A][weight]" value="0" type="hidden"><input name="item[A][tax]" id="item[A][tax]" value="0" type="hidden"><input name="return" id="return" value="http://www.chronolabs.coop/modules/donations/success.php" type="hidden"><input name="cancel" id="cancel" value="http://www.chronolabs.coop/modules/donations/success.php" type="hidden"></form>', + 3 => '', + 4 => '<!-- Start Form Validation JavaScript //--> +<script type="text/javascript"> +<!--// +function xoopsFormValidate_donation() { var myform = window.document.donation; +var hasSelected = false; var selectBox = myform.item[A][amount];for (i = 0; i < selectBox.options.length; i++ ) { if (selectBox.options[i].selected == true && selectBox.options[i].value != \'\') { hasSelected = true; break; } }if (!hasSelected) { window.alert("Please enter Donation Amount"); selectBox.focus(); return false; }return true; +} +//--></script> +<!-- End Form Validation JavaScript //-->'); + + $paypalform = array( 0 => '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">', + 1 => '<input name="cmd" value="_s-xclick" type="hidden">', + 2 => '<input name="hosted_button_id" value="%s" type="hidden">', + 3 => '<img alt="" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" height="1" border="0" width="1">', + 4 => '<input src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!" border="0" type="image">', + 5 => '</form>'); + + for($key=0;$key<=4;$key++) { + switch ($key) { + case 2: + $donationform[$key] = sprintf($donationform[$key], $GLOBALS['xoopsConfig']['sitename'] . ' - ' . (strlen($GLOBALS['xoopsUser']->getVar('name'))>0?$GLOBALS['xoopsUser']->getVar('name'). ' ['.$GLOBALS['xoopsUser']->getVar('uname').']':$GLOBALS['xoopsUser']->getVar('uname')), $GLOBALS['xoopsUser']->getVar('email'), XOOPS_LICENSE_KEY, strtoupper($GLOBALS['xortifyModule']->getVar('dirname')), strtoupper($GLOBALS['xortifyModule']->getVar('dirname')). ' '.$GLOBALS['xortifyModule']->getVar('name')); + break; + } + } + + $istart = strpos($about, ($paypalform[0]), 1); + $iend = strpos($about, ($paypalform[5]), $istart+1)+strlen($paypalform[5])-1; + echo (substr($about, 0, $istart-1)); + echo implode("\n", $donationform); + echo (substr($about, $iend+1, strlen($about)-$iend-1)); + break; + } + + xortify_footer_adminMenu(); + $GLOBALS['xoops']->footer(); +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/admin/index.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/admin/menu.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/admin/menu.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/admin/menu.php 2011-12-18 18:03:50 UTC (rev 8518) @@ -0,0 +1,39 @@ +<?php +/** + * @package xortify + * @subpackage module + * @description Sector Network Security Drone + * @author Simon Roberts WISHCRAFT <si...@ch...> + * @copyright copyright (c) 2010-2013 XOOPS.org + * @licence GPL 2.0 - see docs/LICENCE.txt + */ +global $xortifyModule, $xortifyImageAdmin; +$xoops = Xoops::getInstance(); +$module_handler = $xoops->getHandler('module'); +$xortifyModule = $module_handler->getByDirname('xortify'); +global $adminmenu; +$adminmenu = array(); +if (is_object($GLOBALS['xortifyModule'])) { + $xortifyImageAdmin = $xortifyModule->getInfo('icons32'); + $adminmenu[1]['title'] = _XOR_ADMENU4; + $adminmenu[1]['icon'] = '../../'.$xortifyImageAdmin.'/home.png'; + $adminmenu[1]['image'] = '../../'.$xortifyImageAdmin.'/home.png'; + $adminmenu[1]['link'] = "admin/index.php?op=dashboard"; + $adminmenu[2]['title'] = _XOR_ADMENU1; + $adminmenu[2]['icon'] = '../../'.$xortifyImageAdmin.'/current.bans.png'; + $adminmenu[2]['image'] = '../../'.$xortifyImageAdmin.'/current.bans.png'; + $adminmenu[2]['link'] = "admin/index.php?op=list&fct=bans"; + $adminmenu[3]['title'] = _XOR_ADMENU3; + $adminmenu[3]['icon'] = '../../'.$xortifyImageAdmin.'/xortify.log.png'; + $adminmenu[3]['image'] = '../../'.$xortifyImageAdmin.'/xortify.log.png'; + $adminmenu[3]['link'] = "admin/index.php?op=log"; + $adminmenu[4]['title'] = _XOR_ADMENU2; + $adminmenu[4]['icon'] = '../../'.$xortifyImageAdmin.'/access.list.png'; + $adminmenu[4]['image'] = '../../'.$xortifyImageAdmin.'/access.list.png'; + $adminmenu[4]['link'] = "admin/index.php?op=signup&fct=signup"; + $adminmenu[5]['title'] = _XOR_ADMENU5; + $adminmenu[5]['icon'] = '../../'.$xortifyImageAdmin.'/about.png'; + $adminmenu[5]['image'] = '../../'.$xortifyImageAdmin.'/about.png'; + $adminmenu[5]['link'] = "admin/index.php?op=about"; +} +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/admin/menu.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth.php 2011-12-18 18:03:50 UTC (rev 8518) @@ -0,0 +1,118 @@ +<?php +/** + * @package xortify + * @subpackage module + * @description Sector Network Security Drone + * @author Simon Roberts WISHCRAFT <si...@ch...> + * @copyright copyright (c) 2010-2013 XOOPS.org + * @licence GPL 2.0 - see docs/LICENCE.txt + */ + + +class XortifyAuth { + + var $_dao; + + var $_errors; + /** + * Authentication Service constructor + */ + function XortifyAuth (&$dao){ + $this->_dao = $dao; + } + + /** + * @abstract need to be write in the dervied class + */ + function authenticate($uname, $pwd = null) { + $authenticated = false; + + return $authenticated; + } + + /** + * add an error + * + * @param string $value error to add + * @access protected + */ + function setErrors($err_no, $err_str) + { + $this->_errors[$err_no] = trim($err_str); + } + + /** + * return the errors for this object as an array + * + * @return array an array of errors + * @access protected + */ + function getErrors() + { + return $this->_errors; + } + + /** + * return the errors for this object as html + * + * @return string html listing the errors + * @access protected + */ + function getHtmlErrors() + { + global $xoopsConfig; + $ret = '<br>'; + if ( $xoopsConfig['debug_mode'] == 1 || $xoopsConfig['debug_mode'] == 2 ) + { + if (!empty($this->_errors)) { + foreach ($this->_errors as $errno => $errstr) { + $ret .= $errstr . '<br/>'; + } + } else { + $ret .= _NONE.'<br />'; + } + $ret .= sprintf(_AUTH_MSG_AUTH_METHOD, $this->auth_method); + } + else { + $ret .= _US_INCORRECTLOGIN; + } + return $ret; + } + + /** + * checks for variables require in siteinfo package in the auth library + * + * @param array $siteinfo + * + * @return array $siteinfo + * @access protected + */ + function check_siteinfo($siteinfo){ + + global $xoopsConfig; + if (!isset($siteinfo)||empty($siteinfo)||!is_array($siteinfo)){ + $siteinfo = array(); + $siteinfo['sitename'] = $xoopsConfig['sitename']; + $siteinfo['adminmail'] = $xoopsConfig['adminmail']; + $siteinfo['systemkey'] = XOOPS_LICENSE_KEY; + $siteinfo['xoops_url'] = XOOPS_URL; + } + + if (!isset($siteinfo['sitename'])||empty($siteinfo['sitename'])) + $siteinfo['sitename'] = $xoopsConfig['sitename']; + + if (!isset($siteinfo['adminmail'])||empty($siteinfo['adminmail'])) + $siteinfo['adminmail'] = $xoopsConfig['adminmail']; + + if (!isset($siteinfo['xoops_url'])||empty($siteinfo['xoops_url'])) + $siteinfo['xoops_url'] = XOOPS_URL; + + if (!isset($siteinfo['systemkey'])||empty($siteinfo['systemkey'])) + $siteinfo['systemkey'] = $xoopsConfig['systemkey']; + + return $siteinfo; + } +} + + +?> Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_curl.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_curl.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_curl.php 2011-12-18 18:03:50 UTC (rev 8518) @@ -0,0 +1,186 @@ +<?php +/** + * @package xortify + * @subpackage module + * @description Sector Network Security Drone + * @author Simon Roberts WISHCRAFT <si...@ch...> + * @copyright copyright (c) 2010-2013 XOOPS.org + * @licence GPL 2.0 - see docs/LICENCE.txt + */ + +if (!function_exists('json_encode')){ + function json_encode($data) { + static $json = NULL; + if (!class_exists('Services_JSON') ) { include_once $GLOBALS['xoops']->path('/modules/xortify/include/JSON.php'); } + $json = new Services_JSON(); + return $json->encode($data); + } +} + +if (!function_exists('json_decode')){ + function json_decode($data) { + static $json = NULL; + if (!class_exists('Services_JSON') ) { include_once $GLOBALS['xoops']->path('/modules/xortify/include/JSON.php'); } + $json = new Services_JSON(); + return $json->decode($data); + } +} + + +define('XORTIFY_CURL_API', $GLOBALS['xortifyModuleConfig']['xortify_uricurl']); +define('XORTIFY_USER_AGENT', 'Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.0.2) XOOPS/20100101 XoopsAuth/1.xx (php)'); +include_once XOOPS_ROOT_PATH . '/modules/xortify/class/auth/auth_curl_provisionning.php'; + +class XortifyAuthCurl extends XortifyAuth { + + var $curl_client; + var $curl_xoops_username = ''; + var $curl_xoops_password = ''; + var $_dao; + var $_json = ''; + /** + * Authentication Service constructor + */ + function XortifyAuthCurl (&$dao) { + if (!$ch = curl_init(XORTIFY_CURL_API)) { + trigger_error('Could not intialise CURL file: '.XORTIFY_CURL_API); + return false; + } + $cookies = XOOPS_VAR_PATH.'/cache/xoops_cache/authcurl_'.md5(XORTIFY_CURL_API).'.cookie'; + + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $GLOBALS['xortifyModuleConfig']['curl_connecttimeout']*2); + curl_setopt($ch, CURLOPT_TIMEOUT, $GLOBALS['xortifyModuleConfig']['curl_timeout']*2); + curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_USERAGENT, XORTIFY_USER_AGENT); + $this->curl_client = $ch; + } + + + /** + * Authenticate user again curl directory (Bind) + * + * @param string $uname Username + * @param string $pwd Password + * + * @return bool + */ + function authenticate($uname, $pwd = null) { + $authenticated = false; + $this->XortifyAuthCurl($GLOBALS['xoopsDB']); + + if (!$this->curl_client) { + $this->setErrors(0, _AUTH_CURL_EXTENSION_NOT_LOAD); + return $authenticated; + } + + + $rnd = rand(-100000, 100000000); + curl_setopt($this->curl_client, CURLOPT_POSTFIELDS, array('xoops_authentication' => json_encode(array("username"=> $this->curl_xoops_username, "password"=> $this->curl_xoops_password, "auth" => array('username' => $uname, "password" => $pwd, "time" => time(), "passhash" => sha1((time()-$rnd).$uname.$pwd), "rand"=>$rnd))))); + $data = curl_exec($this->curl_client); + curl_close($this->curl_client); + $result = $this->obj2array(json_decode($data)); + return $result["RESULT"]; + } + + + /** + * validate a user via curl + * + * @param string $uname + * @param string $email + * @param string $pass + * @param string $vpass + * + * @return string + */ + function validate($uname, $email, $pass, $vpass){ + $this->XortifyAuthCurl($GLOBALS['xoopsDB']); + $rnd = rand(-100000, 100000000); + curl_setopt($this->curl_client, CURLOPT_POSTFIELDS, array('xoops_user_validate' => json_encode(array("username"=> $this->curl_xoops_username, "password"=> $this->curl_xoops_password, "validate" => array('uname' => $uname, "pass" => $pass, "vpass" => $vpass, "email" => $email, "time" => time(), "passhash" => sha1((time()-$rnd).$uname.$pass), "rand"=>$rnd))))); + $data = curl_exec($this->curl_client); + curl_close($this->curl_client); + $result = $this->obj2array(json_decode($data)); + if ($result['ERRNUM']==1){ + return $result["RESULT"]; + } else { + return false; + } + + } + + + /** + * get the xoops site disclaimer via curl + * + * @return string + */ + function network_disclaimer(){ + $this->XortifyAuthCurl($GLOBALS['xoopsDB']); + curl_setopt($this->curl_client, CURLOPT_POSTFIELDS, array('xoops_network_disclaimer' => json_encode(array("username"=> $this->curl_xoops_username, "password"=> $this->curl_xoops_password)))); + $data = curl_exec($this->curl_client); + curl_close($this->curl_client); + + $result = $this->obj2array(json_decode($data)); + if ($result['ERRNUM']==1){ + return $result["RESULT"]; + } else { + return false; + } + + } + + /** + * create a user + * + * @param bool $user_viewemail + * @param string $uname + * @param string $email + * @param string $url + * @param string $actkey + * @param string $pass + * @param integer $timezone_offset + * @param bool $user_mailok + * @param array $siteinfo + * + * @return array + */ + function create_user($user_viewemail, $uname, $email, $url, $actkey, + $pass, $timezone_offset, $user_mailok, $siteinfo){ + + $siteinfo = $this->check_siteinfo($siteinfo); + + $rnd = rand(-100000, 100000000); + $this->XortifyAuthCurl($GLOBALS['xoopsDB']); + curl_setopt($this->curl_client, CURLOPT_POSTFIELDS, 'xoops_create_user='.json_encode(array("username"=> $this->curl_xoops_username, "password"=> $this->curl_xoops_password, "user" => array('user_viewemail' =>$user_viewemail, 'uname' => $uname, 'email' => $email, 'url' => $url, 'actkey' => $actkey, 'pass' => $pass, 'timezone_offset' => $timezone_offset, 'user_mailok' => $user_mailok, "time" => time(), "passhash" => sha1((time()-$rnd).$uname.$pass), "rand"=>$rnd), "siteinfo" => $siteinfo))); + $data = curl_exec($this->curl_client); + curl_close($this->curl_client); + $result = $this->obj2array(json_decode($data)); + if ($result['ERRNUM']==1){ + return $result["RESULT"]; + } else { + return false; + } + } + + function obj2array($objects) { + $ret = array(); + foreach($objects as $key => $value) { + if (is_a($value, 'stdClass')) { + $ret[$key] = (array)$value; + } elseif (is_array($value)) { + $ret[$key] = $this->obj2array($value); + } else { + $ret[$key] = $value; + } + } + return $ret; + } + +} +// end class + + +?> Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_curl.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_curl_provisionning.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_curl_provisionning.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xortify/class/auth/auth_curl_provisionning.php 2011-12-18 18:03:50 UTC (rev 8518) @@ -0,0 +1,190 @@ +<?php +/** + * @package xortify + * @subpackage module + * @description Sector Network Security Drone + * @author Simon Roberts WISHCRAFT <si...@ch...> + * @copyright copyright (c) 2010-2013 XOOPS.org + * @licence GPL 2.0 - see docs/LICENCE.txt + */ + + +class XortifyAuthCurlProvisionning { + + var $_auth_instance; + + function &getInstance(&$auth_instance) + { + static $provis_instance; + if (!isset($provis_instance)) { + $provis_instance = new XortifyAuthCurlProvisionning($auth_instance); + } + return $provis_instance; + } + + /** + * Authentication Service constructor + */ + function XortifyAuthCurlProvisionning (&$auth_instance) { + $this->_auth_instance = &$auth_instance; + $config_handler = $GLOBALS['xoops']->getHandler('config'); + $config = $config_handler->getConfigsByCat(XOOPS_CONF_AUTH); + foreach ($config as $key => $val) { + $this->$key = $val; + } + $config_gen = $config_handler->getConfigsByCat(XOOPS_CONF); + $this->default_TZ = $config_gen['default_TZ']; + $this->theme_set = $config_gen['theme_set']; + $this->com_mode = $config_gen['com_mode']; + $this->com_order = $config_gen['com_order']; + } + + /** + * Return a Xortify User Object + * + * @return XortifyUser or false + */ + function getXortifyUser($uname) { + $member_handler = $GLOBALS['xoops']->getHandler('member'); + $criteria = new Criteria('uname', $uname); + $getuser = $member_handler->getUsers($criteria); + if (count($getuser) == 1) + return $getuser[0]; + else return false; + } + + /** + * Launch the synchronisation process + * + * @return bool + */ + function sync($datas, $uname, $pwd = null) { + $xoopsUser = $this->getXortifyUser($uname); + if (!$xoopsUser) { // Xortify User Database not exists + if ($this->curl_provisionning) { + $xoopsUser = $this->add($datas, $uname, $pwd); + } else $this->_auth_instance->setErrors(0, sprintf(_AUTH_LDAP_XOOPS_USER_NOTFOUND, $uname)); + } else { // Xortify User Database exists + + } + return $xoopsUser; + } + + /** + * Add a new user to the system + * + * @return bool + */ + function add($datas, $uname, $pwd = null) { + $ret = false; + $member_handler = $GLOBALS['xoops']->getHandler('member'); + // Create XOOPS Database User + $newuser = $member_handler->createUser(); + $newuser->setVar('uname', $uname); + $newuser->setVar('pass', md5(stripslashes($pwd))); + $newuser->setVar('email', $datas['email']); + $newuser->setVar('rank', 0); + $newuser->setVar('level', 1); + $newuser->setVar('timezone_offset', $this->default_TZ); + $newuser->setVar('theme', $this->theme_set); + $newuser->setVar('umode', $this->com_mode); + $newuser->setVar('uorder', $this->com_order); + if ($this->curl_provisionning) + $tab_mapping = explode('|', $this->curl_field_mapping); + else + $tab_mapping = explode('|', $this->ldap_field_mapping); + + foreach ($tab_mapping as $mapping) { + $fields = explode('=', trim($mapping)); + if ($fields[0] && $fields[1]) + $newuser->setVar(trim($fields[0]), utf8_decode($datas[trim($fields[1])])); + } + if ($member_handler->insertUser($newuser)) { + } + if ($member_handler->insertUser($newuser)) { + foreach ($this->curl_provisionning_group as $groupid) + $member_handler->addUserToGroup($groupid, $newuser->getVar('uid')); + $newuser->unsetNew(); + return $newuser; + } else $GLOBALS['xoops']->redirect(XOOPS_URL.'/user.php', 5, $newuser->getHtmlErrors()); + + $newuser->unsetNew(); + return $newuser; + //else $GLOBALS['xoops']->redirect(XOOPS_URL.'/user.php', 5, $newuser->getHtmlErrors()); + return $ret; + } + + /** + * Modify user information + * + * @return bool + */ + function change(&$xoopsUser, $datas, $uname, $pwd = null) { + $ret = false; + $member_handler = $GLOBALS['xoops']->getHandler('member'); + $xoopsUser->setVar('pass', md5(stripslashes($pwd))); + $tab_mapping = explode('|', $this->ldap_field_mapping); + foreach ($tab_mapping as $mapping) { + $fields = explode('=', trim($mapping)); + if ($fields[0] && $fields[1]) + $xoopsUser->setVar(trim($fields[0]), utf8_decode($datas[trim($fields[1])][0])); + } + if ($member_handler->insertUser($xoopsUser)) { + return $xoopsUser; + } else $GLOBALS['xoops']->redirect(XOOPS_URL.'/user.php', 5, $xoopsUser->getHtmlErrors()); + return $ret; + } + + function change_curl(&$xoopsUser, $datas, $uname, $pwd = null) { + $ret = false; + $member_handler = $GLOBALS['xoops']->getHandler('member'); + $xoopsU... [truncated message content] |