Little corrections.

This commit is contained in:
tomas 2004-09-12 23:28:00 +00:00
parent 72d8984500
commit 83a6d5e452
8 changed files with 26 additions and 21 deletions

View file

@ -20,7 +20,7 @@
# #
# #
# Author : $Author: tomas $ # Author : $Author: tomas $
# Version : $Revision: 1.1 $ # Version : $Revision: 1.2 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/Attic/Makefile,v $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/Attic/Makefile,v $
# #
# @configure_input@ # @configure_input@
@ -62,7 +62,7 @@ USR_LIB_DIR = ${USR_DIR}/lib
DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config
HTTP_GROUP = nobody HTTP_GROUP = apache
PHP_DIR = ${BASE_DIR}/var PHP_DIR = ${BASE_DIR}/var
INSTALL_DIR = ${PHP_DIR}/install INSTALL_DIR = ${PHP_DIR}/install

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.1 $ Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/GreenBox.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/GreenBox.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -47,7 +47,7 @@ require_once '../StoredFile.php';
* LiveSupport file storage module * LiveSupport file storage module
* *
* @author $Author: tomas $ * @author $Author: tomas $
* @version $Revision: 1.1 $ * @version $Revision: 1.2 $
* @see Alib * @see Alib
*/ */
class GreenBox extends Alib{ class GreenBox extends Alib{
@ -923,7 +923,8 @@ class GreenBox extends Alib{
$this->dbc->query("CREATE INDEX {$this->accessTable}_acc_idx $this->dbc->query("CREATE INDEX {$this->accessTable}_acc_idx
ON {$this->accessTable} (tmpLink, sessid)"); ON {$this->accessTable} (tmpLink, sessid)");
if(!file_exists("{$this->storageDir}/buffer")){ if(!file_exists("{$this->storageDir}/buffer")){
mkdir("{$this->storageDir}/buffer", 0775); mkdir("{$this->storageDir}/buffer", 02775);
chmod("{$this->storageDir}/buffer", 02775);
} }
$this->initData(); $this->initData();
} }

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.1 $ Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/MetaData.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/MetaData.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -157,9 +157,9 @@ class MetaData{
$xml = domxml_open_mem($mdata); $xml = domxml_open_mem($mdata);
} }
$root = $xml->document_element(); $root = $xml->document_element();
// $res = $this->dbTransaction($root, NULL, $mode); if(!is_object($root)) return PEAR::raiseError(
// $root, $parid=NULL, $mode='insert' "MetaData::storeXMLDoc: metadata parser failed (".gettype($root).")"
// if(PEAR::isError($res)) return $res; );
$this->dbc->query("BEGIN"); $this->dbc->query("BEGIN");
if($mode == 'update') $this->nameSpaces = $this->readNamespaces(); if($mode == 'update') $this->nameSpaces = $this->readNamespaces();
$res = $this->storeXMLNode($root, NULL, $mode); $res = $this->storeXMLNode($root, NULL, $mode);

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.1 $ Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/RawMediaData.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/RawMediaData.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -62,7 +62,7 @@ class RawMediaData{
function insert($mediaFileLP) function insert($mediaFileLP)
{ {
if($this->exists) return FALSE; if($this->exists) return FALSE;
@umask(0002); umask(0002);
if(@copy($mediaFileLP, $this->fname)){ if(@copy($mediaFileLP, $this->fname)){
// @chmod($this->fname, 0775); // @chmod($this->fname, 0775);
$this->exists = TRUE; $this->exists = TRUE;

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.1 $ Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/StoredFile.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/StoredFile.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -478,7 +478,7 @@ class StoredFile{
function _getResDir() function _getResDir()
{ {
$resDir="{$this->gb->storageDir}/".substr($this->gunid, 0, 3); $resDir="{$this->gb->storageDir}/".substr($this->gunid, 0, 3);
if(!file_exists($resDir)){ mkdir($resDir, 02775); } if(!file_exists($resDir)){ mkdir($resDir, 02775); chmod($resDir, 02775); }
return $resDir; return $resDir;
} }
/** /**

View file

@ -98,17 +98,17 @@ $tpldata['showMenu']=true;
'</form>'; '</form>';
} }
function fmove(id, relPath){ function fmove(id, relPath){
var newPath=prompt('Destination folder:', relPath); var newPath=prompt('Destination folder (relative path):', relPath);
if(newPath==null) return; if(newPath==null) return;
location.href='gbHttp.php?id='+id+'&act=move&newPath='+newPath; location.href='gbHttp.php?id='+id+'&act=move&newPath='+newPath;
} }
function fcopy(id, relPath){ function fcopy(id, relPath){
var newPath=prompt('Destination folder:', relPath); var newPath=prompt('Destination folder (relative path):', relPath);
if(newPath==null) return; if(newPath==null) return;
location.href='gbHttp.php?id='+id+'&act=copy&newPath='+newPath; location.href='gbHttp.php?id='+id+'&act=copy&newPath='+newPath;
} }
function freplicate(name, id){ function freplicate(name, id){
var np=prompt('Destination folder:', id); var np=prompt('Destination folder (relative path):', id);
if(np==null) return; if(np==null) return;
location.href='gbHttp.php?id='+id+'&act=repl&newparid='+np; location.href='gbHttp.php?id='+id+'&act=repl&newparid='+np;
} }
@ -165,11 +165,11 @@ $tpldata['showMenu']=true;
</td><td> </td><td>
<?$a=array('Folder'=>'D', 'File'=>'F', 'Replica'=>'R'); echo$a[$o['type']]?> <?$a=array('Folder'=>'D', 'File'=>'F', 'Replica'=>'R'); echo$a[$o['type']]?>
&nbsp;<a href="javascript:frename('<?=$o['name']?>', '<?=$o['id']?>')" class="button">rename</a> &nbsp;<a href="javascript:frename('<?=$o['name']?>', '<?=$o['id']?>')" class="button">rename</a>
<?/**/?>
&nbsp;<a href="javascript:fmove('<?=$o['id']?>', '.')" class="button">move</a> &nbsp;<a href="javascript:fmove('<?=$o['id']?>', '.')" class="button">move</a>
&nbsp;<a href="javascript:fcopy('<?=$o['id']?>', '.')" class="button">copy</a> &nbsp;<a href="javascript:fcopy('<?=$o['id']?>', '.')" class="button">copy</a>
<?/*?>
&nbsp;<a href="javascript:freplicate('<?=$o['name']?>', '<?=$o['id']?>')" class="button">replicate</a> &nbsp;<a href="javascript:freplicate('<?=$o['name']?>', '<?=$o['id']?>')" class="button">replicate</a>
<?/**/?> <?*/?>
&nbsp;<a href="gbHtmlPerms.php?id=<?=$o['id']?>" class="button">permissions</a> &nbsp;<a href="gbHtmlPerms.php?id=<?=$o['id']?>" class="button">permissions</a>
&nbsp;<a href="gbHttp.php?act=delete&id=<?=$o['id']?>" class="button" &nbsp;<a href="gbHttp.php?act=delete&id=<?=$o['id']?>" class="button"
onClick="return confirm('Delete object &quot;<?=$o['name']?>&quot;?')">DEL</a> onClick="return confirm('Delete object &quot;<?=$o['name']?>&quot;?')">DEL</a>

View file

@ -72,7 +72,6 @@ switch($_REQUEST['act']){
if(PEAR::isError($r)) $_SESSION['alertMsg'] = $r->getMessage(); if(PEAR::isError($r)) $_SESSION['alertMsg'] = $r->getMessage();
$redirUrl = BROWSER."?id=$parid"; $redirUrl = BROWSER."?id=$parid";
break; break;
/* NOT WORKING - sorry */
case"move": case"move":
$newPath = urlencode($_REQUEST['newPath']); $newPath = urlencode($_REQUEST['newPath']);
$did = $gb->getObjIdFromRelPath($id, $newPath); $did = $gb->getObjIdFromRelPath($id, $newPath);
@ -96,13 +95,14 @@ switch($_REQUEST['act']){
} }
else $redirUrl = BROWSER."?id=$did"; else $redirUrl = BROWSER."?id=$did";
break; break;
/* NOT WORKING - sorry
case"repl": case"repl":
$unewpath = urlencode($_REQUEST['newpath']); $unewpath = urlencode($_REQUEST['newpath']);
$r = $gb->createReplica($id, $_REQUEST['newpath'], '', $sessid); $r = $gb->createReplica($id, $_REQUEST['newpath'], '', $sessid);
if(PEAR::isError($r)) $_SESSION['alertMsg'] = $r->getMessage(); if(PEAR::isError($r)) $_SESSION['alertMsg'] = $r->getMessage();
$redirUrl = BROWSER."?id=$newparid"; $redirUrl = BROWSER."?id=$newparid";
break; break;
/* */ */
case"delete": case"delete":
$parid = $gb->getparent($id); $parid = $gb->getparent($id);
$r = $gb->deleteFile($id, $sessid); $r = $gb->deleteFile($id, $sessid);

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.1 $ Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/install/install.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/install/install.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -53,6 +53,10 @@ if(PEAR::isError($dbc)){
$dbc->setFetchMode(DB_FETCHMODE_ASSOC); $dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb = &new GreenBox(&$dbc, $config); $gb = &new GreenBox(&$dbc, $config);
echo "\nIMPORTANT settings:\n";
echo " Makefile: HTTP_GROUP - group of running http daemon\n";
echo " var/xmlrpc/testRunner.sh: XMLRPC - URL of XMLRPC server\n\n";
echo "Storage: Install ...\n"; echo "Storage: Install ...\n";
$dbc->setErrorHandling(PEAR_ERROR_RETURN); $dbc->setErrorHandling(PEAR_ERROR_RETURN);
$gb->uninstall(); $gb->uninstall();