mirror of https://github.com/itflow-org/itflow
Convert custom function names to camelCase
This commit is contained in:
parent
10362f86ef
commit
531bd25f27
|
|
@ -17,7 +17,7 @@ header('Content-Type: application/json');
|
|||
$_POST = json_decode(file_get_contents('php://input'), true);
|
||||
|
||||
// Get user IP
|
||||
$ip = strip_tags(mysqli_real_escape_string($mysqli, getIp()));
|
||||
$ip = strip_tags(mysqli_real_escape_string($mysqli, getIP()));
|
||||
// Get user agent
|
||||
$user_agent = strip_tags(mysqli_real_escape_string($mysqli, $_SERVER['HTTP_USER_AGENT']));
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ if (!isset($_SESSION['logged']) || !$_SESSION['logged']) {
|
|||
}
|
||||
|
||||
// SESSION FINGERPRINT
|
||||
$session_ip = strip_tags(mysqli_real_escape_string($mysqli,getIp()));
|
||||
$session_ip = strip_tags(mysqli_real_escape_string($mysqli,getIP()));
|
||||
|
||||
// User agent
|
||||
$session_user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
$log_description = htmlentities($row['log_description']);
|
||||
$log_ip = htmlentities($row['log_ip']);
|
||||
$log_user_agent = htmlentities($row['log_user_agent']);
|
||||
$log_user_os = get_os($log_user_agent);
|
||||
$log_user_os = getOS($log_user_agent);
|
||||
$log_user_browser = getWebBrowser($log_user_agent);
|
||||
$log_created_at = $row['log_created_at'];
|
||||
$user_id = $row['user_id'];
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ function getUserAgent() {
|
|||
return $_SERVER['HTTP_USER_AGENT'];
|
||||
}
|
||||
|
||||
function getIp() {
|
||||
function getIP() {
|
||||
if (defined("CONST_GET_IP_METHOD")) {
|
||||
if (CONST_GET_IP_METHOD == "HTTP_X_FORWARDED_FOR") {
|
||||
$ip = getenv('HTTP_X_FORWARDED_FOR');
|
||||
|
|
@ -103,7 +103,7 @@ function getWebBrowser($user_browser) {
|
|||
return $browser;
|
||||
}
|
||||
|
||||
function get_os($user_os) {
|
||||
function getOS($user_os) {
|
||||
$os_platform = "Unknown OS";
|
||||
$os_array = array(
|
||||
'/windows nt 10/i' => "<i class='fab fa-fw fa-windows text-secondary'></i> Windows 10",
|
||||
|
|
@ -130,7 +130,7 @@ function get_os($user_os) {
|
|||
return $os_platform;
|
||||
}
|
||||
|
||||
function GetDevice() {
|
||||
function getDevice() {
|
||||
$tablet_browser = 0;
|
||||
$mobile_browser = 0;
|
||||
if (preg_match('/(tablet|ipad|playbook)|(android(?!.*(mobi|opera mini)))/i', strtolower($_SERVER['HTTP_USER_AGENT']))) {
|
||||
|
|
@ -437,9 +437,6 @@ function getSSL($name) {
|
|||
function strtoAZaz09($string) {
|
||||
$string = ucwords(strtolower($string));
|
||||
|
||||
// Replace spaces with _
|
||||
//$string = str_replace(' ', '_', $string);
|
||||
|
||||
// Gets rid of non-alphanumerics
|
||||
return preg_replace('/[^A-Za-z0-9_]/', '', $string);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ include_once("config.php");
|
|||
include_once("functions.php");
|
||||
|
||||
// IP & User Agent for logging
|
||||
$ip = strip_tags(mysqli_real_escape_string($mysqli,getIp()));
|
||||
$ip = strip_tags(mysqli_real_escape_string($mysqli,getIP()));
|
||||
$user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
||||
|
||||
// Define wording for the user
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// Not including the guest header as we don't want any HTML output
|
||||
include("config.php");
|
||||
include("functions.php");
|
||||
$ip = trim(strip_tags(mysqli_real_escape_string($mysqli,getIp())));
|
||||
$ip = trim(strip_tags(mysqli_real_escape_string($mysqli,getIP())));
|
||||
$user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
||||
|
||||
if (isset($_GET['id']) && isset($_GET['key'])) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ include("functions.php");
|
|||
|
||||
session_start();
|
||||
|
||||
$ip = trim(strip_tags(mysqli_real_escape_string($mysqli,getIp())));
|
||||
$ip = trim(strip_tags(mysqli_real_escape_string($mysqli,getIP())));
|
||||
$user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -65,10 +65,10 @@ if (isset($_GET['invoice_id'], $_GET['url_key'])) {
|
|||
//Set Currency Format
|
||||
$currency_format = numfmt_create($company_locale, NumberFormatter::CURRENCY);
|
||||
|
||||
$ip = strip_tags(mysqli_real_escape_string($mysqli,getIp()));
|
||||
$ip = strip_tags(mysqli_real_escape_string($mysqli,getIP()));
|
||||
|
||||
$session_user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
||||
$os = strip_tags(mysqli_real_escape_string($mysqli,get_os($session_user_agent)));
|
||||
$os = strip_tags(mysqli_real_escape_string($mysqli,getOS($session_user_agent)));
|
||||
$browser = strip_tags(mysqli_real_escape_string($mysqli,getWebBrowser($session_user_agent)));
|
||||
|
||||
//Set Badge color based off of invoice status
|
||||
|
|
|
|||
|
|
@ -64,10 +64,10 @@ if (isset($_GET['quote_id'], $_GET['url_key'])) {
|
|||
//Set Currency Format
|
||||
$currency_format = numfmt_create($company_locale, NumberFormatter::CURRENCY);
|
||||
|
||||
$ip = strip_tags(mysqli_real_escape_string($mysqli,getIp()));
|
||||
$ip = strip_tags(mysqli_real_escape_string($mysqli,getIP()));
|
||||
|
||||
$session_user_agent = strip_tags(mysqli_real_escape_string($mysqli,$_SERVER['HTTP_USER_AGENT']));
|
||||
$os = strip_tags(mysqli_real_escape_string($mysqli,get_os($session_user_agent)));
|
||||
$os = strip_tags(mysqli_real_escape_string($mysqli,getOS($session_user_agent)));
|
||||
$browser = strip_tags(mysqli_real_escape_string($mysqli,getWebBrowser($session_user_agent)));
|
||||
|
||||
//Update status to Viewed only if invoice_status = "Sent"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ require_once("functions.php");
|
|||
require_once("rfc6238.php");
|
||||
|
||||
// IP & User Agent for logging
|
||||
$ip = strip_tags(mysqli_real_escape_string($mysqli, getIp()));
|
||||
$ip = strip_tags(mysqli_real_escape_string($mysqli, getIP()));
|
||||
$user_agent = strip_tags(mysqli_real_escape_string($mysqli, $_SERVER['HTTP_USER_AGENT']));
|
||||
|
||||
// Block brute force password attacks - check recent failed login attempts for this IP
|
||||
|
|
|
|||
2
logs.php
2
logs.php
|
|
@ -141,7 +141,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
$log_description = htmlentities($row['log_description']);
|
||||
$log_ip = htmlentities($row['log_ip']);
|
||||
$log_user_agent = htmlentities($row['log_user_agent']);
|
||||
$log_user_os = get_os($log_user_agent);
|
||||
$log_user_os = getOS($log_user_agent);
|
||||
$log_user_browser = getWebBrowser($log_user_agent);
|
||||
$log_created_at = $row['log_created_at'];
|
||||
$user_id = $row['user_id'];
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ if (!$_SESSION['client_logged_in']) {
|
|||
}
|
||||
|
||||
// SESSION FINGERPRINT
|
||||
$session_ip = strip_tags(mysqli_real_escape_string($mysqli, getIp()));
|
||||
$session_ip = strip_tags(mysqli_real_escape_string($mysqli, getIP()));
|
||||
|
||||
// Get user agent
|
||||
$session_user_agent = strip_tags(mysqli_real_escape_string($mysqli, $_SERVER['HTTP_USER_AGENT']));
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ if (!isset($_SESSION)) {
|
|||
session_start();
|
||||
}
|
||||
|
||||
$ip = strip_tags(mysqli_real_escape_string($mysqli, getIp()));
|
||||
$ip = strip_tags(mysqli_real_escape_string($mysqli, getIP()));
|
||||
$user_agent = strip_tags(mysqli_real_escape_string($mysqli, $_SERVER['HTTP_USER_AGENT']));
|
||||
|
||||
$sql_settings = mysqli_query($mysqli, "SELECT config_azure_client_id FROM settings WHERE company_id = '1'");
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ if (!isset($_SESSION)) {
|
|||
session_start();
|
||||
}
|
||||
|
||||
$ip = strip_tags(mysqli_real_escape_string($mysqli,getIp()));
|
||||
$ip = strip_tags(mysqli_real_escape_string($mysqli,getIP()));
|
||||
$user_agent = strip_tags(mysqli_real_escape_string($mysqli, $_SERVER['HTTP_USER_AGENT']));
|
||||
|
||||
$company_sql = mysqli_query($mysqli, "SELECT company_name FROM companies WHERE company_id = '1'");
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ $sql_recent_logs = mysqli_query($mysqli, "SELECT * FROM logs
|
|||
$log_id = $row['log_id'];
|
||||
$log_ip = htmlentities($row['log_ip']);
|
||||
$log_user_agent = htmlentities($row['log_user_agent']);
|
||||
$log_user_os = get_os($log_user_agent);
|
||||
$log_user_os = getOS($log_user_agent);
|
||||
$log_user_browser = getWebBrowser($log_user_agent);
|
||||
$log_created_at = $row['log_created_at'];
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
$log_created_at = $row['log_created_at'];
|
||||
$log_ip = htmlentities($row['log_ip']);
|
||||
$log_user_agent = htmlentities($row['log_user_agent']);
|
||||
$log_user_os = get_os($log_user_agent);
|
||||
$log_user_os = getOS($log_user_agent);
|
||||
$log_user_browser = getWebBrowser($log_user_agent);
|
||||
$last_login = "$log_user_os<br>$log_user_browser<br><i class='fa fa-fw fa-globe'></i> $log_ip";
|
||||
if (empty($last_login)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue