Beispiel #1
0
        case 'fckstyles.xml':
            header('content-type: text/xml');
            $site->loadDefaultFilters();
            $site->display(SITE_PATH . 'core' . SLASH . 'templates' . SLASH . 'fckstyles.tpl');
            die;
    }
    /*for safety reasons, if user try to go out pages dir, go to first page*/
    if (strstr('..', $page)) {
        $oPage = $site->getFirstPage();
    } else {
        $oPage = $site->getPage($page, isConnected());
    }
}
//if page has not been found, load the extra page event
if (!$oPage) {
    $bRes = doEventAction('extrapage', array(&$page, &$site));
    if ($bRes !== true) {
        $oPage =& $bRes;
    }
}
if (!$oPage) {
    header("HTTP/1.0 404 Not Found");
    die(_('Page not found'));
}
//display the page
$site->displayPage($oPage);
setDebug('Generate page in ' . (time() + microtime() - $timestart) . ' s');
//var_dump($oGlobalEventsManager->_events);
if (DEBUG) {
    printDebug();
}
Beispiel #2
0
{
    global $STEPCOUNTER;
    printf("\nStep %d. %s\n", ++$STEPCOUNTER, sprintf($msg, $p1, $p2, $p3));
}
function info($msg, $p1 = NULL, $p2 = NULL, $p3 = NULL)
{
    printf("  %s\n", sprintf($msg, $p1, $p2, $p3));
}
define('TIMEFORMAT', 'r');
step('Authenticate');
$rackspace = new \OpenCloud\Rackspace(AUTHURL, array('username' => USERNAME, 'apiKey' => APIKEY));
step('Connect to the VolumeService');
$cbs = $rackspace->VolumeService('cloudBlockStorage', 'DFW');
step('Snapshotting volumes');
$list = $cbs->VolumeList();
while ($vol = $list->Next()) {
    info('Volume: %s [%s] size=%d', $vol->display_name, $vol->display_description, $vol->size);
    $snap = $cbs->Snapshot();
    // empty snapshot object
    info('  Creating snapshot');
    //setDebug(TRUE);
    $snap->Create(array('display_name' => $vol->Name() . 'Snapshot-' . time(), 'volume_id' => $vol->id, 'force' => TRUE));
    setDebug(FALSE);
}
step('DONE');
exit;
// callback for WaitFor
function dot($server)
{
    printf("\r\t%s %s %3d%% %s", $server->id, $server->name, $server->progress, $server->status);
}
Beispiel #3
0
<?php

require './jsave_cf.php';
setDebug("{$DATA['dbg']}");
$path = asStr($DATA, 'path');
$data = asStr($DATA, 'data');
$pure = stripslashes($data);
$json = jsave_decode($pure);
$link = jsave_put($path, $json ? $pure : '');
$read = jsave_get($path);
$DATA['json'] = $json;
$DATA['link'] = $link;
if ($debug < 3 && !empty($path)) {
    if ($debug == 2) {
        flashBack();
    }
    // emit JSON
    $DATA['read'] = $read;
    jsave_emit(json_encode($DATA));
    exit;
} else {
    // continue LOGGING
    error_log("Refresh in 3 @ {$SERV['REMOTE_ADDR']}");
    $DATA['read'] = json_decode($read);
}
### ### ### ### ### ### ###
?>
<!DOCTYPE HTML>
<html lang="en">
  <head>
    <meta charset="utf-8">
Beispiel #4
0
<?php

require './jsave_fn.php';
header('Access-Control-Allow-Origin: *');
ini_set('magic_quotes_gpc', 'off');
// does this work?
setDebug(0);
### GLOBS
$ROOT = '';
// CUSTOMIZE THIS (point anywhere on the server)
$SERV = $_SERVER;
$DOCS = "{$SERV['DOCUMENT_ROOT']}";
$SELF = "{$SERV['PHP_SELF']}";
$SAVE = empty($ROOT) ? dirname($SELF) : $ROOT;
$DATA_path_ = "{$SAVE}/data/";
$FULL_path_ = "{$DOCS}{$DATA_path_}";
$DATA = array_merge($_GET, $_POST);
jsave_safe($DATA);
Beispiel #5
0
<?php

