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; }
case 'current': $lanid = getCurrentLID(); $user->query("SELECT *, {$arrived->__table}.aid as arrived,{$seat->__table}.seat_name, {$seat->__table}.id as seat_id, {$user->__table}.user_id as userid FROM {$user->__table} LEFT JOIN {$arrived->__table} on {$arrived->__table}.user_id " . " = {$user->__table}.user_id LEFT JOIN {$seat->__table} on {$seat->__table}.user_id = {$user->__table}.user_id WHERE {$seat->__table}.lan_id = '{$lanid}' AND {$user->__table}.user_id IN (SELECT user_id FROM {$attendees->__table} WHERE `lan_id` = '{$lanid}') ORDER BY {$user->__table}.username"); while ($user->fetch()) { if (strlen($user->arrived) == 0) { $user->arrived = "No"; } else { $user->arrived = "Yes"; } //Pull tickets $sold = new Lan_addons_sold(); $addon = new Lan_addons_groups(); $sold->whereAdd("user_id = {$user->user_id}"); //$sold->user_id ; $sold->lan_id = getCurrentLID(); $sold->joinAdd($addon); $sold->find(); $tickets = array(); while ($sold->fetch()) { $tickets[] = clone $sold; } $user->tickets = $tickets; $userlist[] = clone $user; } break; case 'none': $user->orderBy('username'); //$user->groupBy('clan'); $user->find(); while ($user->fetch()) { $user->arrived = "n/a";
$attendees->user_id = "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();