Ejemplo n.º 1
0
function SetupGroups()
{
    //Get groups
    $groups = array();
    $group = new Lan_permission_groups();
    //Setup system groups
    //Anonymous == everyone
    $groups[] = $group->FindGroupID("Anonymous");
    //Are we logged in?
    if (!streq(getCurrentUID(), "0")) {
        $groups[] = $group->FindGroupID("Registered");
    }
    //Attending this lan?
    $attendee = new lan_attendees();
    $attendee->user_id = getCurrentUID();
    $attendee->lan_id = getCurrentLID();
    if ($attendee->count() != 0) {
        $groups[] = $group->FindGroupID("Attending");
    }
    //Booked a place at this lan?
    $booked = false;
    $sold = new Lan_addons_sold();
    $addon = new Lan_addons_groups();
    $sold->joinAdd($addon);
    $sold->user_id = getCurrentUID();
    $sold->lan_id = getCurrentLID();
    $sold->find();
    while ($sold->fetch()) {
        if (streq($sold->allowSeating, "1")) {
            $groups[] = $group->FindGroupID("Booked");
            break;
        }
    }
    //Integration mode flag group.
    //if(defined("_LANMAN_INTEGRATION"))
    //$groups[] = $group->FindGroupID("Integration");
    //Membership based groups
    if (!streq(getCurrentUID(), "0")) {
        $group = new lan_permission_groups();
        $membership = new lan_permission_membership();
        $group->user_group = 1;
        $membership->user_id = getCurrentUID();
        $group->joinAdd($membership);
        $group->find();
        while ($group->fetch()) {
            $groups[] = $group->permgroup_id;
        }
    }
    $_SESSION['groups'] = $groups;
}
Ejemplo n.º 2
0
 $master->Smarty->assign("lan", $lan);
 $attendees = new Lan_attendees();
 $user = new Lan_users();
 $attendees->lan_id = getCurrentLID();
 $attendees->joinAdd($user);
 $attendees->orderBy('username');
 $attendees->find();
 $attendeeslist = array();
 while ($attendees->fetch()) {
     if (streq(getCurrentUID(), $attendees->user_id)) {
         $state = "signedup";
     }
     $sold = new Lan_addons_sold();
     $sold->lan_id = getCurrentLID();
     $sold->user_id = $attendees->user_id;
     $sold->find();
     $soldlists = array();
     while ($sold->fetch()) {
         $g = new Lan_addons_groups();
         $g->get($sold->addon_id);
         $soldlists[] = $g->name;
         if (getCurrentUID() == $sold->user_id && 0 == strcmp($g->allowSeating, '1')) {
             $state = "hasticket";
         }
     }
     $attendees->tickets = $soldlists;
     $seat = new Lan_seats();
     $seat->lan_id = getCurrentLID();
     $seat->user_id = $attendees->user_id;
     $success = $seat->find();
     $success = false;
Ejemplo n.º 3
0
     $attendeeslist[] = clone $attendees;
 }
 $master->Smarty->assign("attendees", $attendeeslist);
 if (!streq('0', getCurrentUID())) {
     $exseat = new Lan_seats();
     $exseat->user_id = getCurrentUID();
     $exseat->lan_id = getCurrentLID();
     if (0 == $exseat->count()) {
         $allowSeating = false;
         $tickets = new Lan_addons_sold();
         $tickets->user_id = getCurrentUID();
         $tickets->lan_id = getCurrentLID();
         $ticktypes = new Lan_addons_groups();
         $tickets->joinAdd($ticktypes, "LEFT");
         $tickets->selectAs($ticktypes, 'type_%s');
         $tickets->find();
         $a = array();
         while ($tickets->fetch()) {
             if (0 == strcmp($tickets->type_allowSeating, '1')) {
                 $allowSeating = true;
             }
         }
         if ($allowSeating) {
             $master->Smarty->assign("state", "noseat");
         }
     } else {
         $master->Smarty->assign("state", "seated");
         $exseat->find();
         $exseat->fetch();
         $seatname = $exseat->seat_name;
         if (strlen($seatname) == 0) {