From 127f93c4840ad072d3d3338c0dea43eec5ff1d06 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Thu, 20 Mar 2014 13:18:23 -0500
Subject: [PATCH] Force login for clients if required

---
 include/class.config.php | 4 ++++
 open.php                 | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/include/class.config.php b/include/class.config.php
index 5973a820c..34aabc418 100644
--- a/include/class.config.php
+++ b/include/class.config.php
@@ -519,6 +519,10 @@ class OsticketConfig extends Config {
         return $this->get('pw_reset_window') * 60;
     }
 
+    function isClientLoginRequired() {
+        return $this->get('clients_only');
+    }
+
     function isCaptchaEnabled() {
         return (extension_loaded('gd') && function_exists('gd_info') && $this->get('enable_captcha'));
     }
diff --git a/open.php b/open.php
index 4cb7684a8..719f35cc8 100644
--- a/open.php
+++ b/open.php
@@ -76,6 +76,8 @@ if($ticket
                     array_fill(0, 3, 'XXXXXX'),
                     $page->getBody()
                     )));
+} elseif ($cfg->isClientLoginRequired() && !$thisclient) {
+    require(CLIENTINC_DIR.'login.inc.php');
 } else {
     require(CLIENTINC_DIR.'open.inc.php');
 }
-- 
GitLab