Pman/Login.php
[Pman.Base] / Pman / Login.php
index d5e0849..7f5558d 100644 (file)
@@ -91,6 +91,13 @@ class Pman_Login extends Pman
             $this->jok(array('id' => 0)); // not logged in..
             exit;
         }
+        
+        $ff= HTML_FlexyFramework::get();
+        if (!empty($ff->Pman['auth_comptype']) && $ff->Pman['auth_comptype'] != $u->company()->comptype) {
+            $this->jerr("Login not permited to outside companies");
+        }
+        
+        
         $au = $u->getAuthUser();
         
         $aur = $au->authUserArray();
@@ -201,7 +208,8 @@ class Pman_Login extends Pman
         }
         
         // check if config allows non-owner passwords.
-        // auth_company = "OWNER" auth_company = "CLIENT"
+        // auth_company = "OWNER" // auth_company = "CLIENT" or blank for all?
+        // perhaps it should support arrays..
         $ff= HTML_FlexyFramework::get();
         if (!empty($ff->Pman['auth_comptype']) && $ff->Pman['auth_comptype'] != $u->company()->comptype) {
             $this->jerr("Login not permited to outside companies");