Skip to content

Commit d6128ef

Browse files
committed
fix to install scripts
0 parents  commit d6128ef

File tree

128 files changed

+18423
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+18423
-0
lines changed

.htaccess

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Other restrictions
2+
Order Allow,Deny
3+
Allow from all

COPYING

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
**************************
2+
Installation
3+
Copy this entire directory to your web server under a directory named '/coral/licensing/', then point your web browser to:
4+
http://your_server/coral/licensing/install/
5+
and follow instructions
6+
7+
For the manual install, refer to the Technical Documentation available on http://erm.library.nd.edu
8+
9+
10+
**************************
11+
License / Copyright notices
12+
13+
Copyright (c) 2010 University of Notre Dame
14+
This file is part of CORAL.
15+
CORAL 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, either version 3 of the License, or (at your option) any later version.
16+
CORAL 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.
17+
You should have received a copy of the GNU General Public License along with CORAL. If not, see <http://www.gnu.org/licenses/>.
18+
19+
20+
**************************
21+
To contact the CORAL team:
22+

admin.php

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
<?php
2+
3+
/*
4+
**************************************************************************************************************************
5+
** CORAL Licensing Module v. 1.0
6+
**
7+
** Copyright (c) 2010 University of Notre Dame
8+
**
9+
** This file is part of CORAL.
10+
**
11+
** CORAL 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, either version 3 of the License, or (at your option) any later version.
12+
**
13+
** CORAL 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.
14+
**
15+
** You should have received a copy of the GNU General Public License along with CORAL. If not, see <http://www.gnu.org/licenses/>.
16+
**
17+
**************************************************************************************************************************
18+
*/
19+
20+
include_once 'directory.php';
21+
22+
$pageTitle='Administration';
23+
include 'templates/header.php';
24+
25+
//set referring page
26+
$_SESSION['ref_script']=$currentPage;
27+
28+
if ($user->isAdmin()){
29+
30+
?>
31+
32+
33+
<table class="headerTable">
34+
<tr><td>
35+
<span class="headerText">Users</span>&nbsp;&nbsp;<span id='span_User_response' class='redText'></span>
36+
<br /><span id='span_newUser' class='adminAddInput'><a href='ajax_forms.php?action=getAdminUserUpdateForm&height=202&width=288&modal=true' class='thickbox' id='expression'>add new user</a></span>
37+
<br /><br />
38+
<div id='div_User'>
39+
<img src = "images/circle.gif">Loading...
40+
</div>
41+
</td></tr>
42+
</table>
43+
44+
45+
46+
47+
<br />
48+
<br />
49+
50+
<table class="headerTable">
51+
<tr><td>
52+
<span class="headerText">Document Types</span>&nbsp;&nbsp;<span id='span_DocumentType_response'></span>
53+
<br /><span id='span_newDocumentType' class='adminAddInput'><a href='javascript:showAdd("DocumentType");'>add new document type</a></span>
54+
<br /><br />
55+
<div id='div_DocumentType'>
56+
<img src = "images/circle.gif">Loading...
57+
</div>
58+
</td></tr>
59+
</table>
60+
61+
<br />
62+
<br />
63+
64+
<table class="headerTable">
65+
<tr><td>
66+
<span class="headerText">Expression Types</span>&nbsp;&nbsp;<span id='span_ExpressionType_response'></span>
67+
<br /><span id='span_newExpressionType' class='adminAddInput'><a href='ajax_forms.php?action=getExpressionTypeForm&height=148&width=265&modal=true' class='thickbox' id='expressionType'>add new expression type</a></span>
68+
<br /><br />
69+
<div id='div_ExpressionType'>
70+
<img src = "images/circle.gif">Loading...
71+
</div>
72+
</td></tr>
73+
</table>
74+
75+
<br />
76+
<br />
77+
<table class="headerTable">
78+
<tr><td>
79+
<span class="headerText">Qualifiers</span>&nbsp;&nbsp;<span id='span_Qualifier_response'></span>
80+
<br /><span id='span_newQualifier' class='adminAddInput'><a href='ajax_forms.php?action=getQualifierForm&height=148&width=295&modal=true' class='thickbox'>add new qualifier</a></span>
81+
<br /><br />
82+
<div id='div_Qualifier'>
83+
<img src = "images/circle.gif">Loading...
84+
</div>
85+
</td></tr>
86+
</table>
87+
88+
<br />
89+
<br />
90+
91+
<table class="headerTable">
92+
<tr><td>
93+
<span class="headerText">Signature Types</span>&nbsp;&nbsp;<span id='span_SignatureType_response'></span>
94+
<br /><span id='span_newSignatureType' class='adminAddInput'><a href='javascript:showAdd("SignatureType");'>add new signature type</a></span>
95+
<br /><br />
96+
<div id='div_SignatureType'>
97+
<img src = "images/circle.gif">Loading...
98+
</div>
99+
</td></tr>
100+
</table>
101+
102+
<br />
103+
<br />
104+
105+
106+
<table class="headerTable">
107+
<tr><td>
108+
<span class="headerText">License Statuses</span>&nbsp;&nbsp;<span id='span_Status_response'></span>
109+
<br /><span id='span_newStatus' class='adminAddInput'><a href='javascript:showAdd("Status");'>add new license status</a></span>
110+
<br /><br />
111+
<div id='div_Status'>
112+
<img src = "images/circle.gif">Loading...
113+
</div>
114+
</td></tr>
115+
</table>
116+
117+
<br />
118+
<br />
119+
120+
121+
122+
<?php
123+
124+
$config = new Configuration;
125+
126+
//if the org module is not installed, display provider list for updates
127+
if ($config->settings->organizationsModule != 'Y'){ ?>
128+
129+
130+
<br />
131+
<br />
132+
133+
<table class="headerTable">
134+
<tr><td>
135+
<span class="headerText">Consortia</span>&nbsp;&nbsp;<span id='span_Consortium_response'></span>
136+
<br /><span id='span_newConsortium' class='adminAddInput'><a href='javascript:showAdd("Consortium");'>add new consortium</a></span>
137+
<br /><br />
138+
<div id='div_Consortium'>
139+
<img src = "images/circle.gif">Loading...
140+
</div>
141+
</td></tr>
142+
</table>
143+
144+
<br />
145+
<br />
146+
147+
<table class="headerTable">
148+
<tr><td>
149+
<span class="headerText">Providers</span>&nbsp;&nbsp;<span id='span_Organization_response'></span>
150+
<br /><span id='span_newOrganization' class='adminAddInput'><a href='javascript:showAdd("Organization");'>add new provider</a></span>
151+
<br /><br />
152+
<div id='div_Organization'>
153+
<img src = "images/circle.gif">Loading...
154+
</div>
155+
</td></tr>
156+
</table>
157+
158+
<?php } ?>
159+
160+
<br />
161+
162+
<script type="text/javascript" src="js/admin.js"></script>
163+
164+
<?php
165+
}else{
166+
echo "You don't have permission to access this page";
167+
}
168+
169+
include 'templates/footer.php';
170+
?>
171+

