From ecb4f898481285c396f83d31161b51683aad50f1 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Wed, 7 Jan 2015 11:32:43 -0600
Subject: [PATCH] oops: Fix inability to edit agents with only one admin

---
 include/class.staff.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/class.staff.php b/include/class.staff.php
index 38c46b772..10404bf80 100644
--- a/include/class.staff.php
+++ b/include/class.staff.php
@@ -780,7 +780,7 @@ class Staff extends AuthenticatedUser {
                 .' WHERE isadmin=1 and isactive=1';
             if (($res = db_query($sql))
                     && (list($count, $sid) = db_fetch_row($res))) {
-                if ($count == 1 && $sid = $id) {
+                if ($count == 1 && $sid == $id) {
                     $errors['isadmin'] = __(
                         'Cowardly refusing to remove or lock out the only active administrator'
                     );
-- 
GitLab