<?php
/* --------------------------------------------------------------
Yoochoose GmbH
http://www.yoochoose.com
Copyright (c) 2011 Yoochoose GmbH
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
-------------------------------------------------------------- */
defined('_VALID_XTC') or die('Direct Access to this location is not allowed.');
///
/// Check frame for Yoochoose configuration module.
/// It is included to /admin/yoochoose.php
///
echo '<div style="padding: 20px 40px 30px 40px;" class="yoo-image6-large">';
define('AVAILABLE', '<span style="color:green; font-weight:bold;">available</span>');
define('SUCCESSFUL', '<span style="color:green; font-weight:bold;">successful</span>');
define('UNAVAILABLE', '<span style="color:red; font-weight:bold;">unavailable</span>');
define('FAILED', '<span style="color:red; font-weight:bold;">failed</span>');
echo '<h2>YOOCHOOSE REQUIREMENTS CHECKING</h2>';
echo '<h3>PHP Configuration</h3>';
echo '<p>';
echo 'Your PHP Version (5.1 required, 5.2 or higher recommended): <b>'.phpversion().'</b><br>';
echo 'Function json_decode: '.(function_exists('json_decode') ? AVAILABLE : UNAVAILABLE).'<br>';
echo 'Module curl: '.(in_array('curl', get_loaded_extensions()) ? AVAILABLE : UNAVAILABLE).'<br>';
echo 'Object DateTime: '.(class_exists('DateTime') ? AVAILABLE : UNAVAILABLE).'<br>';
echo '<h3>Connectivity</h3>';
echo '<p>';
$url = getMeUrl();
curlSomeAdress("Requesting myself as [$url]", $url);
$url = 'http://google.com';
curlSomeAdress("Requesting Google as [$url]", $url);
$url = 'http://config.yoochoose.net';
curlSomeAdress("Requesting YOOCHOOSE registration server [$url]", $url);
$url = 'https://config.yoochoose.net';
curlSomeAdress("Requesting YOOCHOOSE registration server over SSL [$url]", $url);
echo '<h3>Authentication</h3>';
echo '<p>';
if (!isset($_POST["id"])) {
echo '<form method="POST" action="yoochoose.php?page=check">';
echo 'Enter your customer ID <input name="id" value="'.htmlentities(@$_POST["id"]).'"> ';
echo ' and license key <input name="key" value="'.htmlentities(@$_POST["key"]).'">.';
echo ' <input type="submit" value=">>">';
echo '</form>';
} else {
$url = 'http://reco.yoochoose.net/ebl/recommendation/'.$_POST["id"].'/also_purchased.json';
curlSomeAdress("Requesting YOOCHOOSE recommendations [$url]", $url);
$url = 'https://config.yoochoose.net/rest/'.$_POST["id"].'/license.json';
curlSomeAdress("Requesting YOOCHOOSE license [$url]", $url, $_POST["id"], $_POST["key"]);
$url = 'https://config.yoochoose.net/rest/'.$_POST["id"].'/counter/summary.json';
curlSomeAdress("Requesting YOOCHOOSE statistic [$url]", $url, $_POST["id"], $_POST["key"]);
}
echo '</div>';
/////////////////////////////// SOME FUNCTIONS
function getMeUrl() {
$httpsStr = @$_SERVER['HTTPS'];
$a = (@$httpsStr && $httpsStr != 'off') ? 'https' : 'http';
$b = $_SERVER['SERVER_NAME'];
$c = $_SERVER['SERVER_PORT'];
return $a."://".$b.":".$c;
}
function curlSomeAdress($name, $url, $user='', $password='') {
$options = array(
CURLOPT_URL => $url,
CURLOPT_HEADER => TRUE,
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_TIMEOUT => 4,
CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
CURLOPT_SSL_VERIFYPEER => FALSE,
CURLOPT_FAILONERROR => TRUE
);
if ($user) {
$options[CURLOPT_USERPWD] = "$user:$password";
}
$ch = curl_init();
if (!$ch) {
echo '<b>failed</b>. Unable to initialize curl. Error code: '.$n.' Error Message: '.$m;
}
curl_setopt_array($ch, $options);
echo $name.': ';
$scs = curl_exec($ch);
$n = curl_errno($ch);
$m = curl_error($ch);
if ($scs) {
echo SUCCESSFUL;
} else {
echo FAILED." $n: $m";
}
echo '</br>';
curl_close($ch);
}
?>| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| images/ | 2013-11-12 20:55 | 472.79 KB | 76129f60960:kunden | dxwrx-rx-r | |
| activate.php | 2013-11-12 20:53 | 3.12 KB | 76129f60960:kunden | -xw-x----- | |
| check_nested.php | 2013-11-12 20:53 | 4.33 KB | 76129f60960:kunden | -xw-x----- | |
| config.php | 2013-11-12 20:53 | 10.77 KB | 76129f60960:kunden | -xw-x----- | |
| contact_de.php | 2013-11-12 20:53 | 1.75 KB | 76129f60960:kunden | -xw-x----- | |
| contact_en.php | 2013-11-12 20:53 | 1.65 KB | 76129f60960:kunden | -xw-x----- | |
| counters.php | 2013-11-12 20:53 | 3.36 KB | 76129f60960:kunden | -xw-x----- | |
| faq_de.php | 2013-11-12 20:53 | 4.3 KB | 76129f60960:kunden | -xw-x----- | |
| faq_en.php | 2013-11-12 20:53 | 1.67 KB | 76129f60960:kunden | -xw-x----- | |
| info_de.php | 2013-11-12 20:53 | 2.82 KB | 76129f60960:kunden | -xw-x----- | |
| info_en.php | 2013-11-12 20:53 | 2.61 KB | 76129f60960:kunden | -xw-x----- | |
| migration.sql | 2013-11-12 20:53 | 1.2 KB | 76129f60960:kunden | -xw-x----- | |
| models.php | 2013-11-12 20:53 | 13.72 KB | 76129f60960:kunden | -xw-x----- | |
| sprintf.js | 2013-11-12 20:53 | 3.8 KB | 76129f60960:kunden | -xw-x----- | |
| usage_data_common.php | 2013-11-12 20:53 | 9.9 KB | 76129f60960:kunden | -xw-x----- | |
| usage_data_tools.php | 2013-11-12 20:53 | 19.11 KB | 76129f60960:kunden | -xw-x----- | |
| usage_data_upload.php | 2013-11-12 20:53 | 10.93 KB | 76129f60960:kunden | -xw-x----- | |
| utils.php | 2013-11-12 20:53 | 4.78 KB | 76129f60960:kunden | -xw-x----- | |
| yoo_lang_english.php | 2013-11-12 20:53 | 9.1 KB | 76129f60960:kunden | -xw-x----- | |
| yoo_lang_german.php | 2013-11-12 20:53 | 9.61 KB | 76129f60960:kunden | -xw-x----- | |
| yooinit.php | 2013-11-12 20:53 | 1.54 KB | 76129f60960:kunden | -xw-x----- | |