diff --git a/dev/quux.php b/dev/quux.php
index b04a220..9d55faa 100644
--- a/dev/quux.php
+++ b/dev/quux.php
@@ -1,162 +1,163 @@
assign('PAGE_TITLE', "Quux [$case]");
+ include('controllers/header.php');
+
switch ($case) {
case 'YubiCloud':
require_once('Auth/Yubico.php');
echo '
YubiKey ';
if (!array_key_exists('YubiCloud', $Config)) {
message_die(GENERAL_ERROR, "YubiCloud authentication not configured. Add \$Config['YubiCloud']['ClientID'] and \$Config['YubiCloud']['SecretKey'] to your config.");
}
if (!$key = $_GET['OTP']) {
message_die(GENERAL_ERROR, "Please add in URL ?OTP=, then put your cursor at right of the = and press your YubiKey button");
}
$yubi = new Auth_Yubico($Config['YubiCloud']['ClientID'], $Config['YubiCloud']['SecretKey']);
if (!$data = $yubi->parsePasswordOTP($key)) {
message_die(GENERAL_ERROR, "This is not an YubiKey OTP.");
}
$prefix = $data['prefix'];
$auth = $yubi->verify($key);
if (@PEAR::isError($auth)) {
if ($auth->getMessage() == 'REPLAYED_OTP') {
message_die("This OTP has already been used.");
}
message_die(HACK_ERROR, "Authentication failed: " . $auth->getMessage() . "
Debug: " . $yubi->getLastResponse() . "
");
} else {
print "You are authenticated!
";
}
break;
case 'PointPolarZ':
echo "PointPolarZ ";
$point = PointPolarZ::fromString("(48, 30°, 3)");
printf("Secteur T%dC%d", $point->getSection(), $point->z);
dprint_r($point);
break;
case 'index_scenes':
$time[] = microtime();
require_once('includes/geo/scene.php');
require_once('includes/geo/sceneindex.php');
$cache = Cache::load();
if ($index = $cache->get('GeoSceneIndex')) {
$index = unserialize($index);
} else {
$index = GeoSceneIndex::Load(SCENE_DIR);
$cache->set('GeoSceneIndex', serialize($index));
}
$time[] = microtime();
echo 'GeoSceneIndex ';
dprint_r($index);
echo 'Time (ms) ';
dprint_r(1000 * ($time[1] - $time[0]));
dprint_r($time);
break;
case 'travel':
require_once('includes/travel/travel.php');
$travel = Travel::load();
dieprint_r($travel);
break;
case 'spherical':
require_once('includes/geo/galaxy.php');
echo 'Spherical coordinates test ';
echo '';
echo "Name Type Cartesian coords Spherical I Spherical II Pencil coordinates ";
$objects = GeoGalaxy::getCoordinates();
foreach ($objects as $row) {
echo "$row[0] $row[1] $row[2] ";
$pt = $row[2];
echo '(', implode(', ', $pt->toSpherical()), ') ';
echo '(', implode(', ', $pt->toSphericalAlternative()), ') ';
$pt->translate(500, 300, 200, 2);
echo '', $pt, ' ';
echo ' ';
}
echo '
';
break;
case 'travel':
require_once('includes/travel/travel.php');
require_once('includes/travel/place.php');
$cache = Cache::load();
$travel = $cache->get('zed_travel');
if ($travel == '') {
$travel_nocached = new Travel();
$travel_nocached->load_xml("content/travel.xml");
$cache->set('zed_travel', serialize($travel_nocached));
} else {
$travel = unserialize($travel);
}
dieprint_r($travel);
break;
case 'perso.create.notify':
$testperso = Perso::get(4733);
$message = new Message();
$message->from = 0;
$message->to = invite::who_invited(4733);
$url = get_server_url() . get_url('who', $testperso->nickname);
$message->text = sprintf(lang_get('InvitePersoCreated'), $testperso->name, $url);
$message->send();
dieprint_r($message);
break;
case 'pushdata';
echo '
/api.php/app/pushdata
';
break;
case 'thumbnail':
$content = new Content(1);
dprint_r($content);
$content->generate_thumbnail();
break;
case 'port':
echo 'Port::from_location test ';
$locations = array("B00002", "B00002123", "B00001001", "xyz: [800, 42, 220]");
foreach ($locations as $location) {
dprint_r(Port::from_location($location));
}
break;
case 'ext':
$file = 'dev/foo.tar';
echo "$file ";
echo ".tar.bz2 ";
echo preg_match('/\.tar\.bz2$/', $file);
echo ".tar ";
echo preg_match('/\.tar$/', $file);
break;
case 'app':
echo Application::from_api_key("37d839ba-f9fc-42ca-a3e8-28053e979b90")->generate_userkey();
break;
case '':
dieprint_r("No case currently selected.");
break;
}
include('controllers/footer.php');
diff --git a/skins/zed/header.tpl b/skins/zed/header.tpl
index 57a1126..dddd6da 100644
--- a/skins/zed/header.tpl
+++ b/skins/zed/header.tpl
@@ -1,68 +1,68 @@
- {$PAGE_TITLE} - {#SiteTitle#}
+ {if isset($PAGE_TITLE)}{$PAGE_TITLE} - {/if}{#SiteTitle#}
{foreach from=$PAGE_CSS item=css}
{/foreach}
{foreach from=$PAGE_JS item=js}
{/foreach}
{if $DOJO}
{if isset($DIJIT)}
{/if}
{/if}
{if isset($WAP)}
{/if}
{if isset($NOTIFY)}
{/if}
{if isset($SmartLine_STDOUT) || isset($SmartLine_STDERR)}
{include file="smartline_results.tpl"}
{/if}