diff --git a/livesupport/modules/alib/var/example/alibExPMatrix.php b/livesupport/modules/alib/var/example/alibExPMatrix.php index 74618ac27..3b61057a1 100644 --- a/livesupport/modules/alib/var/example/alibExPMatrix.php +++ b/livesupport/modules/alib/var/example/alibExPMatrix.php @@ -23,7 +23,7 @@ Author : $Author: tomas $ - Version : $Revision: 1.2 $ + Version : $Revision: 1.3 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/alib/var/example/alibExPMatrix.php,v $ ------------------------------------------------------------------------------*/ @@ -31,14 +31,20 @@ require_once "alib_h.php"; $sid=$_GET['subj']; -foreach($alib->getAllObjects() as $it){ +$all = $alib->getAllObjects(); +foreach($alib->getClasses() as $cl) + $all[] = array('name'=>$cl['cname']." (class)", 'id'=>$cl['id']); + +foreach($all as $it){ $aa=array(); foreach($alib->getAllActions() as $a){ - $aa[$a]=$alib->checkPerm($sid, $a, $it['id']); -# if(PEAR::isError($aa[$a])){ errCallback($aa[$a]); } + $aa[$a] = $r = $alib->checkPerm($sid, $a, $it['id']); + if(PEAR::isError($r)){ + echo $r->getMessage()." ".$r->getUserInfo()."\n"; exit; } } $m[]=array($it['name'], $aa); } +#echo"
\n"; var_dump($m);
 $u=$alib->getSubjName($sid);
 
 ?>
@@ -58,7 +64,7 @@ $u=$alib->getSubjName($sid);
 
  
  
-  
+  
  
 
 
diff --git a/livesupport/modules/alib/var/example/alibExTree.php b/livesupport/modules/alib/var/example/alibExTree.php
index ea6b19185..fa4e74ce8 100644
--- a/livesupport/modules/alib/var/example/alibExTree.php
+++ b/livesupport/modules/alib/var/example/alibExTree.php
@@ -23,7 +23,7 @@
  
  
     Author   : $Author: tomas $
-    Version  : $Revision: 1.2 $
+    Version  : $Revision: 1.3 $
     Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/alib/var/example/alibExTree.php,v $
 
 ------------------------------------------------------------------------------*/
@@ -46,6 +46,7 @@ $d = array(
 );
 $d['msg'] = preg_replace(array("|\n|","|'|"), array("\\n","\\'"), $_SESSION['alertMsg']); unset($_SESSION['alertMsg']);
 
+#echo"
\n"; var_dump($d['path']);exit;
 require_once "alib_f.php";
 // template follows:
 ?>
diff --git a/livesupport/modules/alib/var/example/alibHttp.php b/livesupport/modules/alib/var/example/alibHttp.php
index 1b241e5c4..3b1bc5147 100644
--- a/livesupport/modules/alib/var/example/alibHttp.php
+++ b/livesupport/modules/alib/var/example/alibHttp.php
@@ -23,7 +23,7 @@
  
  
     Author   : $Author: tomas $
-    Version  : $Revision: 1.2 $
+    Version  : $Revision: 1.3 $
     Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/alib/var/example/alibHttp.php,v $
 
 ------------------------------------------------------------------------------*/
@@ -96,7 +96,7 @@ switch($act)
     break;
     case"removePerm";
         $a = $alib->isClass($_REQUEST['oid']) ? 'classes':'editPerms';
-        $oid = $alib->isClass($_REQUEST['oid']) ? '':$_REQUEST['oid'];
+        $oid = $alib->isClass($_REQUEST['oid']) ? NULL:$_REQUEST['oid'];
         if($alib->checkPerm($userid, $a, $oid))
             $alib->removePerm($_GET['permid']);
         else $_SESSION['alertMsg']='Access denied.';
diff --git a/livesupport/modules/alib/var/install/install.php b/livesupport/modules/alib/var/install/install.php
index 8704db1aa..95e76468d 100644
--- a/livesupport/modules/alib/var/install/install.php
+++ b/livesupport/modules/alib/var/install/install.php
@@ -23,7 +23,7 @@
  
  
     Author   : $Author: tomas $
-    Version  : $Revision: 1.1 $
+    Version  : $Revision: 1.2 $
     Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/alib/var/install/install.php,v $
 
 ------------------------------------------------------------------------------*/
@@ -41,7 +41,6 @@ function errCallback($err)
 }
 
 
-PEAR::setErrorHandling(PEAR_ERROR_PRINT, "%s
\n"); $dbc = DB::connect($config['dsn'], TRUE); if(PEAR::isError($dbc)){ echo "Database connection problem.\n"; @@ -49,20 +48,35 @@ if(PEAR::isError($dbc)){ echo "Database access is defined by 'dsn' values in conf.php.\n"; exit; } - +#$dbc->setErrorHandling(PEAR_ERROR_PRINT, "%s
\n"); +$dbc->setErrorHandling(PEAR_ERROR_RETURN); +#$$dbc->setErrorHandling(PEAR_ERROR_DIE, "%s
\n"); $dbc->setFetchMode(DB_FETCHMODE_ASSOC); + $alib =& new Alib($dbc, $config); -echo "Alib: Install ...\n"; +echo "\n\n======\n". + "This is Alib standalone installation script, it is NOT needed to run ". + "for Livesupport.\nAlib is automatically used by storageServer without it.". + "\n======\n\n"; + +echo "Alib: uninstall ...\n"; +$alib->uninstall(); + +$dbc->setErrorHandling(PEAR_ERROR_DIE, "%s
\n"); +echo "Alib: install ...\n"; $alib->install(); +#$alib->testData(); echo $alib->dumpTree(); exit; + echo " Testing ...\n"; -$alib->test(); +$r = $alib->test(); +if($dbc->isError($r)) if($dbc->isError($r)){ echo $r->getMessage()."\n".$r->getUserInfo()."\n"; exit; } $log = $alib->test_log; echo " TESTS:\n$log\n---\n"; -echo " Reinstall + testdata insert ...\n"; -$alib->reinstall(); +echo " clean up + testdata insert ...\n"; +$alib->deleteData(); $alib->testData(); echo " TREE DUMP:\n"; diff --git a/livesupport/modules/alib/var/install/uninstall.php b/livesupport/modules/alib/var/install/uninstall.php index 8076fbbd0..b8c47cdbf 100644 --- a/livesupport/modules/alib/var/install/uninstall.php +++ b/livesupport/modules/alib/var/install/uninstall.php @@ -23,7 +23,7 @@ Author : $Author: tomas $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/alib/var/install/uninstall.php,v $ ------------------------------------------------------------------------------*/ @@ -41,7 +41,6 @@ function errCallback($err) } -PEAR::setErrorHandling(PEAR_ERROR_PRINT, "%s
\n"); $dbc = DB::connect($config['dsn'], TRUE); if(PEAR::isError($dbc)){ echo "Database connection problem.\n"; @@ -50,6 +49,8 @@ if(PEAR::isError($dbc)){ exit; } +#PEAR::setErrorHandling(PEAR_ERROR_PRINT, "%s
\n"); +$dbc->setErrorHandling(PEAR_ERROR_RETURN); $dbc->setFetchMode(DB_FETCHMODE_ASSOC); $alib =& new Alib($dbc, $config);