From: <chr...@us...> - 2018-06-22 17:54:59
|
Revision: 13363 http://sourceforge.net/p/xoops/svn/13363 Author: chronolabscoop Date: 2018-06-22 17:54:49 +0000 (Fri, 22 Jun 2018) Log Message: ----------- Periodical Backup Work in progress xoopsauth/authkey! Modified Paths: -------------- XoopsModules/authkey/trunk/modules/authkey/api/index.php XoopsModules/authkey/trunk/modules/authkey/class/keys.php XoopsModules/authkey/trunk/modules/authkey/class/statistics.php XoopsModules/authkey/trunk/modules/authkey/header.php XoopsModules/authkey/trunk/modules/authkey/include/functions.php XoopsModules/authkey/trunk/modules/authkey/index.php XoopsModules/authkey/trunk/modules/authkey/language/english/modinfo.php XoopsModules/authkey/trunk/modules/authkey/xoops_version.php Modified: XoopsModules/authkey/trunk/modules/authkey/api/index.php =================================================================== --- XoopsModules/authkey/trunk/modules/authkey/api/index.php 2018-06-09 06:29:01 UTC (rev 13362) +++ XoopsModules/authkey/trunk/modules/authkey/api/index.php 2018-06-22 17:54:49 UTC (rev 13363) @@ -1 +1,278 @@ <?php +/** + * Authkey API Authentication Keys for xoops.org + * + * 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 (c) 2000-2019 Chronolabs Cooperative (8Bit.snails.email) + * @license GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html) + * @package authkey + * @since 1.0.7 + * @author Simon Antony Roberts <wis...@us...> + * @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/authkey + */ + +global $authkeyModule, $op, $mode; + +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'header.php'; + +$odds = $inner = array(); +foreach($_GET as $key => $values) { + if (!isset($inner[$key])) { + $inner[$key] = $values; + } elseif (!in_array(!is_array($values)?$values:md5(json_encode($values, true)), array_keys($odds[$key]))) { + if (is_array($values)) { + $odds[$key][md5(json_encode($inner[$key] = $values, true))] = $values; + } else { + $odds[$key][$inner[$key] = $values] = "$values--$key"; + } + } +} +foreach($_POST as $key => $values) { + if (!isset($inner[$key])) { + $inner[$key] = $values; + } elseif (!in_array(!is_array($values)?$values:md5(json_encode($values, true)), array_keys($odds[$key]))) { + if (is_array($values)) { + $odds[$key][md5(json_encode($inner[$key] = $values, true))] = $values; + } else { + $odds[$key][$inner[$key] = $values] = "$values--$key"; + } + } +} +foreach(parse_url('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].(strpos($_SERVER['REQUEST_URI'], '?')?'&':'?').$_SERVER['QUERY_STRING'], PHP_URL_QUERY) as $key => $values) { + if (!isset($inner[$key])) { + $inner[$key] = $values; + } elseif (!in_array(!is_array($values)?$values:md5(json_encode($values, true)), array_keys($odds[$key]))) { + if (is_array($values)) { + $odds[$key][md5(json_encode($inner[$key] = $values, true))] = $values; + } else { + $odds[$key][$inner[$key] = $values] = "$values--$key"; + } + } +} + +$return = array(); +switch ($inner['mode']) +{ + default: + $help = true; + break; + case "getkey": + $usersHandler = xoops_getHandler('users'); + + $criteriap = new CriteriaCompo(new Criteria('pass', $inner['pass'])); + $criteriap->add(new Criteria('pass', md5($inner['pass'])), 'OR'); + $criteria = new CriteriaCompo(new Criteria('uname', $inner['uname'])); + $criteria->add($criteriap); + + if ($userObjs = $usersHandler->getObjects($criteria) && isset($userObjs[0])) + { + if (!strlen($inner['title'])) + $return = array('code' => 501, 'errors' => array(102 => 'Variable required to be passed the title of the key in "title" ~ field element not found!')); + elseif (!strlen($inner['name'])) + $return = array('code' => 501, 'errors' => array(103 => 'Variable required to be passed the individual name of the owner of the key in "name" ~ field element not found!')); + elseif (!strlen($inner['url'])) + $return = array('code' => 501, 'errors' => array(105 => 'Variable required to be passed the url of the owning site of the key in "url" ~ field element not found!')); + elseif (!strlen($inner['email'])) + $return = array('code' => 501, 'errors' => array(106 => 'Variable required to be passed the owning sites email of the key in "email" ~ field element not found!')); + elseif (checkEmail($inner['email'])) + $return = array('code' => 501, 'errors' => array(107 => 'Variable required to be passed not a valid owning sites email in the field element "email" ~ field element invalid!')); + + if (empty($return)) { + $keysHandler = xoops_getModuleHandler('keys', basename(dirname(__DIR__))); + + $object = $keysHandler->create(); + $object->setVar('title', $inner['title']); + $object->setVar('name', $inner['name']); + $object->setVar('company', $inner['company']); + $object->setVar('url', $inner['url']); + $object->setVar('email', $inner['email']); + $object->setVar('uid', $userObjs[0]->getVar('uid')); + + $key = $keysHandler->get($keysHandler->insert($object, true)); + $return = array('code' => 201, 'authkey' => $key->getVar('key'), 'issuing' => $key->getVar('issuing')); + } + + } else { + $return = array('code' => 501, 'errors' => array(101 => 'Username of "' . $inner['uname'] . '" with the password of "' . $inner['pass'] . '" not found!')); + } + break; + case "verify": + if (!strlen($inner['key'])) + $return = array('code' => 501, 'errors' => array(108 => 'Variable required to be passed the the xoopskey in the field element: "key" ~ field element not found!')); + if (empty($return)) { + $keysHandler = xoops_getModuleHandler('keys', basename(dirname(__DIR__))); + if (!$token = XoopsCache::read("xoopskey_".md5($inner['key']))) + { + if (!$key = $keysHandler->getByXoopsKey($inner['key'])) + $return = array('code' => 501, 'errors' => array(109 => 'Variable not found in database being passed as the xoopskey in the field element: "key" ~ field element data not found!')); + if (is_object($key) && empty($return)) + { + if ($key->getVar('stats-hour') < time()) + $key->setVar('stats-hour', time() + (3600)); + if ($key->getVar('stats-day') < time()) + $key->setVar('stats-day', time() + (3600 * 24)); + if ($key->getVar('stats-week') < time()) + $key->setVar('stats-week', time() + (3600 * 24 * 7)); + if ($key->getVar('stats-month') < time()) + $key->setVar('stats-month', time() + (3600 * 24 * 7 * 4)); + if ($key->getVar('stats-quarter') < time()) + $key->setVar('stats-quarter', time() + (3600 * 24 * 7 * 4 * 3)); + if ($key->getVar('stats-year') < time()) + $key->setVar('stats-year', time() + (3600 * 24 * 7 * 4 * 12)); + + $key = $keysHandler->get($keyid = $keysHandler->insert($key, true)); + $data = $key->getValues(array_keys($key->vars)); + $data['polling'] = 0; + $data['polled'] = time(); + XoopsCache::write("xoopskey_".md5($key->getVar('key')), $data, 3600 * 24 * 7 * 4 * 36); + XoopsCache::write("xoopskey_".md5(md5($key->getVar('key'))), $data, 3600 * 24 * 7 * 4 * 36); + XoopsCache::write("xoopskey_".md5(sha1($key->getVar('key'))), $data, 3600 * 24 * 7 * 4 * 36); + $return = array('code'=>201, 'passed' => true); + } + } else { + $token['polling'] = $token['polling'] + 1; + $token['polled'] = time(); + XoopsCache::write("xoopskey_".md5($inner['key']), $token, 3600 * 24 * 7 * 4 * 36); + + if ($authkeyConfigsList['limited']!=true) + $return = array('code'=>201, 'passed' => true); + + $key = $keysHandler->get($token['id']); + foreach(array(md5($key->getVar('key')), md5(md5($key->getVar('key'))), md5(sha1($key->getVar('key')))) as $keyy) { + if ($token = XoopsCache::read("xoopskey_".$keyy)) { + if ($token['polled'] < time() - $authkeyConfigsList['polling-seconds'] || $key->getVar('stats-hour') < time() || $key->getVar('stats-day') < time() || $key->getVar('stats-week') < time() || $key->getVar('stats-month') < time() || $key->getVar('stats-quarter') < time() || $key->getVar('stats-year') < time()) + { + $key = $keysHandler->get($token['id']); + $key->setVar('calls-hour', $key->getVar('calls-hour') + $token['polling']); + $key->setVar('calls-day', $key->getVar('calls-day') + $token['polling']); + $key->setVar('calls-week', $key->getVar('calls-week') + $token['polling']); + $key->setVar('calls-month', $key->getVar('calls-month') + $token['polling']); + $key->setVar('calls-quarter', $key->getVar('calls-quarter') + $token['polling']); + $key->setVar('calls-year', $key->getVar('calls-year') + $token['polling']); + $token['polling'] = 0; + + $overlimit = false; + if ($authkeyConfigsList['limited']==true) + { + if ($key->getVar('limit-hour') < $key->getVar('calls-hour')) + { + $overlimit = true; + $key->setVar('overs-hour', $key->getVar('calls-hour') - $key->getVar('limit-hour')); + } + if ($key->getVar('limit-day') < $key->getVar('calls-day')) + { + $overlimit = true; + $key->setVar('overs-day', $key->getVar('calls-day') - $key->getVar('limit-day')); + } + if ($key->getVar('limit-week') < $key->getVar('calls-week')) + { + $overlimit = true; + $key->setVar('overs-week', $key->getVar('calls-week') - $key->getVar('limit-week')); + } + if ($key->getVar('limit-month') < $key->getVar('calls-month')) + { + $overlimit = true; + $key->setVar('overs-month', $key->getVar('calls-month') - $key->getVar('limit-month')); + } + if ($key->getVar('limit-quarter') < $key->getVar('calls-quarter')) + { + $overlimit = true; + $key->setVar('overs-quarter', $key->getVar('calls-quarter') - $key->getVar('limit-quarter')); + } + if ($key->getVar('limit-year') < $key->getVar('calls-year')) + { + $overlimit = true; + $key->setVar('overs-year', $key->getVar('calls-year') - $key->getVar('limit-year')); + } + } + + $key = $keysHandler->get($keyid = $keysHandler->insert($key, true)); + XoopsCache::write("xoopskey_".$keyy, $token, 3600 * 24 * 7 * 4 * 36); + } + } + } + + if ($key->getVar('stats-hour') < time() || $key->getVar('stats-day') < time() || $key->getVar('stats-week') < time() || $key->getVar('stats-month') < time() || $key->getVar('stats-quarter') < time() || $key->getVar('stats-year') < time()) + { + + if ($key->getVar('stats-hour') < time()) + $key->setVar('stats-hour', time() + (3600)); + if ($key->getVar('stats-day') < time()) + $key->setVar('stats-day', time() + (3600 * 24)); + if ($key->getVar('stats-week') < time()) + $key->setVar('stats-week', time() + (3600 * 24 * 7)); + if ($key->getVar('stats-month') < time()) + $key->setVar('stats-month', time() + (3600 * 24 * 7 * 4)); + if ($key->getVar('stats-quarter') < time()) + $key->setVar('stats-quarter', time() + (3600 * 24 * 7 * 4 * 3)); + if ($key->getVar('stats-year') < time()) + $key->setVar('stats-year', time() + (3600 * 24 * 7 * 4 * 12)); + + $key = $keysHandler->get($keyid = $keysHandler->insert($key, true)); + $data = $key->getValues(array_keys($key->vars)); + $data['polling'] = 0; + $data['polled'] = time(); + XoopsCache::write("xoopskey_".md5($key->getVar('key')), $data, 3600 * 24 * 7 * 4 * 36); + XoopsCache::write("xoopskey_".md5(md5($key->getVar('key'))), $data, 3600 * 24 * 7 * 4 * 36); + XoopsCache::write("xoopskey_".md5(sha1($key->getVar('key'))), $data, 3600 * 24 * 7 * 4 * 36); + } + + if ($authkeyConfigsList['limited']==true && $overlimit == true) + $return = array('code'=>501, 'passed' => false, 'error' => array(110 => 'Over Limit of Calling Polls to API\'s')); + + } + } + break; +} + +/** + * Buffers Help + */ +if ($help==true) { + if (function_exists("http_response_code")) + http_response_code(400); + include __DIR__ . DS . 'help.php'; + exit; +} + +/** + * Commences Execution of API Functions + */ +if (function_exists("http_response_code")) + http_response_code((isset($return['code'])?$return['code']:200)); +if (isset($return['code'])) + unset($return['code']); + +switch ($inner['format']) { + case 'html': + echo '<pre style="font-family: \'Courier New\', Courier, Terminal; font-size: 0.77em;">'; + echo var_dump($return, true); + echo '</pre>'; + break; + case 'raw': + echo "<?php\n\n return " . var_export($return, true) . ";\n\n?>"; + break; + default: + case 'json': + header('Content-type: application/json'); + echo json_encode($return); + break; + case 'serial': + header('Content-type: text/html'); + echo serialize($return); + break; + case 'xml': + header('Content-type: application/xml'); + $dom = new XmlDomConstruct('1.0', 'utf-8'); + $dom->fromMixed(array('root'=>$return)); + echo $dom->saveXML(); + break; +} + +exit(0); Modified: XoopsModules/authkey/trunk/modules/authkey/class/keys.php =================================================================== --- XoopsModules/authkey/trunk/modules/authkey/class/keys.php 2018-06-09 06:29:01 UTC (rev 13362) +++ XoopsModules/authkey/trunk/modules/authkey/class/keys.php 2018-06-22 17:54:49 UTC (rev 13363) @@ -88,7 +88,86 @@ $this->db = $db; parent::__construct($db, 'authkey_keys', 'AuthkeyKeys', "id", "key"); } + + function getByXoopsKey($key = '') + { + $sql = "SELECT * FROM `" . $this->db->prefix('authkey_keys') . "` WHERE `key` LIKE '$key' OR md5(`key`) LIKE '$key' OR sha1(`key`) LIKE '$key'"; + if ($row = $this->db->fetchArray($this->db->queryF($sql))) + { + $obj = new AuthkeyKeys(); + $obj->assignVars($row); + return $obj; + } + return false; + } + function insert(AuthkeyKeys $object, $force = true, $notify = false) + { + + if ($object->isNew()) + { + $notify = true; + $object->setVar('created', time()); + $object->setVar('issuing', time()); + if (!strlen(trim($object->getVar('key')))) + $object->setVar('key', authkey_getAuthKey()); + $object->setVar('limit-hour', $authkeyConfigsList['limit-hour']); + $object->setVar('limit-day', $authkeyConfigsList['limit-day']); + $object->setVar('limit-week', $authkeyConfigsList['limit-week']); + $object->setVar('limit-month', $authkeyConfigsList['limit-month']); + $object->setVar('limit-quarter', $authkeyConfigsList['limit-quarter']); + $object->setVar('limit-year', $authkeyConfigsList['limit-year']); + } + $keyid = parent::insert($object, $force); + if ($notify == true) + { + xoops_load('XoopsMailer'); + $object = $this->get($keyid); + if ($object->getVar('uid') != 0) + $user = xoops_getHandler('users')->get($object->getVar('uid')); + $mailer = new XoopsMailer($GLOBALS['xoopsConfig']['sitename'], $GLOBALS['xoopsConfig']['adminemail']); + if (is_dir(dirname(__DIR__) . DS . 'language' . DS . $GLOBALS['xoopsConfig']['language'] . DS . 'mail_templates')) + $mailer->setTemplateDir(dirname(__DIR__) . DS . 'language' . DS . $GLOBALS['xoopsConfig']['language'] . DS . 'mail_templates'); + else + $mailer->setTemplateDir(dirname(__DIR__) . DS . 'language' . DS . 'english' . DS . 'mail_templates'); + $mailer->setTemplate('issuing_authkey.txt'); + $mailer->setFromEmail($GLOBALS['xoopsConfig']['adminemail']); + $mailer->setFromName($GLOBALS['xoopsConfig']['sitename']); + $mailer->assign('KEY', $object->getVar('key')); + $mailer->assign('MD5KEY', md5($object->getVar('key'))); + $mailer->assign('SHA1KEY', sha1($object->getVar('key'))); + $mailer->assign('KEY-TITLE', $object->getVar('title')); + $mailer->assign('KEY-NAME', $object->getVar('name')); + $mailer->assign('KEY-COMPANY', $object->getVar('company')); + $mailer->assign('KEY-EMAIL', $object->getVar('email')); + $mailer->assign('KEY-URL', $object->getVar('url')); + $mailer->assign('IP', authkeyGetIP(true)); + + if (is_object($user)) + { + $mailer->assign('UNAME', $user->getVar('uname')); + $mailer->assign('USERNAME', $user->getVar('name')); + $mailer->assign('USEREMAIL', $user->getVar('email')); + $mailer->setToEmails(array($user->getVar('email'), $object->getVar('email'), $GLOBALS['xoopsConfig']['adminemail'])); + } else { + $mailer->assign('UNAME', '---'); + $mailer->assign('USERNAME', $GLOBALS['xoopsConfig']['sitename']); + $mailer->assign('USEREMAIL', $GLOBALS['xoopsConfig']['adminemail']); + $mailer->setToEmails(array($GLOBALS['xoopsConfig']['adminemail'], $object->getVar('email'))); + } + $mailer->assign('LIMITED', ($authkeyConfigsList['limited']==true?_YES:_NO)); + $mailer->assign('LIMIT-HOUR', $object->getVar('limit-hour')); + $mailer->assign('LIMIT-DAY', $object->getVar('limit-day')); + $mailer->assign('LIMIT-WEEK', $object->getVar('limit-week')); + $mailer->assign('LIMIT-MONTH', $object->getVar('limit-month')); + $mailer->assign('LIMIT-QUARTER', $object->getVar('limit-quarter')); + $mailer->assign('LIMIT-YEAR', $object->getVar('limit-year')); + $mailer->setPriority(1); + $mailer->setSubject(sprintf(_MI_AUTHKEY_SUBJECT_ISSUINGKEY, $object->getVar('key'))); + @$mailer->send(false); + } + return $keyid; + } } ?> \ No newline at end of file Modified: XoopsModules/authkey/trunk/modules/authkey/class/statistics.php =================================================================== --- XoopsModules/authkey/trunk/modules/authkey/class/statistics.php 2018-06-09 06:29:01 UTC (rev 13362) +++ XoopsModules/authkey/trunk/modules/authkey/class/statistics.php 2018-06-22 17:54:49 UTC (rev 13363) @@ -1,6 +1,6 @@ <?php /** - * Authkey API Authentication Keys for xoops.org + * Authkey API Authentication Statistics for xoops.org * * 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 @@ -20,73 +20,49 @@ if (!defined('XOOPS_ROOT_PATH')) { - exit(); + exit(); } /** * Class for Blue Room Xcenter - * @author Simon Roberts <si...@xo...> + * @author Simon Roberts <simon@snails.email> * @copyright copyright (c) 2009-2003 XOOPS.org * @package kernel */ -class XcenterCategory extends XoopsObject +class AuthkeyStatistics extends XoopsObject { - - function XcenterCategory($id = null) + + function AuthkeyStatistics($id = null) { - $this->initVar('catid', XOBJ_DTYPE_INT, null, false); - $this->initVar('parent_id', XOBJ_DTYPE_INT, null, false); - $this->initVar('rssenabled', XOBJ_DTYPE_INT, false, false); - } + $this->initVar('id', XOBJ_DTYPE_INT, null, false); + $this->initVar('key-id', XOBJ_DTYPE_INT, null, false); + $this->initVar('uid', XOBJ_DTYPE_INT, null, false); + $this->initVar('type', XOBJ_DTYPE_ENUM, null, false, false, false, false, array('hour','day','week','month','quarter','year')); + $this->initVar('calls', XOBJ_DTYPE_INT, null, false); + $this->initVar('limit', XOBJ_DTYPE_INT, null, false); + $this->initVar('over', XOBJ_DTYPE_INT, null, false); + $this->initVar('begining', XOBJ_DTYPE_INT, null, false); + $this->initVar('finished', XOBJ_DTYPE_INT, null, false); + + } } /** -* XOOPS policies 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 XcenterCategoryHandler extends XoopsPersistableObjectHandler + * XOOPS policies handler class. + * This class is responsible for providing data access mechanisms to the data source + * of XOOPS user class objects. + * + * @author Simon Roberts <simon@snails.email> + * @package kernel + */ +class AuthkeyStatisticsHandler extends XoopsPersistableObjectHandler { - function __construct(&$db) + function __construct(&$db) { - $this->db = $db; - parent::__construct($db, _XTR_TABLE_CATEGORY, 'XcenterCategory', "catid", "title"); + $this->db = $db; + parent::__construct($db, 'authkey_statistics', 'AuthkeyStatistics', "id", "key-id"); } - function createnew() - { - $ret = array(); - $text_handler =& xoops_getmodulehandler(_XTR_CLASS_TEXT, _XTR_DIRNAME); - $ret['text'] = $text_handler->create(); - $ret['cat'] = $this->create(); - return $ret; - } - - function getCategory($catid = 0, $language = '') - { - $ret = array(); - if (empty($language)) { - $language = $GLOBALS['xoopsConfig']['language']; - } - $text_handler =& xoops_getmodulehandler(_XTR_CLASS_TEXT, _XTR_DIRNAME); - $criteria = new CriteriaCompo(new Criteria('catid', $catid)); - $criteria->add(new Criteria('language', $language)); - $criteria->add(new Criteria('type', _XTR_ENUM_TYPE_CATEGORY)); - if ($texts = $text_handler->getObjects($criteria)) { - $ret['text'] = $texts[0]; - $ret['cat'] = $this->get($catid); - return $ret; - } - - $ret["text"] = $text_handler->create(); - $ret["text"]->setVar('language', $language); - $ret['cat'] = $this->get($catid); - return $ret; - } - } ?> \ No newline at end of file Modified: XoopsModules/authkey/trunk/modules/authkey/header.php =================================================================== --- XoopsModules/authkey/trunk/modules/authkey/header.php 2018-06-09 06:29:01 UTC (rev 13362) +++ XoopsModules/authkey/trunk/modules/authkey/header.php 2018-06-22 17:54:49 UTC (rev 13363) @@ -1,52 +1,55 @@ <?php +/** + * Authkey API Authentication Keys for xoops.org + * + * 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 (c) 2000-2019 Chronolabs Cooperative (8Bit.snails.email) + * @license GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html) + * @package authkey + * @since 1.0.7 + * @author Simon Antony Roberts <wis...@us...> + * @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/authkey + */ -/* -Module: Xcenter -Version: 2.01 - -Description: Multilingual Content Module with tags and lists with search functions - -Author: Written by Simon Roberts aka. Wishcraft (si...@ch...) - -Owner: Chronolabs - -License: See /docs - GPL 2.0 -*/ - - - require ('../../mainfile.php'); - - require_once($GLOBALS['xoops']->path(_XTR_PATH_PHP_FUNCTIONS)); - require_once($GLOBALS['xoops']->path(_XTR_PATH_PHP_FORMOBJECTS)); - require_once($GLOBALS['xoops']->path(_XTR_PATH_PHP_FORMS)); - require_once($GLOBALS['xoops']->path(_XTR_PATH_PHP_TEMPLATE)); - + global $authkeyModule, $op, $mode, $authkeyConfigsList, $authkeyConfigs, $authkeyConfigsOptions, $groups; + + require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'mainfile.php'; + require_once __DIR__ . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'functions.php'; + $myts =& MyTextSanitizer::getInstance(); - + + if (empty($authkeyModule)) + { + if (is_a($authkeyModule = xoops_getHandler('module')->getByDirname(basename(__DIR__)), "XoopsModule")) + { + if (empty($authkeyConfigsList)) + { + $authkeyConfigsList = authkey_load_config(); + } + if (empty($authkeyConfigs)) + { + $authkeyConfigs = xoops_getHandler('config')->getConfigs(new Criteria('conf_modid', $authkeyModule->getVar('mid'))); + } + if (empty($authkeyConfigsOptions) && !empty($authkeyConfigs)) + { + foreach($authkeyConfigs as $key => $config) + $authkeyConfigsOptions[$config->getVar('conf_name')] = $config->getConfOptions(); + } + } + } + $gperm_handler =& xoops_gethandler('groupperm'); $groups = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getGroups() : array(XOOPS_GROUP_ANONYMOUS); - $module_handler =& xoops_gethandler('module'); - $xoModule = $module_handler->getByDirname(_XTR_DIRNAME); - $modid = $xoModule->getVar('mid'); $op = (isset($_REQUEST['op']))?strtolower($_REQUEST['op']):''; - $fct = (isset($_REQUEST['fct']))?strtolower($_REQUEST['fct']):''; - $storyid = (isset($_REQUEST['storyid']))?intval($_REQUEST['storyid']):0; - $xcenterid = (isset($_REQUEST['xcenterid']))?intval($_REQUEST['xcenterid']):0; - $catid = (isset($_REQUEST['catid']))?intval($_REQUEST['catid']):0; - $blockid = (isset($_REQUEST['blockid']))?intval($_REQUEST['blockid']):0; - $form = (isset($_REQUEST['form']))?strtolower($_REQUEST['form']):''; - $passkey = (isset($_REQUEST['passkey']))?strtolower($_REQUEST['passkey']):''; $mode = (isset($_REQUEST['mode']))?strtolower($_REQUEST['mode']):_XTR_PERM_MODE_VIEW; - $language = (isset($_REQUEST['language']))?($_REQUEST['language']):$GLOBALS['xoopsConfig']['language']; - $module_handler =& xoops_gethandler('module'); - $criteria = new CriteriaCompo(new Criteria('dirname', 'xlanguage')); - $criteria->add(new Criteria('isactive', true)); - if ($module_handler->getCount($criteria)>0) - $GLOBALS['multilingual']=true; - else - $GLOBALS['multilingual']=false; ?> \ No newline at end of file Modified: XoopsModules/authkey/trunk/modules/authkey/include/functions.php =================================================================== --- XoopsModules/authkey/trunk/modules/authkey/include/functions.php 2018-06-09 06:29:01 UTC (rev 13362) +++ XoopsModules/authkey/trunk/modules/authkey/include/functions.php 2018-06-22 17:54:49 UTC (rev 13363) @@ -1,28 +1,315 @@ <?php +/** + * Authkey API Authentication Keys for xoops.org + * + * 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 (c) 2000-2019 Chronolabs Cooperative (8Bit.snails.email) + * @license GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html) + * @package authkey + * @since 1.0.7 + * @author Simon Antony Roberts <wis...@us...> + * @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/authkey + */ -/* -Module: Xcenter -Version: 2.01 +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . 'xcp' . DIRECTORY_SEPARATOR . 'xcp.class.php'; -Description: Multilingual Content Module with tags and lists with search functions -Author: Written by Simon Roberts aka. Wishcraft (si...@ch...) +if (!function_exists("checkEmail")) { + /** + * checkEmail() + * + * @param mixed $email + * @param mixed $antispam + * @return bool|mixed + */ + function checkEmail($email, $antispam = false) + { + if (!$email || !preg_match('/^[^@]{1,64}@[^@]{1,255}$/', $email)) { + return false; + } + $email_array = explode('@', $email); + $local_array = explode('.', $email_array[0]); + $local_arrayCount = count($local_array); + for ($i = 0; $i < $local_arrayCount; ++$i) { + if (!preg_match("/^(([A-Za-z0-9!#$%&'*+\/\=?^_`{|}~-][A-Za-z0-9!#$%&'*+\/\=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$/", $local_array[$i])) { + return false; + } + } + if (!preg_match("/^\[?[0-9\.]+\]?$/", $email_array[1])) { + $domain_array = explode('.', $email_array[1]); + if (count($domain_array) < 2) { + return false; // Not enough parts to domain + } + for ($i = 0; $i < count($domain_array); ++$i) { + if (!preg_match("/^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$/", $domain_array[$i])) { + return false; + } + } + } + if ($antispam) { + $email = str_replace('@', ' at ', $email); + $email = str_replace('.', ' dot ', $email); + } + + return $email; + } +} -Owner: Chronolabs +function authkey_getAuthKey($minlen = 3, $maxlen = 6, $minseg = 4, $maxseg = 7) +{ + $len = mt_rand($minlen, $maxlen); + $seg = mt_rand($minseg, $maxseg); + $key = ''; + for($i=1;$i<=$seg;$i++) + { + $xcp = new xcp(NULL, mt_rand(0, 255), $len); + $key .= $xcp->calc(mt_rand(-microtime(true) * time(), microtime(true) * time()) . XOOPS_DB_PASS); + if ($i<$seg) + $key .= '-'; + } + return $key; +} -License: See /docs - GPL 2.0 -*/ +function authkey_load_config() +{ + global $xoopsModuleConfig; + static $moduleConfig; + + if (isset($moduleConfig)) { + return $moduleConfig; + } + + if (isset($GLOBALS["xoopsModule"]) && is_object($GLOBALS["xoopsModule"]) && $GLOBALS["xoopsModule"]->getVar("dirname", "n") == "authkey") { + if (!empty($GLOBALS["xoopsModuleConfig"])) { + $moduleConfig = $GLOBALS["xoopsModuleConfig"]; + } else { + return null; + } + } else { + $module_handler =& xoops_gethandler('module'); + $module = $module_handler->getByDirname("authkey"); + + $config_handler =& xoops_gethandler('config'); + $criteria = new CriteriaCompo(new Criteria('conf_modid', $module->getVar('mid'))); + $configs = $config_handler->getConfigs($criteria); + foreach (array_keys($configs) as $i) { + $moduleConfig[$configs[$i]->getVar('conf_name')] = $configs[$i]->getConfValueForOutput(); + } + unset($configs); + } + if ($customConfig = @include XOOPS_ROOT_PATH . "/modules/authkey/include/plugin.php") { + $moduleConfig = array_merge($moduleConfig, $customConfig); + } + + return $moduleConfig; +} - function xcenter_getpostinglocal() { - if (strpos($_SERVER['PHP_SELF'], '/admin/index.php')==0) - return '/manage.php'; - else - return '/admin/index.php'; - } + +if (!function_exists("authkeyGetIP")) { + + /* function whitelistGetIP() + * + * get the True IPv4/IPv6 address of the client using the API + * @author Simon Roberts (Chronolabs) si...@la... + * + * @param boolean $asString Whether to return an address or network long integer + * + * @return mixed + */ + function authkeyGetIP($asString = true){ + // Gets the proxy ip sent by the user + $proxy_ip = ''; + if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { + $proxy_ip = $_SERVER['HTTP_X_FORWARDED_FOR']; + } else + if (!empty($_SERVER['HTTP_X_FORWARDED'])) { + $proxy_ip = $_SERVER['HTTP_X_FORWARDED']; + } else + if (! empty($_SERVER['HTTP_FORWARDED_FOR'])) { + $proxy_ip = $_SERVER['HTTP_FORWARDED_FOR']; + } else + if (!empty($_SERVER['HTTP_FORWARDED'])) { + $proxy_ip = $_SERVER['HTTP_FORWARDED']; + } else + if (!empty($_SERVER['HTTP_VIA'])) { + $proxy_ip = $_SERVER['HTTP_VIA']; + } else + if (!empty($_SERVER['HTTP_X_COMING_FROM'])) { + $proxy_ip = $_SERVER['HTTP_X_COMING_FROM']; + } else + if (!empty($_SERVER['HTTP_COMING_FROM'])) { + $proxy_ip = $_SERVER['HTTP_COMING_FROM']; + } + if (!empty($proxy_ip) && $is_ip = preg_match('/^([0-9]{1,3}.){3,3}[0-9]{1,3}/', $proxy_ip, $regs) && count($regs) > 0) { + $the_IP = $regs[0]; + } else { + $the_IP = $_SERVER['REMOTE_ADDR']; + } + + $the_IP = ($asString) ? $the_IP : ip2long($the_IP); + return $the_IP; + } +} + + +if (!function_exists("getURIData")) { + + /* function yonkURIData() + * + * Get a supporting domain system for the API + * @author Simon Roberts (Chronolabs) si...@la... + * + * @return float() + */ + function getURIData($uri = '', $timeout = 25, $connectout = 25, $post = array(), $headers = array()) + { + if (!function_exists("curl_init")) + { + die("Install PHP Curl Extension ie: $ sudo apt-get install php-curl -y"); + } + $GLOBALS['php-curl'][md5($uri)] = array(); + if (!$btt = curl_init($uri)) { + return false; + } + if (count($post)==0 || empty($post)) + curl_setopt($btt, CURLOPT_POST, false); + else { + $uploadfile = false; + foreach($post as $field => $value) + if (substr($value , 0, 1) == '@' && !file_exists(substr($value , 1, strlen($value) - 1))) + unset($post[$field]); + else + $uploadfile = true; + curl_setopt($btt, CURLOPT_POST, true); + curl_setopt($btt, CURLOPT_POSTFIELDS, http_build_query($post)); + + if (!empty($headers)) + foreach($headers as $key => $value) + if ($uploadfile==true && substr($value, 0, strlen('Content-Type:')) == 'Content-Type:') + unset($headers[$key]); + if ($uploadfile==true) + $headers[] = 'Content-Type: multipart/form-data'; + } + if (count($headers)==0 || empty($headers)) + curl_setopt($btt, CURLOPT_HEADER, false); + else { + curl_setopt($btt, CURLOPT_HEADER, true); + curl_setopt($btt, CURLOPT_HTTPHEADER, $headers); + } + curl_setopt($btt, CURLOPT_CONNECTTIMEOUT, $connectout); + curl_setopt($btt, CURLOPT_TIMEOUT, $timeout); + curl_setopt($btt, CURLOPT_RETURNTRANSFER, true); + curl_setopt($btt, CURLOPT_VERBOSE, false); + curl_setopt($btt, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($btt, CURLOPT_SSL_VERIFYPEER, false); + $data = curl_exec($btt); + $GLOBALS['php-curl'][md5($uri)]['http']['posts'] = $post; + $GLOBALS['php-curl'][md5($uri)]['http']['headers'] = $headers; + $GLOBALS['php-curl'][md5($uri)]['http']['code'] = curl_getinfo($btt, CURLINFO_HTTP_CODE); + $GLOBALS['php-curl'][md5($uri)]['header']['size'] = curl_getinfo($btt, CURLINFO_HEADER_SIZE); + $GLOBALS['php-curl'][md5($uri)]['header']['value'] = curl_getinfo($btt, CURLINFO_HEADER_OUT); + $GLOBALS['php-curl'][md5($uri)]['size']['download'] = curl_getinfo($btt, CURLINFO_SIZE_DOWNLOAD); + $GLOBALS['php-curl'][md5($uri)]['size']['upload'] = curl_getinfo($btt, CURLINFO_SIZE_UPLOAD); + $GLOBALS['php-curl'][md5($uri)]['content']['length']['download'] = curl_getinfo($btt, CURLINFO_CONTENT_LENGTH_DOWNLOAD); + $GLOBALS['php-curl'][md5($uri)]['content']['length']['upload'] = curl_getinfo($btt, CURLINFO_CONTENT_LENGTH_UPLOAD); + $GLOBALS['php-curl'][md5($uri)]['content']['type'] = curl_getinfo($btt, CURLINFO_CONTENT_TYPE); + curl_close($btt); + return $data; + } +} + +if (!class_exists("XmlDomConstruct")) { + /** + * class XmlDomConstruct + * + * Extends the DOMDocument to implement personal (utility) methods. + * + * @author Simon Roberts (Chronolabs) si...@la... + */ + class XmlDomConstruct extends DOMDocument { + + /** + * Constructs elements and texts from an array or string. + * The array can contain an element's name in the index part + * and an element's text in the value part. + * + * It can also creates an xml with the same element tagName on the same + * level. + * + * ex: + * <nodes> + * <node>text</node> + * <node> + * <field>hello</field> + * <field>world</field> + * </node> + * </nodes> + * + * Array should then look like: + * + * Array ( + * "nodes" => Array ( + * "node" => Array ( + * 0 => "text" + * 1 => Array ( + * "field" => Array ( + * 0 => "hello" + * 1 => "world" + * ) + * ) + * ) + * ) + * ) + * + * @param mixed $mixed An array or string. + * + * @param DOMElement[optional] $domElement Then element + * from where the array will be construct to. + * + * @author Simon Roberts (Chronolabs) si...@la... + * + */ + public function fromMixed($mixed, DOMElement $domElement = null) { + + $domElement = is_null($domElement) ? $this : $domElement; + + if (is_array($mixed)) { + foreach( $mixed as $index => $mixedElement ) { + + if ( is_int($index) ) { + if ( $index == 0 ) { + $node = $domElement; + } else { + $node = $this->createElement($domElement->tagName); + $domElement->parentNode->appendChild($node); + } + } + + else { + $node = $this->createElement($index); + $domElement->appendChild($node); + } + + $this->fromMixed($mixedElement, $node); + + } + } else { + $domElement->appendChild($this->createTextNode($mixed)); + } + + } + + } +} - function xcenter_checkperm($op, $fct, $storyid, $catid, $blockid, $securitymode) { $gperm_handler =& xoops_gethandler('groupperm'); @@ -249,10 +536,10 @@ { $datab = urldecode(strtolower($datab)); $datab = urlencode($datab); - $datab = str_replace(urlencode('\xE6'),'ae',$datab); - $datab = str_replace(urlencode('\xF8'),'oe',$datab); - $datab = str_replace(urlencode('\xE5'),'aa',$datab); - $replacement_chars = array(' ', '|', '=', '\\', '+', '-', '_', '{', '}', ']', '[', '\'', '"', ';', ':', '?', '>', '<', '.', ',', ')', '(', '*', '&', '^', '%', '$', '#', '@', '!', '`', '~', '\xA0', '', '\xA1', '\xA6', '\xA7', '\xA8', '\xA9', '\xAA', '\xAB', '\xAC', '\xAE', '\xAD', '\xAF', '\xB0', '\xB1', '\xB2', '\xB3', '\xB4', '\xB5', '\xB6', '\xB7', '\xB8', '\xB9', '\xBA', '\xBB', '\xBC', '\xBD', '\xBE', '\xBF'); + $datab = str_replace(urlencode('�'),'ae',$datab); + $datab = str_replace(urlencode('�'),'oe',$datab); + $datab = str_replace(urlencode('�'),'aa',$datab); + $replacement_chars = array(' ', '|', '=', '\\', '+', '-', '_', '{', '}', ']', '[', '\'', '"', ';', ':', '?', '>', '<', '.', ',', ')', '(', '*', '&', '^', '%', '$', '#', '@', '!', '`', '~', '�', '', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�', '�'); $return_data = str_replace($replacement_chars,$char,urldecode($datab)); #print $return_data."<BR><BR>"; switch ($char) { Modified: XoopsModules/authkey/trunk/modules/authkey/index.php =================================================================== --- XoopsModules/authkey/trunk/modules/authkey/index.php 2018-06-09 06:29:01 UTC (rev 13362) +++ XoopsModules/authkey/trunk/modules/authkey/index.php 2018-06-22 17:54:49 UTC (rev 13363) @@ -1,19 +1,23 @@ <?php +/** + * Authkey API Authentication Keys for xoops.org + * + * 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 (c) 2000-2019 Chronolabs Cooperative (8Bit.snails.email) + * @license GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html) + * @package authkey + * @since 1.0.7 + * @author Simon Antony Roberts <wis...@us...> + * @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/authkey + */ -/* -Module: Xcenter -Version: 2.01 - -Description: Multilingual Content Module with tags and lists with search functions - -Author: Written by Simon Roberts aka. Wishcraft (si...@ch...) - -Owner: Chronolabs - -License: See /docs - GPL 2.0 -*/ - include ('header.php'); $xoopsOption['template_main'] = _XTR_TEMPLATE_INDEX; Modified: XoopsModules/authkey/trunk/modules/authkey/language/english/modinfo.php =================================================================== --- XoopsModules/authkey/trunk/modules/authkey/language/english/modinfo.php 2018-06-09 06:29:01 UTC (rev 13362) +++ XoopsModules/authkey/trunk/modules/authkey/language/english/modinfo.php 2018-06-22 17:54:49 UTC (rev 13363) @@ -19,6 +19,9 @@ + + // Email Subjects + define('_MI_AUTHKEY_SUBJECT_ISSUINGKEY','Xoops.org ~ Issuing API Key: /?xoopskey=%s'); // MENUs define('_MI_AUTHKEY_ADMENU1','Manage Content'); Modified: XoopsModules/authkey/trunk/modules/authkey/xoops_version.php =================================================================== --- XoopsModules/authkey/trunk/modules/authkey/xoops_version.php 2018-06-09 06:29:01 UTC (rev 13362) +++ XoopsModules/authkey/trunk/modules/authkey/xoops_version.php 2018-06-22 17:54:49 UTC (rev 13363) @@ -150,8 +150,51 @@ "options" => "", "template" => "authkey_over.html", ); - + $i++; +$modversion['config'][$i]['name'] = 'auto-generate'; +$modversion['config'][$i]['title'] = "_MI_AUTHKEY_AUTOGENERATED"; +$modversion['config'][$i]['description'] = "_MI_AUTHKEY_AUTOGENERATED_DESC"; +$modversion['config'][$i]['formtype'] = 'yesno'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = true; + +$i++; +$modversion['config'][$i]['name'] = 'auto-generate-seconds'; +$modversion['config'][$i]['title'] = "_MI_AUTHKEY_AUTOGENERATED_SECONDS"; +$modversion['config'][$i]['description'] = "_MI_AUTHKEY_AUTOGENERATED_SECONDS_DESC"; +$modversion['config'][$i]['formtype'] = 'select'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = (mt_rand(1,9)*5)*60; +$modversion['config'][$i]['options'] = array((5*60) => '5 minutes', (10*60) => '10 minutes', (15*60) => '15 minutes', (20*60) => '20 minutes', (25*60) => '25 minutes', (30*60) => '30 minutes', (35*60) => '35 minutes', (40*60) => '40 minutes', (45*60) => '45 minutes', (50*60) => '50 minutes', (55*60) => '55 minutes'); + +$i++; +$modversion['config'][$i]['name'] = 'number-auto-generated'; +$modversion['config'][$i]['title'] = "_MI_AUTHKEY_NUMBER_AUTOGENERATED"; +$modversion['config'][$i]['description'] = "_MI_AUTHKEY_NUMBER_AUTOGENERATED_DESC"; +$modversion['config'][$i]['formtype'] = 'int'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = mt_rand(13,69); + +$i++; +$modversion['config'][$i]['name'] = 'polling-seconds'; +$modversion['config'][$i]['title'] = "_MI_AUTHKEY_POLLING_SECONDS"; +$modversion['config'][$i]['description'] = "_MI_AUTHKEY_POLLING_SECONDS_DESC"; +$modversion['config'][$i]['formtype'] = 'select'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = (mt_rand(1,4)*5)*60; +$modversion['config'][$i]['options'] = array((5*60) => '5 minutes', (10*60) => '10 minutes', (15*60) => '15 minutes', (20*60) => '20 minutes', (25*60) => '25 minutes', (30*60) => '30 minutes', (35*60) => '35 minutes', (40*60) => '40 minutes', (45*60) => '45 minutes', (50*60) => '50 minutes', (55*60) => '55 minutes'); + +$i++; +$modversion['config'][$i]['name'] = 'preload-seconds'; +$modversion['config'][$i]['title'] = "_MI_AUTHKEY_PRELOAD_SECONDS"; +$modversion['config'][$i]['description'] = "_MI_AUTHKEY_PRELOAD_SECONDS_DESC"; +$modversion['config'][$i]['formtype'] = 'select'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = (mt_rand(1,4)*5)*60; +$modversion['config'][$i]['options'] = array((5*60) => '5 minutes', (10*60) => '10 minutes', (15*60) => '15 minutes', (20*60) => '20 minutes', (25*60) => '25 minutes', (30*60) => '30 minutes', (35*60) => '35 minutes', (40*60) => '40 minutes', (45*60) => '45 minutes', (50*60) => '50 minutes', (55*60) => '55 minutes'); + +$i++; $modversion['config'][$i]['name'] = 'limited'; $modversion['config'][$i]['title'] = "_MI_AUTHKEY_LIMITED"; $modversion['config'][$i]['description'] = "_MI_AUTHKEY_LIMITED_DESC"; @@ -216,6 +259,45 @@ $modversion['config'][$i]['default'] = 350; $i++; +$modversion['config'][$i]['name'] = 'purchase-day'; +$modversion['config'][$i]['title'] = "_MI_AUTHKEY_PURCHASE_DAY"; +$modversion['config'][$i]['description'] = "_MI_AUTHKEY_PURCHASE_DAY_DESC"; +$modversion['config'][$i]['formtype'] = 'int'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 350 * 24; + +$i++; +$modversion['config'][$i]['name'] = 'purchase-week'; +$modversion['config'][$i]['title'] = "_MI_AUTHKEY_PURCHASE_WEEK"; +$modversion['config'][$i]['description'] = "_MI_AUTHKEY_PURCHASE_WEEK_DESC"; +$modversion['config'][$i]['formtype'] = 'int'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 350 * 24 * 7; + +$i++; +$modversion['config'][$i]['name'] = 'purchase-month'; +$modversion['config'][$i]['title'] = "_MI_AUTHKEY_PURCHASE_MONTH"; +$modversion['config'][$i]['description'] = "_MI_AUTHKEY_PURCHASE_MONTH_DESC"; +$modversion['config'][$i]['formtype'] = 'int'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 350 * 24 * 7 * 4; + +$i++; +$modversion['config'][$i]['name'] = 'purchase-quarter'; +$modversion['config'][$i]['title'] = "_MI_AUTHKEY_PURCHASE_QUARTER"; +$modversion['config'][$i]['description'] = "_MI_AUTHKEY_PURCHASE_QUARTER_DESC"; +$modversion['config'][$i]['formtype'] = 'int'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 350 * 24 * 7 * 4 * 3; + +$i++; +$modversion['config'][$i]['name'] = 'purchase-year'; +$modversion['config'][$i]['title'] = "_MI_AUTHKEY_PURCHASE_YEAR"; +$modversion['config'][$i]['description'] = "_MI_AUTHKEY_PURCHASE_YEAR_DESC"; +$modversion['config'][$i]['formtype'] = 'int'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 350 * 24 * 7 * 4 * 12; +$i++; $modversion['config'][$i]['name'] = 'purchase-price'; $modversion['config'][$i]['title'] = "_MI_AUTHKEY_PURCHASE_PRICE"; $modversion['config'][$i]['description'] = "_MI_AUTHKEY_PURCHASE_PRICE_DESC"; @@ -245,7 +327,7 @@ $modversion['config'][$i]['description'] = "_MI_AUTHKEY_BASEURL_DESC"; $modversion['config'][$i]['formtype'] = 'text'; $modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = 'xcenter'; +$modversion['config'][$i]['default'] = 'xoopskeys'; $i++; $modversion['config'][$i]['name'] = 'endofurl'; |