Merge pull request #733 from robertdown/checker-namespace
[openemr.git] / interface / globals.php
blobd0e672298dd9a9770ae8825aea9db6b32e877470
1 <?php
3 // Checks if the server's PHP version is compatible with OpenEMR:
4 require_once(dirname(__FILE__) . "/../common/compatibility/Checker.php");
6 use OpenEMR\Checker;
8 $response = Checker::checkPhpVersion();
9 if ($response !== true) {
10 die($response);
13 // Default values for optional variables that are allowed to be set by callers.
15 // Unless specified explicitly, apply Auth functions
16 if (!isset($ignoreAuth)) $ignoreAuth = false;
17 // Unless specified explicitly, caller is not offsite_portal and Auth is required
18 if (!isset($ignoreAuth_offsite_portal)) $ignoreAuth_offsite_portal = false;
19 // Same for onsite
20 if (!isset($ignoreAuth_onsite_portal_two)) $ignoreAuth_onsite_portal_two = false;
21 // Unless specified explicitly, "fake" register_globals.
22 if (!isset($fake_register_globals)) $fake_register_globals = true;
24 // Is this windows or non-windows? Create a boolean definition.
25 if (!defined('IS_WINDOWS'))
26 define('IS_WINDOWS', (stripos(PHP_OS,'WIN') === 0));
28 // Some important php.ini overrides. Defaults for these values are often
29 // too small. You might choose to adjust them further.
31 ini_set('session.gc_maxlifetime', '14400');
33 // The webserver_root and web_root are now automatically collected.
34 // If not working, can set manually below.
35 // Auto collect the full absolute directory path for openemr.
36 $webserver_root = dirname(dirname(__FILE__));
37 if (IS_WINDOWS) {
38 //convert windows path separators
39 $webserver_root = str_replace("\\","/",$webserver_root);
41 // Collect the apache server document root (and convert to windows slashes, if needed)
42 $server_document_root = realpath($_SERVER['DOCUMENT_ROOT']);
43 if (IS_WINDOWS) {
44 //convert windows path separators
45 $server_document_root = str_replace("\\","/",$server_document_root);
47 // Auto collect the relative html path, i.e. what you would type into the web
48 // browser after the server address to get to OpenEMR.
49 // This removes the leading portion of $webserver_root that it has in common with the web server's document
50 // root and assigns the result to $web_root. In addition to the common case where $webserver_root is
51 // /var/www/openemr and document root is /var/www, this also handles the case where document root is
52 // /var/www/html and there is an Apache "Alias" command that directs /openemr to /var/www/openemr.
53 $web_root = substr($webserver_root, strspn($webserver_root ^ $server_document_root, "\0"));
54 // Ensure web_root starts with a path separator
55 if (preg_match("/^[^\/]/",$web_root)) {
56 $web_root = "/".$web_root;
58 // The webserver_root and web_root are now automatically collected in
59 // real time per above code. If above is not working, can uncomment and
60 // set manually here:
61 // $webserver_root = "/var/www/openemr";
62 // $web_root = "/openemr";
65 // This is the directory that contains site-specific data. Change this
66 // only if you have some reason to.
67 $GLOBALS['OE_SITES_BASE'] = "$webserver_root/sites";
69 // The session name names a cookie stored in the browser.
70 // Now that restore_session() is implemented in javaScript, session IDs are
71 // effectively saved in the top level browser window and there is no longer
72 // any need to change the session name for different OpenEMR instances.
73 // On 4/8/17, added cookie_path to improve security when using different
74 // OpenEMR instances on same server to prevent session conflicts; also
75 // modified interface/login/login.php and library/restoreSession.php to be
76 // consistent with this.
77 ini_set('session.cookie_path', $web_root ? $web_root : '/');
78 session_name("OpenEMR");
80 session_start();
82 // Set the site ID if required. This must be done before any database
83 // access is attempted.
84 if (empty($_SESSION['site_id']) || !empty($_GET['site'])) {
85 if (!empty($_GET['site'])) {
86 $tmp = $_GET['site'];
88 else {
89 if (empty($ignoreAuth)) die("Site ID is missing from session data!");
90 $tmp = $_SERVER['HTTP_HOST'];
91 if (!is_dir($GLOBALS['OE_SITES_BASE'] . "/$tmp")) $tmp = "default";
93 if (empty($tmp) || preg_match('/[^A-Za-z0-9\\-.]/', $tmp))
94 die("Site ID '". htmlspecialchars($tmp,ENT_NOQUOTES) . "' contains invalid characters.");
95 if (isset($_SESSION['site_id']) && ($_SESSION['site_id'] != $tmp)) {
96 // This is to prevent using session to penetrate other OpenEMR instances within same multisite module
97 session_unset(); // clear session, clean logout
98 if (isset($landingpage) && !empty($landingpage)) {
99 // OpenEMR Patient Portal use
100 header('Location: index.php?site='.$tmp);
102 else {
103 // Main OpenEMR use
104 header('Location: ../login/login.php?site='.$tmp); // Assuming in the interface/main directory
106 exit;
108 if (!isset($_SESSION['site_id']) || $_SESSION['site_id'] != $tmp) {
109 $_SESSION['site_id'] = $tmp;
110 //error_log("Session site ID has been set to '$tmp'"); // debugging
114 // Set the site-specific directory path.
115 $GLOBALS['OE_SITE_DIR'] = $GLOBALS['OE_SITES_BASE'] . "/" . $_SESSION['site_id'];
117 // Set a site-specific uri root path.
118 $GLOBALS['OE_SITE_WEBROOT'] = $web_root . "/sites/" . $_SESSION['site_id'];
120 require_once($GLOBALS['OE_SITE_DIR'] . "/config.php");
122 // Collecting the utf8 disable flag from the sqlconf.php file in order
123 // to set the correct html encoding. utf8 vs iso-8859-1. If flag is set
124 // then set to iso-8859-1.
125 require_once(dirname(__FILE__) . "/../library/sqlconf.php");
126 if (!$disable_utf8_flag) {
127 ini_set('default_charset', 'utf-8');
128 $HTML_CHARSET = "UTF-8";
129 mb_internal_encoding('UTF-8');
131 else {
132 ini_set('default_charset', 'iso-8859-1');
133 $HTML_CHARSET = "ISO-8859-1";
134 mb_internal_encoding('ISO-8859-1');
137 // Root directory, relative to the webserver root:
138 $GLOBALS['rootdir'] = "$web_root/interface";
139 $rootdir = $GLOBALS['rootdir'];
140 // Absolute path to the source code include and headers file directory (Full path):
141 $GLOBALS['srcdir'] = "$webserver_root/library";
142 // Absolute path to the location of documentroot directory for use with include statements:
143 $GLOBALS['fileroot'] = "$webserver_root";
144 // Absolute path to the location of interface directory for use with include statements:
145 $include_root = "$webserver_root/interface";
146 // Absolute path to the location of documentroot directory for use with include statements:
147 $GLOBALS['webroot'] = $web_root;
149 // Static assets directory, relative to the webserver root.
150 // (it is very likely that this path will be changed in the future))
151 $GLOBALS['assets_static_relative'] = "$web_root/public/assets";
153 // Relative images directory, relative to the webserver root.
154 $GLOBALS['images_static_relative'] = "$web_root/public/images";
156 // Static images directory, absolute to the webserver root.
157 $GLOBALS['images_static_absolute'] = "$webserver_root/public/images";
159 //Composer vendor directory, absolute to the webserver root.
160 $GLOBALS['vendor_dir'] = "$webserver_root/vendor";
162 $GLOBALS['template_dir'] = $GLOBALS['fileroot'] . "/templates/";
163 $GLOBALS['incdir'] = $include_root;
164 // Location of the login screen file
165 $GLOBALS['login_screen'] = $GLOBALS['rootdir'] . "/login_screen.php";
167 // Variable set for Eligibility Verification [EDI-271] path
168 $GLOBALS['edi_271_file_path'] = $GLOBALS['OE_SITE_DIR'] . "/edi/";
170 // Check necessary writeable paths exist for mPDF tool
171 if (is_dir($GLOBALS['OE_SITE_DIR'] . '/documents/mpdf/')) {
172 if (! is_dir($GLOBALS['OE_SITE_DIR'] . '/documents/mpdf/ttfontdata/')) {
173 mkdir($GLOBALS['OE_SITE_DIR'] . '/documents/mpdf/ttfontdata/', 0755);
175 if (! is_dir($GLOBALS['OE_SITE_DIR'] . '/documents/mpdf/pdf_tmp/')) {
176 mkdir($GLOBALS['OE_SITE_DIR'] . '/documents/mpdf/pdf_tmp/', 0755);
178 } else {
179 mkdir($GLOBALS['OE_SITE_DIR'] . '/documents/mpdf/ttfontdata/', 0755, true);
180 mkdir($GLOBALS['OE_SITE_DIR'] . '/documents/mpdf/pdf_tmp/', 0755);
182 // Safe bet support directories exist, define them.
183 define("_MPDF_TEMP_PATH", $GLOBALS['OE_SITE_DIR'] . '/documents/mpdf/pdf_tmp/');
184 define("_MPDF_TTFONTDATAPATH", $GLOBALS['OE_SITE_DIR'] . '/documents/mpdf/ttfontdata/');
186 // Includes composer autoload
187 // Note this also brings in following library files:
188 // library/htmlspecialchars.inc.php - Include convenience functions with shorter names than "htmlspecialchars" (for security)
189 // library/formdata.inc.php - Include sanitization/checking functions (for security)
190 // library/sanitize.inc.php - Include sanitization/checking functions (for security)
191 // library/date_functions.php - Includes functions for date internationalization
192 // library/validation/validate_core.php - Includes functions for page validation
193 // library/translation.inc.php - Includes translation functions
194 require_once $GLOBALS['vendor_dir'] ."/autoload.php";
196 // This will open the openemr mysql connection.
197 require_once (dirname(__FILE__) . "/../library/sql.inc");
199 // Include the version file
200 require_once (dirname(__FILE__) . "/../version.php");
202 // The logging level for common/logging/logger.php
203 // Value can be TRACE, DEBUG, INFO, WARN, ERROR, or OFF:
204 // - DEBUG/INFO are great for development
205 // - INFO/WARN/ERROR are great for production
206 // - TRACE is useful when debugging hard to spot bugs
207 $GLOBALS["log_level"] = "OFF";
209 // Should Doctrine make use of connection pooling? Database connection pooling is a method
210 // used to keep database connections open so they can be reused by others. (The only reason
211 // to not use connection pooling is if your server has limited resources.)
212 $GLOBALS["doctrine_connection_pooling"] = true;
214 // Defaults for specific applications.
215 $GLOBALS['weight_loss_clinic'] = false;
216 $GLOBALS['ippf_specific'] = false;
218 // Defaults for drugs and products.
219 $GLOBALS['inhouse_pharmacy'] = false;
220 $GLOBALS['sell_non_drug_products'] = 0;
222 $glrow = sqlQuery("SHOW TABLES LIKE 'globals'");
223 if (!empty($glrow)) {
224 // Collect user specific settings from user_settings table.
226 $gl_user = array();
227 // Collect the user id first
228 $temp_authuserid = '';
229 if (!empty($_SESSION['authUserID'])) {
230 //Set the user id from the session variable
231 $temp_authuserid = $_SESSION['authUserID'];
233 else {
234 if (!empty($_POST['authUser'])) {
235 $temp_sql_ret = sqlQuery("SELECT `id` FROM `users` WHERE `username` = ?", array($_POST['authUser']) );
236 if (!empty($temp_sql_ret['id'])) {
237 //Set the user id from the login variable
238 $temp_authuserid = $temp_sql_ret['id'];
242 if (!empty($temp_authuserid)) {
243 $glres_user = sqlStatement("SELECT `setting_label`, `setting_value` " .
244 "FROM `user_settings` " .
245 "WHERE `setting_user` = ? " .
246 "AND `setting_label` LIKE 'global:%'", array($temp_authuserid) );
247 for($iter=0; $row=sqlFetchArray($glres_user); $iter++) {
248 //remove global_ prefix from label
249 $row['setting_label'] = substr($row['setting_label'],7);
250 $gl_user[$iter]=$row;
253 // Set global parameters from the database globals table.
254 // Some parameters require custom handling.
256 $GLOBALS['language_menu_show'] = array();
257 $glres = sqlStatement("SELECT gl_name, gl_index, gl_value FROM globals " .
258 "ORDER BY gl_name, gl_index");
259 while ($glrow = sqlFetchArray($glres)) {
260 $gl_name = $glrow['gl_name'];
261 $gl_value = $glrow['gl_value'];
262 // Adjust for user specific settings
263 if (!empty($gl_user)) {
264 foreach ($gl_user as $setting) {
265 if ($gl_name == $setting['setting_label']) {
266 $gl_value = $setting['setting_value'];
270 if ($gl_name == 'language_menu_other') {
271 $GLOBALS['language_menu_show'][] = $gl_value;
273 else if ($gl_name == 'css_header') {
274 $GLOBALS[$gl_name] = $rootdir.'/themes/'.$gl_value.'?v='.$v_js_includes;
275 $temp_css_theme_name = $gl_value;
277 else if ($gl_name == 'weekend_days') {
278 $GLOBALS[$gl_name] = explode(',', $gl_value);
280 else if ($gl_name == 'specific_application') {
281 if ($gl_value == '2') $GLOBALS['ippf_specific'] = true;
282 else if ($gl_value == '3') $GLOBALS['weight_loss_clinic'] = true;
284 else if ($gl_name == 'inhouse_pharmacy') {
285 if ($gl_value) $GLOBALS['inhouse_pharmacy'] = true;
286 if ($gl_value == '2') $GLOBALS['sell_non_drug_products'] = 1;
287 else if ($gl_value == '3') $GLOBALS['sell_non_drug_products'] = 2;
289 else if ($gl_name == 'gbl_time_zone') {
290 // The default PHP time zone is set here if it was specified, and is used
291 // as source data for the MySQL time zone here and in some other places
292 // where MySQL connections are opened.
293 if ($gl_value) {
294 date_default_timezone_set($gl_value);
296 // Synchronize MySQL time zone with PHP time zone.
297 sqlStatement("SET time_zone = ?", array((new DateTime())->format("P")));
299 else {
300 $GLOBALS[$gl_name] = $gl_value;
303 // Language cleanup stuff.
304 $GLOBALS['language_menu_login'] = false;
305 if ((count($GLOBALS['language_menu_show']) >= 1) || $GLOBALS['language_menu_showall']) {
306 $GLOBALS['language_menu_login'] = true;
309 // Added this $GLOBALS['concurrent_layout'] set to 3 in order to support legacy forms
310 // that may use this; note this global has been removed from the standard codebase.
311 $GLOBALS['concurrent_layout'] = 3;
313 // Additional logic to override theme name.
314 // For RTL languages we substitute the theme name with the name of RTL-adapted CSS file.
315 $rtl_override = false;
316 if( isset( $_SESSION['language_direction'] )) {
317 if( $_SESSION['language_direction'] == 'rtl' &&
318 !strpos($GLOBALS['css_header'], 'rtl') ) {
320 // the $css_header_value is set above
321 $rtl_override = true;
324 else if (isset( $_SESSION['language_choice'] )) {
325 //this will support the onsite patient portal which will have a language choice but not yet a set language direction
326 $_SESSION['language_direction'] = getLanguageDir($_SESSION['language_choice']);
327 if ( $_SESSION['language_direction'] == 'rtl' &&
328 !strpos($GLOBALS['css_header'], 'rtl')) {
329 // the $css_header_value is set above
330 $rtl_override = true;
333 else {
334 //$_SESSION['language_direction'] is not set, so will use the default language
335 $default_lang_id = sqlQuery('SELECT lang_id FROM lang_languages WHERE lang_description = ?',array($GLOBALS['language_default']));
337 if ( getLanguageDir( $default_lang_id['lang_id'] ) === 'rtl' && !strpos($GLOBALS['css_header'], 'rtl')) { // @todo eliminate 1 SQL query
338 $rtl_override = true;
343 // change theme name, if the override file exists.
344 if( $rtl_override ) {
345 // the $css_header_value is set above
346 $new_theme = 'rtl_' . $temp_css_theme_name;
348 // Check file existance
349 if( file_exists( $include_root.'/themes/'.$new_theme ) ) {
350 $GLOBALS['css_header'] = $rootdir.'/themes/'.$new_theme.'?v='.$v_js_includes;
351 } else {
352 // throw a warning if rtl'ed file does not exist.
353 error_log("Missing theme file ".text($include_root).'/themes/'.text($new_theme) );
356 unset( $temp_css_theme_name, $new_theme,$rtl_override);
357 // end of RTL section
360 // End of globals table processing.
362 else {
363 // Temporary stuff to handle the case where the globals table does not
364 // exist yet. This will happen in sql_upgrade.php on upgrading to the
365 // first release containing this table.
366 $GLOBALS['language_menu_login'] = true;
367 $GLOBALS['language_menu_showall'] = true;
368 $GLOBALS['language_menu_show'] = array('English (Standard)','Swedish');
369 $GLOBALS['language_default'] = "English (Standard)";
370 $GLOBALS['translate_layout'] = true;
371 $GLOBALS['translate_lists'] = true;
372 $GLOBALS['translate_gacl_groups'] = true;
373 $GLOBALS['translate_form_titles'] = true;
374 $GLOBALS['translate_document_categories'] = true;
375 $GLOBALS['translate_appt_categories'] = true;
376 $timeout = 7200;
377 $openemr_name = 'OpenEMR';
378 $css_header = "$rootdir/themes/style_default.css";
379 $GLOBALS['css_header'] = $css_header;
380 $GLOBALS['schedule_start'] = 8;
381 $GLOBALS['schedule_end'] = 17;
382 $GLOBALS['calendar_interval'] = 15;
383 $GLOBALS['phone_country_code'] = '1';
384 $GLOBALS['disable_non_default_groups'] = true;
385 $GLOBALS['ippf_specific'] = false;
388 // If >0 this will enforce a separate PHP session for each top-level
389 // browser window. You must log in separately for each. This is not
390 // thoroughly tested yet and some browsers might have trouble with it,
391 // so make it 0 if you must. Alternatively, you can set it to 2 to be
392 // notified when the session ID changes.
393 $GLOBALS['restore_sessions'] = 1; // 0=no, 1=yes, 2=yes+debug
395 // Theme definition. All this stuff should be moved to CSS.
397 $top_bg_line = ' bgcolor="#dddddd" ';
398 $GLOBALS['style']['BGCOLOR2'] = "#dddddd";
399 $bottom_bg_line = $top_bg_line;
400 $title_bg_line = ' bgcolor="#bbbbbb" ';
401 $nav_bg_line = ' bgcolor="#94d6e7" ';
402 $login_filler_line = ' bgcolor="#f7f0d5" ';
403 $logocode = "<img class='img-responsive center-block' src='" . $GLOBALS['OE_SITE_WEBROOT'] . "/images/login_logo.gif'>";
404 // optimal size for the tiny logo is height 43 width 86 px
405 // inside the open emr they will be auto reduced
406 $tinylogocode1 = "<img class='tinylogopng' src='" . $GLOBALS['OE_SITE_WEBROOT'] . "/images/logo_1.png'>";
407 $tinylogocode2 = "<img class='tinylogopng' src='" . $GLOBALS['OE_SITE_WEBROOT'] . "/images/logo_2.png'>";
409 $linepic = "$rootdir/pic/repeat_vline9.gif";
410 $table_bg = ' bgcolor="#cccccc" ';
411 $GLOBALS['style']['BGCOLOR1'] = "#cccccc";
412 $GLOBALS['style']['TEXTCOLOR11'] = "#222222";
413 $GLOBALS['style']['HIGHLIGHTCOLOR'] = "#dddddd";
414 $GLOBALS['style']['BOTTOM_BG_LINE'] = $bottom_bg_line;
415 // The height in pixels of the Logo bar at the top of the login page:
416 $GLOBALS['logoBarHeight'] = 110;
417 // The height in pixels of the Navigation bar:
418 $GLOBALS['navBarHeight'] = 22;
419 // The height in pixels of the Title bar:
420 $GLOBALS['titleBarHeight'] = 40;
422 // The assistant word, MORE printed next to titles that can be clicked:
423 // Note this label gets translated here via the xl function
424 // -if you don't want it translated, then strip the xl function away
425 $tmore = xl('(More)');
426 // The assistant word, BACK printed next to titles that return to previous screens:
427 // Note this label gets translated here via the xl function
428 // -if you don't want it translated, then strip the xl function away
429 $tback = xl('(Back)');
431 // This is the idle logout function:
432 // if a page has not been refreshed within this many seconds, the interface
433 // will return to the login page
434 if (!empty($special_timeout)) {
435 $timeout = intval($special_timeout);
438 $versionService = new \services\VersionService();
439 $version = $versionService->fetch();
441 if (!empty($version)) {
442 //Version tag
443 $patch_appending = "";
444 //Collected below function call to a variable, since unable to directly include
445 // function calls within empty() in php versions < 5.5 .
446 $version_getrealpatch = $version->getRealPatch();
447 if ( ($version->getRealPatch() != '0') && (!(empty($version_getrealpatch))) ) {
448 $patch_appending = " (".$version->getRealPatch().")";
451 $openemr_version = $version->getMajor() . "." . $version->getMinor() . "." . $version->getPatch();
452 $openemr_version .= $version->getTag() . $patch_appending;
453 } else {
454 $openemr_version = xl('Unknown version');
457 $srcdir = $GLOBALS['srcdir'];
458 $login_screen = $GLOBALS['login_screen'];
459 $GLOBALS['css_header'] = $css_header;
460 $GLOBALS['backpic'] = $backpic;
462 // 1 = send email message to given id for Emergency Login user activation,
463 // else 0.
464 $GLOBALS['Emergency_Login_email'] = empty($GLOBALS['Emergency_Login_email_id']) ? 0 : 1;
466 //set include_de_identification to enable De-identification (currently de-identification works fine only with linux machines)
467 //Run de_identification_upgrade.php script to upgrade OpenEMR database to include procedures,
468 //functions, tables for de-identification(Mysql root user and password is required for successful
469 //execution of the de-identification upgrade script)
470 $GLOBALS['include_de_identification']=0;
471 // Include the authentication module code here, but the rule is
472 // if the file has the word "login" in the source code file name,
473 // don't include the authentication module - we do this to avoid
474 // include loops.
476 if ( ($ignoreAuth_offsite_portal === true) && ($GLOBALS['portal_offsite_enable'] == 1) ) {
477 $ignoreAuth = true;
479 elseif ( ($ignoreAuth_onsite_portal_two === true) && ($GLOBALS['portal_onsite_two_enable'] == 1) ) {
480 $ignoreAuth = true;
482 if (!$ignoreAuth) {
483 include_once("$srcdir/auth.inc");
487 // This is the background color to apply to form fields that are searchable.
488 // Currently it is applicable only to the "Search or Add Patient" form.
489 $GLOBALS['layout_search_color'] = '#ffff55';
491 //EMAIL SETTINGS
492 $SMTP_Auth = !empty($GLOBALS['SMTP_USER']);
495 //module configurations
496 $GLOBALS['baseModDir'] = "interface/modules/"; //default path of modules
497 $GLOBALS['customModDir']= "custom_modules"; //non zend modules
498 $GLOBALS['zendModDir'] = "zend_modules"; //zend modules
500 // Don't change anything below this line. ////////////////////////////
502 $encounter = empty($_SESSION['encounter']) ? 0 : $_SESSION['encounter'];
504 if (!empty($_GET['pid']) && empty($_SESSION['pid'])) {
505 $_SESSION['pid'] = $_GET['pid'];
507 elseif (!empty($_POST['pid']) && empty($_SESSION['pid'])) {
508 $_SESSION['pid'] = $_POST['pid'];
510 $pid = empty($_SESSION['pid']) ? 0 : $_SESSION['pid'];
511 $userauthorized = empty($_SESSION['userauthorized']) ? 0 : $_SESSION['userauthorized'];
512 $groupname = empty($_SESSION['authProvider']) ? 0 : $_SESSION['authProvider'];
514 //This is crucial for therapy groups and patients mechanisms to work together properly
515 $attendant_type = (empty($pid) && isset($_SESSION['therapy_group'])) ? 'gid' : 'pid';
516 $therapy_group = (empty($pid) && isset($_SESSION['therapy_group'])) ? $_SESSION['therapy_group'] : 0;
518 // global interface function to format text length using ellipses
519 function strterm($string,$length) {
520 if (strlen($string) >= ($length-3)) {
521 return substr($string,0,$length-3) . "...";
522 } else {
523 return $string;
527 // Override temporary_files_dir if PHP >= 5.2.1.
528 if (version_compare(phpversion(), "5.2.1", ">=")) {
529 $GLOBALS['temporary_files_dir'] = rtrim(sys_get_temp_dir(),'/');
532 // turn off PHP compatibility warnings
533 ini_set("session.bug_compat_warn","off");
535 //////////////////////////////////////////////////////////////////
537 /* Pages with "myadmin" in the URL don't need register_globals. */
538 $fake_register_globals =
539 $fake_register_globals && (strpos($_SERVER['REQUEST_URI'],"myadmin") === FALSE);
542 // Emulates register_globals = On. Moved to the bottom of globals.php to prevent
543 // overrides of any variables used during global setup.
544 // EXTR_SKIP flag set to prevent overriding any variables defined earlier
545 if ($fake_register_globals) {
546 extract($_GET,EXTR_SKIP);
547 extract($_POST,EXTR_SKIP);