mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-04-29 18:59:21 +02:00
ZEOTSS integration. cURL validation for paypal and ZEOTSS, register users on ZEOTS server.
This commit is contained in:
parent
e52fb6a2ef
commit
480f528e38
@ -78,7 +78,7 @@ if (isset($changelogs) && !empty($changelogs) && $changelogs !== false) {
|
||||
foreach ($changelogs as $changelog) {
|
||||
?>
|
||||
<tr>
|
||||
<td><b><?php echo getClock($changelog['time'], true, true); ?></b><br><?php echo $changelog['text']; ?></td>
|
||||
<td><b><?php echo getClock((isset($changelog['time'])) ? $changelog['time'] : 0, true, true); ?></b><br><?php echo $changelog['text']; ?></td>
|
||||
<?php
|
||||
if (user_logged_in())
|
||||
if (is_admin($user_data)) {
|
||||
|
10
config.php
10
config.php
@ -371,7 +371,15 @@
|
||||
$config['api'] = array(
|
||||
'debug' => false,
|
||||
);
|
||||
|
||||
// Use Znote's External Open Tibia Services Server
|
||||
// Currently in Alpha and is pretty useless, but will contain paypal blacklist etc in future.
|
||||
// You can use the official server: http://zeotss.znote.eu/
|
||||
// Or host your own private one, here is the code: https://github.com/Znote/ZEOTSS
|
||||
$config['zeotss'] = array(
|
||||
'enabled' => true,
|
||||
'visitors' => true,
|
||||
'server' => "http://zeotss.znote.eu/"
|
||||
);
|
||||
// Don't touch this unless you know what you are doing. (modifying this(key value) also requires modifications in OT files /XML/commands.xml).
|
||||
$config['ingame_positions'] = array(
|
||||
1 => 'Player',
|
||||
|
@ -12,6 +12,12 @@ $accQueriesData = array();
|
||||
session_start();
|
||||
ob_start();
|
||||
require 'config.php';
|
||||
|
||||
if ($config['paypal']['enabled'] || $config['zeotss']['enabled']) {
|
||||
$curlcheck = function_exists('curl_version') ? true : false;
|
||||
if (!$curlcheck) die("php cURL is not enabled. It is required to for paypal and ZEOTSS services.<br>1. Find your php.ini file.<br>2. Uncomment extension=php_curl<br>Restart web server.<br><br><b>If you don't want this then disable zeotss and paypal in config.php.</b>");
|
||||
}
|
||||
|
||||
require 'database/connect.php';
|
||||
require 'function/general.php';
|
||||
require 'function/users.php';
|
||||
|
@ -370,4 +370,29 @@ if (!empty($_POST['selected_comment'])) {
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
include 'layout/overall/footer.php'; ?>
|
||||
include 'layout/overall/footer.php';
|
||||
// ZEOTSS: Register visitor
|
||||
if ($config['zeotss']['enabled'] && $config['zeotss']['visitors']) {
|
||||
$curl_connection = curl_init($config['zeotss']['server']."modules/visitor/registervisitor.php");
|
||||
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 1);
|
||||
curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
|
||||
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 0);
|
||||
$post_string = "longip=".ip2long($_SERVER['REMOTE_ADDR'])."®ister=1";
|
||||
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
|
||||
$result = curl_exec($curl_connection);
|
||||
data_dump(false, array($result), "CURL DATA");
|
||||
curl_close($curl_connection);
|
||||
|
||||
// Check if site is registered on ZEOTSS and can use its utilities:
|
||||
$result = json_decode($result);
|
||||
if ($result->data->exist === false) {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
alert("Error: ZEOTSS site validation failed, have you registered? Register at: <?php echo $config['zeotss']['server']; ?>");
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user