From 4ce979d07730c3edd389742c1856442764828fb8 Mon Sep 17 00:00:00 2001
From: tomas <tomas@cfc7b370-4200-0410-a6e3-cb6bdb053afe>
Date: Tue, 22 Feb 2005 14:44:12 +0000
Subject: [PATCH] minor change (#590)

---
 livesupport/modules/alib/var/m2tree.php       |  4 +-
 .../modules/archiveServer/var/conf.php        |  3 +-
 .../modules/storageServer/var/BasicStor.php   | 40 ++++++++++---------
 3 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/livesupport/modules/alib/var/m2tree.php b/livesupport/modules/alib/var/m2tree.php
index 5d6673059..53ff43336 100644
--- a/livesupport/modules/alib/var/m2tree.php
+++ b/livesupport/modules/alib/var/m2tree.php
@@ -22,7 +22,7 @@ define('ALIBERR_MTREE', 10);
  *    );
  *   </code></pre>
  *  @author  $Author: tomas $
- *  @version $Revision: 1.2 $
+ *  @version $Revision: 1.3 $
  *  @see ObjClasses
  *  Original author Tom Hlava
  */
@@ -414,7 +414,7 @@ class M2tree{
         $r = array();
         if($withRoot){
             $r[] = $re = $this->getObjLevel($oid, 'id, name, level', $rootId);
-        }
+        }else $re=NULL;
         if($this->dbc->isError($re)) return $re;
         $dirarr = $this->getDir($oid, 'id, level');
         if($this->dbc->isError($dirarr)) return $dirarr;
diff --git a/livesupport/modules/archiveServer/var/conf.php b/livesupport/modules/archiveServer/var/conf.php
index 62d735156..e632775f1 100644
--- a/livesupport/modules/archiveServer/var/conf.php
+++ b/livesupport/modules/archiveServer/var/conf.php
@@ -23,7 +23,7 @@
  
  
     Author   : $Author: tomas $
-    Version  : $Revision: 1.7 $
+    Version  : $Revision: 1.8 $
     Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/archiveServer/var/conf.php,v $
 
 ------------------------------------------------------------------------------*/
@@ -66,6 +66,7 @@ $config = array(
     'tblNamePrefix' => 'as_',
     'authCookieName'=> 'assid',
     'StationPrefsGr'=> '',
+    'AllGr'         => '',
     'storageDir'    =>  dirname(getcwd()).'/stor',
     'bufferDir'     =>  dirname(getcwd()).'/stor/buffer',
     'transDir'      =>  dirname(getcwd()).'/trans',
diff --git a/livesupport/modules/storageServer/var/BasicStor.php b/livesupport/modules/storageServer/var/BasicStor.php
index 50172e7f9..3de364059 100644
--- a/livesupport/modules/storageServer/var/BasicStor.php
+++ b/livesupport/modules/storageServer/var/BasicStor.php
@@ -23,7 +23,7 @@
  
  
     Author   : $Author: tomas $
-    Version  : $Revision: 1.34 $
+    Version  : $Revision: 1.35 $
     Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/BasicStor.php,v $
 
 ------------------------------------------------------------------------------*/
@@ -52,7 +52,7 @@ require_once "Transport.php";
  *  Core of LiveSupport file storage module
  *
  *  @author  $Author: tomas $
- *  @version $Revision: 1.34 $
+ *  @version $Revision: 1.35 $
  *  @see Alib
  */
 class BasicStor extends Alib{
@@ -864,18 +864,20 @@ class BasicStor extends Alib{
             if($this->dbc->isError($fid)) return $fid;
             $res = $this->addPerm($uid, '_all', $fid, 'A');
             if($this->dbc->isError($res)) return $res;
-            $res =$this->addSubj2Gr($login, $this->config['StationPrefsGr']);
-            if($this->dbc->isError($res)) return $res;
-            $res =$this->addSubj2Gr($login, $this->config['AllGr']);
-            if($this->dbc->isError($res)) return $res;
-            $pfid = $this->bsCreateFolder($fid, 'public');
-            if($this->dbc->isError($pfid)) return $pfid;
-            $res = $this->addPerm($uid, '_all', $pfid, 'A');
-            if($this->dbc->isError($res)) return $res;
-            $allGrId =  $this->getSubjId($this->config['AllGr']);
-            if($this->dbc->isError($allGrId)) return $allGrId;
-            $res = $this->addPerm($allGrId, 'read', $pfid, 'A');
-            if($this->dbc->isError($res)) return $res;
+            if(!$this->config['isArchive']){
+                $res =$this->addSubj2Gr($login, $this->config['StationPrefsGr']);
+                if($this->dbc->isError($res)) return $res;
+                $res =$this->addSubj2Gr($login, $this->config['AllGr']);
+                if($this->dbc->isError($res)) return $res;
+                $pfid = $this->bsCreateFolder($fid, 'public');
+                if($this->dbc->isError($pfid)) return $pfid;
+                $res = $this->addPerm($uid, '_all', $pfid, 'A');
+                if($this->dbc->isError($res)) return $res;
+                $allGrId =  $this->getSubjId($this->config['AllGr']);
+                if($this->dbc->isError($allGrId)) return $allGrId;
+                $res = $this->addPerm($allGrId, 'read', $pfid, 'A');
+                if($this->dbc->isError($res)) return $res;
+            }
         }
         return $uid;
     }
@@ -1320,10 +1322,12 @@ class BasicStor extends Alib{
         $rootUid = parent::addSubj('root', $this->config['tmpRootPass']);
         $res = $this->addPerm($rootUid, '_all', $this->rootId, 'A');
         $fid = $this->bsCreateFolder($this->storId, 'root');
-        $stPrefGr = parent::addSubj($this->config['StationPrefsGr']);
-        $this->addSubj2Gr('root', $this->config['StationPrefsGr']);
-        $stPrefGr = parent::addSubj($this->config['AllGr']);
-        $this->addSubj2Gr('root', $this->config['AllGr']);
+        if(!$this->config['isArchive']){
+            $stPrefGr = parent::addSubj($this->config['StationPrefsGr']);
+            $this->addSubj2Gr('root', $this->config['StationPrefsGr']);
+            $stPrefGr = parent::addSubj($this->config['AllGr']);
+            $this->addSubj2Gr('root', $this->config['AllGr']);
+        }
     }
     /**
      *  install - create tables