getPermission( session_get_user() ); if (!$perm || !is_object($perm)) { return; } /* Enforce Project Admin Perms */ if (!$perm->isAdmin()) { exit_permission_denied(); } site_project_header($params); $labels = array(); $links = array(); //$labels[] = _('Admin'); $labels[] = _('Edit Public Info'); $labels[] = _('Project History'); if($GLOBALS['sys_use_people']) { $labels[] = _('Post Jobs'); $labels[] = _('Edit Jobs'); } if($GLOBALS['sys_use_project_multimedia']) { $labels[] = _('Edit Multimedia Data'); } if($GLOBALS['sys_use_project_vhost']) { $labels[] = _('VHOSTs'); } if($GLOBALS['sys_use_project_database']) { $labels[] = _('Database Admin'); } $labels[] = _('Stats'); plugin_hook("quota_label_project_admin"); //$links[] = '/project/admin/?group_id='.$group_id; $links[] = '/project/admin/editgroupinfo.php?group_id='.$group_id; $links[] = '/project/admin/history.php?group_id='.$group_id; if($GLOBALS['sys_use_people']) { $links[] = '/people/createjob.php?group_id='.$group_id; $links[] = '/people/?group_id='.$group_id; } if($GLOBALS['sys_use_project_multimedia']) { $links[] = '/project/admin/editimages.php?group_id='.$group_id; } if($GLOBALS['sys_use_project_vhost']) { $links[] = '/project/admin/vhost.php?group_id='.$group_id; } if($GLOBALS['sys_use_project_database']) { $links[] = '/project/admin/database.php?group_id='.$group_id; } $links[] = '/project/stats/?group_id='.$group_id; plugin_hook("quota_link_project_admin"); echo ($HTML->beginSubMenu()); echo $HTML->printSubMenu($labels, $links); plugin_hook ("groupadminmenu", $params) ; echo ($HTML->endSubMenu()); } /* Standard footer to be used on all /project/admin/* pages */ function project_admin_footer($params) { site_project_footer($params); } /* The following three functions are for group audit trail When changes like adduser/rmuser/change status are made to a group, a row is added to audit trail using group_add_history() */ function group_get_history ($group_id=false) { $sql="SELECT group_history.field_name,group_history.old_value,group_history.adddate,users.user_name ". "FROM group_history,users ". "WHERE group_history.mod_by=users.user_id ". "AND group_id='$group_id' ORDER BY group_history.adddate DESC"; return db_query($sql); } function group_add_history ($field_name,$old_value,$group_id) { $group=group_get_object($group_id); $group->addHistory($field_name,$old_value); } /* Nicely html-formatted output of this group's audit trail */ function show_grouphistory ($group_id) { /* show the group_history rows that are relevant to this group_id */ $result=group_get_history($group_id); $rows=db_numrows($result); if ($rows > 0) { echo '

'._('Group Change History').'

'; $title_arr=array(); $title_arr[]=_('Field'); $title_arr[]=_('Old Value'); $title_arr[]=_('Date'); $title_arr[]=_('By'); echo $GLOBALS['HTML']->listTableTop ($title_arr); for ($i=0; $i < $rows; $i++) { $field=db_result($result, $i, 'field_name'); echo ' boxGetAltRowStyle($i) .'>'.$field.''; if (is_numeric(db_result($result, $i, 'old_value'))) { if (ereg("user|User", $field)) { echo user_getname(db_result($result, $i, 'old_value')); } else { echo db_result($result, $i, 'old_value'); } } else { echo db_result($result, $i, 'old_value'); } echo ''. ''.date(_('Y-m-d H:i'),db_result($result, $i, 'adddate')).''. ''.db_result($result, $i, 'user_name').''; } echo $GLOBALS['HTML']->listTableBottom(); } else { echo '

'._('No changes').'

'; } } /* prdb_namespace_seek - check that a projects' potential db name hasn't already been used. If it has - add a 1..20 to the end of it. If it iterates through twenty times and still fails - namespace depletion - throw an error. */ function prdb_namespace_seek($namecheck) { $query = "select * " ."from prdb_dbs " ."where dbname = '$namecheck'"; $res_dbl = db_query($query); if (db_numrows($res_dbl) > 0) { //crap, we're going to have issues $curr_num = 1; while ((db_numrows($res_dbl) > 0) && ($curr_num < 20)) { $curr_num++; $namecheck .= "$namecheck"."$curr_num"; $query = "select * " ."from prdb_dbs " ."where dbname = '$namecheck'"; $res_dbl = db_query($query); } // if we reached 20, then the namespace is depleted - eject eject if ($curr_num == 20) { exit_error("Namespace Failure","Failed to find namespace for database"); } } return $namecheck; } //end prdb_namespace_seek() function random_pwgen() { srand ( (double) microtime()*10000000); $rnpw = ""; for ($i = 0; $i < 10; $i++) { $rn = rand(1,2); if ($rn == 1) { $rnpw .= rand(1,9); } else { $rnpw .= chr(rand(65,122)); } } return $rnpw; } function permissions_blurb() { return _('NOTE:
Project Admins (bold)
can access this page and other project administration pages
Release Technicians
can make the file releases (any project admin also a release technician)
Tool Technicians (T)
can be assigned Bugs/Tasks/Patches
Tool Admins (A)
can make changes to Bugs/Tasks/Patches as well as use the /toolname/admin/ pages
Tool No Permission (N/A)
Developer doesn\'t have specific permission (currently equivalent to \'-\')
Moderators (forums)
can delete messages from the project forums
Editors (doc. manager)
can update/edit/remove documentation from the project.
'); } // Local Variables: // mode: php // c-file-style: "bsd" // End: ?>