Main Page | Directories | File List | File Members

include/trackers_run/admin/userperms.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: userperms.php 5429 2006-02-17 22:59:20Z toddy $
00006 #
00007 #  Copyright 1999-2000 (c) The SourceForge Crew
00008 #  Copyright 2000-2003 (c) Free Software Foundation
00009 #                          Mathieu Roy <yeupou--gnu.org>
00010 #
00011 #  Copyright 2004-2005 (c) Mathieu Roy <yeupou--gnu.org>
00012 #                          Yves Perrin <yves.perrin--cern.ch>
00013 # 
00014 # The Savane project is free software; you can redistribute it and/or
00015 # modify it under the terms of the GNU General Public License
00016 # as published by the Free Software Foundation; either version 2
00017 # of the License, or (at your option) any later version.
00018 #
00019 # The Savane project is distributed in the hope that it will be useful,
00020 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022 # GNU General Public License for more details.
00023 #
00024 # You should have received a copy of the GNU General Public License
00025 # along with the Savane project; if not, write to the Free Software
00026 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00027 
00028 ###
00029 ### WARNING: whenever you modify this page, you should modify 
00030 ###   project/admin/userperms.php as well
00031 
00032 require_directory("project");
00033 $is_admin_page='y';
00034 
00035 session_require(array('group'=>$group_id,'admin_flags'=>'A'));
00036 
00037 if ($update)  
00038 {
00039 
00040   # If the group entry does not exist, create it
00041   if (!db_result(db_query("SELECT groups_default_permissions_id FROM groups_default_permissions WHERE group_id='$group_id'"), 0, "groups_default_permissions_id"))
00042     {
00043       db_query("INSERT INTO groups_default_permissions (group_id) VALUES ($group_id)"); 
00044     }
00045   
00046   # ##### Update posting restrictions
00047   $newitem_restrict_event1 = ARTIFACT."_restrict_event1";
00048   $newitem_restrict_event2 = ARTIFACT."_restrict_event2";
00049   $flags = ($$newitem_restrict_event2)*100 + $$newitem_restrict_event1;
00050   if (!$flags)
00051     { 
00052       # if equal to 0, manually set to NULL, since 0 have a different meaning
00053       $flags = 'NULL';
00054     }
00055 
00056   # Update the table
00057   $sql = 'UPDATE groups_default_permissions SET ' 
00058      .ARTIFACT."_rflags=".$flags." "
00059      ."WHERE group_id='$group_id'";
00060 
00061   $result = db_query($sql);
00062   
00063   if ($result) 
00064     {
00065       group_add_history('Changed Posting Restrictions','',$group_id);
00066       fb(_("Posting restrictions updated."));
00067     }
00068   else
00069     {
00070       print db_error();
00071       fb(_("Unable to change posting restrictions."), 0);
00072     }
00073 }
00074 
00075 
00076 # start HTML
00077 trackers_header_admin(array ('title'=>_("Permissions Management")));
00078 
00079 ########################### POSTING RESTRICTIONS
00080 print '<h3>'._("Permissions Management: Posting Restrictions").'</h3>';
00081 print '<form action="'.$PHP_SELF.'" method="post">
00082 <input type="hidden" name="group" value="'.$group_name.'" />';
00083 

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