Beispiel #1
0
 case 'menu':
     if ($_GET) {
         echo $pm->buildMenu();
         break;
     }
     unset($_POST['func']);
     if ($pm->updateMenu($_POST['data'])) {
         $message = "Menu order updated.";
     } else {
         $message = "Menu order NOT updated. Try again in a few minutes.";
     }
     echo json_encode(array("message" => $message));
     break;
 case 'login':
     unset($_POST['func']);
     echo (string) $pm->login($_POST['password']);
     if ($pm->login($_POST['password'])) {
         $_SESSION['l_o_g_g_e_d__i_n'] = true;
     } else {
         // Unset all of the session variables.
         $_SESSION = array();
         // If it's desired to kill the session, also delete the session cookie.
         // Note: This will destroy the session, and not just the session data!
         if (isset($_COOKIE[session_name()])) {
             setcookie(session_name(), '', time() - 42000, '/');
         }
         // Finally, destroy the session.
         session_destroy();
     }
     break;
 case 'load':