/* ********************************************************************* *\
        MAIN SERVER
\* ********************************************************************* */
//setup session
session_start();
//setup database connection
require 'dbConfig.php';
//setup global object
$USER = new stdClass();
$PAGE = new stdClass();
//get path to a service
$service = getRoute(getUri());
//set the debug flag
$SERVERDEBUG = setDebug();
//exit with msg if path doesnt exist
if ($service == false) {
    return errorHandler('Invalid Path', 501);
}
//if path was valid, load service
require $service;
//if debug, dump server response
if ($SERVERDEBUG) {
    echo "\r\n page:";
    echo json_encode($PAGE);
    return;
}
//at the end of it all, close db
$DB->close();
/* ********************************************************************* *\
Beispiel #6
0
                    if (!empty($icon)) {
                        $icon = $db->getIconSrc($icon);
                    }
                    if (empty($icon) && isset($entry[Database::KEY_ICON])) {
                        $icon = KPHPUI::iconPath($entry[Database::KEY_ICON]);
                    }
                    $s .= '<tr><td>' . ($icon == null ? '' : '<img src="' . KPHPUI::htmlify($icon) . '" />') . '</td>';
                    $s .= '<td>' . KPHPUI::htmlify($entry[Database::KEY_TITLE]) . '</td>';
                    $url = $entry[Database::KEY_URL];
                    $protoSep = strpos($url, "://");
                    $proto = $protoSep === false ? null : substr($url, 0, $protoSep);
                    $isHttp = $proto == "http" || $proto == "https";
                    $displayed = $isHttp ? substr($url, $protoSep + 3) : $url;
                    $s .= '<td>' . ($isHttp ? '<a href="' : '<span title="') . KPHPUI::htmlify($url) . '">' . KPHPUI::htmlify(strlen($displayed) > 20 ? substr($displayed, 0, 17) . '...' : $displayed) . ($isHttp ? '</a>' : '</span>') . '</td>';
                    $s .= '<td><input type="text" class="col-sm-3 form-control selectOnFocus" value="' . KPHPUI::htmlify($entry[Database::KEY_USERNAME]) . '" /></td>';
                    $s .= '<td id="pwd_' . $uuid . '"><button type="button" class="btn btn-primary passwordLoader" data-uuid="' . $uuid . '" autocomplete="off" data-loading-text="...">' . KPHPUI::l(KPHPUI::LANG_SEE_ENTRY_LOAD) . '</button></td></tr>';
                }
                $s .= '</tbody></table>';
                $answer->set(AjaxAnswer::SUCCESS, $s);
            }
        } else {
            $answer->set(AjaxAnswer::BAD_PASSWORD);
        }
    } else {
        $answer->set(AjaxAnswer::NO_SUCH_ID);
    }
    if (KeePassPHP::$isError) {
        $answer > setDebug(KeePassPHP::$errordump);
    }
}
$answer->send();
Beispiel #7
0
// get a domain
printf("Adding raxdrg.info\n");
$domain = $dns->Domain(array('name' => 'raxdrg.info', 'ttl' => 3600, 'emailAddress' => '*****@*****.**'));
printf("Adding records\n");
$domain->AddRecord($domain->Record(array('type' => 'A', 'name' => 'raxdrg.info', 'ttl' => 600, 'data' => '50.56.174.152')));
$domain->AddRecord($domain->Record(array('type' => 'AAAA', 'name' => 'raxdrg.info', 'ttl' => 600, 'data' => '2001:4800:780e:0510:a325:deec:ff04:48a8')));
$domain->AddRecord($domain->Record(array('type' => 'MX', 'name' => 'raxdrg.info', 'ttl' => 600, 'data' => 'mx1.xlerb.com', 'priority' => 10)));
$domain->AddRecord($domain->Record(array('type' => 'MX', 'name' => 'raxdrg.info', 'ttl' => 600, 'data' => 'mx2.xlerb.com', 'priority' => 20)));
$domain->AddRecord($domain->Record(array('type' => 'CNAME', 'name' => 'www.raxdrg.info', 'ttl' => 600, 'data' => 'rack2.broadpool.net', 'comment' => 'Added ' . date('Y-m-d H:i:s'))));
printf("Adding Subdomain foo\n");
$domain->AddSubdomain($domain->Subdomain(array('name' => 'foo.raxdrg.info', 'ttl' => 600, 'emailAddress' => '*****@*****.**')));
printf("Adding Subdomain bar\n");
$domain->AddSubdomain($domain->Subdomain(array('name' => 'bar.raxdrg.info', 'ttl' => 600, 'emailAddress' => '*****@*****.**')));
printf("Creating everything\n");
//setDebug(True);
$resp = $domain->Create();
setDebug(False);
$resp->WaitFor("COMPLETED", 300, 'showme', 1);
exit;
// callback for WaitFor method
function showme($obj)
{
    printf("%s %s %s\n", date('H:i:s'), $obj->Status(), $obj->Name());
    if ($obj->Status() == 'ERROR') {
        printf("\tError code [%d] message [%s]\n\tDetails: %s\n", $obj->error->code, $obj->error->message, $obj->error->details);
    } else {
        if ($obj->Status() == 'COMPLETED') {
            printf("Done\n");
        }
    }
}