Automatically exported from code.google.com/p/planningalerts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

69 regels
1.4 KiB

  1. <?php
  2. require_once ("config.php");
  3. require_once ("user.php");
  4. $unsubscribe_page = new unsubscribe_page;
  5. class unsubscribe_page {
  6. //Properties
  7. var $postcode = "";
  8. var $alert_area_size = 0;
  9. //Constructor
  10. function unsubscribe_page() {
  11. $this->setup();
  12. $this->bind();
  13. }
  14. //Setup
  15. function setup (){
  16. //Grab the user
  17. if(isset($_GET['cid'])){
  18. $confirm_id = $_GET['cid'];
  19. }else{
  20. header("HTTP/1.0 404 Not Found");
  21. exit;
  22. }
  23. $user = new user();
  24. if ($user->load_from_confirm_id($confirm_id)){
  25. //Grab the postcode and area
  26. $this->postcode = $user->postcode;
  27. $this->alert_area_size = alert_size_to_meters($user->alert_area_size);
  28. //delete the user
  29. $user->delete();
  30. }else{
  31. header("HTTP/1.0 404 Not Found");
  32. exit;
  33. }
  34. }
  35. //Bind
  36. function bind() {
  37. $form_action = $_SERVER['PHP_SELF'];
  38. //smarty
  39. $smarty = new Smarty;
  40. $smarty->force_compile = true;
  41. $smarty->compile_dir = SMARTY_COMPILE_DIRECTORY;
  42. $smarty->assign("menu_item", "signup");
  43. $smarty->assign("page_title","Unsubscribed");
  44. $smarty->assign("postcode", $this->postcode);
  45. $smarty->assign("alert_area_size", $this->alert_area_size);
  46. //Render
  47. $smarty->display('unsubscribed.tpl');
  48. }
  49. }
  50. ?>