Skip to content

Commit

Permalink
Fixed: UCS command line updater cannot run because of undefined constant
Browse files Browse the repository at this point in the history
Fixed: UCS command line updater changed to ucs_upload.sh.php and run with "commandlineshell# php -f ucs_upload.sh.php
  • Loading branch information
dicarve committed Apr 23, 2014
1 parent 9f20038 commit c9ddca6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/php
<?php
/**
* Copyright (C) 2010 Arie Nugraha ([email protected])
Expand All @@ -21,14 +20,21 @@

/* Send ALL Catalog data to UCS server */

// check if we are running from command line or not
if (php_sapi_name() != 'cli') {
die('This script intended to be run on command line interface only!');
}

set_time_limit(0);

define('INDEX_AUTH', 1);

// main system configuration
require '../../../sysconfig.inc.php';

// check if UCS is enabled or not
if (!$sysconf['ucs']['enable']) {
die(__('UCS is not enabled! Change global system configuration to enable UCS'));
die(__('UCS is not enabled! Change global system configuration to enable UCS'));
}

require SB.'ucnode.inc.php';
Expand Down Expand Up @@ -99,3 +105,4 @@
} else {
exit(0);
}
?>
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@
$main_content = ob_get_clean();

// template output
require $sysconf['template']['dir'].'/'.$sysconf['template']['theme'].'/index_template.inc.php';
require SB.$sysconf['template']['dir'].'/'.$sysconf['template']['theme'].'/index_template.inc.php';
14 changes: 7 additions & 7 deletions sysconfig.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function stripslashes_deep($value)
$_REQUEST = array_map('stripslashes_deep', $_REQUEST);
}
// turn off all error messages for security reason
@ini_set('display_errors',true);
@ini_set('display_errors', true);
// check if safe mode is on
if ((bool) ini_get('safe_mode')) {
define('SENAYAN_IN_SAFE_MODE', 1);
Expand Down Expand Up @@ -104,7 +104,7 @@ function stripslashes_deep($value)
// senayan web doc root dir
/* Custom base URL */
$sysconf['baseurl'] = '';
$temp_senayan_web_root_dir = preg_replace('@admin.*@i', '', dirname($_SERVER['PHP_SELF']));
$temp_senayan_web_root_dir = preg_replace('@admin.*@i', '', dirname(@$_SERVER['PHP_SELF']));
define('SWB', $sysconf['baseurl'].$temp_senayan_web_root_dir.(preg_match('@\/$@i', $temp_senayan_web_root_dir)?'':'/'));

// admin section web root dir
Expand Down Expand Up @@ -153,12 +153,12 @@ function stripslashes_deep($value)
header('Content-type: text/html; charset=UTF-8');

/* GUI Template config */
ob_start();
include $sysconf['template']['dir'].'/'.$sysconf['template']['theme'].'/tinfo.inc.php';
ob_end_clean();
$sysconf['template']['dir'] = 'template';
$sysconf['template']['theme'] = 'default';
$sysconf['template']['css'] = $sysconf['template']['dir'].'/'.$sysconf['template']['theme'].'/style.css';
ob_start();
include $sysconf['template']['dir'].'/'.$sysconf['template']['theme'].'/tinfo.inc.php';
ob_end_clean();

/* ADMIN SECTION GUI Template config */
$sysconf['admin_template']['dir'] = 'admin_template';
Expand Down Expand Up @@ -484,7 +484,7 @@ function stripslashes_deep($value)
// OAI-PMH settings
$sysconf['OAI']['enable'] = false;
$sysconf['OAI']['identifierPrefix'] = 'oai:slims/';
$sysconf['OAI']['Identify']['baseURL'] = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].SWB.'oai.php';
$sysconf['OAI']['Identify']['baseURL'] = 'http://'.@$_SERVER['SERVER_NAME'].':'.@$_SERVER['SERVER_PORT'].SWB.'oai.php';
$sysconf['OAI']['Identify']['repositoryName'] = 'SLiMS Senayan Library Management System OAI-PMh';
$sysconf['OAI']['Identify']['adminEmail'] = '[email protected]';
$sysconf['OAI']['Identify']['granularity'] = 'YYYY-MM-DDThh:mm:ssZ';
Expand Down Expand Up @@ -528,7 +528,7 @@ function stripslashes_deep($value)
/* MYSQLI */
$dbs = @new mysqli(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_NAME, DB_PORT);
if (mysqli_connect_error()) {
die('<div style="border: 1px dotted #FF0000; color: #FF0000; padding: 5px;">Error Connecting to Database. Please check your configuration</div>');
die("Error Connecting to Database with message: ".mysqli_connect_error().". Please check your configuration!\n");
}
} else {
/* MYSQL */
Expand Down
2 changes: 1 addition & 1 deletion ucnode.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
die("can not access this file directly");
}

$ucs['serveraddr'] = 'http://127.0.0.1/ucs2'; // UCS server address. NO TRAILING SLASH! for local testing on Windows machine don't use localhost, use 127.0.0.1 instead
$ucs['serveraddr'] = 'http://localhost/ucs2'; // UCS server address. NO TRAILING SLASH! for local testing on Windows machine don't use localhost, use 127.0.0.1 instead
$node['id'] = 'slims-node'; // node ID
$node['password'] = '2325f677e21c1613909c953eb03c57352259cc5d'; // default is s0beautifulday
$node['name'] = 'SLiMS Library'; // node name

0 comments on commit c9ddca6

Please sign in to comment.