Newer
Older
Digital_Repository / OARiNZ / DIY / deb_package / eprints-3.0 / cgi / logout
nstanger on 7 Jun 2007 1 KB - Added debian package source.
  1. ######################################################################
  2. #
  3. # Remove the login ticket
  4. #
  5. ######################################################################
  6. #
  7. # This file is part of GNU EPrints 2.
  8. #
  9. # Copyright (c) 2000-2004 University of Southampton, UK. SO17 1BJ.
  10. #
  11. # EPrints 2 is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version.
  15. #
  16. # EPrints 2 is distributed in the hope that it will be useful,
  17. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. # GNU General Public License for more details.
  20. #
  21. # You should have received a copy of the GNU General Public License
  22. # along with EPrints 2; if not, write to the Free Software
  23. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  24. #
  25. ######################################################################
  26.  
  27. use EPrints;
  28.  
  29. use strict;
  30. my $session = new EPrints::Session;
  31. exit( 0 ) unless( defined $session );
  32.  
  33. my $page=$session->make_doc_fragment();
  34.  
  35.  
  36. my $ticketid = EPrints::Apache::AnApache::cookie( $session->get_request, "eprints_session" );
  37.  
  38. my $sql = "DELETE FROM login_tickets WHERE code='".EPrints::Database::prep_value($ticketid)."'";
  39. my $sth = $session->get_database->prepare( $sql );
  40. $session->get_database->execute( $sth , $sql );
  41. $session->logout;
  42.  
  43.  
  44.  
  45. $page->appendChild( $session->render_message(
  46. "message",
  47. $session->make_text( "Logout OK!" ) ) );
  48.  
  49. $page->appendChild( $session->html_phrase( "general:frontpage_link" ) );
  50. my $title = $session->make_text( "Logout" );
  51. $session->build_page( $title, $page, "login" );
  52. $session->send_page();
  53.  
  54. $session->terminate;
  55. exit;
  56.  
  57.  
  58.