Ejemplo n.º 1
0
 case 'removeme':
     if (streq("0", getCurrentUID())) {
         $master->Smarty->assign("message", "Anonymous users cannot unregister.");
         break;
     } else {
         $lan = new Lan_events();
         $success = $lan->get(getCurrentLID());
         if ($success) {
             $attendees = new Lan_attendees();
             $attendees->lan_id = getCurrentLID();
             $attendees->user_id = getCurrentUID();
             if ($attendees->count() == 0) {
                 $master->Smarty->assign("message", "Oddly enough your already not signed up to this event!");
                 break;
             } else {
                 $attendees->delete();
                 $master->Smarty->assign("message", "Removed your sign up!");
                 logMessage(getCurrentUID(), 0, "User is no longer attending LAN " . $lan->name . " [" . $lan->id . "]");
                 //check if they have any seats for this lan, if so remove them.
                 $seat = new Lan_seats();
                 $seat->user_id = getCurrentUID();
                 $seat->lan_id = getCurrentLID();
                 if ($seat->find()) {
                     $seat->delete();
                 }
                 break;
             }
         } else {
             $master->Smarty->assign("message", "Unknown LAN selected.");
             break;
         }
Ejemplo n.º 2
0
                $lan = new Lan_events();
                $lan->get($lan->escape($_GET["id"]));
                logMessage($Frontend->getUserId(), 0, "Removed ticket '" . $g->name . "' from " . $Frontend->getName($sold->user_id) . " at " . $lan->name);
                $sold->delete();
            }
            break;
        case 'remu':
            // Get tickets for the attendee
            $user = new Lan_attendees();
            $success = $user->get($user->escape($_GET["tid"]));
            $lan = new Lan_events();
            $lan->get($lan->escape($_GET["id"]));
            if ($success) {
                $Frontend = new FrontEnd();
                logMessage($Frontend->getUserId(), 0, "Removed attendance for " . $Frontend->getName($user->user_id) . "' from " . $lan->name . " [" . $lan->id . "]");
                $user->delete();
            }
            break;
    }
}
if (isset($_POST["user"]) && isset($_POST["lan"])) {
    $newuser = new Lan_attendees();
    $newuser->lan_id = $newuser->escape($_POST["lan"]);
    $newuser->user_id = $newuser->escape($_POST["user"]);
    $newuser->insert();
    $Frontend = new FrontEnd();
    $lan = new Lan_events();
    $lan->get($lan->escape($_GET["id"]));
    logMessage($Frontend->getUserId(), 0, "Added attendee " . $Frontend->getName($newuser->user_id) . " at " . $lan->name);
}
if (isset($_POST["lanid"]) && isset($_POST["ticket"])) {