Main Page | Directories | File List | File Members

exit.php

Go to the documentation of this file.
00001 <?php
00002 # This file is part of the Savane project
00003 # <http://gna.org/projects/savane/>
00004 #
00005 # $Id: exit.php 5187 2005-12-01 16:22:29Z yeupou $
00006 #
00007 #  Copyright 1999-2000 (c) The SourceForge Crew
00008 #  Copyright 2000-2003 (c) Free Software Foundation
00009 #
00010 #  Copyright 2004      (c) ...
00011 # 
00012 # The Savane project is free software; you can redistribute it and/or
00013 # modify it under the terms of the GNU General Public License
00014 # as published by the Free Software Foundation; either version 2
00015 # of the License, or (at your option) any later version.
00016 #
00017 # The Savane project is distributed in the hope that it will be useful,
00018 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 # GNU General Public License for more details.
00021 #
00022 # You should have received a copy of the GNU General Public License
00023 # along with the Savane project; if not, write to the Free Software
00024 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00025 
00026 
00027 
00028 # Generic functions
00029 
00030 function exit_error($title,$text=0) 
00031 {
00032   
00033   global $HTML;
00034   global $feedback;
00035   
00036   $content = $title;
00037   if ($text)
00038     { $content .= _(':').' '.$text; }
00039 
00040   fb($content, 1);
00041 
00042   $HTML->header(array('title'=>sprintf(_("Exiting with Error: %s"), $title)));
00043   html_feedback_top();
00044   
00045   $HTML->footer(array());
00046   exit;
00047 }
00048 
00049 function exit_permission_denied() 
00050 {
00051   exit_error(_("Permission Denied"));
00052 }
00053 
00054 function exit_not_logged_in() 
00055 {
00056   #instead of a simple error page, take user to the login page
00057   global $REQUEST_URI;
00058   
00059   if ($GLOBALS['sys_https_host'])
00060     {  
00061       header('Location: https://'.$GLOBALS['sys_https_host'].$GLOBALS['sys_home'].'account/login.php?return_to='.urlencode($REQUEST_URI));
00062     } 
00063   else 
00064     {
00065       header ("Location: http://".$GLOBALS['sys_default_domain'].$GLOBALS['sys_home']."account/login.php?return_to=".urlencode($REQUEST_URI));
00066     }
00067 }
00068 
00069 function exit_no_group() 
00070 {
00071   exit_error(_("No group chosen"),'nogroup');
00072 }
00073 
00074 function exit_missing_param() 
00075 {
00076   exit_error(_("Missing Parameters"),'');
00077 }
00078 
00079 # Test per artifact
00080 
00081 function exit_test_usesmail($group_id) 
00082 {
00083   $project=project_get_object($group_id);
00084   if (!$project->usesMail()) {
00085     exit_error(_("Error"),_("This Project Has Turned Off Mailing Lists"));
00086   }
00087 }
00088   
00089 
00090 ?>

Generated on Sun Feb 26 13:23:03 2006 for Savane PHP Frontend Developer Reference by  doxygen 1.4.4