forked from mfreiholz/iF.SVNAdmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
repositorylist.php
84 lines (72 loc) · 2.31 KB
/
repositorylist.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
* iF.SVNAdmin
* Copyright (c) 2010 by Manuel Freiholz
* http://www.insanefactory.com/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2
* of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.
*/
include("include/config.inc.php");
//
// Authentication
//
$engine = \svnadmin\core\Engine::getInstance();
if (!$engine->isProviderActive(PROVIDER_REPOSITORY_VIEW)) {
$engine->forwardError(ERROR_INVALID_MODULE);
}
$engine->checkUserAuthentication(true, ACL_MOD_REPO, ACL_ACTION_VIEW);
$appTR->loadModule("repositorylist");
//
// Actions
//
if (check_request_var("delete")) {
$engine->handleAction("delete_repository");
}
else if (check_request_var('dump')) {
$engine->handleAction('dump_repository');
exit(0);
}
else if (check_request_var('load')) {
exit(0);
}
//
// View data
//
$repositoryParentList = array();
$repositoryList = array();
try {
// Repository parent locations.
$repositoryParentList = $engine->getRepositoryViewProvider()->getRepositoryParents();
// Repositories of all locations.
foreach ($repositoryParentList as $rp) {
$repositoryList[$rp->identifier] = $engine->getRepositoryViewProvider()->getRepositoriesOfParent($rp);
usort($repositoryList[$rp->identifier], array('\svnadmin\core\entities\Repository', 'compare'));
}
// Show options column?
if (($engine->isProviderActive(PROVIDER_REPOSITORY_EDIT)
&& $engine->hasPermission(ACL_MOD_REPO, ACL_ACTION_DUMP)
&& $engine->getConfig()->getValueAsBoolean('GUI', 'RepositoryDumpEnabled', false))
){
SetValue('ShowOptions', true);
SetValue('ShowDumpOption', true);
}
}
catch (Exception $ex) {
$engine->addException($ex);
}
SetValue('RepositoryParentList', $repositoryParentList);
SetValue('RepositoryList', $repositoryList);
SetValue('ShowDeleteButton', $engine->getConfig()->getValueAsBoolean('GUI', 'RepositoryDeleteEnabled', true));
ProcessTemplate('repository/repositorylist.html.php');
?>