<?php
-/** FusionForge CVS plugin
+/**
+ * FusionForge CVS plugin
*
* Copyright 2004-2009, Roland Mas
+ * Copyright 2013, Franck Villaume - TrivialDev
*
* This file is part of FusionForge.
*
return false ;
}
- if ($project->usesPlugin($this->name)) {
+ if ($project->usesPlugin($this->name) && forge_check_perm('scm', $project->getID(), 'read')) {
$result = db_query_params('SELECT sum(commits) AS commits, sum(adds) AS adds FROM stats_cvs_group WHERE group_id=$1',
array ($project->getID())) ;
$commit_num = db_result($result,0,'commits');
while($data = db_fetch_array($result)) {
$b .= '<tr '. $HTML->boxGetAltRowStyle($i) .'>';
- $b .= '<td width="50%">' ;
+ $b .= '<td class="halfwidth">' ;
$b .= util_make_link_u ($data['user_name'], $data['user_id'], $data['realname']) ;
- $b .= '</td><td width="25%" align="right">'.$data['adds']. '</td>'.
- '<td width="25%" align="right">'.$data['commits'].'</td></tr>';
+ $b .= '</td><td class="onequarterwidth align-right">'.$data['adds']. '</td>'.
+ '<td class="onequarterwidth align-right">'.$data['commits'].'</td></tr>';
$total['adds'] += $data['adds'];
$total['commits'] += $data['commits'];
$i++;
}
$b .= '<tr '. $HTML->boxGetAltRowStyle($i) .'>';
- $b .= '<td width="50%"><strong>'._('Total').':</strong></td>'.
- '<td width="25%" align="right"><strong>'.$total['adds']. '</strong></td>'.
- '<td width="25%" align="right"><strong>'.$total['commits'].'</strong></td>';
+ $b .= '<td class="halfwidth"><strong>'._('Total').':</strong></td>'.
+ '<td class="onequarterwidth align-right"><strong>'.$total['adds']. '</strong></td>'.
+ '<td class="onequarterwidth align-right"><strong>'.$total['commits'].'</strong></td>';
$b .= '</tr>';
$b .= $HTML->listTableBottom();
}
$repo_exists = true ;
}
+ if (forge_get_config('use_shell')) {
+ $unix_group = 'scm_' . $project->getUnixName() ;
+ } else {
+ $unix_group = forge_get_config ('apache_user') ;
+ }
+
if (!$repo_exists) {
- if (!mkdir($repo, 0700)) {
+ if (!@mkdir($repo, 0700)) {
return false;
}
$ret = 0;
system ("chmod 3777 $locks_dir") ;
if (forge_get_config('use_shell')) {
- $unix_group = 'scm_' . $project->getUnixName() ;
-
util_create_file_with_contents ("$repo/CVSROOT/config", "SystemAuth=no\nLockDir=$locks_dir\nUseNewInfoFmtStrings=yes\n");
if ($project->enableAnonSCM()) {
util_create_file_with_contents ("$repo/CVSROOT/readers", "anonymous\n");
system ("chgrp -R $unix_group $repo") ;
} else {
$unix_user = forge_get_config ('apache_user') ;
- $unix_group = forge_get_config ('apache_user') ;
system ("chmod -R g-rwx,o-rwx $repo") ;
system ("chown -R $unix_user:$unix_group $repo") ;
}
// mode: php
// c-file-style: "bsd"
// End:
-
-?>