false, 'html' => cp() ); echo jsonEncode($result); return; } login(md5($_POST['password'])); $result = array(); if (loggedIn()) { $result['error'] = false; $result['html'] = cp(); } else $result['error'] = 'invalid'; echo jsonEncode($result); } function doLogout() { logout(); $result = array( 'error' => false ); echo jsonEncode($result); } function doUnban() { global $kioskMode; if ($kioskMode) { $result = array( 'error' => false ); echo jsonEncode($result); return; } if (!loggedIn()) return; $ys = ys(); $result = array(); $ip = $_POST['ip']; if ($ys->banned($ip)) { $ys->unban($ip); $result['error'] = false; } else $result['error'] = 'notbanned'; echo jsonEncode($result); } function doUnbanAll() { global $kioskMode; if ($kioskMode) { $result = array( 'error' => false ); echo jsonEncode($result); return; } if (!loggedIn()) return; $ys = ys(); $ys->unbanAll(); $result = array( 'error' => false ); echo jsonEncode($result); } function doSetPreference() { global $prefs, $kioskMode; if ($kioskMode) { $result = array( 'error' => false ); echo jsonEncode($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 jsonEncode($result); } function doResetPreferences() { global $prefs, $kioskMode; if ($kioskMode) { $result = array( 'error' => false ); echo jsonEncode($result); return; } if (!loggedIn()) return; resetPrefs(); login(md5($prefs['password'])); // $prefs['password'] = 'lol no'; $result = array( 'error' => false, 'prefs' => $prefs ); echo jsonEncode($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!