mirror of https://github.com/itflow-org/itflow
Moved files check_login.php, get_settings.php, settings_localization_array.php, inc_set_timezone.php into the includes folder, we also moved /client/check_login.php into client/includes/
This commit is contained in:
parent
59bbbe4a8d
commit
7150b1545a
|
|
@ -189,11 +189,6 @@ ob_start();
|
|||
<a class="nav-link" data-toggle="pill" href="#pills-contact-recurring-tickets<?php echo $contact_id; ?>"><i class="fas fa-fw fa-redo-alt fa-2x"></i><br>Rcr Tickets (<?php echo $recurring_ticket_count; ?>)</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if ($services_count) { ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-contact-services<?php echo $contact_id; ?>"><i class="fas fa-fw fa-stream fa-2x"></i><br>Services (<?php echo $services_count; ?>)</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if ($document_count) { ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#pills-contact-documents<?php echo $contact_id; ?>"><i class="fas fa-fw fa-file-alt fa-2x"></i><br>Documents (<?php echo $document_count; ?>)</a>
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ if ($_SESSION['user_type'] !== 2) {
|
|||
}
|
||||
|
||||
// Set Timezone
|
||||
require_once "../inc_set_timezone.php";
|
||||
require_once "../includes/inc_set_timezone.php";
|
||||
|
||||
// User IP & UA
|
||||
$session_ip = sanitizeInput(getIP());
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
require_once '../config.php';
|
||||
require_once '../get_settings.php';
|
||||
require_once '../includes/get_settings.php';
|
||||
require_once '../functions.php';
|
||||
require_once 'check_login.php';
|
||||
require_once 'functions.php';
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ require_once '../config.php';
|
|||
|
||||
require_once '../functions.php';
|
||||
|
||||
require_once '../get_settings.php';
|
||||
require_once '../includes/get_settings.php';
|
||||
|
||||
if (!isset($_SESSION)) {
|
||||
// HTTP Only cookies
|
||||
|
|
@ -23,7 +23,7 @@ if (!isset($_SESSION)) {
|
|||
}
|
||||
|
||||
// Set Timezone after session_start
|
||||
require_once "../inc_set_timezone.php";
|
||||
require_once "../includes/inc_set_timezone.php";
|
||||
|
||||
// Check to see if client portal is enabled
|
||||
if($config_client_portal_enable == 0) {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ if (!isset($_SESSION)) {
|
|||
}
|
||||
|
||||
// Set Timezone after session starts
|
||||
require_once "../inc_set_timezone.php";
|
||||
require_once "../includes/inc_set_timezone.php";
|
||||
|
||||
$session_ip = sanitizeInput(getIP());
|
||||
$session_user_agent = sanitizeInput($_SERVER['HTTP_USER_AGENT']);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ header("Content-Security-Policy: default-src 'self'");
|
|||
|
||||
require_once '../config.php';
|
||||
require_once '../functions.php';
|
||||
require_once '../get_settings.php';
|
||||
require_once '../includes/get_settings.php';
|
||||
|
||||
|
||||
if (empty($config_smtp_host)) {
|
||||
|
|
@ -33,7 +33,7 @@ if (!isset($_SESSION)) {
|
|||
}
|
||||
|
||||
// Set Timezone after session
|
||||
require_once "../inc_set_timezone.php";
|
||||
require_once "../includes/inc_set_timezone.php";
|
||||
|
||||
$ip = sanitizeInput(getIP());
|
||||
$user_agent = sanitizeInput($_SERVER['HTTP_USER_AGENT']);
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
*/
|
||||
|
||||
require_once '../config.php';
|
||||
require_once '../get_settings.php';
|
||||
require_once '../includes/get_settings.php';
|
||||
require_once '../functions.php';
|
||||
require_once 'check_login.php';
|
||||
require_once 'includes/check_login.php';
|
||||
require_once 'functions.php';
|
||||
|
||||
if (isset($_POST['add_ticket'])) {
|
||||
|
|
|
|||
|
|
@ -83,14 +83,16 @@ if (isset($_GET['id']) && intval($_GET['id'])) {
|
|||
</ol>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header bg-dark text-center">
|
||||
<h4 class="mt-1">
|
||||
<div class="card-header bg-dark my-2">
|
||||
<h4 class="card-title mt-1">
|
||||
Ticket <?php echo $ticket_prefix, $ticket_number ?>
|
||||
</h4>
|
||||
<div class="card-tools">
|
||||
<?php
|
||||
if (empty($ticket_resolved_at) && $task_count == $completed_task_count) { ?>
|
||||
<a href="post.php?resolve_ticket=<?php echo $ticket_id; ?>" class="btn btn-sm btn-outline-success float-right text-white confirm-link"><i class="fas fa-fw fa-check text-success"></i> Resolve ticket</a>
|
||||
<?php } ?>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body prettyContent">
|
||||
|
|
@ -122,7 +124,7 @@ if (isset($_GET['id']) && intval($_GET['id'])) {
|
|||
while ($ticket_attachment = mysqli_fetch_array($sql_ticket_attachments)) {
|
||||
$name = nullable_htmlentities($ticket_attachment['ticket_attachment_name']);
|
||||
$ref_name = nullable_htmlentities($ticket_attachment['ticket_attachment_reference_name']);
|
||||
echo "<hr class=''><i class='fas fa-fw fa-paperclip text-secondary mr-1'></i>$name | <a target='_blank' href='https://$config_base_url/uploads/tickets/$ticket_id/$ref_name'><i class='fas fa-fw fa-external-link-alt mr-1'></i>View</a>";
|
||||
echo "<hr><i class='fas fa-fw fa-paperclip text-secondary mr-1'></i>$name | <a href='../uploads/tickets/$ticket_id/$ref_name' download='$name'><i class='fas fa-fw fa-download mr-1'></i>Download</a> | <a target='_blank' href='../uploads/tickets/$ticket_id/$ref_name'><i class='fas fa-fw fa-external-link-alt mr-1'></i>View</a>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
|
@ -259,7 +261,7 @@ if (isset($_GET['id']) && intval($_GET['id'])) {
|
|||
while ($ticket_attachment = mysqli_fetch_array($sql_ticket_reply_attachments)) {
|
||||
$name = nullable_htmlentities($ticket_attachment['ticket_attachment_name']);
|
||||
$ref_name = nullable_htmlentities($ticket_attachment['ticket_attachment_reference_name']);
|
||||
echo "<hr><i class='fas fa-fw fa-paperclip text-secondary mr-1'></i>$name | <a target='_blank' href='https://$config_base_url/uploads/tickets/$ticket_id/$ref_name'><i class='fas fa-fw fa-external-link-alt mr-1'></i>View</a>";
|
||||
echo "<hr><i class='fas fa-fw fa-paperclip text-secondary mr-1'></i>$name | <a href='../uploads/tickets/$ticket_id/$ref_name' download='$name'><i class='fas fa-fw fa-download mr-1'></i>Download</a> | <a target='_blank' href='../uploads/tickets/$ticket_id/$ref_name'><i class='fas fa-fw fa-external-link-alt mr-1'></i>View</a>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
require_once "../config.php";
|
||||
|
||||
// Set Timezone
|
||||
require_once "../inc_set_timezone.php";
|
||||
require_once "../includes/inc_set_timezone.php";
|
||||
|
||||
require_once "../functions.php";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ require_once "../functions.php";
|
|||
session_start();
|
||||
|
||||
// Set Timezone
|
||||
require_once "../inc_set_timezone.php";
|
||||
require_once "../includes/inc_set_timezone.php";
|
||||
|
||||
$ip = sanitizeInput(getIP());
|
||||
$user_agent = sanitizeInput($_SERVER['HTTP_USER_AGENT']);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ require_once "../functions.php";
|
|||
|
||||
session_start();
|
||||
|
||||
require_once "../inc_set_timezone.php"; // Must be included after session_start to work
|
||||
require_once "../includes/inc_set_timezone.php"; // Must be included after session_start to work
|
||||
|
||||
if (isset($_GET['accept_quote'], $_GET['url_key'])) {
|
||||
$quote_id = intval($_GET['accept_quote']);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require_once "../config.php";
|
||||
require_once "../functions.php";
|
||||
require_once "../check_login.php";
|
||||
require_once "check_login.php";
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
|
|
|
|||
|
|
@ -13,16 +13,16 @@ if (!isset($_SESSION)) {
|
|||
|
||||
// Check to see if setup is enabled
|
||||
if (!isset($config_enable_setup) || $config_enable_setup == 1) {
|
||||
header("Location: setup.php");
|
||||
header("Location: ../setup.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Check user is logged in with a valid session
|
||||
if (!isset($_SESSION['logged']) || !$_SESSION['logged']) {
|
||||
if ($_SERVER["REQUEST_URI"] == "/") {
|
||||
header("Location: login.php");
|
||||
header("Location: ../login.php");
|
||||
} else {
|
||||
header("Location: login.php?last_visited=" . base64_encode($_SERVER["REQUEST_URI"]) );
|
||||
header("Location: ../login.php?last_visited=" . base64_encode($_SERVER["REQUEST_URI"]) );
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
|
@ -103,8 +103,8 @@
|
|||
<p>
|
||||
Calendar
|
||||
<?php
|
||||
if ($num_events > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_events; ?></span>
|
||||
if ($num_calendar_events > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_calendar_events; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -208,8 +208,8 @@ if (isset($_GET['client_id'])) {
|
|||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('document_id') AS num FROM documents WHERE document_archived_at IS NULL AND document_client_id = $client_id"));
|
||||
$num_documents = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('event_id') AS num FROM events WHERE event_client_id = $client_id"));
|
||||
$num_events = $row['num'];
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('event_id') AS num FROM calendar_events WHERE event_client_id = $client_id"));
|
||||
$num_calendar_events = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('trip_id') AS num FROM trips WHERE trip_archived_at IS NULL AND trip_client_id = $client_id"));
|
||||
$num_trips = $row['num'];
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ if (!file_exists('config.php')) {
|
|||
require_once "config.php";
|
||||
|
||||
// Set Timezone
|
||||
require_once "inc_set_timezone.php";
|
||||
require_once "includes/inc_set_timezone.php";
|
||||
|
||||
// Check if the application is configured for HTTPS-only access
|
||||
if ($config_https_only && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] !== 'on') && (!isset($_SERVER['HTTP_X_FORWARDED_PROTO']) || $_SERVER['HTTP_X_FORWARDED_PROTO'] !== 'https')) {
|
||||
|
|
|
|||
2
post.php
2
post.php
|
|
@ -8,7 +8,7 @@ require_once "config.php";
|
|||
|
||||
require_once "functions.php";
|
||||
|
||||
require_once "check_login.php";
|
||||
require_once "includes/check_login.php";
|
||||
|
||||
// Define a variable that we can use to only allow running post files via inclusion (prevents people/bots poking them)
|
||||
define('FROM_POST_HANDLER', true);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ if (php_sapi_name() !== 'cli') {
|
|||
require_once "../config.php";
|
||||
|
||||
// Set Timezone
|
||||
require_once "../inc_set_timezone.php";
|
||||
require_once "../includes/inc_set_timezone.php";
|
||||
require_once "../functions.php";
|
||||
|
||||
$sql_companies = mysqli_query($mysqli, "SELECT * FROM companies, settings WHERE companies.company_id = settings.company_id AND companies.company_id = 1");
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ if (php_sapi_name() !== 'cli') {
|
|||
require_once "../config.php";
|
||||
|
||||
// Set Timezone
|
||||
require_once "../inc_set_timezone.php";
|
||||
require_once "../includes/inc_set_timezone.php";
|
||||
require_once "../functions.php";
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ if (php_sapi_name() !== 'cli') {
|
|||
require_once "../config.php";
|
||||
|
||||
// Set Timezone
|
||||
require_once "../inc_set_timezone.php";
|
||||
require_once "../includes/inc_set_timezone.php";
|
||||
require_once "../functions.php";
|
||||
|
||||
$sql_settings = mysqli_query($mysqli, "SELECT * FROM settings WHERE settings.company_id = 1");
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ if (php_sapi_name() !== 'cli') {
|
|||
|
||||
require_once "../config.php";
|
||||
// Set Timezone
|
||||
require_once "../inc_set_timezone.php";
|
||||
require_once "../includes/inc_set_timezone.php";
|
||||
require_once "../functions.php";
|
||||
|
||||
$sql_settings = mysqli_query($mysqli, "SELECT * FROM settings WHERE company_id = 1");
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ if (php_sapi_name() !== 'cli') {
|
|||
require_once "../config.php";
|
||||
|
||||
// Set Timezone
|
||||
require_once "../inc_set_timezone.php";
|
||||
require_once "../includes/inc_set_timezone.php";
|
||||
require_once "../functions.php";
|
||||
|
||||
// Get settings for the "default" company
|
||||
require_once "../get_settings.php";
|
||||
require_once "../includes/get_settings.php";
|
||||
|
||||
$config_ticket_prefix = sanitizeInput($config_ticket_prefix);
|
||||
$config_ticket_from_name = sanitizeInput($config_ticket_from_name);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ if ($config_enable_setup == 0) {
|
|||
exit;
|
||||
}
|
||||
|
||||
include_once "settings_localization_array.php";
|
||||
include_once "includes/settings_localization_array.php";
|
||||
$errorLog = ini_get('error_log') ?: "Debian/Ubuntu default is usually /var/log/apache2/error.log";
|
||||
|
||||
// Get a list of all available timezones
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
<?php require_once "includes/inc_all.php"; ?>
|
||||
|
||||
<!-- Breadcrumbs-->
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="index.html">Dashboard</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">Temp bugfix page</li>
|
||||
</ol>
|
||||
|
||||
<!-- Page Content -->
|
||||
<h1>Temporary page to fix bulk ticket close/resolution bug</h1>
|
||||
<hr>
|
||||
<p>Navigate back to tickets - all bulk closed tickets should be fixed now and no longer appear as open.</p>
|
||||
|
||||
<?php
|
||||
|
||||
$sql_tickets = mysqli_query($mysqli, "SELECT ticket_id, ticket_updated_at, ticket_closed_at FROM tickets WHERE ticket_resolved_at IS NULL AND ticket_closed_at IS NOT NULL");
|
||||
foreach ($sql_tickets as $row) {
|
||||
$ticket_id = intval($row['ticket_id']);
|
||||
$ticket_updated_at = sanitizeInput($row['ticket_updated_at']); // To keep old updated_at time
|
||||
$ticket_closed_at = sanitizeInput($row['ticket_closed_at']); // To keep the original closed time
|
||||
mysqli_query($mysqli, "UPDATE tickets SET ticket_resolved_at = '$ticket_closed_at', ticket_updated_at = '$ticket_updated_at' WHERE ticket_id = '$ticket_id'");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php require_once "includes/footer.php";
|
||||
Loading…
Reference in New Issue