Permalink
Browse files

Merge commit 'jdpurdyvi/master' into v2.2_dev

  • Loading branch information...
2 parents e6f7e77 + 7d9dc9e commit fd9a737e7566cdea28cb1d3aca7ab3fffe078780 @anon84 anon84 committed May 11, 2010
@@ -1,17 +1,17 @@
-#!/bin/bash
+#!/bin/bash
-aptitude update -y
-aptitude safe-upgrade -y
-echo -e "Enter the password for the root user in MySQL: \c"
-read -s ROOT_PASSWORD
-echo "mysql-server mysql-server/root_password select $ROOT_PASSWORD" | debconf-set-selections
-echo "mysql-server mysql-server/root_password_again select $ROOT_PASSWORD" | debconf-set-selections
-echo "python-mysqldb mysql-server/root_password select $ROOT_PASSWORD" | debconf-set-selections
-echo "python-mysqldb mysql-server/root_password_again select $ROOT_PASSWORD" | debconf-set-selections
+aptitude update -y
+aptitude safe-upgrade -y
+echo -e "Enter the password for the root user in MySQL: \c"
+read -s ROOT_PASSWORD
+echo "mysql-server mysql-server/root_password select $ROOT_PASSWORD" | debconf-set-selections
+echo "mysql-server mysql-server/root_password_again select $ROOT_PASSWORD" | debconf-set-selections
+echo "python-mysqldb mysql-server/root_password select $ROOT_PASSWORD" | debconf-set-selections
+echo "python-mysqldb mysql-server/root_password_again select $ROOT_PASSWORD" | debconf-set-selections
aptitude install -y mysql-server apache2 php5 libapache2-mod-php5 python-mysqldb php5-mysql
-python /pos/installation/install_lane.py
+python /pos/installation/install_lane.py
-/pos/installation/ubuntu/ssd_server.sh
+/pos/installation/ubuntu/ssd_server.sh
-/pos/installation/ubuntu/php_lane.pl
+/pos/installation/ubuntu/php_lane.pl
/pos/installation/ubuntu/apache_lane.pl
@@ -59,10 +59,17 @@
}
}
elseif ($admin_task == "TR") {
- getsubtotals();
- if ($_SESSION["LastID"] != 0) {
- msgscreen("transaction in progress");
- }
+ getsubtotals();
+ if ($_SESSION["LastID"] != 0) {
+ msgscreen("transaction in progress");
+ }
+ elseif ($_SESSION["standalone"] != 0) {?>
+ <script type="text/javascript">
+ alert('Unable to contact server. Please make sure both the lane and server are connected to the network and the server is powered on. You can check connectivity to the server by looking for the gren connection icon next to the date and time field.');
+ </script>
+ <?php
+ gohome();
+ }
else {
tenderReport();
}
@@ -1,7 +1,7 @@
<?php
- include_once("connect.php");
- include_once("lib/query.php");
- include_once("lib/conf.php");
+ include_once("lib/conf.php");
+ include_once("connect.php");
+ include_once("lib/query.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -42,15 +42,16 @@
$_SESSION["config_saved"] = FALSE;
}
?>
- </p
+ </p>
<div class='config_forms'>
- <form action='/lib/apply_configurations.php' method='post'>
- <input type='submit' value='Save Changes' />
- <?php
+ <form action='/lib/apply_configurations.php' method='post'>
+ <input type='submit' value='Save Changes'/>
+ <?php
$groups = get_configuration_groups();
foreach ($groups as $group) {
?>
- <fieldset>
+ <fieldset>
+
<legend><?=$group["group_name"]?></legend>
<?php
$configs = get_configuration_settings($group["group_id"]);
@@ -22,7 +22,7 @@
*********************************************************************************/
if (!function_exists("get_config_auto")) {
include_once("lib/conf.php");
- apply_configurations();
+ # apply_configurations();
}
if (!function_exists("setglobalflags")) {
@@ -326,7 +326,7 @@ function sql_connect($server, $user, $pass) {
$connection = mssql_connect($server, $user, $pass);
}
else {
- $connection = mysql_connect($server, $user, $pass) or die(mysql_error());
+ $connection = mysql_connect($server, $user, $pass);
}
return $connection;
}
@@ -1,5 +1,4 @@
<?php
-
include_once("/pos/is4c/lib/initialize.php");
if (!function_exists("get_users")) {
include_once("/pos/is4c/lib/query.php");
@@ -1,5 +1,5 @@
<?php
- if (!isset($_SESSION["DBMS"]))
+ if (!isset($_SESSION["DBMS"]) || empty($_SESSION['DBMS']))
{
$handle = fopen("/pos/db_connect", "r");
$contents = fread($handle, filesize("/pos/db_connect"));
@@ -24,5 +24,6 @@
preg_match('/[\r\n]?password:[^\r\n]*\n/', $contents, $match);
preg_match('/[^: ]*$/', $match[0], $match);
$_SESSION["localPass"] = trim($match[0]);
+ } else {
}
?>
@@ -1,6 +1,6 @@
<?php
if (!function_exists("pDataConnect")) {
- include("/pos/is4c/connect.php");
+ include_once("/pos/is4c/connect.php");
}
/*Returns an associative array of active employees.*/
@@ -121,7 +121,7 @@ function get_configuration_groups_query() {
$query =
'SELECT group_id,
group_name
- FROM configurationGroups
+ FROM `opdata`.`configurationGroups`
WHERE group_id > 0;';
$result = sql_query($query, pDataConnect());
for ($i = 0; $i < sql_num_rows($result); $i++) {
@@ -137,7 +137,7 @@ function get_configuration_group_settings_query($configuration_group) {
'SELECT `key`,
value,
type
- FROM configuration
+ FROM `opdata`.`configuration`
WHERE group_id = ' . $configuration_group;
$result = sql_query($query, pDataConnect());
for ($i = 0; $i < sql_num_rows($result); $i++) {
@@ -151,7 +151,7 @@ function get_configurations() {
$query =
'SELECT `key`,
value
- FROM configuration
+ FROM `opdata`.`configuration`
WHERE group_id > 0;';
$result = sql_query($query, pDataConnect());
for ($i = 0; $i < sql_num_rows($result); $i++) {
@@ -164,9 +164,9 @@ function get_configurations() {
// Checks for a list of configuration values that must be set for IS4C to operate.
// If any of these configurations are not set, then it returen false.
function configs_set() {
- $query =
+ $query =
'SELECT value
- FROM configuration
+ FROM `opdata`.`configuration`
WHERE `key` IN
(
"OS",
@@ -178,37 +178,41 @@ function configs_set() {
"localUser",
"laneno"
);';
- $result = sql_query($query, pDataConnect());
- for ($i = 0; $i < sql_num_rows($result); $i++) {
- $row = sql_fetch_assoc_array($result);
- if ($row["value"] == NULL)
- {
- return false;
- }
- }
- return true;
+ $result = sql_query($query, pDataConnect());
+ if ($result) {
+ for ($i = 0; $i < sql_num_rows($result); $i++) {
+ $row = sql_fetch_assoc_array($result);
+ if ($row["value"] == NULL)
+ {
+ return false;
+ }
+ }
+ return true;
+ } else {
+ return false;
+ }
}
function save_configurations($configurations) {
// Set all flag fields to 0.
// Those that have been checked will be reset back to 1.
$query =
'SELECT conf_id
- FROM configuration
+ FROM `opdata`.`configuration`
WHERE type = "flag";';
$result = sql_query($query, pDataConnect());
for ($i = 0; $i < sql_num_rows($result); $i++) {
$row = sql_fetch_assoc_array($result);
$query =
- 'UPDATE configuration
+ 'UPDATE `opdata`.`configuration`
SET value = 0
WHERE conf_id = "' . $row["conf_id"] . '";';
$execute = sql_query($query, pDataConnect());
}
// Save the configurations to the database.
foreach($configurations as $key => $value) {
$query =
- 'UPDATE configuration
+ 'UPDATE `opdata`.`configuration`
SET value = "' . $value . '"
WHERE `key` = "' . $key . '";';
$result = sql_query($query, pDataConnect());
View
@@ -23,7 +23,6 @@
if (!function_exists("get_config_auto")) {
include_once("lib/conf.php");
- apply_configurations();
}
if (!function_exists("pDataConnect") || !function_exists("tDataConnect")) {
@@ -39,16 +38,16 @@
include("lib/conf.php");
}
- initiate_session();
-
if (!is_config_set()) {
?>
<script type='text/javascript'>
window.top.location = '/configure.php';
</script>
<?php
}
-
+
+ apply_configurations();
+ initiate_session();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
@@ -1,3 +1,3 @@
<?php
print_r($_SESSION);
-s
+?>
Oops, something went wrong.

0 comments on commit fd9a737

Please sign in to comment.