minor changes

This commit is contained in:
tomas 2005-02-20 21:56:35 +00:00
parent b9d03c9037
commit 84ab36151f
5 changed files with 39 additions and 17 deletions

View File

@ -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"<pre>\n"; var_dump($m);
$u=$alib->getSubjName($sid);
?>
@ -58,7 +64,7 @@ $u=$alib->getSubjName($sid);
<tr class="<?php echo(($o=1-$o) ? 'odd' : 'ev')?>">
<td><?php echo$obj?></td>
<?php foreach($aa as $pr){?>
<td><?php echo($pr ? 'Y' : '-')?></td>
<td><?php echo($pr===TRUE ? 'Y' : '-')?></td>
<?php }?>
</tr>
<?php }?>

View File

@ -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"<pre>\n"; var_dump($d['path']);exit;
require_once "alib_f.php";
// template follows:
?>

View File

@ -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.';

View File

@ -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<hr>\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<hr>\n");
$dbc->setErrorHandling(PEAR_ERROR_RETURN);
#$$dbc->setErrorHandling(PEAR_ERROR_DIE, "%s<hr>\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<hr>\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";

View File

@ -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<hr>\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<hr>\n");
$dbc->setErrorHandling(PEAR_ERROR_RETURN);
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$alib =& new Alib($dbc, $config);