示例#1
0
<html>

<head>

	<title>Log in or Sign Up!</title>
</head>

<body>

<div id="mainDiv">

If you have an account...

<?php 
ui_render();
?>

<form action="<?php 
echo site_url("auth/login");
?>
" method="post">
Log In

<div class="inputField">
<input type="text" name="username" placeholder="Username" />
</div>

<div class="inputField">
<input type="password" name="password" placeholder="Password" />
</div>
示例#2
0
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    // DO NOT RETURN HTTP HEADERS
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    // RETURN THE CONTENTS OF THE CALL
    $response = curl_exec($ch);
    curl_close($ch);
    return $response;
}
// ---- end functions -----
if (isset($argv[2]) && !isset($argv[3])) {
    // Connect to Redis backend
    $redis = new Redis();
    $redis->connect('/tmp/redis.sock');
    if (!$redis->sIsMember('w_lock', $argv[2])) {
        usleep(800000);
    } else {
        do {
            usleep(500000);
        } while ($redis->sIsMember('w_lock', $argv[2]));
    }
    $redis->close();
} else {
    usleep(500000);
}
if (isset($argv[3]) && $argv[3] === 'simplemessage') {
    $output = json_encode(array('title' => $argv[1], 'text' => $argv[2], 'type' => null));
    ui_render('notify', $output);
} else {
    ui_render('notify', $argv[1]);
}
示例#3
0
function ui_libraryHome($redis)
{
    // LocalStorage
    $localStorages = countDirs('/mnt/MPD/LocalStorage');
    // runelog('networkmounts: ',$networkmounts);
    // Network mounts
    $networkmounts = countDirs('/mnt/MPD/NAS');
    // runelog('networkmounts: ',$networkmounts);
    // USB mounts
    $usbmounts = countDirs('/mnt/MPD/USB');
    // runelog('usbmounts: ',$usbmounts);
    // Webradios
    $webradios = count($redis->hKeys('webradios'));
    // runelog('webradios: ',$webradios);
    // Dirble
    $proxy = $redis->hGetall('proxy');
    $dirblecfg = $redis->hGetAll('dirble');
    $dirble = json_decode(curlGet($dirblecfg['baseurl'] . 'amountStation/apikey/' . $dirblecfg['apikey'], $proxy));
    // runelog('dirble: ',$dirble);
    // Spotify
    $spotify = $redis->hGet('spotify', 'enable');
    // Check current player backend
    $activePlayer = $redis->get('activePlayer');
    // Bookmarks
    $redis_bookmarks = $redis->hGetAll('bookmarks');
    $bookmarks = array();
    foreach ($redis_bookmarks as $key => $data) {
        $bookmark = json_decode($data);
        runelog('bookmark details', $data);
        // $bookmarks[] = array('bookmark' => $key, 'name' => $bookmark->name, 'path' => $bookmark->path);
        $bookmarks[] = array('id' => $key, 'name' => $bookmark->name, 'path' => $bookmark->path);
    }
    // runelog('bookmarks: ',$bookmarks);
    // $jsonHome = json_encode(array_merge($bookmarks, array(0 => array('networkMounts' => $networkmounts)), array(0 => array('USBMounts' => $usbmounts)), array(0 => array('webradio' => $webradios)), array(0 => array('Dirble' => $dirble->amount)), array(0 => array('ActivePlayer' => $activePlayer))));
    // $jsonHome = json_encode(array_merge($bookmarks, array(0 => array('networkMounts' => $networkmounts)), array(0 => array('USBMounts' => $usbmounts)), array(0 => array('webradio' => $webradios)), array(0 => array('Spotify' => $spotify)), array(0 => array('Dirble' => $dirble->amount)), array(0 => array('ActivePlayer' => $activePlayer))));
    $jsonHome = json_encode(array('bookmarks' => $bookmarks, 'localStorages' => $localStorages, 'networkMounts' => $networkmounts, 'USBMounts' => $usbmounts, 'webradio' => $webradios, 'Spotify' => $spotify, 'Dirble' => $dirble->amount, 'ActivePlayer' => $activePlayer));
    // Encode UI response
    runelog('libraryHome JSON: ', $jsonHome);
    ui_render('library', $jsonHome);
}