public function delete($id = null)
 {
     $article = self::load_article($id);
     $article->destroy();
     Site::flash("notice", "The article has been deleted");
     Redirect("admin/articles");
 }
 public function delete($id = null)
 {
     $slideshow = self::load_slideshow($id);
     $slideshow->destroy();
     Site::flash("notice", "The slide has been deleted");
     Redirect("admin/slideshow");
 }
Пример #3
0
 public function delete($permalink = null)
 {
     $news = self::load_news($permalink, false);
     $news->destroy();
     Site::flash("notice", "The news has been deleted");
     Redirect("admin/news");
 }
 public function delete($id = null)
 {
     $user_achievement = $this->load_user_achievement($id);
     $user_achievement->destroy();
     Site::flash("notice", "The user achievement has been deleted");
     Redirect("admin/users/{$user_achievement->user->nickname}");
 }
 public function delete($permalink = null)
 {
     $event = self::load_event($permalink);
     $event->destroy();
     Site::flash("notice", "The event has been deleted");
     Redirect("admin/events");
 }
 public function delete($id = null)
 {
     $discount = $this->load_discount($id);
     $discount->destroy();
     Site::flash("notice", "The discount code has been deleted");
     Redirect("admin/discounts");
 }
 public function delete($permalink = null)
 {
     $content = self::load_content($permalink);
     $content->destroy();
     Site::flash("notice", "The content page has been deleted");
     Redirect("admin/content");
 }
 public function delete($id = null)
 {
     $award = $this->load_award($id);
     $award->destroy();
     Site::flash("notice", "The awarded loyalty has been deleted");
     Redirect("admin/loyalty");
 }
 public function contact()
 {
     $content = Content::find_by_permalink("contact");
     $this->assign("content", $content);
     $contact = new Contact();
     if ($this->post) {
         $contact->name = $_POST['name'];
         $contact->emailaddress = $_POST['emailaddress'];
         $contact->subject = $_POST['subject'];
         $contact->message = $_POST['message'];
         $contact->ip = Site::RemoteIP();
         if ($this->csrf) {
             $sent = $contact->send();
             if ($sent) {
                 Site::flash("notice", "The email has been sent");
                 Redirect("contact");
             }
         } else {
             global $site;
             $site['flash']['error'] = "Invalid form submission";
         }
     }
     $this->assign("contact", $contact);
     $this->title = "Contact Us";
     $this->render("contact/contact.tpl");
 }
 public function refresh($id = null)
 {
     $server = self::load_gameserver($id);
     $server->update_stats();
     Site::flash("notice", "The game server has been refreshed");
     Redirect("admin/servers");
 }
Пример #11
0
 public function delete($id = null)
 {
     $tag = self::load_tag($id);
     $tag->destroy();
     Site::flash("notice", "The tag has been deleted");
     Redirect("admin/tags");
 }
 public function delete($id = null)
 {
     $account = $this->load_account($id);
     $account->destroy();
     Site::flash("notice", "The account has been deleted");
     Redirect("admin/twitter/accounts");
 }
