* Copyright 2009, Roland Mas
* Copyright 2009, Mehdi Dogguy <mehdi@debian.org>
* Copyright 2012, Franck Villaume - TrivialDev
- * http://fusionforge.org
+ * Copyright © 2013
+ * Thorsten Glaser <t.glaser@tarent.de>
*
* This file is part of FusionForge.
*
$root = $params['root'];
$repodir = $root . '/users/' . $user_name . '.git' ;
- system("su - $user_name -c 'chgrp $unix_group $repodir'");
+ chgrp($repodir, $unix_group);
if ($project->enableAnonSCM()) {
chmod ($repodir, 02755);
} else {
} else {
$unix_group = forge_get_config('apache_group');
}
+ system ("chgrp $unix_group $root") ;
$main_repo = $root . '/' . $project_name . '.git' ;
if (!is_dir($main_repo) || (!is_file("$main_repo/HEAD") &&
system ("echo \"Git repository for $project_name\" > $tmp_repo/description") ;
system ("find $tmp_repo -type d | xargs chmod g+s") ;
system ("chgrp -R $unix_group $tmp_repo") ;
+ system ("chmod -R g+wX,o+rX-w $tmp_repo") ;
if ($project->enableAnonSCM()) {
system ("chmod g+wX,o+rX-w $root") ;
- system ("chmod -R g+wX,o+rX-w $tmp_repo") ;
} else {
system ("chmod g+wX,o-rwx $root") ;
- system ("chmod -R g+wX,o-rwx $tmp_repo") ;
+ system ("chmod g+wX,o-rwx $tmp_repo") ;
}
$ret = true;
/*
fwrite($config_f, "\$stylesheet = '". util_make_url('/plugins/scmgit/gitweb.css')."';\n");
fwrite($config_f, "\$javascript = '". util_make_url('/plugins/scmgit/gitweb.js')."';\n");
fwrite($config_f, "\$prevent_xss = 'true';\n");
+ fwrite($config_f, "\$feature{'actions'}{'default'} = [('project home', '" .
+ util_make_url('/plugins/scmgit/?func=grouppage/%n') .
+ "', 'summary')];\n");
fclose($config_f);
chmod ($fname.'.new', 0644) ;
rename ($fname.'.new', $fname) ;
$repo = forge_get_config('repos_path', 'scmgit') . '/' . $project->getUnixName() . '/' . $project->getUnixName() . '.git';
if (!is_dir ($repo) || !is_dir ("$repo/refs")) {
- // echo "No repository\n" ;
+ // echo "No repository $repo\n" ;
return false ;
}
$user2email[$last_user] = strtolower($matches['mail']);
} else {
// Short-commit stats line
- preg_match("/^(?P<mode>[AM])\s+(?P<file>.+)$/", $line, $matches);
+ $result = preg_match("/^(?P<mode>[AMD])\s+(?P<file>.+)$/", $line, $matches);
+ if (!$result) continue;
if ($last_user == "") continue;
+ if (!isset ($usr_adds[$last_user])) $usr_adds[$last_user] = 0;
+ if (!isset ($usr_updates[$last_user])) $usr_updates[$last_user] = 0;
+ if (!isset ($usr_deletes[$last_user])) $usr_deletes[$last_user] = 0;
if ($matches['mode'] == 'A') {
$usr_adds[$last_user]++;
$adds++;
}
}
- $uu = $usr_updates[$user] ? $usr_updates[$user] : 0 ;
- $ua = $usr_adds[$user] ? $usr_adds[$user] : 0 ;
+ $uu = isset ($usr_updates[$user]) ? $usr_updates[$user] : 0 ;
+ $ua = isset ($usr_adds[$user]) ? $usr_adds[$user] : 0 ;
if ($uu > 0 || $ua > 0) {
if (!db_query_params ('INSERT INTO stats_cvs_user (month,day,group_id,user_id,commits,adds) VALUES ($1,$2,$3,$4,$5,$6)',
array ($month_string,