if ($project->usesPlugin('svntracker')) { check_svn_tracker($row["unix_group_name"], $svn . "/" . $row["unix_group_name"][0] . "/" . $row["unix_group_name"]); } } else { passthru("[ ! -d {$svn}/" . $row["unix_group_name"] . " ] && {$svn_path}/svnadmin create {$repos_type} {$svn}/" . $row["unix_group_name"]); $cmd = 'chown -R ' . $file_owner . ' ' . $svn . '/' . $row["unix_group_name"]; passthru($cmd); // svn dir owned by apache or viewcvs doesn't work if ($project->usesPlugin('svncommitemail')) { check_svn_mail($row["unix_group_name"], $svn . "/" . $row["unix_group_name"]); } if ($project->usesPlugin('svntracker')) { check_svn_tracker($row["unix_group_name"], $svn . "/" . $row["unix_group_name"]); } } $access_file_content .= add2AccessFile($row["group_id"]); $cmd = 'chown -R ' . $file_owner . ' ' . $svn; passthru($cmd); } } // Now generate the contents for the password file $password_file_contents = ''; $res = db_query("SELECT * FROM users WHERE user_id IN (SELECT DISTINCT user_id FROM user_group ug, group_plugin gp, plugins p\n\tWHERE ug.group_id=gp.group_id AND gp.plugin_id=p.plugin_id AND p.plugin_name='scmsvn')"); $output = ""; if (!$res) { $err .= "Error! Database Query Failed: " . db_error(); echo $err; cron_entry(21, $err); exit; } while ($row =& db_fetch_array($res)) {
$err .= "Error! svndir_prefix Is Not Set Or Points To The Root Directory!"; echo $err; cron_entry(26, $err); exit; } $res = db_query("SELECT is_public,enable_anonscm,unix_group_name,groups.group_id \n\tFROM groups, plugins, group_plugin \n\tWHERE groups.status != 'P' \n\tAND groups.group_id=group_plugin.group_id\n\tAND group_plugin.plugin_id=plugins.plugin_id\n\tAND plugins.plugin_name='scmsvn'"); if (!$res) { $err .= "Error! Database Query Failed: " . db_error(); echo $err; cron_entry(26, $err); exit; } // The content of the access file used by svn authz apache2 module $access_file_content = ''; while ($group_row =& db_fetch_array($res)) { $access_file_content .= add2AccessFile($group_row['group_id']); if ($per_group_access) { writeAccessFile(sprintf($access_file, $group_row['unix_group_name']), $access_file_content); $access_file_content = ''; // Now generate the contents for the password file $res = db_query('SELECT user_name,unix_pw FROM users NATURAL JOIN user_group WHERE group_id=\'' . $group_row['group_id'] . '\''); if (!$res) { $err .= "Error! Database Query Failed: " . db_error(); echo $err; cron_entry(26, $err); exit; } $password_file_content = ''; while ($user_row =& db_fetch_array($res)) { if (!empty($user_row['unix_pw'])) { $password_file_content .= $user_row['user_name'] . ':' . $user_row['unix_pw'] . "\n";