Пример #13
0
 public function delete($id = null)
 {
     $game = self::load_game($id);
     $game->destroy();
     Site::flash("notice", "The game has been deleted");
     Redirect("admin/games");
 }
 public function delete($permalink = null)
 {
     $event = $this->load_event();
     $content = $this->load_content($event, $permalink);
     $content->destroy();
     Site::flash("notice", "The event content page has been deleted");
     Redirect("admin/events/{$event->permalink}/content");
 }
 public function up($id = null)
 {
     self::Restrict("admin");
     $category = self::load_category($id);
     $category->move_up();
     Site::flash("notice", "The category has been moved up");
     Redirect("admin/achievements/categories");
 }
 public function delete($survey_id = null, $id = null)
 {
     $survey = self::load_survey($survey_id);
     $response = self::load_response($survey, $id);
     $response->destroy();
     Site::flash("notice", "The response has been deleted");
     Redirect("admin/surveys/{$survey->id}#responses");
 }
 public function move($article_id = null, $id = null)
 {
     $article = self::load_article($article_id);
     $page = self::load_page($article, $id);
     if (isset($_GET['direction']) && $_GET['direction'] == 'up') {
         $page->move_up();
     } else {
         $page->move_down();
     }
     Site::flash("notice", "The page has been moved");
     Redirect("admin/articles/{$article->id}");
 }
 public function acknowledge($id = null)
 {
     $script = self::load_script($id);
     if ($script->getAlert('bool') && !$script->acknowledged) {
         $script->acknowledged = true;
         $nickname = Site::CurrentUser()->nickname;
         $script->addlog("Alert acknowledged by {$nickname}");
         $script->save();
     }
     Site::flash("notice", "The script alert has been acknowledged.");
     RedirectBack("admin/scripts");
 }
 public function delete($id = null)
 {
     $game = self::load_game();
     $id = mysql_real_escape_string($_GET['id']);
     $gametype = Gametype::find_by_id($id);
     if (!$gametype) {
         Error404();
     }
     $gametype->destroy();
     Site::flash("notice", "The gametype has been deleted");
     Redirect("admin/games/{$game->id}");
 }
