예제 #1
0
function doResetPreferences()
{
    global $prefs, $kioskMode;
    if ($kioskMode) {
        $result = array('error' => false);
        echo json_encode($result);
        return;
    }
    if (!loggedIn()) {
        return;
    }
    resetPrefs();
    login(md5($prefs['password']));
    //	$prefs['password'] = '******';
    $result = array('error' => false, 'prefs' => $prefs);
    echo json_encode($result);
}
예제 #2
0
<?php

// If you want to change the nickname, the line below is the one to modify.
// Simply set $overrideNickname to whatever variable you want to appear as the nickname,
// or leave it null to use the set nicknames.
$overrideNickname = null;
$storage = 'FileStorage';
function loadPrefs()
{
    global $prefs, $storage, $null;
    $s = new $storage('yshout.prefs');
    $s->open();
    $prefs = $s->load();
    $s->close($null);
}
function savePrefs($newPrefs)
{
    global $prefs, $storage;
    $s = new $storage('yshout.prefs');
    $s->open(true);
    $s->close($newPrefs);
    $prefs = $newPrefs;
}
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, 'floodDelete' => false, 'autobanFlood' => 0, 'censorWords' => 'f**k shit bitch ass', 'postFormLink' => 'history', 'info' => 'inline');
    savePrefs($defaultPrefs);
}
resetPrefs();
//loadPrefs();