admin/.htaccess

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
order deny,allow
2+
deny from all
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
/*
3+
**************************************************************************************************************************
4+
** CORAL Licensing Module v. 1.0
5+
**
6+
** Copyright (c) 2010 University of Notre Dame
7+
**
8+
** This file is part of CORAL.
9+
**
10+
** CORAL 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, either version 3 of the License, or (at your option) any later version.
11+
**
12+
** CORAL 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.
13+
**
14+
** You should have received a copy of the GNU General Public License along with CORAL. If not, see <http://www.gnu.org/licenses/>.
15+
**
16+
**************************************************************************************************************************
17+
*/
18+
19+
20+
class Configuration extends DynamicObject {
21+
22+
public function init(NamedArguments $arguments) {
23+
$arguments->setDefaultValueForArgumentName('filename', BASE_DIR . '/admin/configuration.ini');
24+
$config = parse_ini_file($arguments->filename, true);
25+
foreach ($config as $section => $entries) {
26+
$this->$section = Utility::objectFromArray($entries);
27+
}
28+
}
29+
30+
}
31+
32+
?>

admin/classes/common/DBService.php

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?php
2+
/*
3+
**************************************************************************************************************************
4+
** CORAL Licensing Module v. 1.0
5+
**
6+
** Copyright (c) 2010 University of Notre Dame
7+
**
8+
** This file is part of CORAL.
9+
**
10+
** CORAL 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, either version 3 of the License, or (at your option) any later version.
11+
**
12+
** CORAL 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.
13+
**
14+
** You should have received a copy of the GNU General Public License along with CORAL. If not, see <http://www.gnu.org/licenses/>.
15+
**
16+
**************************************************************************************************************************
17+
*/
18+
19+
20+
21+
class DBService extends Object {
22+
23+
protected $db;
24+
protected $config;
25+
protected $error;
26+
27+
protected function init(NamedArguments $arguments) {
28+
parent::init($arguments);
29+
$this->config = new Configuration;
30+
$this->connect();
31+
}
32+
33+
protected function dealloc() {
34+
$this->disconnect();
35+
parent::dealloc();
36+
}
37+
38+
protected function checkForError() {
39+
if ($this->error = mysql_error($this->db)) {
40+
throw new Exception("There was a problem with the database: " . $this->error);
41+
}
42+
}
43+
44+
protected function connect() {
45+
$host = $this->config->database->host;
46+
$username = $this->config->database->username;
47+
$password = $this->config->database->password;
48+
$this->db = mysql_connect($host, $username, $password);
49+
$this->checkForError();
50+
51+
$databaseName = $this->config->database->name;
52+
mysql_select_db($databaseName, $this->db);
53+
$this->checkForError();
54+
}
55+
56+
protected function disconnect() {
57+
//mysql_close($this->db);
58+
}
59+
60+
public function processQuery($sql, $type = NULL) {
61+
//echo $sql. "<br />";
62+
$result = mysql_query($sql, $this->db);
63+
$this->checkForError();
64+
$data = array();
65+
66+
if (is_resource($result)) {
67+
$resultType = MYSQL_NUM;
68+
if ($type == 'assoc') {
69+
$resultType = MYSQL_ASSOC;
70+
}
71+
while ($row = mysql_fetch_array($result, $resultType)) {
72+
if (mysql_affected_rows($this->db) > 1) {
73+
array_push($data, $row);
74+
} else {
75+
$data = $row;
76+
}
77+
}
78+
mysql_free_result($result);
79+
} else if ($result) {
80+
$data = mysql_insert_id($this->db);
81+
}
82+
83+
return $data;
84+
}
85+
86+
}
87+
88+
?>

0 commit comments

Comments
 (0)