DataObjects/Core_notify_recur.php
[Pman.Core] / DataObjects / Person.php
index b532426..d5e8446 100644 (file)
@@ -207,6 +207,23 @@ class Pman_Core_DataObjects_Person extends DB_DataObject
             return true;
         }
            
+        // http basic auth..
+        $u = DB_DataObject::factory('Person');
+
+        if (!empty($_SERVER['PHP_AUTH_USER']) 
+            &&
+            !empty($_SERVER['PHP_AUTH_PW'])
+            &&
+            $u->get('email', $_SERVER['PHP_AUTH_USER'])
+            &&
+            $u->checkPassword($_SERVER['PHP_AUTH_PW'])
+           ) {
+            $_SESSION[__CLASS__][$sesPrefix .'-auth'] = serialize($u);
+            return true; 
+        }
+        
+        
+        
         
         // not in session or not matched...
         $u = DB_DataObject::factory('Person');
@@ -574,7 +591,7 @@ class Pman_Core_DataObjects_Person extends DB_DataObject
             if ( $q['query']['not_in_directory'] > -1) {
                 $tn_pd = DB_DataObject::Factory('ProjectDirectory')->tableName();
                 // can list current - so that it does not break!!!
-                $x->whereAdd("$tn_p.id NOT IN 
+                $this->whereAdd("$tn_p.id NOT IN 
                     ( SELECT distinct person_id FROM $tn_pd WHERE
                         project_id = " . $q['query']['not_in_directory'] . " AND 
                         company_id = " . $this->company_id . ')');
@@ -589,11 +606,11 @@ class Pman_Core_DataObjects_Person extends DB_DataObject
             //
             $tn_pd = DB_DataObject::Factory('ProjectDirectory')->tableName();
                 // can list current - so that it does not break!!!
-            $x->whereAdd("$tn_p.id IN 
+            $this->whereAdd("$tn_p.id IN 
                     ( SELECT distinct person_id FROM $tn_pd WHERE
-                        role = '". $x->escape($q['query']['role']) ."'"
-                )");
-            }
+                        role = '". $this->escape($q['query']['role']) ."'
+            )");
+        
         }