'tabtitle', 'title' => _('General information about project. Tag, trove list, description.')); $links[] = '/project/admin/?group_id='.$group_id; $labels[] = _('Users and permissions'); $attr_r[] = array('class' => 'tabtitle', 'title' => _('Permissions management. Edit / Create roles. Assign new permissions to user. Add / Remove member.')); $links[] = '/project/admin/users.php?group_id='.$group_id; $labels[] = _('Tools'); $attr_r[] = array('class' => 'tabtitle', 'title' => _('Activate / Desactivate extensions like docman, forums, plugins.')); $links[] = '/project/admin/tools.php?group_id='.$group_id; $labels[] = _('Project History'); $attr_r[] = array('class' => 'tabtitle', 'title' => _('Show the significant change of your project.')); $links[] = '/project/admin/history.php?group_id='.$group_id; if(forge_get_config('use_people')) { $labels[] = _('Post Jobs'); $attr_r[] = array('class' => 'tabtitle', 'title' => _('Hiring new people. Describe the job')); $links[] = '/people/createjob.php?group_id='.$group_id; $labels[] = _('Edit Jobs'); $attr_r[] = array('class' => 'tabtitle', 'title' => _('Edit already created available position in your project.')); $links[] = '/people/?group_id='.$group_id; } if(forge_get_config('use_project_multimedia')) { $labels[] = _('Edit Multimedia Data'); //TODO: set the title. $attr_r[] = array('class' => 'tabtitle', 'title' => _('')); $links[] = '/project/admin/editimages.php?group_id='.$group_id; } if(forge_get_config('use_project_vhost')) { $labels[] = _('VHOSTs'); //TODO: set the title. $attr_r[] = array('class' => 'tabtitle', 'title' => _('')); $links[] = '/project/admin/vhost.php?group_id='.$group_id; } if(forge_get_config('use_project_database')) { $labels[] = _('Database Admin'); //TODO: set the title. $attr_r[] = array('class' => 'tabtitle', 'title' => _('')); $links[] = '/project/admin/database.php?group_id='.$group_id; } if ($project->usesStats()) { $labels[] = _('Stats'); //TODO: set the title. $attr_r[] = array('class' => 'tabtitle', 'title' => _('')); $links[] = '/project/stats/?group_id='.$group_id; } $params['labels'] =& $labels; $params['links'] =& $links; $params['attr_r'] =& $attr_r; plugin_hook("groupadminmenu", $params); $params['submenu'] = $HTML->subMenu($params['labels'], $params['links'], $params['attr_r']); site_project_header($params); } /* Standard footer to be used on all /project/admin/* pages */ function project_admin_footer($params=array()) { 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) { return db_query_params("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=$1 ORDER BY group_history.adddate DESC", array($group_id)); } 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 '
'._('This log will show who made significant changes to your project and when').'
'; $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 ''._('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=$1'; $res_dbl = db_query_params($query, array($namecheck)); 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; $res_dbl = db_query_params($query, array($namecheck)); } // if we reached 20, then the namespace is depleted - eject eject if ($curr_num == 20) { exit_error(_('Failed to find namespace for database'),'home'); } } return $namecheck; } //end prdb_namespace_seek() function random_pwgen() { return (substr(strtr(base64_encode(util_randbytes(9)), '+', '.'), 0, 10)); } function permissions_blurb() { return _('NOTE: