Пример #1
0
function dbUtil($type, $paramList = null)
{
    global $retArray;
    try {
        $mongo = new MongoClient('mongodb://nb403:27127/admin:admin');
        $db = $mongo->adtestClassicBugs;
        if ($type == SaveCategory) {
            saveCategory($db, $paramList);
        } elseif ($type == ReadCategory) {
            return readCateList($db);
        } elseif ($type == SaveInputContent) {
            saveInputContent($db, $paramList);
        } elseif ($type == ReadAllContents) {
            return listContent($db);
        } elseif ($type == ReadSpecificContent) {
            return listContent2($db, $paramList);
        } elseif ($type == UpdateSpecificContent) {
            updateInfo($db, $paramList);
        }
    } catch (MongoConnectionException $e) {
        $retArray = array("1", $e->getMessage());
    }
}
Пример #2
0
function printDir($request)
{
    $dir = BASE_PATH . $request;
    $uri = BASE_URI . $request;
    $html = "";
    if ($dh = opendir($dir)) {
        while (($file = readdir($dh)) !== false) {
            if (interestingFile($file, $bla)) {
                if (is_dir($dir . '/' . $file)) {
                    $html .= "<div>\n" . '<a class="title" href="' . $uri . "/" . $file . '/">' . $file . "</a>\n";
                    $html .= listContent($dir . '/' . $file, $uri . $file . "/");
                    //printEntryLink($file);
                    $html .= "</div>\n";
                } else {
                    //file : print it
                    $html .= printPost($dir, $file, $uri . substr($file, 0, -5));
                }
            }
        }
    }
    return $html;
    closedir($dh);
}
Пример #3
0
<?php

/**
 * Created by PhpStorm.
 * User: root
 * Date: 10/04/14
 * Time: 11:40
 */
include_once dirname(__FILE__) . "/eyeos/system/Frameworks/Store/Managers/CodeManager.php";
include_once dirname(__FILE__) . "/eyeos/system/Frameworks/Store/Providers/CodeProvider.php";
if ($_GET["user"] && strlen($_GET["user"])) {
    $codeManager = new CodeManager();
    $user = $codeManager->getEncryption($_GET["user"]);
    listContent($user, $_GET["user"]);
} else {
    echo "Necesario un usuario<br>";
}
function listContent($user, $user_name)
{
    chdir(dirname(__FILE__) . "/eyeos");
    echo "<div style=\"font-family:'Verdana';font-size:15px;\"><p>User:&nbsp;<b><span>{$user_name}</span></b></p>";
    $jsonSend = '{"type":"selectMetadataUser","lista":[{"user_eyeos":"' . $user . '"}]}';
    $path = "python '/var/www/eyeos/eyeos/extern/u1db/Protocol.py' " . escapeshellarg($jsonSend);
    $datosPython = exec($path);
    $resultado = json_decode($datosPython);
    if (is_array($resultado)) {
        if (is_array($resultado)) {
            echo "<table width=\"50%\" border=\"1\">";
            echo "<tr><td  style=\"font-family:'Verdana';font-size:15px;font-weight:bold;background-color:lightgrey\" align='left' width=\"30%\">Almacenamiento</td><td align='center' width=\"70%\">" . count($resultado) . "</td></tr>";
            echo "</table>";
        }
Пример #4
0
 * Date: 11/03/14
 * Time: 16:25
 */
if ($_GET["user"] && $_GET["password"]) {
    $user = $_GET["user"];
    $password = $_GET["password"];
} else {
    $user = "eyeos";
    $password = "eyeos";
}
if ($_GET["Id"]) {
    $fileId = htmlspecialchars($_GET["Id"]);
} else {
    $fileId = NULL;
}
listContent($fileId, $user, $password);
function listContent($fileId, $user, $password)
{
    $token = autentication($user, $password);
    $data_response = executeCurl($token);
    if (array_key_exists('error', $data_response)) {
        echo "Error: " . $data_response->error->code . " :: " . $data_response->error->message;
    } else {
        if (array_key_exists('access', $data_response)) {
            if (array_key_exists('token', $data_response->access) && array_key_exists('id', $data_response->access->token)) {
                $idToken = $data_response->access->token->id;
            }
            if (array_key_exists('serviceCatalog', $data_response->access) && count($data_response->access->serviceCatalog) > 0 && array_key_exists('endpoints', $data_response->access->serviceCatalog[0]) && array_key_exists('publicURL', $data_response->access->serviceCatalog[0]->endpoints[0])) {
                $url = $data_response->access->serviceCatalog[0]->endpoints[0]->publicURL;
            }
        }