These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /*************************************************************************** |
||
3 | * for license information see LICENSE.md |
||
4 | * |
||
5 | * |
||
6 | * Production system sample of settings.inc.php - all lib2 settings needed |
||
7 | * to run the website. In addition to this, you must create settings.inc.php |
||
8 | * files from .dist files at the following places: |
||
9 | * |
||
10 | * lib |
||
11 | * util/notifications |
||
12 | * util/publish_caches |
||
13 | * util/watchlist |
||
14 | * |
||
15 | * This file may be outdated. |
||
16 | * |
||
17 | ***************************************************************************/ |
||
18 | |||
19 | /* PHP settings |
||
20 | * see settings-dist.inc.php for explanation |
||
21 | */ |
||
22 | $opt['php']['debug'] = PHP_DEBUG_OFF; |
||
23 | $opt['php']['timezone'] = 'Europe/Berlin'; |
||
24 | |||
25 | /* database settings |
||
26 | */ |
||
27 | $opt['db']['servername'] = 'localhost'; |
||
28 | $opt['db']['username'] = '<user>'; |
||
29 | $opt['db']['password'] = '<pw>'; |
||
30 | $opt['db']['pconnect'] = false; |
||
31 | $opt['db']['maintenance_user'] = '<priviledged_user>'; |
||
32 | |||
33 | // ... how long a query can take without warning (0 <= disabled) |
||
34 | $opt['db']['warn']['time'] = 180; |
||
35 | $opt['db']['warn']['mail'] = 'root'; |
||
36 | $opt['db']['warn']['subject'] = 'sql_warn'; |
||
37 | |||
38 | // display mysql error messages on the website - not recommended for productive use! |
||
39 | $opt['db']['error']['display'] = false; |
||
40 | $opt['db']['error']['mail'] = 'root'; |
||
41 | $opt['db']['error']['subject'] = 'sql_error'; |
||
42 | |||
43 | // database names |
||
44 | $opt['db']['placeholder']['db'] = 'ocde'; |
||
45 | $opt['db']['placeholder']['tmpdb'] = 'ocdetmp'; |
||
46 | |||
47 | /* cookie or session |
||
48 | * |
||
49 | * SAVE_COOKIE = only use cookies |
||
50 | * SAVE_SESSION = use php sessions |
||
51 | * |
||
52 | * to use SESSIONS set php.ini to session default values: |
||
53 | * |
||
54 | * session.auto_start = 0 |
||
55 | * session.use_cookies = 1 |
||
56 | * session.use_only_cookies = 0 |
||
57 | * session.cookie_lifetime = 0 |
||
58 | * session.cookie_path = "/" |
||
59 | * session.cookie_domain = "" |
||
60 | * session.cookie_secure = off |
||
61 | * session.use_trans_sid = 0 |
||
62 | * |
||
63 | * set session.safe_path to a secure place |
||
64 | * |
||
65 | * other parameters may be customized |
||
66 | */ |
||
67 | $opt['session']['mode'] = SAVE_COOKIE; |
||
68 | $opt['session']['cookiename'] = '<cookiename>'; // e.g. 'ocde' |
||
69 | $opt['session']['domain'] = '<.do.main>'; // may be overwritten by $opt['domain'][...]['cookiedomain'] |
||
0 ignored issues
–
show
|
|||
70 | |||
71 | /* If the Referer was sent by the client and the substring was not found, |
||
72 | * the embedded session id will be marked as invalid. |
||
73 | * Only used with session.mode = SAVE_SESSION |
||
74 | */ |
||
75 | $opt['session']['check_referer'] = true; |
||
76 | |||
77 | /* Debug level (combine with OR | ) |
||
78 | * DEBUG_NO = productive use |
||
79 | * DEBUG_DEVELOPER = developer system |
||
80 | * DEBUG_TEMPLATES = no template caching |
||
81 | * DEBUG_OUTOFSERVICE = only admin login (includes DEBUG_TEMPLATES) |
||
82 | * DEBUG_TESTING = display warning (includes DEBUG_TEMPLATES) |
||
83 | * DEBUG_SQLDEBUGGER = sql debugger (use &sqldebug=1 when calling the site) |
||
84 | * DEBUG_TRANSLATE = read translate messages (use &trans=1 when calling the site) |
||
85 | * DEBUG_FORCE_TRANSLATE = force read of translate messages |
||
86 | * DEBUG_CLI = print debug messages of cli scripts |
||
87 | */ |
||
88 | $opt['debug'] = DEBUG_NO; |
||
89 | //$opt['debug'] = DEBUG_DEVELOPER|DEBUG_TEMPLATES|DEBUG_SQLDEBUGGER|DEBUG_TRANSLATE|DEBUG_FORCE_TRANSLATE; |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
52% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them.
Loading history...
|
|||
90 | //$opt['debug'] = DEBUG_DEVELOPER|DEBUG_TEMPLATES|DEBUG_SQLDEBUGGER; |
||
91 | //$opt['debug'] = DEBUG_DEVELOPER|DEBUG_SQLDEBUGGER; |
||
92 | |||
93 | /* other template options |
||
94 | * |
||
95 | */ |
||
96 | $opt['page']['name'] = 'Geocaching mit Opencaching'; |
||
97 | $opt['mail']['from'] = '<notification email from address>'; |
||
98 | $opt['page']['max_logins_per_hour'] = 250; |
||
99 | |||
100 | /* default locale |
||
101 | */ |
||
102 | $opt['template']['default']['locale'] = 'DE'; // can be overwritten by $opt['domain'][<domain>]['locale'] |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
43% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them.
Loading history...
|
|||
103 | |||
104 | /* multi-domain settings |
||
105 | * |
||
106 | * If one of the domains matches $_SERVER['SERVER_NAME'], the default values (in |
||
107 | * common-settings.inc.php) will be overwritten. Can be used to host more than one |
||
108 | * locale on one server with multiple default-locales. |
||
109 | * Must be overwritten in BOTH lib1 and lib2 settings.inc.php, |
||
110 | * and BEFORE calling set_absolute_urls! |
||
111 | */ |
||
112 | //$opt['domain']['www.opencaching.de']['url'] = 'https://www.opencaching.de/'; |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
69% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them.
Loading history...
|
|||
113 | //$opt['domain']['www.opencaching.de']['shortlink_domain'] = 'opencaching.de'; |
||
114 | //$opt['domain']['www.opencaching.de']['sitename'] = 'Opencaching.de'; |
||
115 | //$opt['domain']['www.opencaching.de']['locale'] = 'DE'; |
||
116 | //$opt['domain']['www.opencaching.de']['fallback_locale'] = 'EN'; |
||
117 | //$opt['domain']['www.opencaching.de']['style'] = 'ocstyle'; |
||
118 | //$opt['domain']['www.opencaching.de']['cookiedomain'] = '.opencaching.de'; |
||
119 | //$opt['domain']['www.opencaching.de']['country'] = 'DE'; |
||
120 | //$opt['domain']['www.opencaching.de']['keywords'] = 'Geocaching, Geocache, Cache, Schatzsuche, GPS, kostenlos, GPX, Koordinaten, Hobby, Natur'; // 5-10 keywords are recommended |
||
121 | //$opt['domain']['www.opencaching.de']['description'] = 'Opencaching.de ist das freie Portal für Geocaching, ein Schatzsuche-Spiel. Mittels GPS-Koordinaten sind Behälter oder Objekte zu finden.'; |
||
122 | //$opt['domain']['www.opencaching.de']['headoverlay'] = 'oc_head_alpha3'; |
||
123 | // |
||
124 | // When overriding HTTPS settings, you must override *all* of them! |
||
125 | //$opt['domain']['www.opencaching.de']['https']['mode'] = HTTPS_ENABLED; |
||
126 | //$opt['domain']['www.opencaching.de']['https']['is_default'] = false; |
||
127 | //$opt['domain']['www.opencaching.de']['https']['force_login'] = true; |
||
128 | |||
129 | //$opt['domain']['www.opencaching.pl']['url'] = 'https://opencaching.pl/'; |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
75% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them.
Loading history...
|
|||
130 | //$opt['domain']['www.opencaching.pl']['sitename'] = 'Opencaching.PL'; |
||
131 | //$opt['domain']['www.opencaching.pl']['locale'] = 'PL'; |
||
132 | //$opt['domain']['www.opencaching.pl']['fallback_locale'] = 'EN'; |
||
133 | //$opt['domain']['www.opencaching.pl']['style'] = 'ocstyle'; |
||
134 | //$opt['domain']['www.opencaching.pl']['cookiedomain'] = '.opencaching.pl'; |
||
135 | //$opt['domain']['www.opencaching.pl']['country'] = 'PL'; |
||
136 | //$opt['domain']['www.opencaching.pl']['keywords'] = 'geocaching, geocache, cache, poszukiwanie skarbów, GPS, wolne, GPX, koordynować, hobby, natura'; // 5-10 keywords are recommended |
||
137 | //$opt['domain']['www.opencaching.pl']['description'] = 'Opencaching.pl jest darmowy portal dla Geocaching, gry Treasure Hunt. Za pomocą współrzędnych GPS można znaleźć pojemniki lub obiektów.'; |
||
138 | //$opt['domain']['www.opencaching.pl']['headoverlay'] = 'oc_head_alpha3_pl'; |
||
139 | |||
140 | // Supply the site's primary URL and the shortlink domain here. |
||
141 | // Can be overriden by domain settings. |
||
142 | // Set shortlink domain to false if not available. |
||
143 | set_absolute_urls($opt, 'https://www.opencaching.de/', 'opencaching.de', 2); |
||
144 | |||
145 | /* The OC site's ID; see settings-dist.inc.php for known IDs. |
||
146 | */ |
||
147 | $opt['logic']['node']['id'] = 0; |
||
148 | |||
149 | /* data license settings |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
45% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them.
Loading history...
|
|||
150 | * The text and licsense link are determined by $opt['locale'][<locale>]['page']['license'] |
||
151 | * and $opt['locale'][<locale>]['page']['license_url']. |
||
152 | */ |
||
153 | $opt['logic']['license']['disclaimer'] = false; |
||
154 | $opt['logic']['license']['terms'] = 'articles.php?page=impressum#datalicense'; |
||
155 | |||
156 | /* password authentication method |
||
157 | * (true means extra hash on the digested password) |
||
158 | */ |
||
159 | $opt['logic']['password_hash'] = false; |
||
160 | |||
161 | /* password salt |
||
162 | * is a random generated String that is appended to the password |
||
163 | */ |
||
164 | $opt['logic']['password_salt'] = ''; |
||
165 | |||
166 | /* pregenerated waypoint list for new caches |
||
167 | * - Waypoint prefix (OC, OP, OZ ... AA=local development) |
||
168 | * - When pool contains less than min_count, generation process starts |
||
169 | * and fills up the pool until max_count is reached. |
||
170 | */ |
||
171 | $opt['logic']['waypoint_pool']['prefix'] = 'AA'; |
||
172 | $opt['logic']['waypoint_pool']['min_count'] = 1000; |
||
173 | $opt['logic']['waypoint_pool']['max_count'] = 2000; |
||
174 | // chars used for waypoints. Remember to reinstall triggers and clear cache_waypoint_pool after changing |
||
175 | $opt['logic']['waypoint_pool']['valid_chars'] = '0123456789ABCDEF'; |
||
176 | // fill_gaps = true: search for gaps between used waypoints and fill up these gaps |
||
177 | // (fill_gaps is slow and CPU intensive on database server. For |
||
178 | // productive servers you may want to generate some waypoints |
||
179 | // without fill_gaps first) |
||
180 | // fill_gaps = false: continue with the last waypoint |
||
181 | $opt['logic']['waypoint_pool']['fill_gaps'] = false; |
||
182 | |||
183 | /* OC Username for cronjobs or CLI tools |
||
184 | * is used e.g. for cache auto-archiving and auto-publishing |
||
185 | */ |
||
186 | $opt['logic']['systemuser']['user'] = ''; |
||
187 | |||
188 | // 3rd party library options |
||
189 | // developer.what3words.com API Key |
||
190 | $opt['lib']['w3w']['apikey'] = 'YOURAPIKEY'; |
||
191 | |||
192 | // Google Maps API key |
||
193 | // http://code.google.com/intl/de/apis/maps/signup.html |
||
194 | $opt['lib']['google']['mapkey']['<domain>'] = 'EEFFGGHH...'; |
||
195 | |||
196 | // email address for user contact emails |
||
197 | // has to be an autoresponder informing about wrong mail usage |
||
198 | $opt['mail']['usermail'] = 'usermail@<domain>'; |
||
199 | |||
200 | // contact address |
||
201 | $opt['mail']['contact'] = 'contact@<domain>'; |
||
202 | |||
203 | $opt['page']['showdonations'] = true; |
||
204 | $opt['page']['showsocialmedia'] = true; |
||
205 | |||
206 | /* index.php news section configuration |
||
207 | * include '' => from table 'news', else from RSS feed |
||
208 | */ |
||
209 | // $opt['news']['include'] = 'http://blog.opencaching.de/feed'; |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
67% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them.
Loading history...
|
|||
210 | // $opt['news']['count'] = 8; |
||
211 | |||
212 | /* forum RSS integration (index.php) |
||
213 | */ |
||
214 | // $opt['forum']['url'] = ''http://forum.opencaching.de/index.php?action=.xml;type=rss;limit=50'; |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
64% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them.
Loading history...
|
|||
215 | // $opt['forum']['count'] = 8; |
||
216 | // $opt['forum']['name'] = 'forum.opencaching.de'; |
||
217 | |||
218 | |||
219 | function post_config() |
||
220 | { |
||
221 | global $opt, $menuitem, $tpl; |
||
222 | |||
223 | $domain = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : ''; |
||
224 | if ($domain == '') { |
||
225 | return; |
||
226 | } |
||
227 | |||
228 | switch (mb_strtolower($domain)) { |
||
229 | case 'www.opencaching.de': |
||
230 | config_domain_www_opencaching_de(); |
||
231 | break; |
||
232 | case 'www.opencaching.it': |
||
233 | config_domain_www_opencaching_it(); |
||
234 | break; |
||
235 | case 'www.opencachingspain.es': |
||
236 | config_domain_www_opencachingspain_es(); |
||
237 | break; |
||
238 | default: |
||
239 | $tpl->redirect('https://www.opencaching.de/index.php'); |
||
240 | } |
||
241 | } |
||
242 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.