MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
+
+define("FA_LOGOUT_PHP_FILE","");
+
$page_security = 'SA_OPEN';
$path_to_root="..";
include($path_to_root . "/includes/session.inc");
//---------------------------------------------------------------------------------------------
if (isset($_GET['selected_id']))
{
- $selected_id = $_GET['selected_id'];
+ $selected_id = (int)$_GET['selected_id'];
}
elseif (isset($_POST['selected_id']))
{
- $selected_id = $_POST['selected_id'];
+ $selected_id = (int)$_POST['selected_id'];
}
else
$selected_id = -1;
{
global $def_coy, $db_connections, $comp_subdirs, $path_to_root;
- $id = $_GET['id'];
+ $id = (int)$_GET['id'];
// First make sure all company directories from the one under removal are writable.
// Without this after operation we end up with changed per-company owners!
}
// Add user to database
- db_query("INSERT INTO ".TB_PREF."useronline (timestamp, ip, file) VALUES ('". $timestamp ."','". $ip ."','". $_SERVER['PHP_SELF'] ."')");
+ db_query("INSERT INTO ".TB_PREF."useronline (timestamp, ip, file) VALUES ('". $timestamp ."',". db_escape($ip) .",". db_escape($_SERVER['PHP_SELF']) .")");
//Remove users that were not online within $timeoutseconds.
db_query("DELETE FROM ".TB_PREF."useronline WHERE timestamp<". $timeout);
return "$users ".($users == 1 ? _("user online") : _("users online"));
}
-?>
\ No newline at end of file
+?>
function set_company($company)
{
- $this->company = $company;
+ $this->company = (int)$company;
}
function login($company, $loginname, $password)
// logout.php is the only page we should have always
// accessable regardless of access level and current login status.
-if (strstr($_SERVER['PHP_SELF'], 'logout.php') == false){
+if (!defined('FA_LOGOUT_PHP_FILE')){
login_timeout();
// We quote all values later with db_escape() before db update.
$_POST = strip_quotes($_POST);
-?>
\ No newline at end of file
+?>
editable=".db_escape($editable);
if ($units != '')
- $sql .= ", units='$units'";
+ $sql .= ", units=".db_escape($units);
if ($mb_flag != '')
- $sql .= ", mb_flag='$mb_flag'";
+ $sql .= ", mb_flag=".db_escape($mb_flag);
$sql .= " WHERE stock_id=".db_escape($stock_id);
}
return $msg;
}
-?>
\ No newline at end of file
+?>
db_query($sql, "could not delete tax type");
// also delete any item tax exemptions associated with this type
- $sql = "DELETE FROM ".TB_PREF."item_tax_type_exemptions WHERE tax_type_id=$type_id";
+ $sql = "DELETE FROM ".TB_PREF."item_tax_type_exemptions WHERE tax_type_id=".db_escape($type_id);
db_query($sql, "could not delete item tax type exemptions");
}
-?>
\ No newline at end of file
+?>