From 8a2f9924d7d727f77b382c1f48eacf32806c72b7 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Mon, 24 Mar 2014 11:36:03 -0500
Subject: [PATCH] Forbid new ticket if not signed in

This will be triggered if the client follows a link from an email And the
help desk administrator has enabled the setting to require a login to create
a  ticket.
---
 include/staff/settings-access.inc.php |  1 -
 open.php                              | 10 ++++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/include/staff/settings-access.inc.php b/include/staff/settings-access.inc.php
index 753d8ca43..08c8836a0 100644
--- a/include/staff/settings-access.inc.php
+++ b/include/staff/settings-access.inc.php
@@ -97,7 +97,6 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config)
 <?php foreach (array(
     'disabled' => 'Disabled — All users are guests',
     'public' => 'Public — Anyone can register',
-    'auto' => 'Automatic — Create new accounts for all new tickets',
     'closed' => 'Private — Only staff can register clients',)
     as $key=>$val) { ?>
         <option value="<?php echo $key; ?>" <?php
diff --git a/open.php b/open.php
index 6bcecf5e5..12be34b53 100644
--- a/open.php
+++ b/open.php
@@ -64,8 +64,14 @@ if ($_POST) {
 
 //page
 $nav->setActiveNav('new');
-if ($cfg->isClientLoginRequired() && !$thisclient) {
-    require_once 'secure.inc.php';
+if ($cfg->isClientLoginRequired()) {
+    if (!$thisclient) {
+        require_once 'secure.inc.php';
+    }
+    elseif ($thisclient->isGuest()) {
+        require_once 'login.php';
+        exit();
+    }
 }
 
 require(CLIENTINC_DIR.'header.inc.php');
-- 
GitLab