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
*/
global $sys_datefmt;
$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 html_build_list_table_top ($title_arr);
for ($i=0; $i < $rows; $i++) {
$field=db_result($result, $i, 'field_name');
echo '
'.$field.' | ';
if ($field=='removed user') {
echo user_getname(db_result($result, $i, 'old_value'));
} else {
echo db_result($result, $i, 'old_value');
}
echo ' | '.
''.date($sys_datefmt,db_result($result, $i, 'date')).' | '.
''.db_result($result, $i, 'user_name').' |
';
}
echo '
';
} else {
echo '
No Changes Have Been Made to This Group
';
}
}
/*
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)
'.
/*
'- CVS Admins
- will be able to access repository files directly (in addition to standard write access)
'.
*/
'- 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.
';
}
?>