From: <be...@us...> - 2012-07-27 17:37:55
|
Revision: 9930 http://xoops.svn.sourceforge.net/xoops/?rev=9930&view=rev Author: beckmi Date: 2012-07-27 17:37:45 +0000 (Fri, 27 Jul 2012) Log Message: ----------- - restructure folders - move icons back to th module - fix delete function - add two missing language definitions Added Paths: ----------- XoopsModules/iplog/trunk/iplog/ XoopsModules/iplog/trunk/iplog/admin/ XoopsModules/iplog/trunk/iplog/admin/about.php XoopsModules/iplog/trunk/iplog/admin/dashboard.php XoopsModules/iplog/trunk/iplog/admin/footer.php XoopsModules/iplog/trunk/iplog/admin/header.php XoopsModules/iplog/trunk/iplog/admin/index.html XoopsModules/iplog/trunk/iplog/admin/log.php XoopsModules/iplog/trunk/iplog/admin/menu.php XoopsModules/iplog/trunk/iplog/class/ XoopsModules/iplog/trunk/iplog/class/countries.php XoopsModules/iplog/trunk/iplog/class/index.html XoopsModules/iplog/trunk/iplog/class/log.php XoopsModules/iplog/trunk/iplog/docs/ XoopsModules/iplog/trunk/iplog/docs/changelog.txt XoopsModules/iplog/trunk/iplog/docs/credits.txt XoopsModules/iplog/trunk/iplog/docs/index.html XoopsModules/iplog/trunk/iplog/docs/install.txt XoopsModules/iplog/trunk/iplog/docs/lang_diff.txt XoopsModules/iplog/trunk/iplog/docs/licence.txt XoopsModules/iplog/trunk/iplog/docs/readme.txt XoopsModules/iplog/trunk/iplog/images/ XoopsModules/iplog/trunk/iplog/images/icons/ XoopsModules/iplog/trunk/iplog/images/icons/16/ XoopsModules/iplog/trunk/iplog/images/icons/16/iplog.log.png XoopsModules/iplog/trunk/iplog/images/icons/32/ XoopsModules/iplog/trunk/iplog/images/icons/32/iplog.log.png XoopsModules/iplog/trunk/iplog/images/logo.png XoopsModules/iplog/trunk/iplog/include/ XoopsModules/iplog/trunk/iplog/include/functions.php XoopsModules/iplog/trunk/iplog/include/ip2locationlite.class.php XoopsModules/iplog/trunk/iplog/index.html XoopsModules/iplog/trunk/iplog/language/ XoopsModules/iplog/trunk/iplog/language/english/ XoopsModules/iplog/trunk/iplog/language/english/admin.php XoopsModules/iplog/trunk/iplog/language/english/help/ XoopsModules/iplog/trunk/iplog/language/english/help/help.html XoopsModules/iplog/trunk/iplog/language/english/help/index.html XoopsModules/iplog/trunk/iplog/language/english/index.html XoopsModules/iplog/trunk/iplog/language/english/mail_template/ XoopsModules/iplog/trunk/iplog/language/english/mail_template/index.html XoopsModules/iplog/trunk/iplog/language/english/modinfo.php XoopsModules/iplog/trunk/iplog/language/index.html XoopsModules/iplog/trunk/iplog/preloads/ XoopsModules/iplog/trunk/iplog/preloads/index.html XoopsModules/iplog/trunk/iplog/preloads/logger.php XoopsModules/iplog/trunk/iplog/sql/ XoopsModules/iplog/trunk/iplog/sql/mysql.sql XoopsModules/iplog/trunk/iplog/templates/ XoopsModules/iplog/trunk/iplog/templates/blocks/ XoopsModules/iplog/trunk/iplog/templates/blocks/index.html XoopsModules/iplog/trunk/iplog/templates/index.html XoopsModules/iplog/trunk/iplog/templates/iplog_log_list.html XoopsModules/iplog/trunk/iplog/xoops_version.php Removed Paths: ------------- XoopsModules/iplog/trunk/htdocs/ Added: XoopsModules/iplog/trunk/iplog/admin/about.php =================================================================== --- XoopsModules/iplog/trunk/iplog/admin/about.php (rev 0) +++ XoopsModules/iplog/trunk/iplog/admin/about.php 2012-07-27 17:37:45 UTC (rev 9930) @@ -0,0 +1,76 @@ +<?php +// $Id: about.php 5204 2010-09-06 20:10:52Z mageg $ +// ------------------------------------------------------------------------ // +// XOOPS - PHP Content Management System // +// Copyright (c) 2000 XOOPS.org // +// <http://www.xoops.org/> // +// ------------------------------------------------------------------------ // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// You may not change or alter any portion of this comment or credits // +// of supporting developers from this source code or any supporting // +// source code which is considered copyrighted (c) material of the // +// original comment or credit authors. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// ------------------------------------------------------------------------ // +// Author: XOOPS Foundation // +// URL: http://www.xoops.org/ // +// Project: The XOOPS Project // +// ------------------------------------------------------------------------- // + + include ('header.php'); + xoops_loadLanguage('admin', 'iplog'); + + xoops_cp_header(); + $indexAdmin = new ModuleAdmin(); + echo $indexAdmin->addNavigation('about.php'); + + $aboutAdmin = new ModuleAdmin(); + $paypalitemno='PROFILE175'; + $aboutAdmin = new ModuleAdmin(); + $about = $aboutAdmin->renderabout($paypalitemno, false); + $donationform = array( 0 => '<form name="donation" id="donation" action="http://www.chronolabs.com.au/modules/xpayment/" method="post" onsubmit="return xoopsFormValidate_donation();">', + 1 => '<table class="outer" cellspacing="1" width="100%"><tbody><tr><th colspan="2">'.constant('_AM_IPLOG_ABOUT_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>', 'D'=>'', + 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['iplogModule']->getVar('dirname')), strtoupper($GLOBALS['iplogModule']->getVar('dirname')). ' '.$GLOBALS['iplogModule']->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)); + + include(dirname(__FILE__).'/footer.php'); +?> \ No newline at end of file Added: XoopsModules/iplog/trunk/iplog/admin/dashboard.php =================================================================== --- XoopsModules/iplog/trunk/iplog/admin/dashboard.php (rev 0) +++ XoopsModules/iplog/trunk/iplog/admin/dashboard.php 2012-07-27 17:37:45 UTC (rev 9930) @@ -0,0 +1,90 @@ +<?php +// $Id: directory.php 5204 2010-09-06 20:10:52Z mageg $ +// ------------------------------------------------------------------------ // +// XOOPS - PHP Content Management System // +// Copyright (c) 2000 XOOPS.org // +// <http://www.xoops.org/> // +// ------------------------------------------------------------------------ // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// You may not change or alter any portion of this comment or credits // +// of supporting developers from this source code or any supporting // +// source code which is considered copyrighted (c) material of the // +// original comment or credit authors. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// ------------------------------------------------------------------------ // +// Author: XOOPS Foundation // +// URL: http://www.xoops.org/ // +// Project: The XOOPS Project // +// ------------------------------------------------------------------------- // + + include ('header.php'); + xoops_loadLanguage('admin', 'profile'); + + xoops_cp_header(); + + $indexAdmin = new ModuleAdmin(); + $log_handler = xoops_getmodulehandler('log', 'iplog'); + + $indexAdmin = new ModuleAdmin(); + if (count($log_handler->getNumberByCountry())>1) { + $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_COUNTS_BY_COUNTRY); + foreach ($log_handler->getNumberByCountry() as $id => $value) + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_COUNTS_BY_COUNTRY, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + } + if (count($log_handler->getNumberByRegion())>1) { + $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_COUNTS_BY_REGION); + foreach ($log_handler->getNumberByRegion() as $id => $value) + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_COUNTS_BY_REGION, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + } + if (count($log_handler->getNumberByContinent())>1) { + $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_COUNTS_BY_CONTINENT); + foreach ($log_handler->getNumberByContinent() as $id => $value) + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_COUNTS_BY_CONTINENT, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + } + if (count($log_handler->getTotalSecondsByCountry())>1) { + $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_SUM_BY_COUNTRY); + foreach ($log_handler->getTotalSecondsByCountry() as $id => $value) + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_SUM_BY_COUNTRY, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + } + if (count($log_handler->getTotalSecondsByRegion())>1) { + $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_SUM_BY_REGION); + foreach ($log_handler->getTotalSecondsByRegion() as $id => $value) + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_SUM_BY_REGION, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + } + if (count($log_handler->getTotalSecondsByContinent())>1) { + $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_SUM_BY_CONTINENT); + foreach ($log_handler->getTotalSecondsByContinent() as $id => $value) + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_SUM_BY_CONTINENT, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + } + if (count($log_handler->getAdverageSecondsByCountry())>1) { + $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_AVG_BY_COUNTRY); + foreach ($log_handler->getAdverageSecondsByCountry() as $id => $value) + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_AVG_BY_COUNTRY, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + } + if (count($log_handler->getAdverageSecondsByRegion())>1) { + $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_AVG_BY_REGION); + foreach ($log_handler->getAdverageSecondsByRegion() as $id => $value) + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_AVG_BY_REGION, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + } + if (count($log_handler->getAdverageSecondsByContinent())>1) { + $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_AVG_BY_CONTINENT); + foreach ($log_handler->getAdverageSecondsByContinent() as $id => $value) + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_AVG_BY_CONTINENT, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + } + + echo $indexAdmin->renderIndex(); + include(dirname(__FILE__).'/footer.php'); + +?> \ No newline at end of file Added: XoopsModules/iplog/trunk/iplog/admin/footer.php =================================================================== --- XoopsModules/iplog/trunk/iplog/admin/footer.php (rev 0) +++ XoopsModules/iplog/trunk/iplog/admin/footer.php 2012-07-27 17:37:45 UTC (rev 9930) @@ -0,0 +1,22 @@ +<?php +/** + * xSitemMap module + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package xSitemMap + * @since 2.5.0 + * @author XOOPS Module Team + * @version $Id $ +**/ +echo "<div align=\"center\"><a href=\"http://www.xoops.org\" target=\"_blank\"><img src=" . XOOPS_URL ."/". $GLOBALS['iplogModule']->getInfo("icons32")."/xoopsmicrobutton.gif"." alt=\"XOOPS\" title=\"XOOPS\"></a></div>"; +echo "<div class='center smallsmall italic pad5'><strong>" . $GLOBALS['iplogModule']->getVar("name") . "</strong> is maintained by the <a class='tooltip' rel='external' href='http://www.xoops.org/' title='Visit XOOPS Community'>XOOPS Community</a></div>"; + +xoops_cp_footer(); \ No newline at end of file Added: XoopsModules/iplog/trunk/iplog/admin/header.php =================================================================== --- XoopsModules/iplog/trunk/iplog/admin/header.php (rev 0) +++ XoopsModules/iplog/trunk/iplog/admin/header.php 2012-07-27 17:37:45 UTC (rev 9930) @@ -0,0 +1,84 @@ +<?php +/** + * Extended User iplog + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package iplog + * @since 2.3.0 + * @author Taiwen Jiang <ph...@us...> + * @version $Id: header.php 5204 2010-09-06 20:10:52Z mageg $ + */ + + + require_once (dirname(dirname(dirname(dirname(__FILE__)))).'/include/cp_header.php'); + + if (!defined('_CHARSET')) + define ("_CHARSET","UTF-8"); + if (!defined('_CHARSET_ISO')) + define ("_CHARSET_ISO","ISO-8859-1"); + + $GLOBALS['myts'] = MyTextSanitizer::getInstance(); + + $module_handler = xoops_gethandler('module'); + $config_handler = xoops_gethandler('config'); + $GLOBALS['iplogModule'] = $module_handler->getByDirname('iplog'); + $GLOBALS['iplogModuleConfig'] = $config_handler->getConfigList($GLOBALS['iplogModule']->getVar('mid')); + + xoops_load('pagenav'); + xoops_load('xoopslists'); + xoops_load('xoopsformloader'); + + include_once $GLOBALS['xoops']->path('class'.DS.'xoopsmailer.php'); + include_once $GLOBALS['xoops']->path('class'.DS.'xoopstree.php'); + + if ( file_exists($GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'))){ + include_once $GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'); + }else{ + echo xoops_error("Error: You don't use the Frameworks \"admin module\". Please install this Frameworks"); + } + + $GLOBALS['iplogImageIcon'] = XOOPS_URL .'/'. $GLOBALS['iplogModule']->getInfo('icons16'); + $GLOBALS['iplogImageAdmin'] = XOOPS_URL .'/'. $GLOBALS['iplogModule']->getInfo('icons32'); + + if ($GLOBALS['xoopsUser']) { + $moduleperm_handler =& xoops_gethandler('groupperm'); + if (!$moduleperm_handler->checkRight('module_admin', $GLOBALS['iplogModule']->getVar( 'mid' ), $GLOBALS['xoopsUser']->getGroups())) { + redirect_header(XOOPS_URL, 1, _NOPERM); + exit(); + } + } else { + redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM); + exit(); + } + + require_once $GLOBALS['xoops']->path('/modules/iplog/include/functions.php'); + + xoops_loadLanguage('user'); + + if (!isset($GLOBALS['xoopsTpl']) || !is_object($GLOBALS['xoopsTpl'])) { + include_once(XOOPS_ROOT_PATH."/class/template.php"); + $GLOBALS['xoopsTpl'] = new XoopsTpl(); + } + + $GLOBALS['xoopsTpl']->assign('pathImageIcon', $GLOBALS['iplogImageIcon']); + $GLOBALS['xoopsTpl']->assign('pathImageAdmin', $GLOBALS['iplogImageAdmin']); + + $op = isset($_REQUEST['op'])?$_REQUEST['op']:"dashboard"; + $fct = isset($_REQUEST['fct'])?$_REQUEST['fct']:"list"; + $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'].'':'start'; + $filter = !empty($_REQUEST['filter'])?''.$_REQUEST['filter'].'':'1,1'; + $id = !empty($_REQUEST['id'])?(is_array($_REQUEST['id'])?array_unique($_REQUEST['id']):intval($_REQUEST['id'])):0; + + +?> \ No newline at end of file Added: XoopsModules/iplog/trunk/iplog/admin/index.html =================================================================== --- XoopsModules/iplog/trunk/iplog/admin/index.html (rev 0) +++ XoopsModules/iplog/trunk/iplog/admin/index.html 2012-07-27 17:37:45 UTC (rev 9930) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/iplog/trunk/iplog/admin/log.php =================================================================== --- XoopsModules/iplog/trunk/iplog/admin/log.php (rev 0) +++ XoopsModules/iplog/trunk/iplog/admin/log.php 2012-07-27 17:37:45 UTC (rev 9930) @@ -0,0 +1,109 @@ +<?php +// $Id: category.php 5204 2010-09-06 20:10:52Z mageg $ +// ------------------------------------------------------------------------ // +// XOOPS - PHP Content Management System // +// Copyright (c) 2000 XOOPS.org // +// <http://www.xoops.org/> // +// ------------------------------------------------------------------------ // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// You may not change or alter any portion of this comment or credits // +// of supporting developers from this source code or any supporting // +// source code which is considered copyrighted (c) material of the // +// original comment or credit authors. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// ------------------------------------------------------------------------ // +// Author: XOOPS Foundation // +// URL: http://www.xoops.org/ // +// Project: The XOOPS Project // +// ------------------------------------------------------------------------- // +include 'header.php'; +xoops_cp_header(); +$indexAdmin = new ModuleAdmin(); + +echo $indexAdmin->addNavigation('log.php'); + +$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : 'log'; +$fct = isset($_REQUEST['fct']) ? $_REQUEST['fct'] : 'list'; + +switch($op) { +case "log": + switch ($fct) + { + default: + case "list": + + include_once $GLOBALS['xoops']->path( "/class/pagenav.php" ); + + $log_handler =& xoops_getmodulehandler('log', 'iplog'); + + $criteria = new Criteria(1,1); + $ttl = $log_handler->getCount($criteria); + $sort = !empty($_REQUEST['sort'])?''.$_REQUEST['sort'].'':'start'; + + $pagenav = new XoopsPageNav($ttl, $limit, $start, 'start', 'limit='.$limit.'&sort='.$sort.'&order='.$order.'&op='.$op.'&fct='.$fct.'&filter='.$filter.'&fct='.$fct.'&filter='.$filter); + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); + + foreach ($log_handler->getFields() as $id => $key) { + $GLOBALS['xoopsTpl']->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.'&filter='.$filter.'">'.(defined('_AM_IPLOG_TH_'.strtoupper(str_replace('-','_',$key)))?constant('_AM_IPLOG_TH_'.strtoupper(str_replace('-','_',$key))):'_AM_IPLOG_TH_'.strtoupper(str_replace('-','_',$key))).'</a>'); + } + + $GLOBALS['xoopsTpl']->assign('limit', $limit); + $GLOBALS['xoopsTpl']->assign('start', $start); + $GLOBALS['xoopsTpl']->assign('order', $order); + $GLOBALS['xoopsTpl']->assign('sort', $sort); + $GLOBALS['xoopsTpl']->assign('filter', $filter); + $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['xoopsModuleConfig']); + + $criteria->setStart($start); + $criteria->setLimit($limit); + $criteria->setSort('`'.$sort.'`'); + $criteria->setOrder($order); + + $logs = $log_handler->getObjects($criteria, true); + foreach($logs as $cid => $log) { + if (!is_object($log)) + $log_handler->delete($cid); + else + $GLOBALS['xoopsTpl']->append('log', $log->toArray()); + } + $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); + $GLOBALS['xoopsTpl']->display('db:iplog_log_list.html'); + break; + + + case "delete": + + $log_handler =& xoops_getmodulehandler('log', 'iplog'); + + if (isset($_POST['id'])&&$id!=0) { + $log = $log_handler->get($id); + if (!$log_handler->delete($log)) { + redirect_header('dashboard.php?op='.$op.'&fct=list&limit='.$limit.'&start='.$start.'&order='.$order.'&sort='.$sort.'&filter='.$filter, 10, _AM_MSG_LOG_FAILEDTODELETE); + exit(0); + } else { + redirect_header('dashboard.php?op='.$op.'&fct=list&limit='.$limit.'&start='.$start.'&order='.$order.'&sort='.$sort.'&filter='.$filter, 10, _AM_MSG_LOG_DELETED); + exit(0); + } + } else { + $log = $log_handler->get($id); + xoops_confirm(array('id'=>$id, 'op'=>$_REQUEST['op'], 'fct'=>$_REQUEST['fct'], 'limit'=>$_REQUEST['limit'], 'start'=>$_REQUEST['start'], 'order'=>$_REQUEST['order'], 'sort'=>$_REQUEST['sort'], 'filter'=>$_REQUEST['filter']), 'log.php', sprintf(_AM_MSG_LOG_DELETE, $log->getVar('name'))); + } + break; + } + break; +} + +include(dirname(__FILE__).'/footer.php'); +?> \ No newline at end of file Added: XoopsModules/iplog/trunk/iplog/admin/menu.php =================================================================== --- XoopsModules/iplog/trunk/iplog/admin/menu.php (rev 0) +++ XoopsModules/iplog/trunk/iplog/admin/menu.php 2012-07-27 17:37:45 UTC (rev 9930) @@ -0,0 +1,37 @@ +<?php +/** + * Extended User iplog + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package iplog + * @since 2.3.0 + * @author Jan Pedersen + * @author Taiwen Jiang <ph...@us...> + * @version $Id: menu.php 2021 2008-08-31 02:02:45Z phppp $ + */ +$module_handler = xoops_gethandler('module'); +$GLOBALS['iplogModule'] = $module_handler->getByDirname('iplog'); +$adminmenu = array(); +if (is_object($GLOBALS['iplogModule'])) { + $adminmenu[0]['title'] = _MI_IPLOG_DASHBOARD; + $adminmenu[0]['icon'] = '../../'.$GLOBALS['iplogModule']->getInfo('icons32').'/home.png'; + $adminmenu[0]['image'] = '../../'.$GLOBALS['iplogModule']->getInfo('icons32').'/home.png'; + $adminmenu[0]['link'] = "admin/dashboard.php"; + $adminmenu[1]['title'] = _MI_IPLOG_LOG; + $adminmenu[1]['icon'] = 'images/icons/32/iplog.log.png'; + $adminmenu[1]['image'] = 'images/icons/32/iplog.log.png'; + $adminmenu[1]['link'] = "admin/log.php"; + $adminmenu[2]['title'] = _MI_IPLOG_ABOUT; + $adminmenu[2]['icon'] = '../../'.$GLOBALS['iplogModule']->getInfo('icons32').'/about.png'; + $adminmenu[2]['image'] = '../../'.$GLOBALS['iplogModule']->getInfo('icons32').'/about.png'; + $adminmenu[2]['link'] = "admin/about.php"; +} +?> \ No newline at end of file Added: XoopsModules/iplog/trunk/iplog/class/countries.php =================================================================== --- XoopsModules/iplog/trunk/iplog/class/countries.php (rev 0) +++ XoopsModules/iplog/trunk/iplog/class/countries.php 2012-07-27 17:37:45 UTC (rev 9930) @@ -0,0 +1,87 @@ +<?php +/** + * Extended User Iplog + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package Iplog + * @since 2.3.0 + * @author Jan Pedersen + * @author Taiwen Jiang <ph...@us...> + * @version $Id: Countries.php 4361 2010-02-09 23:36:33Z trabis $ + */ + +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class IplogCountries extends XoopsObject +{ + function __construct() + { + $this->initVar('country_id', XOBJ_DTYPE_INT, null, true); + $this->initVar('code', XOBJ_DTYPE_TXTBOX); + $this->initVar('name', XOBJ_DTYPE_TXTBOX); + $this->initVar('dialcode', XOBJ_DTYPE_TXTBOX); + $this->initVar('tldexists', XOBJ_DTYPE_TXTBOX); + $this->initVar('tld', XOBJ_DTYPE_TXTBOX); + $this->initVar('startgmt', XOBJ_DTYPE_DECIMAL); + $this->initVar('endgmt', XOBJ_DTYPE_DECIMAL); + $this->initVar('region', XOBJ_DTYPE_ENUM, false, false, false, false, array('Antarctica','Australasia','Caribbean','Central Africa','Central America','Central Asia','Eastern Africa','Eastern Asia','Eastern Europe','Middle East','North America','Northern Africa','Northern Asia','Northern Europe','South America','Southeastern Asia','Southeastern Europe','Southern Africa','Southern Asia','Southern Europe','Southwestern Asia','United States','Western Africa','Western Europe','Other')); + $this->initVar('continent', XOBJ_DTYPE_ENUM, false, false, false, false, array('Africa','Asia','Europe','North America','South America','Oceania','Other')); + $this->initVar('daylightsaving', XOBJ_DTYPE_ENUM, false, false, false, false, array('Yes','No')); + $this->initVar('start_dls_day', XOBJ_DTYPE_ENUM, false, false, false, false, array('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday')); + $this->initVar('start_dls_week', XOBJ_DTYPE_ENUM, false, false, false, false, array('1st','2nd','3rd','4th')); + $this->initVar('start_dls_month', XOBJ_DTYPE_ENUM, false, false, false, false, array('January','Febuary','March','April','May','June','July','August','September','October','November','December')); + $this->initVar('start_dls_dayno', XOBJ_DTYPE_INT); + $this->initVar('start_dls_mode', XOBJ_DTYPE_ENUM, false, false, false, false, array('day','dayno')); + $this->initVar('end_dls_day', XOBJ_DTYPE_ENUM, false, false, false, false, array('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday')); + $this->initVar('end_dls_week', XOBJ_DTYPE_ENUM, false, false, false, false, array('1st','2nd','3rd','4th')); + $this->initVar('end_dls_month', XOBJ_DTYPE_ENUM, false, false, false, false, array('January','Febuary','March','April','May','June','July','August','September','October','November','December')); + $this->initVar('end_dls_dayno', XOBJ_DTYPE_INT); + $this->initVar('end_dls_mode', XOBJ_DTYPE_ENUM, false, false, false, false, array('day','dayno')); + + $this->initVar('cat_weight', XOBJ_DTYPE_INT); + } + +} + +/** + * @package kernel + * @copyright copyright © 2000 XOOPS.org + */ +class IplogCountriesHandler extends XoopsPersistableObjectHandler +{ + function IplogCountriesHandler(&$db) + { + $this->__construct($db); + } + + function __construct(&$db) + { + parent::__construct($db, "iplog_countries", "IplogCountries", "country_id", 'name'); + } + + function getIDByCode($code, $as_id = true) { + if ($this->getCount(new Criteria('code', strtoupper($code)))) { + $objs = $this->getObjects(new Criteria('code', strtoupper($code)), false); + if (is_object($objs[0])) { + if ($as_id==true) + return $objs[0]->getVar('country_id'); + else + return $objs[0]; + } + } + return false; + } +} +?> \ No newline at end of file Added: XoopsModules/iplog/trunk/iplog/class/index.html =================================================================== --- XoopsModules/iplog/trunk/iplog/class/index.html (rev 0) +++ XoopsModules/iplog/trunk/iplog/class/index.html 2012-07-27 17:37:45 UTC (rev 9930) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/iplog/trunk/iplog/class/log.php =================================================================== --- XoopsModules/iplog/trunk/iplog/class/log.php (rev 0) +++ XoopsModules/iplog/trunk/iplog/class/log.php 2012-07-27 17:37:45 UTC (rev 9930) @@ -0,0 +1,398 @@ +<?php + +if (!defined('XOOPS_ROOT_PATH')) { + exit(); +} + +require_once(dirname(dirname(__FILE__)).'/include/ip2locationlite.class.php'); +/** + * Class for Iplog Profiler + * @author Simon Roberts (si...@ch...) + * @copyright copyright (c) 2000-2009 XOOPS.org + * @package kernel + */ +class IplogLog extends XoopsObject +{ + + function IplogLog($fid = null) + { + $this->initVar('ip_id', XOBJ_DTYPE_INT, null, false); + $this->initVar('uid', XOBJ_DTYPE_INT, null, false); + $this->initVar('agent', XOBJ_DTYPE_TXTBOX, null, false, 255); + $this->initVar('uname', XOBJ_DTYPE_TXTBOX, null, false, 32); + $this->initVar('ip4', XOBJ_DTYPE_TXTBOX, null, false, 255); + $this->initVar('ip6', XOBJ_DTYPE_TXTBOX, null, false, 65535); + $this->initVar('long', XOBJ_DTYPE_TXTBOX, null, false, 120); + $this->initVar('network-addy', XOBJ_DTYPE_TXTBOX, null, false, 255); + $this->initVar('country_id', XOBJ_DTYPE_INT, null, false); + $this->initVar('country-code', XOBJ_DTYPE_TXTBOX, null, false, 3); + $this->initVar('country-name', XOBJ_DTYPE_TXTBOX, null, false, 128); + $this->initVar('region-name', XOBJ_DTYPE_TXTBOX, null, false, 128); + $this->initVar('city-name', XOBJ_DTYPE_TXTBOX, null, false, 128); + $this->initVar('postcode', XOBJ_DTYPE_TXTBOX, null, false, 15); + $this->initVar('latitude', XOBJ_DTYPE_DECIMAL, null, false); + $this->initVar('longitude', XOBJ_DTYPE_DECIMAL, null, false); + $this->initVar('time-zone', XOBJ_DTYPE_TXTBOX, null, false, 6); + $this->initVar('proxy-ip4', XOBJ_DTYPE_TXTBOX, null, false, 255); + $this->initVar('proxy-ip6', XOBJ_DTYPE_TXTBOX, null, false, 65535); + $this->initVar('proxy-long', XOBJ_DTYPE_TXTBOX, null, false, 65535); + $this->initVar('proxy-network-addy', XOBJ_DTYPE_TXTBOX, null, false, 65535); + $this->initVar('proxy-country_id', XOBJ_DTYPE_INT, null, false); + $this->initVar('proxy-country-code', XOBJ_DTYPE_TXTBOX, null, false, 3); + $this->initVar('proxy-country-name', XOBJ_DTYPE_TXTBOX, null, false, 128); + $this->initVar('proxy-region-name', XOBJ_DTYPE_TXTBOX, null, false, 128); + $this->initVar('proxy-city-name', XOBJ_DTYPE_TXTBOX, null, false, 128); + $this->initVar('proxy-postcode', XOBJ_DTYPE_TXTBOX, null, false, 15); + $this->initVar('proxy-latitude', XOBJ_DTYPE_DECIMAL, null, false); + $this->initVar('proxy-longitude', XOBJ_DTYPE_DECIMAL, null, false); + $this->initVar('proxy-time-zone', XOBJ_DTYPE_TXTBOX, null, false, 6); + $this->initVar('session_id', XOBJ_DTYPE_TXTBOX, null, false, 128); + $this->initVar('start', XOBJ_DTYPE_INT, null, false); + $this->initVar('end', XOBJ_DTYPE_INT, null, false); + $this->initVar('online', XOBJ_DTYPE_INT, null, false); + } + + function toArray() { + $ret = parent::toArray(); + $ret['made'] = date(_DATESTRING, $this->getVar('made')); + $countries_handler = xoops_getmodulehandler('countries', 'iplog'); + $country = $countries_handler->get($this->getVar('country_id')); + if (is_object($country)) + $ret['country'] = $country->toArray(); + $comment_handler = xoops_gethandler('comment'); + $module_handler = xoops_gethandler('module'); + $GLOBALS['moduleIplog'] = $module_handler->getByDirname('iplog'); + $criteria = new CriteriaCompo(new Criteria('com_itemid', $this->getVar('member_id'))); + $criteria->add(new Criteria('com_modid', $GLOBALS['moduleIplog']->getVar('mid'))); + $comments = $comment_handler->getObjects($criteria, true); + if (count($comments)>0) { + foreach($comments as $com_id => $comment); + $ret['comments'][$com_id] = $comment->toArray(); + } + foreach($ret as $key => $value) { + if (is_array($value)) { + foreach ($value as $keyb => $valueb) { + unset($value[$keyb]); + $value[str_replace('-', '_', $keyb)] = $valueb; + } + } + unset($ret[$key]); + $ret[str_replace('-', '_', $key)] = $value; + } + $ret['ip'] = $this->getIPAddy().' ('.$this->getIPType().')'; + $ret['proxy_ip'] = $this->getProxyIPAddy(); + $ret['start'] = date(_DATESTRING,$ret['start']); + $ret['end'] = date(_DATESTRING,$ret['end']); + if ($ret['uid']==0) + $ret['uname'] = _MI_IPLOG_GUEST; + else + $ret['uname'] = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$ret['uid'].'">'.$ret['uname'].'</a>'; + return $ret; + + } + + function setIPAddy($ip) { + if ($this->validateIPv4($ip)) + $this->setVar('ip4', $ip); + elseif ($this->validateIPv6($ip)) + $this->setVar('ip6', $ip); + elseif (strpos($ip,'.')>0&&count(explode('.', $ip))==4) + $this->setVar('ip4', $ip); + elseif (strpos($ip,':')>0&&count(explode(':', $ip))>=5) + $this->setVar('ip6', $ip); + } + + function setProxyIPAddy($ip) { + if ($this->validateIPv4($ip)) + $this->setVar('proxy-ip4', $ip); + elseif ($this->validateIPv6($ip)) + $this->setVar('proxy-ip6', $ip); + } + + function getIPAddy() { + if (strlen($this->getVar('ip4'))>0) + return $this->getVar('ip4'); + elseif (strlen($this->getVar('ip6'))>0) + return $this->getVar('ip6'); + return false; + } + + function getProxyIPAddy() { + if (strlen($this->getVar('proxy-ip4'))>0) + return $this->getVar('proxy-ip4'); + elseif (strlen($this->getVar('proxy-ip6'))>0) + return $this->getVar('proxy-ip6'); + return false; + } + + function getIPType() { + if (strlen($this->getVar('ip4'))>0) + return _MI_IPLOG_IPV4; + elseif (strlen($this->getVar('ip6'))>0) + return _MI_IPLOG_IPV6; + } + + private function validateIPv4($ip) { + if(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE) === FALSE) // returns IP is valid + { + return false; + } else { + return true; + } + } + + private function validateIPv6($ip) { + if(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === FALSE) // returns IP is valid + { + return false; + } else { + return true; + } + } + +} + + +/** +* XOOPS Iplog Profiler handler class. +* This class is responsible for providing data access mechanisms to the data source +* of XOOPS user class objects. +* +* @author Simon Roberts <si...@ch...> +* @package kernel +*/ +class IplogLogHandler extends XoopsPersistableObjectHandler +{ + function __construct(&$db) + { + parent::__construct($db, "iplog_log", 'IplogLog', "ip_id", "session_id"); + } + + function getFields() { + return array('ip_id', 'uname', 'ip', 'country_code', 'name', 'region', 'contient', 'network_addy', 'useragent', 'proxy_ip', 'start', 'end', 'online'); + } + + function writeLog($data) { + $obj = $this->create(); + $obj->setVars($data); + $obj->setIPAddy($data['ip']); + if ($data['proxied']) + $obj->setProxyIPAddy($data['proxy-ip']); + return $this->insert($obj, true); + } + + function insert($obj, $force = true) { + xoops_load('xoopscache'); + $ping = XoopsCache::read('iplog_ip_ping_unixtimes'); + if (!is_array($ping)==true) { + $ping=array($obj->getIPAddy()=>microtime(true)); + $oldping=microtime(true); + } else { + if (time()-$ping[$obj->getIPAddy()]>$GLOBALS['xoopsConfig']['session_expire']*60) { + $pingnew = true; + } else { + $pingnew = false; + } + $oldping=$ping[$obj->getIPAddy()]; + $ping[$obj->getIPAddy()]=microtime(true); + } + XoopsCache::write('iplog_ip_ping_unixtimes', $ping, 60*60*24*7*4); + + if ($this->getCount(new Criteria('session_id', session_id())&&is_object($GLOBALS['xoopsUser']))&&$pingnew!=true) { + $criteria = new Criteria('session_id', session_id()); + $criteria->setSort('`ip_id`'); + $criteria->setOrder('DESC'); + $criteria->setLimit(1); + $objs = $this->getObjects($criteria, false); + if (is_object($objs[0])) { + $obj = $objs[0]; + $obj->setVar('end', $ping[$obj->getIPAddy()]); + $obj->setVar('online', $obj->getVar('end')-$obj->getVar('start')); + } + } elseif (!is_object($GLOBALS['xoopsUser'])&&$GLOBALS['iplogModuleConfig']['anonymous']&&$pingnew!=true) { + if ($obj->getIPType()==_MI_IPLOG_IPV4) { + $criteria = new Criteria('ip4', $obj->getIPAddy()); + $criteria->setSort('`ip_id`'); + $criteria->setOrder('DESC'); + $criteria->setLimit(1); + $objs = $this->getObjects($criteria, false); + } elseif ($obj->getIPType()==_MI_IPLOG_IPV6) { + $criteria = new Criteria('ip6', $obj->getIPAddy()); + $criteria->setSort('`ip_id`'); + $criteria->setOrder('DESC'); + $criteria->setLimit(1); + $objs = $this->getObjects($criteria, false); + } + if (is_object($objs[0])) { + $obj = $objs[0]; + $obj->setVar('end', $ping[$obj->getIPAddy()]); + $obj->setVar('online', $obj->getVar('end')-$obj->getVar('start')); + } + } + if ($obj->isNew()) { + + $obj->setVar('session_id', session_id()); + $obj->setVar('start', $ping[$obj->getIPAddy()]); + $obj->setVar('end', $ping[$obj->getIPAddy()]); + + if (strlen($obj->getVar('ip4'))<>0) { + if (strlen($obj->getVar('ip4'))<7) { + return false; + } elseif (substr($obj->getVar('ip4'), strlen($obj->getVar('ip4'))-1, 1) == '.') { + return false; + } else { + $count = count(explode('.', $obj->getVar('ip4'))); + if ($count!=4) + return false; + } + } elseif (strlen($obj->getVar('ip6'))<>0) { + if (strlen($obj->getVar('ip6'))<15) { + return false; + } elseif (substr($obj->getVar('ip6'), strlen($obj->getVar('ip6'))-1, 1) == ':') { + return false; + } else { + $count = count(explode(':',$obj->getVar('ip6'))); + if ($count<5) + return false; + } + } + + if (strlen($obj->getVar('long'))==0) + $obj->setVar('long', @ip2long($obj->getIPAddy())); + + if (strlen($obj->getVar('network-addy'))<strlen(strlen($obj->getIPAddy()))) + $obj->setVar('network-addy', @gethostbyaddr($obj->getIPAddy())); + + $ipLite = new ip2location_lite; + $ipLite->setKey($GLOBALS['iplogModuleConfig']['ipinfodb_key']); + //Get errors and locations + $locations = $ipLite->getCity($obj->getIPAddy()); + $countries_handler = xoops_getmodulehandler('countries', 'iplog'); + $obj->setVar('country_id', $countries_handler->getIDByCode(strtoupper($locations['countryCode']))); + $obj->setVar('country-code', strtoupper($locations['countryCode'])); + $obj->setVar('country-name', ucfirst($locations['countryName'])); + $obj->setVar('region-name', ucfirst($locations['regionName'])); + $obj->setVar('city-name', ucfirst($locations['cityName'])); + $obj->setVar('postcode', $locations['zipCode']); + $obj->setVar('latitude', $locations['latitude']); + $obj->setVar('longitude', $locations['longitude']); + $obj->setVar('time-zone', $locations['timeZone']); + + if ($obj->getProxyIPAddy()!=false) { + if (strlen($obj->getVar('proxy-long'))==0) + $obj->setVar('proxy-long', @ip2long($obj->getProxyIPAddy())); + + if (strlen($obj->getVar('proxy-network-addy'))<strlen(strlen($obj->getProxyIPAddy()))) + $obj->setVar('proxy-network-addy', @gethostbyaddr($obj->getProxyIPAddy())); + + $locations = $ipLite->getCity($obj->getProxyIPAddy()); + $countries_handler = xoops_getmodulehandler('countries', 'iplog'); + $obj->setVar('proxy-country_id', $countries_handler->getIDByCode(strtoupper($locations['countryCode']))); + $obj->setVar('proxy-country-code', strtoupper($locations['countryCode'])); + $obj->setVar('proxy-country-name', ucfirst($locations['countryName'])); + $obj->setVar('proxy-region-name', ucfirst($locations['regionName'])); + $obj->setVar('proxy-city-name', ucfirst($locations['cityName'])); + $obj->setVar('proxy-postcode', $locations['zipCode']); + $obj->setVar('proxy-latitude', $locations['latitude']); + $obj->setVar('proxy-longitude', $locations['longitude']); + $obj->setVar('proxy-time-zone', $locations['timeZone']); + } + } + + $ret = parent::insert($obj, $force); + $this->deleteAll(new Criteria('end', time() - $GLOBALS['iplogModuleConfig']['logdrops'], '<=')); + return $ret; + + } + + function getNumberByCountry() { + $sql = 'SELECT DISTINCT `country-name` as node, count(*) as total FROM `'.$this->table.'`'; + $result = $GLOBALS['xoopsDB']->queryF($sql); + $ret = array(); + while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { + $ret[] = $row; + } + return $ret; + } + + function getNumberByRegion() { + $sql = 'SELECT DISTINCT `b`.`region` as node, count(*) as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id'; + $result = $GLOBALS['xoopsDB']->queryF($sql); + $ret = array(); + while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { + $ret[] = $row; + } + return $ret; + } + + function getNumberByContinent() { + $sql = 'SELECT DISTINCT `b`.`continent` as node, count(*) as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id'; + $result = $GLOBALS['xoopsDB']->queryF($sql); + $ret = array(); + while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { + $ret[] = $row; + } + return $ret; + } + + function getTotalSecondsByCountry() { + $sql = 'SELECT DISTINCT `country-name` as node, sum(`online`)/60 as total FROM `'.$this->table.'`'; + $result = $GLOBALS['xoopsDB']->queryF($sql); + $ret = array(); + while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { + $ret[] = $row; + } + return $ret; + } + + function getTotalSecondsByRegion() { + $sql = 'SELECT DISTINCT `b`.`region` as node, sum(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id';; + $result = $GLOBALS['xoopsDB']->queryF($sql); + $ret = array(); + while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { + $ret[] = $row; + } + return $ret; + } + + function getTotalSecondsByContinent() { + $sql = 'SELECT DISTINCT `b`.`continent` as node, sum(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id';; + $result = $GLOBALS['xoopsDB']->queryF($sql); + $ret = array(); + while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { + $ret[] = $row; + } + return $ret; + } + + function getAdverageSecondsByCountry() { + $sql = 'SELECT DISTINCT `country-name` as node, avg(`online`)/60 as total FROM `'.$this->table.'`'; + $result = $GLOBALS['xoopsDB']->queryF($sql); + $ret = array(); + while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { + $ret[] = $row; + } + return $ret; + } + + function getAdverageSecondsByRegion() { + $sql = 'SELECT DISTINCT `b`.`region` as node, avg(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id';; + $result = $GLOBALS['xoopsDB']->queryF($sql); + $ret = array(); + while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { + $ret[] = $row; + } + return $ret; + } + + function getAdverageSecondsByContinent() { + $sql = 'SELECT DISTINCT `b`.`continent` as node, avg(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id';; + $result = $GLOBALS['xoopsDB']->queryF($sql); + $ret = array(); + while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { + $ret[] = $row; + } + return $ret; + } +} +?> Added: XoopsModules/iplog/trunk/iplog/docs/changelog.txt =================================================================== --- XoopsModules/iplog/trunk/iplog/docs/changelog.txt (rev 0) +++ XoopsModules/iplog/trunk/iplog/docs/changelog.txt 2012-07-27 17:37:45 UTC (rev 9930) @@ -0,0 +1,5 @@ +=================== +1.01 2012-07-27 +=================== + +Original Release \ No newline at end of file Added: XoopsModules/iplog/trunk/iplog/docs/credits.txt =================================================================== --- XoopsModules/iplog/trunk/iplog/docs/credits.txt (rev 0) +++ XoopsModules/iplog/trunk/iplog/docs/credits.txt 2012-07-27 17:37:45 UTC (rev 9930) @@ -0,0 +1,2 @@ +Credits: +================= \ No newline at end of file Added: XoopsModules/iplog/trunk/iplog/docs/index.html =================================================================== --- XoopsModules/iplog/trunk/iplog/docs/index.html (rev 0) +++ XoopsModules/iplog/trunk/iplog/docs/index.html 2012-07-27 17:37:45 UTC (rev 9930) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/iplog/trunk/iplog/docs/install.txt =================================================================== --- XoopsModules/iplog/trunk/iplog/docs/install.txt (rev 0) +++ XoopsModules/iplog/trunk/iplog/docs/install.txt 2012-07-27 17:37:45 UTC (rev 9930) @@ -0,0 +1,8 @@ +Read Me First +============= + +Please make sure that you download the module from chronolabs to get the latest version, and upload it to your XOOPS Root +directory from all the content inside the zips htdocs folder. + +Install the module as per the system module and then adjust preferences to suit, remember to set your Invoice Broker, Collection +Officer and other groups accordingly in the groups, this will be created as per your installation. \ No newline at end of file Added: XoopsModules/iplog/trunk/iplog/docs/lang_diff.txt =================================================================== --- XoopsModules/iplog/trunk/iplog/docs/lang_diff.txt (rev 0) +++ XoopsModules/iplog/trunk/iplog/docs/lang_diff.txt 2012-07-27 17:37:45 UTC (rev 9930) @@ -0,0 +1,4 @@ +Read Me First +============= + +Please make sure that you download the XOOPS Icon Set, and upload it to uploads/images directory \ No newline at end of file Added: XoopsModules/iplog/trunk/iplog/docs/licence.txt =================================================================== --- XoopsModules/iplog/trunk/iplog/docs/licence.txt (rev 0) +++ XoopsModules/iplog/trunk/iplog/docs/licence.txt 2012-07-27 17:37:45 UTC (rev 9930) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use i... [truncated message content] |