From: Martin V. <mar...@us...> - 2006-03-11 17:33:11
|
Update of /cvsroot/outreach/opt/cvsviewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5522/cvsviewer Modified Files: add_edit.php index.php view.php Log Message: Beautified source: Removed all ^M, created by DOS/Win editors Index: view.php =================================================================== RCS file: /cvsroot/outreach/opt/cvsviewer/view.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** view.php 11 Mar 2006 16:38:54 -0000 1.5 --- view.php 11 Mar 2006 17:32:20 -0000 1.6 *************** *** 1,139 **** ! <? ! # ! # CVS Information page for projects with unconfigured CVS or users who haven't used it at all yet. ! # ! include("../include/OPT_lib.php"); ! auth_open(); ! ?> ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> ! <HTML> ! <HEAD> ! <TITLE>Project Source Code</TITLE> ! <LINK REL=STYLESHEET TYPE="text/css" HREF="../include/opt_css.php"> ! <? echo $_OPT["head_xtra"]; ?> ! </HEAD> ! <? ! $rep = abs($rep); ! if (!$rep) ! { ! OPT_error("A valid repository must be provided!"); auth_close(); ! exit; ! } ! ! mainBody("../images"); ! make_main_title($action,"../images"); ! ! $proj = abs($proj); ! if (!$proj) ! { ! OPT_error("Error, you shouldn't be here without specifying a project."); auth_close(); ! exit; ! } ! ! if (!is_admin() && !crm_project_participant($CRM_user, $proj, DEVELOPER)) ! { ! OPT_error("Access denied."); auth_close(); ! exit; ! } ! ! ! // Handle the submission of an add or an update using MySQL REPLACE ! if ($submit) ! { ! // Verify that we have the required fields ! if (!$name || !$title || !$location || !$root_dir) ! { ! OPT_error("Missing required field. Please provide at least a name, title, location, and root directory."); auth_close(); ! exit; ! } ! ! // Ensure that the location contains a CVSROOT directory, ! // otherwise general system browsing would be possible ! if (!is_dir(realpath($location) . "/CVSROOT")) ! { ! OPT_error("You've specified a location directory that does not appear to be a valid CVS repository."); auth_close(); ! exit; ! } ! ! $sname = OPT_gpc_slashes($name); ! $stitle = OPT_gpc_slashes($title); ! $slocation = OPT_gpc_slashes(realpath($location)); ! $scvsusers = OPT_gpc_slashes($cvsusers); ! $sroot_dir = OPT_gpc_slashes($root_dir); ! $srestrictions = OPT_gpc_slashes($restrictions); ! $sql = "replace into code_repositories (id, project, name, title, location, cvsusers, root_dir, restrictions) values ! ($rep, $proj, '$sname', '$stitle', '$slocation', '$scvsusers', '$sroot_dir', '$srestrictions')"; ! crm_run_query($sql); // insert or update ! OPT_confirm("Successfully updated repository details."); ! } ! else ! { // Get the details from the database ! $sql = "select name, title, location, root_dir, cvsusers, restrictions from code_repositories ! where project = $proj and id = $rep"; ! $result = CRM_run_query($sql); ! if (OPT_num_rows($result) != 1) ! { ! OPT_error("Error: Repository not found!"); auth_close(); ! exit; ! } ! ! $row = OPT_fetch_row($result); ! $name = $row[0]; ! $title = $row[1]; ! $location = $row[2]; ! $root_dir = $row[3]; ! $cvsusers = $row[4]; ! $restrictions = $row[5]; ! } ! ! startTables(); ! ?> ! ! <tr><td colspan='2' bgcolor='<?echo($OPT_col_dk);?>' align='center'><b> ! <a href="../include/horde/chora/cvs.php?proj=<?echo($proj);?>&rep=<?echo($rep);?>&f=<?echo($root_dir);?>"><?echo($name)?></a> ! </b></td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Title</b> ! <div class='small'>A phrase to describe this repository.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'><?echo($title);?> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Location</b> ! <div class='small'>The path to the CVS repository on either local disk or via a network share like NFS. Should contain a CVSROOT directory.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'><?echo($location);?> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Root Directory</b> ! <div class='small'>Project team will have access to all data from this directory down. Typically this is '/', but when multiple projects share the same repository, you can specify only a certain path for this project.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'><?echo($root_dir);?> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Location</b> ! <div class='small'>Optionally, provide a user address map. Often 'CVSROOT/users'.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'><?echo($cvsusers);?> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Restrictions</b> ! <div class='small'>List (comma-separated) of perl-style regular expressions for those files ! whose contents should be protected and not displayed. For example, '^/?projectA/secrets/*','^/?projectA/secrets/*'</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'><?echo($restrictions);?> ! </td></tr> ! ! <? ! endTables(); ! auth_close(); ! ?> ! ! <script language="javascript"> ! <!-- ! parent.leftFrame.location="leftMenu/index.php?proj=<?echo($proj);?>&rep=<?echo($rep);?>"; ! // --> ! </script> ! </BODY> ! </HTML> --- 1,139 ---- ! <? ! # ! # CVS Information page for projects with unconfigured CVS or users who haven't used it at all yet. ! # ! include("../include/OPT_lib.php"); ! auth_open(); ! ?> ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> ! <HTML> ! <HEAD> ! <TITLE>Project Source Code</TITLE> ! <LINK REL=STYLESHEET TYPE="text/css" HREF="../include/opt_css.php"> ! <? echo $_OPT["head_xtra"]; ?> ! </HEAD> ! <? ! $rep = abs($rep); ! if (!$rep) ! { ! OPT_error("A valid repository must be provided!"); auth_close(); ! exit; ! } ! ! mainBody("../images"); ! make_main_title($action,"../images"); ! ! $proj = abs($proj); ! if (!$proj) ! { ! OPT_error("Error, you shouldn't be here without specifying a project."); auth_close(); ! exit; ! } ! ! if (!is_admin() && !crm_project_participant($CRM_user, $proj, DEVELOPER)) ! { ! OPT_error("Access denied."); auth_close(); ! exit; ! } ! ! ! // Handle the submission of an add or an update using MySQL REPLACE ! if ($submit) ! { ! // Verify that we have the required fields ! if (!$name || !$title || !$location || !$root_dir) ! { ! OPT_error("Missing required field. Please provide at least a name, title, location, and root directory."); auth_close(); ! exit; ! } ! ! // Ensure that the location contains a CVSROOT directory, ! // otherwise general system browsing would be possible ! if (!is_dir(realpath($location) . "/CVSROOT")) ! { ! OPT_error("You've specified a location directory that does not appear to be a valid CVS repository."); auth_close(); ! exit; ! } ! ! $sname = OPT_gpc_slashes($name); ! $stitle = OPT_gpc_slashes($title); ! $slocation = OPT_gpc_slashes(realpath($location)); ! $scvsusers = OPT_gpc_slashes($cvsusers); ! $sroot_dir = OPT_gpc_slashes($root_dir); ! $srestrictions = OPT_gpc_slashes($restrictions); ! $sql = "replace into code_repositories (id, project, name, title, location, cvsusers, root_dir, restrictions) values ! ($rep, $proj, '$sname', '$stitle', '$slocation', '$scvsusers', '$sroot_dir', '$srestrictions')"; ! crm_run_query($sql); // insert or update ! OPT_confirm("Successfully updated repository details."); ! } ! else ! { // Get the details from the database ! $sql = "select name, title, location, root_dir, cvsusers, restrictions from code_repositories ! where project = $proj and id = $rep"; ! $result = CRM_run_query($sql); ! if (OPT_num_rows($result) != 1) ! { ! OPT_error("Error: Repository not found!"); auth_close(); ! exit; ! } ! ! $row = OPT_fetch_row($result); ! $name = $row[0]; ! $title = $row[1]; ! $location = $row[2]; ! $root_dir = $row[3]; ! $cvsusers = $row[4]; ! $restrictions = $row[5]; ! } ! ! startTables(); ! ?> ! ! <tr><td colspan='2' bgcolor='<?echo($OPT_col_dk);?>' align='center'><b> ! <a href="../include/horde/chora/cvs.php?proj=<?echo($proj);?>&rep=<?echo($rep);?>&f=<?echo($root_dir);?>"><?echo($name)?></a> ! </b></td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Title</b> ! <div class='small'>A phrase to describe this repository.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'><?echo($title);?> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Location</b> ! <div class='small'>The path to the CVS repository on either local disk or via a network share like NFS. Should contain a CVSROOT directory.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'><?echo($location);?> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Root Directory</b> ! <div class='small'>Project team will have access to all data from this directory down. Typically this is '/', but when multiple projects share the same repository, you can specify only a certain path for this project.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'><?echo($root_dir);?> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Location</b> ! <div class='small'>Optionally, provide a user address map. Often 'CVSROOT/users'.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'><?echo($cvsusers);?> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Restrictions</b> ! <div class='small'>List (comma-separated) of perl-style regular expressions for those files ! whose contents should be protected and not displayed. For example, '^/?projectA/secrets/*','^/?projectA/secrets/*'</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'><?echo($restrictions);?> ! </td></tr> ! ! <? ! endTables(); ! auth_close(); ! ?> ! ! <script language="javascript"> ! <!-- ! parent.leftFrame.location="leftMenu/index.php?proj=<?echo($proj);?>&rep=<?echo($rep);?>"; ! // --> ! </script> ! </BODY> ! </HTML> Index: add_edit.php =================================================================== RCS file: /cvsroot/outreach/opt/cvsviewer/add_edit.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** add_edit.php 11 Mar 2006 16:38:54 -0000 1.5 --- add_edit.php 11 Mar 2006 17:32:20 -0000 1.6 *************** *** 1,126 **** ! <? ! # ! # CVS Information page for projects with unconfigured CVS or users who haven't used it at all yet. ! # ! include("../include/OPT_lib.php"); ! auth_open(); ! ?> ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> ! <HTML> ! <HEAD> ! <TITLE>Project Source Code</TITLE> ! <LINK REL=STYLESHEET TYPE="text/css" HREF="../include/opt_css.php"> ! <? echo $_OPT["head_xtra"]; ?> ! </HEAD> ! <? ! $rep = abs($rep); ! if ($rep) ! { ! $action = 'Edit Repository'; ! } ! else ! { ! $action = 'Add Repository'; ! } ! ! mainBody("../images"); ! make_main_title($action,"../images"); ! ! $proj = abs($proj); ! if (!$proj) ! { ! OPT_error("Error, you shouldn't be here without specifying a project."); auth_close(); ! exit; ! } ! if (!is_admin() && !crm_project_participant($CRM_user, $proj, DEVELOPER)) ! { ! OPT_error("Access denied."); auth_close(); ! exit; ! } ! ?> ! ! <? ! if ($rep) ! { ! $sql = "select name, title, location, root_dir, cvsusers, restrictions from code_repositories ! where project = $proj and id = $rep"; ! $result = CRM_run_query($sql); ! if (OPT_num_rows($result) != 1) ! { ! OPT_error("Error: Repository not found!"); auth_close(); ! exit; ! } ! ! $row = OPT_fetch_row($result); ! $name = $row[0]; ! $title = $row[1]; ! $location = $row[2]; ! $root_dir = $row[3]; ! $cvsusers = $row[4]; ! $restrictions = $row[5]; ! } ! else ! { // Default values for these variables ! $root_dir = '/'; ! $location = '/var/cvs'; ! $rep = OPT_get_id("code_repositories"); ! } ! startTables(); ! ?> ! <form action="view.php" method='post' style="margin:0px;"> ! <tr><td colspan='2' bgcolor='<?echo($OPT_col_dk);?>' align='center'><b>Please complete the form below...</b></td></tr> ! ! <tr><td colspan='2' bgcolor='<?echo($OPT_col_lt);?>' align='left'><div class='small'>A project may have one or more CVS root directories browesable from its project page. This means that each OPT repository could be the same CVS repository with different root directories. The CVS viewer requires filesystem access to the CVS repository. This is easy if you run OPT on the same machine as your CVS server, however on could use NFS if two different machines are involved.</div></td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Name</b> ! <div class='small'>A short name used to identify this repository.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'> ! <input type='text' name='name' value='<?echo($name);?>' size='20' maxlength='16'> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Title</b> ! <div class='small'>A phrase to describe this repository.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'> ! <input type='text' name='title' value='<?echo($title);?>' size='35' maxlength='64'> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Location</b> ! <div class='small'>The path to the CVS repository on either local disk or via a network share like NFS. Should contain a CVSROOT directory.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'> ! <input type='text' name='location' value='<?echo($location);?>' size='50' maxlength='255'> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Root Directory</b> ! <div class='small'>Project team will have access to all data within this directory under CVSROOT. Typically this is '/', but when multiple projects share the same repository, you can specify only a certain path for this project.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'> ! <input type='text' name='root_dir' value='<?echo($root_dir);?>' size='50' maxlength='128'> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>CVS Users Map</b> ! <div class='small'>Optionally, provide a user address map. Often 'CVSROOT/users'.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'> ! <input type='text' name='cvsusers' value='<?echo($cvsusers);?>' size='35' maxlength='64'> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Restrictions</b> ! <div class='small'>List (comma-separated) of perl-style regular expressions for those files ! whose contents should be protected and not displayed. For example, '^/?projectA/secrets/*','^/?projectA/secrets/*'</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'> ! <input type='text' name='restrictions' value='<?echo($restrictions);?>' size='50' maxlength='255'> ! </td></tr> ! ! ! <tr><td colspan='2' bgcolor='<?echo($OPT_col_dk);?>' align='center'> ! <input type='hidden' name='rep' value='<?echo($rep);?>'> ! <input type='hidden' name='proj' value='<?echo($proj);?>'> ! <input type="submit" name='submit' value='Submit'></td></tr> ! </form> ! <? ! endTables(); ! auth_close(); ! ?> ! </BODY> ! </HTML> --- 1,126 ---- ! <? ! # ! # CVS Information page for projects with unconfigured CVS or users who haven't used it at all yet. ! # ! include("../include/OPT_lib.php"); ! auth_open(); ! ?> ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> ! <HTML> ! <HEAD> ! <TITLE>Project Source Code</TITLE> ! <LINK REL=STYLESHEET TYPE="text/css" HREF="../include/opt_css.php"> ! <? echo $_OPT["head_xtra"]; ?> ! </HEAD> ! <? ! $rep = abs($rep); ! if ($rep) ! { ! $action = 'Edit Repository'; ! } ! else ! { ! $action = 'Add Repository'; ! } ! ! mainBody("../images"); ! make_main_title($action,"../images"); ! ! $proj = abs($proj); ! if (!$proj) ! { ! OPT_error("Error, you shouldn't be here without specifying a project."); auth_close(); ! exit; ! } ! if (!is_admin() && !crm_project_participant($CRM_user, $proj, DEVELOPER)) ! { ! OPT_error("Access denied."); auth_close(); ! exit; ! } ! ?> ! ! <? ! if ($rep) ! { ! $sql = "select name, title, location, root_dir, cvsusers, restrictions from code_repositories ! where project = $proj and id = $rep"; ! $result = CRM_run_query($sql); ! if (OPT_num_rows($result) != 1) ! { ! OPT_error("Error: Repository not found!"); auth_close(); ! exit; ! } ! ! $row = OPT_fetch_row($result); ! $name = $row[0]; ! $title = $row[1]; ! $location = $row[2]; ! $root_dir = $row[3]; ! $cvsusers = $row[4]; ! $restrictions = $row[5]; ! } ! else ! { // Default values for these variables ! $root_dir = '/'; ! $location = '/var/cvs'; ! $rep = OPT_get_id("code_repositories"); ! } ! startTables(); ! ?> ! <form action="view.php" method='post' style="margin:0px;"> ! <tr><td colspan='2' bgcolor='<?echo($OPT_col_dk);?>' align='center'><b>Please complete the form below...</b></td></tr> ! ! <tr><td colspan='2' bgcolor='<?echo($OPT_col_lt);?>' align='left'><div class='small'>A project may have one or more CVS root directories browesable from its project page. This means that each OPT repository could be the same CVS repository with different root directories. The CVS viewer requires filesystem access to the CVS repository. This is easy if you run OPT on the same machine as your CVS server, however on could use NFS if two different machines are involved.</div></td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Name</b> ! <div class='small'>A short name used to identify this repository.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'> ! <input type='text' name='name' value='<?echo($name);?>' size='20' maxlength='16'> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Title</b> ! <div class='small'>A phrase to describe this repository.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'> ! <input type='text' name='title' value='<?echo($title);?>' size='35' maxlength='64'> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Location</b> ! <div class='small'>The path to the CVS repository on either local disk or via a network share like NFS. Should contain a CVSROOT directory.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'> ! <input type='text' name='location' value='<?echo($location);?>' size='50' maxlength='255'> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Root Directory</b> ! <div class='small'>Project team will have access to all data within this directory under CVSROOT. Typically this is '/', but when multiple projects share the same repository, you can specify only a certain path for this project.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'> ! <input type='text' name='root_dir' value='<?echo($root_dir);?>' size='50' maxlength='128'> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>CVS Users Map</b> ! <div class='small'>Optionally, provide a user address map. Often 'CVSROOT/users'.</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'> ! <input type='text' name='cvsusers' value='<?echo($cvsusers);?>' size='35' maxlength='64'> ! </td></tr> ! ! <tr><td bgcolor='<?echo($OPT_col_md);?>' align='right' width='50%'><b>Restrictions</b> ! <div class='small'>List (comma-separated) of perl-style regular expressions for those files ! whose contents should be protected and not displayed. For example, '^/?projectA/secrets/*','^/?projectA/secrets/*'</div></td> ! <td bgcolor='<?echo($OPT_col_lt);?>' align='left'> ! <input type='text' name='restrictions' value='<?echo($restrictions);?>' size='50' maxlength='255'> ! </td></tr> ! ! ! <tr><td colspan='2' bgcolor='<?echo($OPT_col_dk);?>' align='center'> ! <input type='hidden' name='rep' value='<?echo($rep);?>'> ! <input type='hidden' name='proj' value='<?echo($proj);?>'> ! <input type="submit" name='submit' value='Submit'></td></tr> ! </form> ! <? ! endTables(); ! auth_close(); ! ?> ! </BODY> ! </HTML> Index: index.php =================================================================== RCS file: /cvsroot/outreach/opt/cvsviewer/index.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.php 11 Mar 2006 16:38:54 -0000 1.4 --- index.php 11 Mar 2006 17:32:20 -0000 1.5 *************** *** 1,95 **** ! <? ! # ! # CVS Information page for projects with unconfigured CVS or users who haven't used it at all yet. ! # ! include("../include/OPT_lib.php"); ! auth_open(); ! include("$CRM_inc/cvs_parser.php"); ! checkCVSLogs(); ! ?> ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> ! <HTML> ! <HEAD> ! <TITLE>Project Source Code</TITLE> ! <LINK REL=STYLESHEET TYPE="text/css" HREF="../include/opt_css.php"> ! <? echo $_OPT["head_xtra"]; ?> ! </HEAD> ! <? ! mainBody("../images"); ! make_main_title("Project Source Code","../images"); ! ! $proj = abs($proj); ! if (!$proj) ! { ! OPT_error("Error, you shouldn't be here without specifying a project."); auth_close(); ! exit; ! } ! ! if (!is_admin() && !crm_project_participant($CRM_user, $proj, DEVELOPER)) ! { ! OPT_error("Access denied."); auth_close(); ! exit; ! } ! ! // Drop a repository if necessary... ! $rep = abs($rep); ! if ($rep && ($action == "delete") && crm_perm("code_repositories", $rep, DELETE)) ! { ! crm_run_query("delete from code_repositories where project = $proj and id = $rep"); ! } ! ?> ! ! <? // TWO CASES: Either this project has CVS configured or it doesn't ! $sql = "select id, name, title, location, root_dir from code_repositories where project = $proj"; ! $result = crm_run_query($sql); ! if (OPT_num_rows($result) == 0) ! { ! echo("<br /><br /><br /><br />"); ! startTables("50%"); ! echo("<tr><td bgcolor='$OPT_col_md' align='center'><b>No code repositories configured.</b></td></tr>"); ! echo("<tr><td bgcolor='$OPT_col_lt' align='left'>OPT does not have any CVS repositories listed for this project. If you are the project manager and would like to use this feature, click the 'Add Repositories' link in the left menu.<br><br>The OPT CVS Viewer is an integrated version of the <a href='http://www.horde.org/chora/' target='_blank'>Chora</a> viewer, part of the <a href='http://www.horde.org' target='_blank'>Horde</a> project.</td></tr>"); ! endTables(); ! } ! else ! { ! echo("<br /><br /><br /><br />"); ! startTables("75%"); ! echo("<tr>"); ! echo("<th bgcolor='$OPT_col_md'>Name</th>"); ! echo("<th bgcolor='$OPT_col_md'>Title</th>"); ! echo("<th bgcolor='$OPT_col_md'>Location</th>"); ! echo("<th bgcolor='$OPT_col_md'>Root Directory</th>"); ! echo("</tr>"); ! while ($row = OPT_fetch_array($result)) ! { ! echo("<tr>"); ! echo("<td bgcolor='$OPT_col_lt'><a href='view.php?proj=$proj&rep=$row[0]'>" . ! stripslashes($row["name"])."</a></td>"); ! echo("<td bgcolor='$OPT_col_lt'>".stripslashes($row["title"])."</td>"); ! echo("<td bgcolor='$OPT_col_lt'>".stripslashes($row["location"])."</td>"); ! echo("<td bgcolor='$OPT_col_lt'>".stripslashes($row["root_dir"])."</td>"); ! echo("</tr>"); ! } ! endTables(); ! } ! auth_close(); ! ?> ! ! <? ! if ($action == "delete") ! { ! ?> ! <script language="javascript"> ! <!-- ! parent.leftFrame.location="leftMenu/index.php?proj=<?echo($proj);?>"; ! // --> ! </script> ! <? ! } ! ?> ! ! ! </BODY> ! </HTML> --- 1,95 ---- ! <? ! # ! # CVS Information page for projects with unconfigured CVS or users who haven't used it at all yet. ! # ! include("../include/OPT_lib.php"); ! auth_open(); ! include("$CRM_inc/cvs_parser.php"); ! checkCVSLogs(); ! ?> ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> ! <HTML> ! <HEAD> ! <TITLE>Project Source Code</TITLE> ! <LINK REL=STYLESHEET TYPE="text/css" HREF="../include/opt_css.php"> ! <? echo $_OPT["head_xtra"]; ?> ! </HEAD> ! <? ! mainBody("../images"); ! make_main_title("Project Source Code","../images"); ! ! $proj = abs($proj); ! if (!$proj) ! { ! OPT_error("Error, you shouldn't be here without specifying a project."); auth_close(); ! exit; ! } ! ! if (!is_admin() && !crm_project_participant($CRM_user, $proj, DEVELOPER)) ! { ! OPT_error("Access denied."); auth_close(); ! exit; ! } ! ! // Drop a repository if necessary... ! $rep = abs($rep); ! if ($rep && ($action == "delete") && crm_perm("code_repositories", $rep, DELETE)) ! { ! crm_run_query("delete from code_repositories where project = $proj and id = $rep"); ! } ! ?> ! ! <? // TWO CASES: Either this project has CVS configured or it doesn't ! $sql = "select id, name, title, location, root_dir from code_repositories where project = $proj"; ! $result = crm_run_query($sql); ! if (OPT_num_rows($result) == 0) ! { ! echo("<br /><br /><br /><br />"); ! startTables("50%"); ! echo("<tr><td bgcolor='$OPT_col_md' align='center'><b>No code repositories configured.</b></td></tr>"); ! echo("<tr><td bgcolor='$OPT_col_lt' align='left'>OPT does not have any CVS repositories listed for this project. If you are the project manager and would like to use this feature, click the 'Add Repositories' link in the left menu.<br><br>The OPT CVS Viewer is an integrated version of the <a href='http://www.horde.org/chora/' target='_blank'>Chora</a> viewer, part of the <a href='http://www.horde.org' target='_blank'>Horde</a> project.</td></tr>"); ! endTables(); ! } ! else ! { ! echo("<br /><br /><br /><br />"); ! startTables("75%"); ! echo("<tr>"); ! echo("<th bgcolor='$OPT_col_md'>Name</th>"); ! echo("<th bgcolor='$OPT_col_md'>Title</th>"); ! echo("<th bgcolor='$OPT_col_md'>Location</th>"); ! echo("<th bgcolor='$OPT_col_md'>Root Directory</th>"); ! echo("</tr>"); ! while ($row = OPT_fetch_array($result)) ! { ! echo("<tr>"); ! echo("<td bgcolor='$OPT_col_lt'><a href='view.php?proj=$proj&rep=$row[0]'>" . ! stripslashes($row["name"])."</a></td>"); ! echo("<td bgcolor='$OPT_col_lt'>".stripslashes($row["title"])."</td>"); ! echo("<td bgcolor='$OPT_col_lt'>".stripslashes($row["location"])."</td>"); ! echo("<td bgcolor='$OPT_col_lt'>".stripslashes($row["root_dir"])."</td>"); ! echo("</tr>"); ! } ! endTables(); ! } ! auth_close(); ! ?> ! ! <? ! if ($action == "delete") ! { ! ?> ! <script language="javascript"> ! <!-- ! parent.leftFrame.location="leftMenu/index.php?proj=<?echo($proj);?>"; ! // --> ! </script> ! <? ! } ! ?> ! ! ! </BODY> ! </HTML> |