From: <wis...@us...> - 2011-09-14 07:43:12
|
Revision: 7598 http://xoops.svn.sourceforge.net/xoops/?rev=7598&view=rev Author: wishcraft Date: 2011-09-14 07:43:01 +0000 (Wed, 14 Sep 2011) Log Message: ----------- Xortify 2.53 (europe cloud settings) Added Paths: ----------- XoopsModules/xortify/releases/2.53 (asia pacific)/ XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/admin/index.php XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curl.php XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curlserialised.php XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curlxml.php XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/include/forms.xortify.php XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/providers/projecthoneypot.org/post.loader.php XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/providers/protector/footer.post.loader.php XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/providers/stopforumspam.com/post.loader.php XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/providers/xortify/post.loader.php XoopsModules/xortify/releases/2.53 (europe)/ XoopsModules/xortify/releases/2.53 (europe)/docs/ XoopsModules/xortify/releases/2.53 (europe)/docs/INSTALL XoopsModules/xortify/releases/2.53 (europe)/docs/UPGRADE XoopsModules/xortify/releases/2.53 (europe)/docs/licence.txt XoopsModules/xortify/releases/2.53 (europe)/htdocs/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/admin/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/admin/index.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/admin/menu.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/auth.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/auth_curl.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/auth_curl_provisionning.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/auth_curlserialised.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/auth_curlserialised_provisionning.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/auth_curlxml.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/auth_curlxml_provisionning.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/auth_json.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/auth_json_provisionning.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/auth_soap.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/auth_soap_provisionning.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/auth_wgetserialised.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/auth_wgetserialised_provisionning.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/auth_wgetxml.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/auth_wgetxml_provisionning.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/authfactory.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/auth/index.html XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/curl.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/curlserialised.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/curlxml.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/index.html XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/json.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/log.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/soap.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/wgetserialised.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/class/wgetxml.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/cron/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/cron/index.html XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/cron/serverup.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/images/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/images/accessdenied.png XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/images/accesslist.png XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/images/index.html XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/images/left_both.gif XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/images/right_both.gif XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/images/xortify_slogo.png XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/include/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/include/JSON.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/include/forms.objects.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/include/forms.xortify.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/include/functions.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/include/install.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/include/post.header.addmeta.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/include/post.loader.mainfile.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/include/pre.loader.mainfile.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/include/update.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/index.html XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/language/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/language/english/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/language/english/admin.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/language/english/ban.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/language/english/index.html XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/language/english/main.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/language/english/modinfo.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/language/index.html XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/plugin/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/plugin/index.html XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/plugin/projecthoneypot.org.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/plugin/protector.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/plugin/spiders.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/plugin/stopforumspam.com.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/plugin/xortify.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/preloads/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/preloads/core.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/preloads/index.html XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/providers/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/providers/index.html XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/providers/projecthoneypot.org/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/providers/projecthoneypot.org/post.loader.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/providers/protector/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/providers/protector/footer.post.loader.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/providers/protector/index.html XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/providers/providers.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/providers/spiders/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/providers/spiders/post.loader.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/providers/stopforumspam.com/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/providers/stopforumspam.com/post.loader.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/providers/xortify/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/providers/xortify/footer.post.loader.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/providers/xortify/index.html XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/providers/xortify/post.loader.php XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/sql/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/sql/index.html XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/sql/mysql.sql XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/templates/ XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/templates/index.html XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/templates/xorify_cpanel_bans.html XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/templates/xortify_banning_notice.html XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/templates/xortify_cpanel_log.html XoopsModules/xortify/releases/2.53 (europe)/htdocs/modules/xortify/xoops_version.php Removed Paths: ------------- XoopsModules/xortify/releases/2.53/ XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/admin/index.php XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curl.php XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curlserialised.php XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curlxml.php XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/include/forms.xortify.php XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/providers/projecthoneypot.org/post.loader.php XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/providers/protector/footer.post.loader.php XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/providers/stopforumspam.com/post.loader.php XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/providers/xortify/post.loader.php Deleted: XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/admin/index.php =================================================================== --- XoopsModules/xortify/releases/2.53/htdocs/modules/xortify/admin/index.php 2011-08-29 10:59:19 UTC (rev 7387) +++ XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/admin/index.php 2011-09-14 07:43:01 UTC (rev 7598) @@ -1,209 +0,0 @@ -<?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('../../../mainfile.php'); - include('../../../include/cp_functions.php'); - include('../include/functions.php'); - include('../include/forms.xortify.php'); - - $moduleHandler =& xoops_gethandler('module'); - $configHandler =& xoops_gethandler('config'); - $xoxortify = $moduleHandler->getByDirname('xortify'); - if (is_object($xoxortify)) - $GLOBALS['xoopsModuleConfig'] = $configHandler->getConfigList($xoxortify->getVar('mid')); - - xoops_cp_header(); - - $op = isset($_REQUEST['op'])?$_REQUEST['op']:"list"; - $fct = isset($_REQUEST['fct'])?$_REQUEST['fct']:""; - - switch($op) { - case "signup": - - switch ($fct) - { - case "save": - - $xortifyAuth =& XortifyAuthFactory::getAuthConnection(false, $GLOBALS['xoopsModuleConfig']['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"; - - xoops_load("captcha"); - $xoopsCaptcha = XoopsCaptcha::getInstance(); - if (! $xoopsCaptcha->verify() ) { - $stop .= $xoopsCaptcha->getMessage(); - } - - if ($stop!='') { - xortify_adminMenu(2); - echo "<p align='center' style='font-size: 15px; color: #FF0000;'>$stop</p>"; - echo XortifySignupForm(); - } else { - @$xortifyAuth->create_user( $_REQUEST['viewemail'], $uname, $email, $url, $actkey, - $pass, $_REQUEST['timezone'], $_REQUEST['mailok'], $xortifyAuth->check_siteinfo(array())); - - $moduleHandler =& xoops_gethandler('module'); - $configHandler =& xoops_gethandler('config'); - $xoModule = $moduleHandler->getByDirname('xortify'); - $configs = $configHandler->getConfigs(new Criteria('conf_modid', $xoModule->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; - } - redirect_header("index.php", 4, _XOR_USERCREATED_PLEASEACTIVATE); - exit(0); - } - break; - default: - case "signup": - xortify_adminMenu(3); - echo XortifySignupForm(); - break; - } - break; - case "log": - - xoops_loadLanguage('admin', 'xortify'); - xortify_adminMenu(2); - - include_once $GLOBALS['xoops']->path( "/class/pagenav.php" ); - include_once $GLOBALS['xoops']->path( "/class/template.php" ); - $GLOBALS['xorTpl'] = new XoopsTpl(); - - $log_handler =& xoops_getmodulehandler('log', 'xortify'); - - $ttl = $log_handler->getCount(NULL); - $limit = !empty($_REQUEST['limit'])?intval($_REQUEST['limit']):30; - $start = !empty($_REQUEST['start'])?intval($_REQUEST['start']):0; - $order = !empty($_REQUEST['order'])?$_REQUEST['order']:'DESC'; - $sort = !empty($_REQUEST['sort'])?''.$_REQUEST['sort'].'':'date'; - - $pagenav = new XoopsPageNav($ttl, $limit, $start, 'start', 'limit='.$limit.'&sort='.$sort.'&order='.$order.'&op='.$op); - $GLOBALS['xorTpl']->assign('pagenav', $pagenav->renderNav()); - - foreach (array( 'action','provider','date','uname','email','ip4','ip6','proxy-ip4', - 'proxy-ip6','network-addy','agent') as $id => $key) { - $GLOBALS['xorTpl']->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['xorTpl']->append('log', $log->toArray()); - } - - $GLOBALS['xorTpl']->display('db:xortify_cpanel_log.html'); - break; - default: - case "list": - xoops_loadLanguage('admin', 'xortify'); - xortify_adminMenu(1); - - include_once $GLOBALS['xoops']->path( "/class/template.php" ); - $GLOBALS['xorTpl'] = new XoopsTpl(); - - xoops_load("xoopscache"); - if (!class_exists('XoopsCache')) - xoops_load("cache"); - xoops_load("pagenav"); - - if (!$bans = XoopsCache::read('xortify_bans_cache')) { - require_once( XOOPS_ROOT_PATH.'/modules/xortify/class/'.$GLOBALS['xoopsModuleConfig']['protocol'].'.php' ); - $func = strtoupper($GLOBALS['xoopsModuleConfig']['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['xoopsModuleConfig']['xortify_seconds']); - XoopsCache::write('xortify_bans_cache_backup', $bans, ($GLOBALS['xoopsModuleConfig']['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['xorTpl']->assign('pagenav', $pagenav->renderNav()); - - 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['xorTpl']->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['xorTpl']->display('db:xorify_cpanel_bans.html'); - } - break; - } - - xortify_footer_adminMenu(); - xoops_cp_footer(); -?> \ No newline at end of file Copied: XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/admin/index.php (from rev 7391, XoopsModules/xortify/releases/2.53/htdocs/modules/xortify/admin/index.php) =================================================================== --- XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/admin/index.php (rev 0) +++ XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/admin/index.php 2011-09-14 07:43:01 UTC (rev 7598) @@ -0,0 +1,210 @@ +<?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('../../../mainfile.php'); + include('../../../include/cp_functions.php'); + include('../include/functions.php'); + include('../include/forms.xortify.php'); + + $moduleHandler =& xoops_gethandler('module'); + $configHandler =& xoops_gethandler('config'); + $xoxortify = $moduleHandler->getByDirname('xortify'); + if (is_object($xoxortify)) + $GLOBALS['xoopsModuleConfig'] = $configHandler->getConfigList($xoxortify->getVar('mid')); + + xoops_cp_header(); + + $op = isset($_REQUEST['op'])?$_REQUEST['op']:"list"; + $fct = isset($_REQUEST['fct'])?$_REQUEST['fct']:""; + + switch($op) { + case "signup": + + switch ($fct) + { + case "save": + + $xortifyAuth =& XortifyAuthFactory::getAuthConnection(false, $GLOBALS['xoopsModuleConfig']['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"; + + xoops_load("captcha"); + $xoopsCaptcha = XoopsCaptcha::getInstance(); + if (! $xoopsCaptcha->verify() ) { + $stop .= $xoopsCaptcha->getMessage(); + } + + if ($stop!='') { + xortify_adminMenu(2); + echo "<p align='center' style='font-size: 15px; color: #FF0000;'>$stop</p>"; + echo XortifySignupForm(); + } else { + @$xortifyAuth->create_user( $_REQUEST['viewemail'], $uname, $email, $url, $actkey, + $pass, $_REQUEST['timezone'], $_REQUEST['mailok'], $xortifyAuth->check_siteinfo(array())); + + $moduleHandler =& xoops_gethandler('module'); + $configHandler =& xoops_gethandler('config'); + $xoModule = $moduleHandler->getByDirname('xortify'); + $configs = $configHandler->getConfigs(new Criteria('conf_modid', $xoModule->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; + } + redirect_header("index.php", 4, _XOR_USERCREATED_PLEASEACTIVATE); + exit(0); + } + break; + default: + case "signup": + xortify_adminMenu(3); + echo XortifySignupForm(); + break; + } + break; + case "log": + + xoops_loadLanguage('admin', 'xortify'); + xortify_adminMenu(2); + + include_once $GLOBALS['xoops']->path( "/class/pagenav.php" ); + include_once $GLOBALS['xoops']->path( "/class/template.php" ); + $GLOBALS['xorTpl'] = new XoopsTpl(); + + $log_handler =& xoops_getmodulehandler('log', 'xortify'); + + $ttl = $log_handler->getCount(NULL); + $limit = !empty($_REQUEST['limit'])?intval($_REQUEST['limit']):30; + $start = !empty($_REQUEST['start'])?intval($_REQUEST['start']):0; + $order = !empty($_REQUEST['order'])?$_REQUEST['order']:'DESC'; + $sort = !empty($_REQUEST['sort'])?''.$_REQUEST['sort'].'':'date'; + + $pagenav = new XoopsPageNav($ttl, $limit, $start, 'start', 'limit='.$limit.'&sort='.$sort.'&order='.$order.'&op='.$op); + $GLOBALS['xorTpl']->assign('pagenav', $pagenav->renderNav()); + + foreach (array( 'action','provider','date','uname','email','ip4','ip6','proxy-ip4', + 'proxy-ip6','network-addy','agent') as $id => $key) { + $GLOBALS['xorTpl']->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['xorTpl']->append('log', $log->toArray()); + } + + $GLOBALS['xorTpl']->display('db:xortify_cpanel_log.html'); + break; + default: + case "list": + xoops_loadLanguage('admin', 'xortify'); + xortify_adminMenu(1); + + include_once $GLOBALS['xoops']->path( "/class/template.php" ); + $GLOBALS['xorTpl'] = new XoopsTpl(); + + xoops_load("xoopscache"); + if (!class_exists('XoopsCache')) + xoops_load("cache"); + xoops_load("pagenav"); + + if (!$bans = XoopsCache::read('xortify_bans_cache')) { + require_once( XOOPS_ROOT_PATH.'/modules/xortify/class/'.$GLOBALS['xoopsModuleConfig']['protocol'].'.php' ); + $func = strtoupper($GLOBALS['xoopsModuleConfig']['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['xoopsModuleConfig']['xortify_seconds']); + XoopsCache::write('xortify_bans_cache_backup', $bans, ($GLOBALS['xoopsModuleConfig']['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['xorTpl']->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['xorTpl']->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['xorTpl']->display('db:xorify_cpanel_bans.html'); + } + break; + } + + xortify_footer_adminMenu(); + xoops_cp_footer(); +?> \ No newline at end of file Deleted: XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curl.php =================================================================== --- XoopsModules/xortify/releases/2.53/htdocs/modules/xortify/class/auth/auth_curl.php 2011-08-29 10:59:19 UTC (rev 7387) +++ XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curl.php 2011-09-14 07:43:01 UTC (rev 7598) @@ -1,185 +0,0 @@ -<?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['xoopsModuleConfig']['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_FOLLOWLOCATION, 1); - 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 - - -?> Copied: XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curl.php (from rev 7391, XoopsModules/xortify/releases/2.53/htdocs/modules/xortify/class/auth/auth_curl.php) =================================================================== --- XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curl.php (rev 0) +++ XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curl.php 2011-09-14 07:43:01 UTC (rev 7598) @@ -0,0 +1,184 @@ +<?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['xoopsModuleConfig']['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_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 + + +?> Deleted: XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curlserialised.php =================================================================== --- XoopsModules/xortify/releases/2.53/htdocs/modules/xortify/class/auth/auth_curlserialised.php 2011-08-29 10:59:19 UTC (rev 7387) +++ XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curlserialised.php 2011-09-14 07:43:01 UTC (rev 7598) @@ -1,166 +0,0 @@ -<?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 - */ - - -define('XORTIFY_CURLSERIAL_API', $GLOBALS['xoopsModuleConfig']['xortify_uriserial']); -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_curlserilaised_provisionning.php'; - -class XortifyAuthCurlserialised extends XortifyAuth { - - var $curl_client; - var $curl_xoops_username = ''; - var $curl_xoops_password = ''; - var $_dao; - /** - * Authentication Service constructor - */ - function XortifyAuthCurlserialised (&$dao) { - - if (!$ch = curl_init(XORTIFY_CURLSERIAL_API)) { - trigger_error('Could not intialise CURL file: '.$url); - return false; - } - $cookies = XOOPS_VAR_PATH.'/cache/xoops_cache/authcurl_'.md5(XORTIFY_CURLSERIAL_API).'.cookie'; - - curl_setopt($ch, CURLOPT_HEADER, 0); - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); - 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->XortifyAuthCurlserialised($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' => serialize(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 = unserialize($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->XortifyAuthCurlserialised($GLOBALS['xoopsDB']); - $rnd = rand(-100000, 100000000); - curl_setopt($this->curl_client, CURLOPT_POSTFIELDS, array('xoops_user_validate' => serialize(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 = unserialize($data); - if ($result['ERRNUM']==1){ - return $result["RESULT"]; - } else { - return false; - } - - } - - - /** - * get the xoops site disclaimer via curl - * - * @return string - */ - function network_disclaimer(){ - $this->XortifyAuthCurlserialised($GLOBALS['xoopsDB']); - curl_setopt($this->curl_client, CURLOPT_POSTFIELDS, array('xoops_network_disclaimer' => serialize(array("username"=> $this->curl_xoops_username, "password"=> $this->curl_xoops_password)))); - $data = curl_exec($this->curl_client); - curl_close($this->curl_client); - $result = unserialize($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->XortifyAuthCurlserialised($GLOBALS['xoopsDB']); - curl_setopt($this->curl_client, CURLOPT_POSTFIELDS, 'xoops_create_user='.serialize(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 = unserialize($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 - - -?> Copied: XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curlserialised.php (from rev 7391, XoopsModules/xortify/releases/2.53/htdocs/modules/xortify/class/auth/auth_curlserialised.php) =================================================================== --- XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curlserialised.php (rev 0) +++ XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curlserialised.php 2011-09-14 07:43:01 UTC (rev 7598) @@ -0,0 +1,165 @@ +<?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 + */ + + +define('XORTIFY_CURLSERIAL_API', $GLOBALS['xoopsModuleConfig']['xortify_uriserial']); +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_curlserilaised_provisionning.php'; + +class XortifyAuthCurlserialised extends XortifyAuth { + + var $curl_client; + var $curl_xoops_username = ''; + var $curl_xoops_password = ''; + var $_dao; + /** + * Authentication Service constructor + */ + function XortifyAuthCurlserialised (&$dao) { + + if (!$ch = curl_init(XORTIFY_CURLSERIAL_API)) { + trigger_error('Could not intialise CURL file: '.$url); + return false; + } + $cookies = XOOPS_VAR_PATH.'/cache/xoops_cache/authcurl_'.md5(XORTIFY_CURLSERIAL_API).'.cookie'; + + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_POST, 1); + 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->XortifyAuthCurlserialised($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' => serialize(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 = unserialize($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->XortifyAuthCurlserialised($GLOBALS['xoopsDB']); + $rnd = rand(-100000, 100000000); + curl_setopt($this->curl_client, CURLOPT_POSTFIELDS, array('xoops_user_validate' => serialize(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 = unserialize($data); + if ($result['ERRNUM']==1){ + return $result["RESULT"]; + } else { + return false; + } + + } + + + /** + * get the xoops site disclaimer via curl + * + * @return string + */ + function network_disclaimer(){ + $this->XortifyAuthCurlserialised($GLOBALS['xoopsDB']); + curl_setopt($this->curl_client, CURLOPT_POSTFIELDS, array('xoops_network_disclaimer' => serialize(array("username"=> $this->curl_xoops_username, "password"=> $this->curl_xoops_password)))); + $data = curl_exec($this->curl_client); + curl_close($this->curl_client); + $result = unserialize($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->XortifyAuthCurlserialised($GLOBALS['xoopsDB']); + curl_setopt($this->curl_client, CURLOPT_POSTFIELDS, 'xoops_create_user='.serialize(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 = unserialize($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 + + +?> Deleted: XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curlxml.php =================================================================== --- XoopsModules/xortify/releases/2.53/htdocs/modules/xortify/class/auth/auth_curlxml.php 2011-08-29 10:59:19 UTC (rev 7387) +++ XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curlxml.php 2011-09-14 07:43:01 UTC (rev 7598) @@ -1,154 +0,0 @@ -<?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 - */ - - -define('XORTIFY_CURLXML_API', $GLOBALS['xoopsModuleConfig']['xortify_urixml']); -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_curlxml_provisionning.php'; - -class XortifyAuthCurlxml extends XortifyAuth { - - var $curl_client; - var $curl_xoops_username = ''; - var $curl_xoops_password = ''; - var $_dao; - var $_json = ''; - /** - * Authentication Service constructor - */ - function XortifyAuthCurlxml (&$dao) { - if (!$ch = curl_init(XORTIFY_CURLXML_API)) { - trigger_error('Could not intialise CURL file: '.$url); - return false; - } - $cookies = XOOPS_VAR_PATH.'/cache/xoops_cache/authcurl_'.md5(XORTIFY_CURLXML_API).'.cookie'; - - curl_setopt($ch, CURLOPT_HEADER, 0); - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); - 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->XortifyAuthCurlxml($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, 'xoops_authentication='. xortify_toXml(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)), 'xoops_authentication')); - $data = curl_exec($this->curl_client); - curl_close($this->curl_client); - $result = xortify_elekey2numeric(xortify_xml2array($data), 'xoops_authentication'); - return $result['xoops_authentication']["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->XortifyAuthCurlxml($GLOBALS['xoopsDB']); - $rnd = rand(-100000, 100000000); - curl_setopt($this->curl_client, CURLOPT_POSTFIELDS, 'xoops_user_validate=' . xortify_toXml(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)), 'xoops_user_validate')); - $data = curl_exec($this->curl_client); - curl_close($this->curl_client); - $result = xortify_elekey2numeric(xortify_xml2array($data), 'xoops_user_validate'); - if ($result['xoops_user_validate']['ERRNUM']==1){ - return $result['xoops_user_validate']["RESULT"]; - } else { - return false; - } - - } - - - /** - * get the xoops site disclaimer via curl - * - * @return string - */ - function network_disclaimer(){ - $this->XortifyAuthCurlxml($GLOBALS['xoopsDB']); - curl_setopt($this->curl_client, CURLOPT_POSTFIELDS, 'xoops_network_disclaimer=' . xortify_toXml(array("username"=> $this->curl_xoops_username, "password"=> $this->curl_xoops_password), 'xoops_network_disclaimer')); - $data = curl_exec($this->curl_client); - curl_close($this->curl_client); - $result = xortify_elekey2numeric(xortify_xml2array($data), 'xoops_network_disclaimer'); - if ($result['xoops_network_disclaimer']['ERRNUM']==1){ - return $result['xoops_network_disclaimer']["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->XortifyAuthCurlxml($GLOBALS['xoopsDB']); - curl_setopt($this->curl_client, CURLOPT_POSTFIELDS, 'xoops_create_user='.xortify_toXml(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), 'xoops_create_user')); - $data = curl_exec($this->curl_client); - curl_close($this->curl_client); - $result = xortify_elekey2numeric(xortify_xml2array($data), 'xoops_create_user'); - if ($result['xoops_create_user']['ERRNUM']==1){ - return $result['xoops_create_user']["RESULT"]; - } else { - return false; - } - } - - -} -// end class - - -?> Copied: XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curlxml.php (from rev 7391, XoopsModules/xortify/releases/2.53/htdocs/modules/xortify/class/auth/auth_curlxml.php) =================================================================== --- XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curlxml.php (rev 0) +++ XoopsModules/xortify/releases/2.53 (asia pacific)/htdocs/modules/xortify/class/auth/auth_curlxml.php 2011-09-14 07:43:01 UTC (rev 7598) @@ -0,0 +1,153 @@ +<?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 + */ + + +define('XORTIFY_CURLXML_API', $GLOBALS['xoopsModuleConfig']['xortify_urixml']); +define('XORTIFY_USER_AGEN... [truncated message content] |