DataObjects/Events.php
[Pman.Core] / Images.php
index 4bc9bb2..51ec17f 100644 (file)
 require_once  'Pman.php';
 class Pman_Core_Images extends Pman
 {
+    
+    // tables that do not need authentication checks before serving.
+    var $public_image_tables = array();
+    
+    
     function getAuth()
     {
         parent::getAuth(); // load company!
@@ -162,10 +167,10 @@ class Pman_Core_Images extends Pman
              $this->imgErr("image has been removed or deleted.",$s);
         }
         
-        if (!$this->authUser) {
+        if (!$this->authUser && !in_array($img->ontable,$this->public_image_tables)) {
            
             if ($img->ontable != 'core_company') {
-                $this->imgErr("not-authenticated",$s);
+                $this->imgErr("not-authenticated {$img->ontable}",$s);
             }
             if ($img->imgtype != 'LOGO') {
                 $this->imgErr("not-logo",$s);