websvn |
Subversion Repositories: |
Rev 1 | Rev 3 | |
---|---|---|
Line 24... | Line 24... | |
|
| |
// --- CONFIGURE THIS VARIABLE --- |
// --- CONFIGURE THIS VARIABLE --- | |
|
| |
// Location of websvn directory via HTTP |
// Location of websvn directory via HTTP | |
// |
// | |
// e.g. For http://servername/websvn use /websvn |
// e.g. For "http://www.example.com/websvn" use "/websvn" | |
// |
// | |
// Note that wsvn.php need not be in the /websvn directory (and normally isn't). |
// Note that wsvn.php need not be in the /websvn directory (and normally isn't). | |
// If you want to use the root server directory, just use a blank string (''). |
// If you want to use the root server directory, just use a blank string (''). | |
//$locwebsvnhttp = "/websvn"; |
//$locwebsvnhttp = "/websvn"; | |
$locwebsvnhttp = ''; |
$locwebsvnhttp = ''; | |
|
| |
// Physical location of websvn directory. Change this if your wsvn.php is not in the |
// Physical location of websvn directory. Change this if your wsvn.php is not in | |
// same folder as the rest of the distribution |
// the same folder as the rest of the distribution | |
$locwebsvnreal = dirname(__FILE__); |
$locwebsvnreal = dirname(__FILE__); | |
|
| |
// --- DON'T CHANGE BELOW HERE --- |
// --- DON'T CHANGE BELOW HERE --- | |
|
| |
chdir($locwebsvnreal); |
chdir($locwebsvnreal); | |
|
| |
// this tells files that we are in multiviews if they are unable to access |
// Tell files that we are using multiviews if they are unable to access $config. | |
// the $config variable |
||
if (!defined('WSVN_MULTIVIEWS')) { |
if (!defined('WSVN_MULTIVIEWS')) { | |
define('WSVN_MULTIVIEWS', 1); |
define('WSVN_MULTIVIEWS', 1); | |
} |
} | |
|
| |
ini_set("include_path", $locwebsvnreal); |
ini_set("include_path", $locwebsvnreal); | |
Line 75... | Line 74... | |
} |
} | |
|
| |
// Split the path into repository and path elements |
// Split the path into repository and path elements | |
// Note: we have to cope with the repository name |
// Note: we have to cope with the repository name | |
// having a slash in it |
// having a slash in it | |
|
||
$found = false; |
||
|
| |
$pos = strpos($path, '/'); |
$pos = strpos($path, '/'); | |
if ($pos === false) { |
if ($pos === false) { | |
$pos = strlen($path); |
$pos = strlen($path); | |
} |
} | |
$name = substr($path, 0, $pos); |
$name = substr($path, 0, $pos); | |
|
| |
foreach ($config->getRepositories() as $rep) { |
$rep =& $config->findRepository($name); | |
if (strcasecmp($rep->getDisplayName(), $name) == 0) { |
if ($rep != null) { | |
$found = true; |
$path = substr($path, $pos); | |
$path = substr($path, $pos); |
if ($path == '') { | |
if ($path == '') { |
$path = '/'; | |
$path = '/'; |
||
} |
||
break; |
||
} |
} | |
} |
} else { | |
|
||
if ($found == false) { |
||
include("$locwebsvnreal/index.php"); |
include("$locwebsvnreal/index.php"); | |
exit; |
exit; | |
} |
} | |
|
| |
createProjectSelectionForm(); |
createProjectSelectionForm(); | |
createRevisionSelectionForm(); |
createRevisionSelectionForm(); | |
$vars["allowdownload"] = $rep->getAllowDownload(); |
$vars["allowdownload"] = $rep->getAllowDownload(); | |
$vars["repname"] = htmlentities($rep->getDisplayName(), ENT_QUOTES, 'UTF-8'); | ||
|
| |
// find the operation type |
// find the operation type | |
$op = @$_REQUEST["op"]; |
$op = @$_REQUEST["op"]; | |
switch ($op) { |
switch ($op) { | |
case "dir": |
case "dir": | |
Line 135... | Line 128... | |
break; |
break; | |
case "comp": |
case "comp": | |
$file = "comp.php"; |
$file = "comp.php"; | |
break; |
break; | |
default: |
default: | |
if ($path[strlen($path) - 1] == "/") { |
$svnrep = new SVNRepository($rep); | |
$file = "listing.php"; |
if ($svnrep->isFile($path, $rev)) { | |
} else { |
||
$file = "filedetails.php"; |
$file = "filedetails.php"; | |
} else { | ||
$file = "listing.php"; | ||
} |
} | |
break; |
break; | |
} |
} | |
|
| |
// Now include the file that handles it |
// Now include the file that handles it |