false, 'html' => cp() ]; echo json_encode($result); return; } login(md5($_POST['password'])); $result = []; if (loggedIn()) { $result['error'] = false; $result['html'] = cp(); } else { $result['error'] = 'invalid'; } echo json_encode($result); } function doLogout() { logout(); $result = [ 'error' => false ]; echo json_encode($result); } function doUnban() { global $kioskMode; if ($kioskMode) { $result = [ 'error' => false ]; echo json_encode($result); return; } if (!loggedIn()) { return; } $ys = ys(); $result = []; $ip = $_POST['ip']; if ($ys->banned($ip)) { $ys->unban($ip); $result['error'] = false; } else { $result['error'] = 'notbanned'; } echo json_encode($result); } function doUnbanAll() { global $kioskMode; if ($kioskMode) { $result = [ 'error' => false ]; echo json_encode($result); return; } if (!loggedIn()) { return; } $ys = ys(); $ys->unbanAll(); $result = [ 'error' => false ]; echo json_encode($result); } function doSetPreference() { global $prefs, $kioskMode; if ($kioskMode) { $result = [ '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 = [ 'error' => false ]; echo json_encode($result); } function doResetPreferences() { global $prefs, $kioskMode; if ($kioskMode) { $result = [ 'error' => false ]; echo json_encode($result); return; } if (!loggedIn()) { return; } resetPrefs(); login(md5($prefs['password'])); // $prefs['password'] = 'lol no'; $result = [ 'error' => false, 'prefs' => $prefs ]; echo json_encode($result); } /* CP Display */ function cp() { global $kioskMode; if (!loggedIn() && !$kioskMode) { return 'You\'re not logged in!'; } return '
No one is banned.
'; } else { $html .= 'YShout was created and developed by Yuri Vishnevsky. Version 5 is the first one with an about page, so you\'ll have to excuse the lack of appropriate information — I\'m not quite sure what it is that goes on "About" pages anyway.
Other than that obviously important tidbit of information, there\'s really nothing else that I can think of putting here... If anyone knows what a good and proper about page should contain, please contact me!
If you have any questions or comments, you can contact me by email at yurivish@gmail.com, or on AIM at yurivish42.
I hope you\'ve enjoyed using YShout!