Main Page | Directories | File List | File Members

include/project/admin.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: admin.php 5495 2006-02-24 18:50:06Z yeupou $
00006 #
00007 #
00008 #  Copyright 1999-2000 (c) The SourceForge Crew
00009 #  Copyright 2000-2003 (c) Free Software Foundation
00010 #                          Mathieu Roy <yeupou--at--gnu.org>
00011 #
00012 #  Copyright 2006      (c) Mathieu Roy <yeupou--gnu.org>
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 
00030 # Nicely html-formatted output of this group's audit trail
00031 
00032 function show_grouphistory ($group_id)
00033 {
00034                 # show the group_history rows that are relevant to
00035                 # this group_id
00036   global $sys_datefmt;
00037   $result=group_get_history($group_id);
00038   $rows=db_numrows($result);
00039 
00040   if ($rows > 0) {
00041 
00042     echo '
00043                 <h3>'
00044       ._("Group Change History").'</h3>
00045                 <p>';
00046     $title_arr=array();
00047     $title_arr[]=_("Field");
00048     $title_arr[]=_("Value");
00049     $title_arr[]=_("Date");
00050     $title_arr[]=_("By");
00051 
00052     echo html_build_list_table_top ($title_arr);
00053 
00054     for ($i=0; $i < $rows; $i++) {
00055       $field=db_result($result, $i, 'field_name');
00056       echo '
00057                         <tr class="'. html_get_alt_row_color($i) .'"><td>'.$field.'</td><td>';
00058 
00059       if ($field=='removed user') {
00060         echo user_getname(db_result($result, $i, 'old_value'));
00061       } else {
00062         echo db_result($result, $i, 'old_value');
00063       }
00064       echo '</td>'.
00065         '<td>'.format_date($sys_datefmt,db_result($result, $i, 'date')).'</td>'.
00066         '<td>'.db_result($result, $i, 'user_name').'</td></tr>';
00067     }
00068 
00069     echo '
00070                 </table>';
00071 
00072   } else {
00073     echo '
00074                 <h3>'
00075       ._("No Changes Have Been Made to This Group").'</h3>';
00076   }
00077 }
00078 
00079 
00080 function project_admin_registration_info ($row_grp)
00081 {
00082   $res_admin = db_query("SELECT user.user_id AS user_id,user.user_name AS user_name, user.realname AS realname, user.email AS email "
00083                         . "FROM user,user_group "
00084                         . "WHERE user_group.user_id=user.user_id AND user_group.group_id=".$row_grp['group_id']." AND "
00085                         . "user_group.admin_flags = 'A'");
00086 
00087 
00088   print '<p><span class="preinput">'._("Project Admins").':</span><br /> ';
00089   while ($row_admin = db_fetch_array($res_admin)) {
00090     print "<a href=\"".$GLOBALS['sys_home']."users/$row_admin[user_name]/\">$row_admin[realname] &lt;$row_admin[email]&gt;</a> ; ";
00091   }
00092 
00093   print '<p><span class="preinput">'._("Registration Date").':</span><br /> '.format_date($sys_datefmt,$row_grp[register_time]);
00094 
00095   print '<p><span class="preinput">'._("System Group Name:").'</span><br /> '.$row_grp[unix_group_name];
00096 
00097   print '<p><span class="preinput">'._("Submitted Description:").'</span><br /> '.utils_rich_markup($row_grp[register_purpose]);
00098 
00099   print '<p><span class="preinput">'._("Required software:").'</span><br /> '.utils_rich_markup($row_grp[required_software]);
00100 
00101   print '<p><span class="preinput">'._("Other comments:").'</span><br /> '.utils_rich_markup($row_grp[other_comments]);
00102 
00103   print '<p>';
00104   print utils_registration_history($row_grp[unix_group_name]);
00105 
00106 }
00107 
00108 ?>

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