Пример #20
0
 public function delete($filename = null)
 {
     $file = self::load_file($filename);
     if ($file->destroy()) {
         Site::flash("notice", "{$file->filename} has been deleted");
         if ($file->image) {
             Redirect("admin/files/category/images");
         } else {
             Redirect("admin/files");
         }
     } else {
         Site::flash("error", "Unable to delete {$file->filename}");
         Redirect("admin/files");
     }
 }
 public function create()
 {
     $user = new RPCUser();
     if ($this->post) {
         $user->username = $this->PostData('username');
         $user->password = $this->PostData('password');
         $user->password_confirmation = $this->PostData('password_confirmation');
         $user->description = $this->PostData('description');
         if ($user->save()) {
             Site::flash('notice', 'The XML-RPC user has been created');
             Redirect('admin/users/rpc');
         }
     }
     $this->assign('user', $user);
     $this->title = 'New XML-RPC User';
     $this->render('rpcuser/create.tpl');
 }
 public function delete($discount_id = null, $item_id = null)
 {
     if (!$discount_id) {
         $discount_id = $_GET['discount_id'];
     }
     if (!$item_id) {
         $item_id = $_GET['item_id'];
     }
     $discount_item = self::load_discount_item($item_id);
     if (!$discount_item->id) {
         Site::flash("error", "Unable to remove the item from this discount code.");
     } else {
         $discount_item->destroy();
         Site::flash("notice", "The discount item has been removed from the discount code.");
     }
     Redirect("admin/discounts/{$discount_id}");
 }
 public function toggle($permalink = null, $id = null, $seat_id = null)
 {
     $event = $this->load_event($permalink);
     $group = $this->load_group($event, $id);
     $seat = $this->load_seat($event, $seat_id);
     if ($seat->seating_group_id == $group->id) {
         $seat->seating_group_id = null;
     } else {
         $seat->seating_group_id = $group->id;
     }
     $seat->save();
     if ($this->xhr) {
         echo (bool) $seat->seating_group_id;
         die;
     }
     Site::flash("notice", "Seat {$seat->label} has been updated");
     Redirect("admin/events/{$event->permalink}/seating/groups/{$group->id}#plan-{$seat->seating_plan->permalink}-");
 }
 public function toggle($permalink = null)
 {
     $event = self::load_event($permalink);
     if (isset($_GET['seat'])) {
         $seat = self::load_seat($_GET['seat'], $event);
         $seat->disabled = !$seat->disabled;
         $seat->save();
         if ($this->xhr) {
             echo $seat->disabled;
             die;
         }
         Site::flash("notice", "Seat {$seat->label} has been updated");
         Redirect("admin/events/{$event->permalink}/seating/toggle#{$seat->seating_plan->permalink}-");
     }
     $this->assign("event", $event);
     $this->title = "Toggle Seats";
     $this->render("event_seat/toggle.tpl");
 }
 public function create()
 {
     $website = new Website();
     if ($this->post) {
         $website->name = $this->PostData('name');
         $website->description = $this->PostData('description');
         $website->url = $this->PostData('url');
         $website->loginurl = $this->PostData('loginurl');
         $website->triggerurl = $this->PostData('triggerurl');
         $website->code = $this->PostData('code');
         if ($website->save()) {
             Site::flash('notice', 'The site has been created');
             Redirect('admin/sites');
         }
     }
     $this->assign('website', $website);
     $this->title = 'New Site';
     $this->render('website/create.tpl');
 }
 public function create($signup_id = null)
 {
     $signup = self::load_signup($signup_id);
     $event_service = new EventService();
     $event_service->event_signup_id = $signup->id;
     if ($this->post) {
         $event_id = mysql_real_escape_string($signup->event->id);
         $service_id = mysql_real_escape_string($_POST['service']);
         $service = Service::find("services.id = '{$service_id}' AND services.event_id = '{$event_id}'");
         if ($service) {
             if ($service->participant and !$signup->event_ticket->participant) {
                 $event_service->add_error("You cannot add participant services to this booking");
             }
             $event_service->service_id = $service->id;
             $event_service->note = $_POST['note'];
             $event_service->paid = $_POST['paid'];
             if ($event_service->save()) {
                 Site::Flash("notice", "The service booking has been added");
                 Redirect("admin/signups/{$signup->id}");
             }
         }
     }
     $available_services = $signup->available_services(false, true);
     if (count($available_services) == 0) {
         Site::flash("error", "There are no services available for this signup");
         Redirect("admin/signups/{$signup->id}");
     }
     $services = array();
     foreach ($available_services as $service) {
         $services[$service->id] = $service->name;
     }
     $this->assign("services", $services);
     $this->assign("signup", $signup);
     $this->assign("service", $event_service);
     $this->title = "Signup {$signup->id} Services";
     $this->render("event_service/create.tpl");
 }
 public function reset()
 {
     $code = $this->PostData('code');
     if (!$code) {
         $code = $this->GetData('code');
     }
     if ($code) {
         $lost_password = LostPassword::find_by_code($code);
         if ($lost_password) {
             $response = $lost_password->activate();
             if ($response[0]) {
                 Email::send_new_password($lost_password->user, $response[1]);
                 Site::flash("notice", "Your new password has been sent to {$lost_password->user->email}");
                 Redirect("login");
             } else {
                 $this->site['flash']['error'] = "There was an error resetting your password";
             }
         } else {
             $this->site['flash']['error'] = "The code you entered could not be found or is not valid";
         }
     }
     $this->assign("code", $code);
     $this->render("lost_password/reset.tpl");
 }
 public function move_down($survey_id = null, $question_id = null, $id = null)
 {
     $survey = self::load_survey($survey_id);
     $question = self::load_question($survey, $question_id);
     $option = self::load_option($question, $id);
     $option->move_down();
     Site::flash("notice", "The question has been moved down");
     Redirect("admin/surveys/{$survey->id}/questions/{$question->id}#options");
 }
Пример #29
0
 public function change_password()
 {
     $user = $this->load_user($nickname);
     if ($this->method == "POST") {
         $password = $_POST['password'];
         $password_confirmation = $_POST['password_confirmation'];
         $user->change_password($password, $password_confirmation);
         if ($user->save()) {
             Site::flash("notice", "{$user->nickname}'s password has been changed");
             Redirect("admin/users/{$user->permalink()}");
         }
     }
     $this->assign("user", $user);
     $this->title = "Change Password";
     $this->render("user/change_password.tpl");
 }
 public function delete($id = null)
 {
     $survey = self::load_survey($id);
     $survey->destroy();
     Site::flash("notice", "The survey has been deleted");
     Redirect("admin/surveys");
 }