Beispiel #1
0
function homePage()
{
    $t = new Template('home.html');
    $t->replace('BACKGROUND', $_SESSION['userconf']['general']['background']);
    $t->replace('CSS', 'css.html');
    $t->replace('NAVBAR', 'navbar.html');
    $t->replace('DATA_COUNT', DataC::getCount($_SESSION['userid']));
    $t->replace('FEED_COUNT', FeedC::getCount($_SESSION['userid']));
    $t->replace('RUNNING_COUNT', FeedC::getRunningCount($_SESSION['userid']));
    $t->replace('PLUGIN', PluginC::getHTML());
    $t->replace('FEED_ALL', FeedC::getAllHTML($_SESSION['userid']));
    $t->replace('MODAL_DDROP', 'modal_ddrop.html');
    $t->replace('MODAL_TAG', 'modal_tag.html');
    $t->replace('TAGS_LIST', TagC::getTagsList());
    $t->replace('PLUGINS_LIST', PluginC::getPluginsList());
    $t->replace('MODAL_PREVIEW', 'feed_data_preview.html');
    $t->replace('FOOTER', 'footer.html');
    $t->replace('JAVASCRIPT_LIBS', 'javascript.libs.php');
    $t->replace('JAVASCRIPT_CHRIS', 'javascript.chris.html');
    $t->replace('USERNAME', ucfirst($_SESSION['username']));
    $t->replace('CHRIS_VERSION', CHRIS_VERSION);
    // ui
    $t->replace('CHRIS_UI_CHECKBOX', 'ui_checkbox.html');
    if (CHRIS_MAINTENANCE) {
        $t->replace('MAINTENANCE', 'display:block');
    } else {
        $t->replace('MAINTENANCE', 'display:none');
    }
    return $t;
}
Beispiel #2
0
     $name = joinPaths(CHRIS_USERS, $parameters);
     // enable cross origin requests
     header("Access-Control-Allow-Origin: *");
     // if the file does not exist, just die
     if (!is_file($name)) {
         die;
     }
     $fp = fopen($name, 'rb');
     fpassthru($fp);
     die;
 } else {
     if ($what == 'users') {
         $result['result'] = UserC::get();
     } else {
         if ($what == 'tag') {
             $result['result'] = TagC::get($_SESSION['userid']);
         } else {
             if ($what == 'directory_content') {
                 // user connects
                 // $ssh_connection = new Net_SSH2(CLUSTER_HOST);
                 // if (!$ssh_connection->login($_SESSION['username'], $_SESSION['password'])) {
                 //   die('Login Failed');
                 // }
                 //$result['result'] = $ssh_connection->exec('/usr/bin/php5 '.CHRIS_CONTROLLER_FOLDER.'/feed.browser.connector.php -d '.$_POST['dir']);
                 //echo $_POST["dir"];
                 $output = array();
                 exec('/usr/bin/php5 ' . CHRIS_CONTROLLER_FOLDER . '/feed.browser.connector.php -d ' . $_POST['dir'], $output);
                 $result['result'] = implode($output);
             } else {
                 if ($what == 'token') {
                     $result['result'] = TokenC::create();