-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample_settings.php
More file actions
149 lines (124 loc) · 4.49 KB
/
sample_settings.php
File metadata and controls
149 lines (124 loc) · 4.49 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?php
/**
*
* Contains database connection settings, API keys, and application configuration variables.
*
*/
/**
* Establishes a connection to the database.
*
* @return mysqli The MySQLi connection object.
*/
function connectDb()
{
$host = getenv('DB_HOST') ?: "localhost";
$username = getenv('DB_USER') ?: "your_database_username";
$password = getenv('DB_PASSWORD') ?: "your_database_password";
$database = getenv('DB_NAME') ?: "your_database_name";
$conn = new mysqli($host, $username, $password, $database);
return $conn;
}
// Establish the database connection
$connection = connectDb();
// ELMO API Key
$apiKeyElmo = getenv('ELMO_API_KEY') ?: '1234-1234-1234-1234';
// Google Maps API Key
$apiKeyGoogleMaps = 'xxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxx';
// API Key for https://timezonedb.com/
$apiKeyTimezone = 'your_timezone_api_key';
// ERNIE Integration (External Vocabulary Service)
$ernieUrl = getenv('ERNIE_URL') ?: '';
$ernieApiKey = getenv('ERNIE_API_KEY') ?: '';
// Cache TTL for all ERNIE data in seconds (default: 6 hours)
$ernieCacheTtl = 21600;
// Funder PID mode: 'CFID' = Crossref Funder ID (default), 'ROR' = ROR ID
$funderPidMode = getenv('FUNDER_PID') ?: 'CFID';
// URL for primary data upload (shown after successful submit)
$dataUploadUrl = getenv('DATA_UPLOAD_URL') ?: '';
// SETTINGS FOR GENERIC DATACITE RESEARCH DATA
// maximale Anzahl der eingebbaren Titel
$maxTitles = 2;
// having the MSL logo in the header:
$showMslLogo = false;
// Show Contributor Persons form group
$showContributorPersons = true;
// Show Contributor Institutios form group
$showContributorInstitutions = true;
// Show Thesauri Keywords form group (master switch; individual thesauri controlled by ERNIE)
$showThesauri = true;
// Show Free Keywords form group
$showFreeKeywords = true;
// Show Spatial and Temporal Coverage form group
$showSpatialTemporalCoverage = true;
// Show Related Work form group
$showRelatedWork = true;
// Show Funding Reference form group
$showFundingReference = true;
// Show Author Institution form group
$showAuthorInstitution = true;
// Show license form group. if not shown defaults to CC-BY 4.0
$showLicense = true;
$defaultLicense = 'CC-BY-4.0';
// SETTINGS FOR EPOS MSL
// Show MSL labs form group
$showMslLabs = false;
// URL to the source with all laboratories for MSL
$mslLabsUrl = 'https://raw.githubusercontent.com/UtrechtUniversity/msl_vocabularies/main/vocabularies/labs/laboratories.json';
// Show MSL vocabularies
$showMslVocabs = false;
// URL to the source with all vocabularies for MSL
$mslVocabsUrl = 'https://raw.githubusercontent.com/UtrechtUniversity/msl_vocabularies/main/vocabularies/combined/editor/';
// SETTINGS FOR PID4INST INSTRUMENTS
// Show Used Instruments form group (PID4INST via ERNIE API)
$showUsedInstruments = false;
$envShowUsedInstruments = getenv('SHOW_USED_INSTRUMENTS');
if ($envShowUsedInstruments !== false) {
$showUsedInstruments = filter_var($envShowUsedInstruments, FILTER_VALIDATE_BOOLEAN);
}
// SETTINGS FOR ICGEM
// Show ICGEM form groups (GGMs Properties and Characteristics of the model)
$showGGMsProperties = false;
// Display the feedback link (true to display, false to hide)
$showFeedbackLink = true;
// Settings for sending mail with SMTP
$smtpHost = getenv('SMTP_HOST') ?: 'your_smtp_host';
$smtpPort = getenv('SMTP_PORT') ?: 465;
$smtpUser = getenv('SMTP_USER') ?: '';
$smtpPassword = getenv('SMTP_PASSWORD') ?: '';
$smtpSender = getenv('SMTP_SENDER') ?: 'your_smtp_sender_email';
$smtpSecure = getenv('SMTP_SECURE') ?: '';
$smtpAuth = getenv('SMTP_AUTH') ?: '';
// Target address for feedback
$feedbackAddress = getenv('FEEDBACK_ADDRESS') ?: 'feedback@example.com';
// Target address for XML submit
$xmlSubmitAddress = getenv('XML_SUBMIT_ADDRESS') ?: 'xmlsubmit@example.com';
function getSettings($setting)
{
global $apiKeyGoogleMaps, $showMslLabs;
header('Content-Type: application/json; charset=utf-8');
switch ($setting) {
case 'apiKey':
echo json_encode([
'apiKey' => $apiKeyGoogleMaps
]);
break;
case 'all':
echo json_encode([
'apiKey' => $apiKeyGoogleMaps,
'showMslLabs' => $showMslLabs
]);
break;
default:
echo json_encode(['error' => 'Unknown setting']);
break;
}
exit;
}
if (isset($_GET['setting'])) {
getSettings($_GET['setting']);
exit;
}
// Initialize logging
function elmo_log($msg) {
error_log('[ELMO save_data] ' . $msg);
}