Beispiel #1
0
function doSetPreference()
{
    global $prefs, $kioskMode;
    if ($kioskMode) {
        $result = array('error' => false);
        echo json_encode($result);
        return;
    }
    if (!loggedIn()) {
        return;
    }
    $pref = $_POST['preference'];
    $value = magic($_POST['value']);
    if ($value === 'true') {
        $value = true;
    }
    if ($value === 'false') {
        $value = false;
    }
    $prefs[$pref] = $value;
    savePrefs($prefs);
    if ($pref == 'password') {
        login(md5($value));
    }
    $result = array('error' => false);
    echo json_encode($result);
}
Beispiel #2
0
<?php

include "includes/vars.php";
debuglog("Saving prefs", "SAVEPREFS");
$p = json_decode($_POST['prefs']);
foreach ($p as $key => $value) {
    debuglog($key . "=" . print_r($value, true), "SAVEPREFS");
    $prefs[$key] = $value;
    if ($key == "music_directory_albumart") {
        debuglog("Creating Album Art SymLink", "SAVEPREFS");
        if (is_link("prefs/MusicFolders")) {
            system("unlink prefs/MusicFolders");
        }
        system('ln -s "' . $prefs[$key] . '" prefs/MusicFolders');
    }
}
savePrefs();
?>
<html></html>
Beispiel #3
0
function resetPrefs()
{
    $defaultPrefs = array('password' => 'fortytwo', 'refresh' => 6000, 'logs' => 5, 'history' => 200, 'inverse' => false, 'truncate' => 15, 'doTruncate' => true, 'timestamp' => 12, 'defaultNickname' => 'Nickname', 'defaultMessage' => 'Message Text', 'defaultSubmit' => 'Shout!', 'showSubmit' => true, 'nicknameLength' => 25, 'messageLength' => 175, 'nicknameSeparator' => ':', 'flood' => true, 'floodTimeout' => 5000, 'floodMessages' => 4, 'floodDisable' => 8000, 'autobanFlood' => 0, 'censorWords' => 'f**k shit bitch ass', 'postFormLink' => 'history', 'info' => 'inline');
    savePrefs($defaultPrefs);
}