|
@@ -20,7 +20,7 @@ discard block |
|
|
block discarded – undo |
|
20
|
20
|
*/ |
|
21
|
21
|
?> |
|
22
|
22
|
<?php |
|
23
|
|
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php"; |
|
|
23
|
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php"; |
|
24
|
24
|
|
|
25
|
25
|
$auth = new \web\lib\admin\Authentication(); |
|
26
|
26
|
$auth->authenticate(); |
|
@@ -35,7 +35,7 @@ discard block |
|
|
block discarded – undo |
|
35
|
35
|
|
|
36
|
36
|
// if we have a pushed close button, submit attributes and send user back to the overview page |
|
37
|
37
|
// if external DB sync is disabled globally, the user never gets to this page. If he came here *anyway* -> send him back immediately. |
|
38
|
|
-if ((isset($_POST['submitbutton']) && $_POST['submitbutton'] == web\lib\common\FormElements::BUTTON_CLOSE ) || CONFIG['DB']['enforce-external-sync'] == FALSE) { |
|
|
38
|
+if ((isset($_POST['submitbutton']) && $_POST['submitbutton'] == web\lib\common\FormElements::BUTTON_CLOSE) || CONFIG['DB']['enforce-external-sync'] == FALSE) { |
|
39
|
39
|
header("Location: ../overview_federation.php"); |
|
40
|
40
|
exit; |
|
41
|
41
|
} |
|
@@ -92,9 +92,9 @@ discard block |
|
|
block discarded – undo |
|
92
|
92
|
$cat = new \core\CAT(); |
|
93
|
93
|
switch ($my_inst->getExternalDBSyncState()) { |
|
94
|
94
|
case \core\IdP::EXTERNAL_DB_SYNCSTATE_SYNCED: |
|
95
|
|
- printf(_("This %s is linked to the %s database."), $uiElements->nomenclatureInst, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</p>"; |
|
96
|
|
- echo "<p>" . sprintf(_("The following information about the IdP is stored in the %s DB and %s DB:"), CONFIG['APPEARANCE']['productname'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</p>"; |
|
97
|
|
- echo "<table><tr><td>" . sprintf(_("Information in <strong>%s Database</strong>"), CONFIG['APPEARANCE']['productname']) . "</td><td>" . sprintf(_("Information in <strong>%s Database</strong>"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</td></tr>"; |
|
|
95
|
+ printf(_("This %s is linked to the %s database."), $uiElements->nomenclatureInst, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</p>"; |
|
|
96
|
+ echo "<p>".sprintf(_("The following information about the IdP is stored in the %s DB and %s DB:"), CONFIG['APPEARANCE']['productname'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</p>"; |
|
|
97
|
+ echo "<table><tr><td>".sprintf(_("Information in <strong>%s Database</strong>"), CONFIG['APPEARANCE']['productname'])."</td><td>".sprintf(_("Information in <strong>%s Database</strong>"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</td></tr>"; |
|
98
|
98
|
echo "<tr><td>"; |
|
99
|
99
|
// left-hand side: CAT DB |
|
100
|
100
|
echo "<table>"; |
|
@@ -106,7 +106,7 @@ discard block |
|
|
block discarded – undo |
|
106
|
106
|
} else { |
|
107
|
107
|
$language = CONFIG['LANGUAGES'][$name['lang']]['display'] ?? "(unsupported language)"; |
|
108
|
108
|
} |
|
109
|
|
- echo "<tr><td>" . sprintf(_("%s Name (%s)"), $uiElements->nomenclatureInst, $language) . "</td><td>" . $name['value'] . "</td></tr>"; |
|
|
109
|
+ echo "<tr><td>".sprintf(_("%s Name (%s)"), $uiElements->nomenclatureInst, $language)."</td><td>".$name['value']."</td></tr>"; |
|
110
|
110
|
} |
|
111
|
111
|
|
|
112
|
112
|
$admins = $my_inst->listOwners(); |
|
@@ -117,7 +117,7 @@ discard block |
|
|
block discarded – undo |
|
117
|
117
|
if (count($username) == 0) { |
|
118
|
118
|
$username[0]['value'] = _("Unnamed User"); |
|
119
|
119
|
} |
|
120
|
|
- echo "<tr><td>" . _("Administrator [invited as]") . "</td><td>" . $username[0]['value'] . " [" . $admin['MAIL'] . "]</td></tr>"; |
|
|
120
|
+ echo "<tr><td>"._("Administrator [invited as]")."</td><td>".$username[0]['value']." [".$admin['MAIL']."]</td></tr>"; |
|
121
|
121
|
} |
|
122
|
122
|
echo "</table>"; |
|
123
|
123
|
// end of left-hand side |
|
@@ -125,38 +125,38 @@ discard block |
|
|
block discarded – undo |
|
125
|
125
|
// right-hand side: external DB |
|
126
|
126
|
$externalid = $my_inst->getExternalDBId(); |
|
127
|
127
|
if (is_bool($externalid)) { // we are in SYNCED state so this cannot happen |
|
128
|
|
- throw new Exception("We are in SYNCSTATE_SYNCED but still there is no external DB Id available for the " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . "!"); |
|
|
128
|
+ throw new Exception("We are in SYNCSTATE_SYNCED but still there is no external DB Id available for the ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']."!"); |
|
129
|
129
|
} |
|
130
|
130
|
|
|
131
|
131
|
$extinfo = $cat->getExternalDBEntityDetails($externalid); |
|
132
|
132
|
|
|
133
|
133
|
echo "<table>"; |
|
134
|
134
|
foreach ($extinfo['names'] as $lang => $name) { |
|
135
|
|
- echo "<tr><td>" . sprintf(_("%s Name (%s)"), $uiElements->nomenclatureInst, $lang) . "</td><td>$name</td>"; |
|
|
135
|
+ echo "<tr><td>".sprintf(_("%s Name (%s)"), $uiElements->nomenclatureInst, $lang)."</td><td>$name</td>"; |
|
136
|
136
|
} |
|
137
|
137
|
foreach ($extinfo['admins'] as $number => $admin_details) { |
|
138
|
|
- echo "<tr><td>" . _("Administrator email") . "</td><td>" . $admin_details['email'] . "</td></tr>"; |
|
|
138
|
+ echo "<tr><td>"._("Administrator email")."</td><td>".$admin_details['email']."</td></tr>"; |
|
139
|
139
|
} |
|
140
|
140
|
echo "</table>"; |
|
141
|
141
|
// end of right-hand side |
|
142
|
142
|
echo "</td></tr></table>"; |
|
143
|
|
- echo "<p>" . _("If this mapping is not correct any more, you can remove the link:") . " "; |
|
|
143
|
+ echo "<p>"._("If this mapping is not correct any more, you can remove the link:")." "; |
|
144
|
144
|
echo "<form name='form-unlink-inst' action='inc/manageDBLink.inc.php?inst_id=$my_inst->identifier' method='post' accept-charset='UTF-8'>"; |
|
145
|
|
- echo "<button type='submit' class='delete' name='submitbutton' id='submit' value='" . web\lib\common\FormElements::BUTTON_DELETE . "'>" . _("Unlink") . "</button></form>"; |
|
|
145
|
+ echo "<button type='submit' class='delete' name='submitbutton' id='submit' value='".web\lib\common\FormElements::BUTTON_DELETE."'>"._("Unlink")."</button></form>"; |
|
146
|
146
|
break; |
|
147
|
147
|
case \core\IdP::EXTERNAL_DB_SYNCSTATE_NOT_SYNCED: |
|
148
|
148
|
$temparray = []; |
|
149
|
|
- printf(_("This %s is not yet linked to the %s database."), $uiElements->nomenclatureInst, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . " "; |
|
150
|
|
- echo "<strong>" . _("This means that its profiles are not made available on the user download page.") . "</strong> "; |
|
|
149
|
+ printf(_("This %s is not yet linked to the %s database."), $uiElements->nomenclatureInst, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])." "; |
|
|
150
|
+ echo "<strong>"._("This means that its profiles are not made available on the user download page.")."</strong> "; |
|
151
|
151
|
printf(_("You can link it to the %s database below."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
|
152
|
152
|
$candidates = $my_inst->getExternalDBSyncCandidates($my_inst->type); |
|
153
|
153
|
echo "<br/><form name='form-link-inst' action='inc/manageDBLink.inc.php?inst_id=$my_inst->identifier' method='post' accept-charset='UTF-8'>"; |
|
154
|
|
- printf(_("Please select an entity from the %s DB which corresponds to this CAT %s."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $uiElements->nomenclatureInst) . " "; |
|
|
154
|
+ printf(_("Please select an entity from the %s DB which corresponds to this CAT %s."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $uiElements->nomenclatureInst)." "; |
|
155
|
155
|
if ($candidates !== FALSE && count($candidates) > 0) { |
|
156
|
156
|
printf(_("Particularly promising entries (names in CAT and %s DB are a 100%% match) are on top of the list."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
|
157
|
157
|
} |
|
158
|
158
|
echo "<table>"; |
|
159
|
|
- echo "<tr><th>" . _("Link to this entity?") . "</th><th>" . sprintf(_("%s Name"), $uiElements->nomenclatureInst) . "</th><th>" . _("Administrators") . "</th></tr>"; |
|
|
159
|
+ echo "<tr><th>"._("Link to this entity?")."</th><th>".sprintf(_("%s Name"), $uiElements->nomenclatureInst)."</th><th>"._("Administrators")."</th></tr>"; |
|
160
|
160
|
if ($candidates !== FALSE && count($candidates) > 0) { |
|
161
|
161
|
foreach ($candidates as $candidate) { |
|
162
|
162
|
$info = $cat->getExternalDBEntityDetails($candidate); |
|
@@ -166,7 +166,7 @@ discard block |
|
|
block discarded – undo |
|
166
|
166
|
} |
|
167
|
167
|
echo "</td><td>"; |
|
168
|
168
|
foreach ($info['admins'] as $number => $admin_details) { |
|
169
|
|
- echo "[E-Mail] " . $admin_details['email'] . "<br/>"; |
|
|
169
|
+ echo "[E-Mail] ".$admin_details['email']."<br/>"; |
|
170
|
170
|
} |
|
171
|
171
|
echo "</td></tr>"; |
|
172
|
172
|
$temparray[] = $candidate; |
|
@@ -179,7 +179,7 @@ discard block |
|
|
block discarded – undo |
|
179
|
179
|
$buffer = ""; |
|
180
|
180
|
|
|
181
|
181
|
foreach ($unmappedentities as $v) { |
|
182
|
|
- $buffer .= "<option value='" . $v['ID'] . "'>[ID " . $v['ID'] . "] " . $v['name'] . "</option>"; |
|
|
182
|
+ $buffer .= "<option value='".$v['ID']."'>[ID ".$v['ID']."] ".$v['name']."</option>"; |
|
183
|
183
|
} |
|
184
|
184
|
|
|
185
|
185
|
if ($buffer != "") { |
|
@@ -190,9 +190,9 @@ discard block |
|
|
block discarded – undo |
|
190
|
190
|
} |
|
191
|
191
|
// issue a big red warning if there are no link candidates at all in the federation |
|
192
|
192
|
if (empty($buffer) && empty($candidates)) { |
|
193
|
|
- echo "<tr><td style='color:#ff0000' colspan='2'>" . sprintf(_('There is no single unmapped %s in the external database for this %s!'), $uiElements->nomenclatureInst, $uiElements->nomenclatureFed) . "</td></tr>"; |
|
|
193
|
+ echo "<tr><td style='color:#ff0000' colspan='2'>".sprintf(_('There is no single unmapped %s in the external database for this %s!'), $uiElements->nomenclatureInst, $uiElements->nomenclatureFed)."</td></tr>"; |
|
194
|
194
|
} |
|
195
|
|
- echo "</table><button type='submit' name='submitbutton' id='submit' value='" . web\lib\common\FormElements::BUTTON_SAVE . "' disabled >" . _("Create Link") . "</button></form>"; |
|
|
195
|
+ echo "</table><button type='submit' name='submitbutton' id='submit' value='".web\lib\common\FormElements::BUTTON_SAVE."' disabled >"._("Create Link")."</button></form>"; |
|
196
|
196
|
break; |
|
197
|
197
|
default: |
|
198
|
198
|
} |