Pman.php
authorChris <chris@roojs.com>
Wed, 10 Jul 2013 05:50:20 +0000 (13:50 +0800)
committerChris <chris@roojs.com>
Wed, 10 Jul 2013 05:50:20 +0000 (13:50 +0800)
Pman.php

index 9b118c8..d77b7da 100644 (file)
--- a/Pman.php
+++ b/Pman.php
@@ -103,8 +103,15 @@ class Pman extends HTML_FlexyFramework_Page
             return;
         } 
         
-        
-        if ($this->getAuthUser()) {
+        $au = $this->getAuthUser();
+        if ($au) {
+            $ff= HTML_FlexyFramework::get();
+
+            if (!empty($ff->Pman['auth_comptype']) && $au->id > 0 &&
+                ($ff->Pman['auth_comptype'] != $au->company()->comptype)) {
+                $au->logout();
+                $this->jerr("Login not permited to outside companies - please reload");
+            }
             $this->addEvent("RELOAD");
         }