Transport submodule added + relevant changes.
Transport need Archive module to be installed.
This commit is contained in:
parent
800acdbcc5
commit
70637ef59e
20 changed files with 453 additions and 277 deletions
|
@ -1,5 +1,5 @@
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Storage - file storage component
|
# StorageServer - file storage component
|
||||||
# Copyright (c) 2004 Media Development Loan Fund
|
# Copyright (c) 2004 Media Development Loan Fund
|
||||||
#
|
#
|
||||||
# This file is part of the LiveSupport project.
|
# This file is part of the LiveSupport project.
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Author : $Author: tomas $
|
# Author : $Author: tomas $
|
||||||
# Version : $Revision: 1.2 $
|
# Version : $Revision: 1.3 $
|
||||||
# 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@
|
||||||
|
@ -63,6 +63,7 @@ USR_LIB_DIR = ${USR_DIR}/lib
|
||||||
DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config
|
DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config
|
||||||
|
|
||||||
HTTP_GROUP = apache
|
HTTP_GROUP = apache
|
||||||
|
#HTTP_GROUP = nobody
|
||||||
|
|
||||||
PHP_DIR = ${BASE_DIR}/var
|
PHP_DIR = ${BASE_DIR}/var
|
||||||
INSTALL_DIR = ${PHP_DIR}/install
|
INSTALL_DIR = ${PHP_DIR}/install
|
||||||
|
@ -90,7 +91,8 @@ TEST_RUNNER = ${PHP_DIR}/xmlrpc/testRunner.sh
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Targets
|
# Targets
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
.PHONY: all dir_setup doc clean docclean depclean distclean dist db_init db_clean
|
.PHONY: all dir_setup doc clean docclean depclean distclean dist \
|
||||||
|
db_init db_clean transtest
|
||||||
|
|
||||||
all: dir_setup db_init
|
all: dir_setup db_init
|
||||||
|
|
||||||
|
@ -117,6 +119,10 @@ check: all ${TEST_RUNNER}
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Specific targets
|
# Specific targets
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
transtest:
|
||||||
|
@echo "Transfer module test (needs ArchiveServer installed):"
|
||||||
|
cd var/tests; php -q transTest.php
|
||||||
|
|
||||||
db_init:
|
db_init:
|
||||||
cd var/install; php -q install.php
|
cd var/install; php -q install.php
|
||||||
|
|
||||||
|
@ -130,6 +136,8 @@ ${DOXYGEN_DIR}:
|
||||||
${MKDIR} ${DOXYGEN_DIR}
|
${MKDIR} ${DOXYGEN_DIR}
|
||||||
|
|
||||||
${STOR_DIR}:
|
${STOR_DIR}:
|
||||||
|
@echo "Http daemon group have set in Makefile: ${HTTP_GROUP}"
|
||||||
|
@echo "You should be in this group for easy testing"
|
||||||
${MKDIR} ${STOR_DIR}
|
${MKDIR} ${STOR_DIR}
|
||||||
chown .${HTTP_GROUP} ${STOR_DIR}
|
chown .${HTTP_GROUP} ${STOR_DIR}
|
||||||
chmod g+ws ${STOR_DIR}
|
chmod g+ws ${STOR_DIR}
|
||||||
|
|
|
@ -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/etc/doxygen.config,v $
|
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/etc/doxygen.config,v $
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
|
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
|
||||||
# by quotes) that should identify the project.
|
# by quotes) that should identify the project.
|
||||||
|
|
||||||
PROJECT_NAME = LiveSupport
|
PROJECT_NAME = LiveSupport - storageServer module
|
||||||
|
|
||||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
|
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
|
||||||
# This could be handy for archiving the generated documentation or
|
# This could be handy for archiving the generated documentation or
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?
|
<?php
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2004 Media Development Loan Fund
|
Copyright (c) 2004 Media Development Loan Fund
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: tomas $
|
Author : $Author: tomas $
|
||||||
Version : $Revision: 1.2 $
|
Version : $Revision: 1.3 $
|
||||||
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 $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -38,8 +38,8 @@ define('GBERR_NOTF', 47);
|
||||||
|
|
||||||
define('GBERR_NOTIMPL', 50);
|
define('GBERR_NOTIMPL', 50);
|
||||||
|
|
||||||
require_once '../../../alib/var/alib.php';
|
require_once "../../../alib/var/alib.php";
|
||||||
require_once '../StoredFile.php';
|
require_once "StoredFile.php";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GreenBox class
|
* GreenBox class
|
||||||
|
@ -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.2 $
|
* @version $Revision: 1.3 $
|
||||||
* @see Alib
|
* @see Alib
|
||||||
*/
|
*/
|
||||||
class GreenBox extends Alib{
|
class GreenBox extends Alib{
|
||||||
|
@ -800,7 +800,7 @@ class GreenBox extends Alib{
|
||||||
*/
|
*/
|
||||||
function testData($d='')
|
function testData($d='')
|
||||||
{
|
{
|
||||||
$exdir = dirname(getcwd()).'/tests';
|
$exdir = '../../../storageServer/var/tests';
|
||||||
$s = $this->sessid;
|
$s = $this->sessid;
|
||||||
$o[] = $this->addSubj('test1', 'a');
|
$o[] = $this->addSubj('test1', 'a');
|
||||||
$o[] = $this->addSubj('test2', 'a');
|
$o[] = $this->addSubj('test2', 'a');
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?
|
<?php
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2004 Media Development Loan Fund
|
Copyright (c) 2004 Media Development Loan Fund
|
||||||
|
@ -23,12 +23,12 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: tomas $
|
Author : $Author: tomas $
|
||||||
Version : $Revision: 1.3 $
|
Version : $Revision: 1.4 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/LocStor.php,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/LocStor.php,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
require_once '../GreenBox.php';
|
require_once "GreenBox.php";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LocStor class
|
* LocStor class
|
||||||
|
@ -100,7 +100,7 @@ class LocStor extends GreenBox{
|
||||||
$oid = $this->addObj($tmpid , 'File', $parid);
|
$oid = $this->addObj($tmpid , 'File', $parid);
|
||||||
if(PEAR::isError($oid)) return $oid;
|
if(PEAR::isError($oid)) return $oid;
|
||||||
$ac =& StoredFile::insert(
|
$ac =& StoredFile::insert(
|
||||||
&$this, $oid, '', $mediaFileLP, $mdataFileLP
|
&$this, $oid, '', $mediaFileLP, $mdataFileLP, $gunid
|
||||||
);
|
);
|
||||||
if(PEAR::isError($ac)) return $ac;
|
if(PEAR::isError($ac)) return $ac;
|
||||||
$res = $this->renameFile($oid, $ac->gunid, $sessid);
|
$res = $this->renameFile($oid, $ac->gunid, $sessid);
|
||||||
|
|
|
@ -23,13 +23,13 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: tomas $
|
Author : $Author: tomas $
|
||||||
Version : $Revision: 1.2 $
|
Version : $Revision: 1.3 $
|
||||||
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 $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
require_once '../RawMediaData.php';
|
require_once "RawMediaData.php";
|
||||||
require_once '../MetaData.php';
|
require_once "MetaData.php";
|
||||||
require_once '../../../getid3/var/getid3.php';
|
require_once "../../../getid3/var/getid3.php";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* StoredFile class
|
* StoredFile class
|
||||||
|
@ -77,11 +77,12 @@ class StoredFile{
|
||||||
* @param name string, name of new file
|
* @param name string, name of new file
|
||||||
* @param mediaFileLP string, local path to media file
|
* @param mediaFileLP string, local path to media file
|
||||||
* @param mdataFileLP string, local path to metadata XML file
|
* @param mdataFileLP string, local path to metadata XML file
|
||||||
|
* @param gunid global unique id (optional) - for insert file with gunid
|
||||||
* @return instace of StoredFile object
|
* @return instace of StoredFile object
|
||||||
*/
|
*/
|
||||||
function insert(&$gb, $oid, $name, $mediaFileLP='', $mdataFileLP='')
|
function insert(&$gb, $oid, $name, $mediaFileLP='', $mdataFileLP='', $gunid=NULL)
|
||||||
{
|
{
|
||||||
$ac =& new StoredFile(&$gb);
|
$ac =& new StoredFile(&$gb, ($gunid ? $gunid : NULL));
|
||||||
$ac->name = $name;
|
$ac->name = $name;
|
||||||
$ac->id = $oid;
|
$ac->id = $oid;
|
||||||
$ac->type = "unKnown";
|
$ac->type = "unKnown";
|
||||||
|
@ -136,7 +137,9 @@ class StoredFile{
|
||||||
if(PEAR::isError($row)) return $row;
|
if(PEAR::isError($row)) return $row;
|
||||||
if(is_null($row)){
|
if(is_null($row)){
|
||||||
return PEAR::raiseError(
|
return PEAR::raiseError(
|
||||||
"StoredFile::recall: fileobj not exist", GBERR_FOBJNEX);
|
"StoredFile::recall: fileobj not exist ($oid/$gunid)",
|
||||||
|
GBERR_FOBJNEX
|
||||||
|
);
|
||||||
}
|
}
|
||||||
$ac =& new StoredFile(&$gb, $row['gunid']);
|
$ac =& new StoredFile(&$gb, $row['gunid']);
|
||||||
$ac->type = $row['type'];
|
$ac->type = $row['type'];
|
||||||
|
@ -157,7 +160,7 @@ class StoredFile{
|
||||||
WHERE tmpLink='$tmpLink' AND sessid='$sessid'");
|
WHERE tmpLink='$tmpLink' AND sessid='$sessid'");
|
||||||
if(PEAR::isError($gunid)) return $gunid;
|
if(PEAR::isError($gunid)) return $gunid;
|
||||||
if(is_null($gunid)) return PEAR::raiseError(
|
if(is_null($gunid)) return PEAR::raiseError(
|
||||||
"StoredFile::recallFromLink: accessobj not exist", GBERR_AOBJNEX);
|
"StoredFile::recallFromLink: accessobj not exist ($tmpLink)", GBERR_AOBJNEX);
|
||||||
return StoredFile::recall(&$gb, '', $gunid);
|
return StoredFile::recall(&$gb, '', $gunid);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?
|
<?php
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2004 Media Development Loan Fund
|
Copyright (c) 2004 Media Development Loan Fund
|
||||||
|
@ -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/conf.php,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/conf.php,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -36,8 +36,8 @@ $config = array(
|
||||||
'phptype' => 'pgsql',
|
'phptype' => 'pgsql',
|
||||||
'database' => 'LiveSupport-test',
|
'database' => 'LiveSupport-test',
|
||||||
),
|
),
|
||||||
'tblNamePrefix' => 'gb_',
|
'tblNamePrefix' => 'ls_',
|
||||||
'authCookieName'=> 'gbsid',
|
'authCookieName'=> 'lssid',
|
||||||
'RootNode' => 'RootNode',
|
'RootNode' => 'RootNode',
|
||||||
'tmpRootPass' => 'q',
|
'tmpRootPass' => 'q',
|
||||||
'objtypes' => array(
|
'objtypes' => array(
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?
|
<?php
|
||||||
#echo"<pre>\n"; print_r($_FILES); print_r($_REQUEST); print_r($_SERVER); exit;
|
#echo"<pre>\n"; print_r($_FILES); print_r($_REQUEST); print_r($_SERVER); exit;
|
||||||
require_once"gbHtml_h.php";
|
require_once"gbHtml_h.php";
|
||||||
require_once"gbHtmlTestAuth.php";
|
require_once"gbHtmlTestAuth.php";
|
||||||
|
@ -115,7 +115,7 @@ $tpldata['showMenu']=true;
|
||||||
function newFolder(){
|
function newFolder(){
|
||||||
var nn=prompt('New folder name:');
|
var nn=prompt('New folder name:');
|
||||||
if(nn==null) return;
|
if(nn==null) return;
|
||||||
location.href='gbHttp.php?id=<?=$tpldata['id']?>&act=newFolder&newname='+nn;
|
location.href='gbHttp.php?id=<?php echo$tpldata['id']?>&act=newFolder&newname='+nn;
|
||||||
}
|
}
|
||||||
-->
|
-->
|
||||||
</script>
|
</script>
|
||||||
|
@ -123,117 +123,117 @@ $tpldata['showMenu']=true;
|
||||||
<div id="rmenu">
|
<div id="rmenu">
|
||||||
Logged as: <span class="b"><?php echo$tpldata['loggedAs']?></span><br>
|
Logged as: <span class="b"><?php echo$tpldata['loggedAs']?></span><br>
|
||||||
<a href="gbHttp.php?act=logout">logout</a><br>
|
<a href="gbHttp.php?act=logout">logout</a><br>
|
||||||
<a href="gbHtmlPerms.php?id=<?=$tpldata['id']?>">Permission editor</a><br>
|
<a href="gbHtmlPerms.php?id=<?php echo$tpldata['id']?>">Permission editor</a><br>
|
||||||
<a href="gbHtmlSubj.php">User/Group editor</a><br>
|
<a href="gbHtmlSubj.php">User/Group editor</a><br>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?if($tpldata['showMenu']){?>
|
<?php if($tpldata['showMenu']){?>
|
||||||
<h3>
|
<h3>
|
||||||
<a href="gbHtmlBrowse.php?act=getHomeDir" class="button">Home directory</a>
|
<a href="gbHtmlBrowse.php?act=getHomeDir" class="button">Home directory</a>
|
||||||
<a href="gbHtmlBrowse.php?id=<?=$tpldata['id']?>&act=newfile" class="button"><span class="hidden">[</span>Upload new file<span class="hidden">]</span></a>
|
<a href="gbHtmlBrowse.php?id=<?php echo$tpldata['id']?>&act=newfile" class="button"><span class="hidden">[</span>Upload new file<span class="hidden">]</span></a>
|
||||||
<a href="javascript:newFolder()" class="button"><span class="hidden">[</span>Create new folder<span class="hidden">]</span></a>
|
<a href="javascript:newFolder()" class="button"><span class="hidden">[</span>Create new folder<span class="hidden">]</span></a>
|
||||||
<a href="gbHtmlBrowse.php?id=<?=$tpldata['id']?>&act=sform" class="button"><span class="hidden">[</span>Search<span class="hidden">]</span></a>
|
<a href="gbHtmlBrowse.php?id=<?php echo$tpldata['id']?>&act=sform" class="button"><span class="hidden">[</span>Search<span class="hidden">]</span></a>
|
||||||
</h3>
|
</h3>
|
||||||
<?}?>
|
<?php }?>
|
||||||
|
|
||||||
<?if($tpldata['showPath']){?>
|
<?php if($tpldata['showPath']){?>
|
||||||
<h3>
|
<h3>
|
||||||
<a href="gbHtmlBrowse.php?id=<?=$tpldata['id']?>&tree=Y" class="button">Tree</a>
|
<a href="gbHtmlBrowse.php?id=<?php echo$tpldata['id']?>&tree=Y" class="button">Tree</a>
|
||||||
<?foreach($tpldata['pathdata'] as $o){?>
|
<?php foreach($tpldata['pathdata'] as $o){?>
|
||||||
<a href="gbHtmlBrowse.php?id=<?=urlencode($o['id'])?>"><?=$o['name']?></a>
|
<a href="gbHtmlBrowse.php?id=<?php echo urlencode($o['id'])?>"><?php echo$o['name']?></a>
|
||||||
<?if($o['type']=='Folder'){?><span class="slash b">/</span><?}?>
|
<?php if($o['type']=='Folder'){?><span class="slash b">/</span><?php }?>
|
||||||
<?}?>:
|
<?php }?>:
|
||||||
<span style="padding-left:6em">
|
<span style="padding-left:6em">
|
||||||
<a href="gbHtmlPerms.php?id=<?=$id?>" class="button">permissions</a>
|
<a href="gbHtmlPerms.php?id=<?php echo$id?>" class="button">permissions</a>
|
||||||
</span>
|
</span>
|
||||||
</h3>
|
</h3>
|
||||||
<?}?>
|
<?php }?>
|
||||||
|
|
||||||
<?if($tpldata['showTree']) if($tpldata['tree']){?>
|
<?php if($tpldata['showTree']) if($tpldata['tree']){?>
|
||||||
<?foreach($tpldata['treedata'] as $o){?>
|
<?php foreach($tpldata['treedata'] as $o){?>
|
||||||
<?=str_repeat(' ', ($tpldata['tree']?intval($o['level']):3)*2)?>
|
<?php echo str_repeat(' ', ($tpldata['tree']?intval($o['level']):3)*2)?>
|
||||||
<a href="gbHtmlBrowse.php?id=<?=$o['id']?>"><?=$o['name']?></a>
|
<a href="gbHtmlBrowse.php?id=<?php echo$o['id']?>"><?php echo$o['name']?></a>
|
||||||
<br>
|
<br>
|
||||||
<?}?>
|
<?php }?>
|
||||||
<?}else{?>
|
<?php }else{?>
|
||||||
<table border="0">
|
<table border="0">
|
||||||
<?foreach($tpldata['listdata'] as $o){?>
|
<?php foreach($tpldata['listdata'] as $o){?>
|
||||||
<tr><td valign="top">
|
<tr><td valign="top">
|
||||||
<?=str_repeat(' ', ($tpldata['tree']?intval($o['level']):3)*2)?><span id="ID<?=$o['id']?>"
|
<?php echo str_repeat(' ', ($tpldata['tree']?intval($o['level']):3)*2)?><span id="ID<?php echo$o['id']?>"
|
||||||
><a <?if($o['type']=='Folder'){?>href="gbHtmlBrowse.php?id=<?=$o['id']?>"<?}?>><?=$o['name']?></a
|
><a <?php if($o['type']=='Folder'){?>href="gbHtmlBrowse.php?id=<?php echo$o['id']?>"<?php }?>><?php echo$o['name']?></a
|
||||||
></span>
|
></span>
|
||||||
</td><td>
|
</td><td>
|
||||||
<?$a=array('Folder'=>'D', 'File'=>'F', 'Replica'=>'R'); echo$a[$o['type']]?>
|
<?php $a=array('Folder'=>'D', 'File'=>'F', 'Replica'=>'R'); echo$a[$o['type']]?>
|
||||||
<a href="javascript:frename('<?=$o['name']?>', '<?=$o['id']?>')" class="button">rename</a>
|
<a href="javascript:frename('<?php echo$o['name']?>', '<?php echo$o['id']?>')" class="button">rename</a>
|
||||||
<a href="javascript:fmove('<?=$o['id']?>', '.')" class="button">move</a>
|
<a href="javascript:fmove('<?php echo$o['id']?>', '.')" class="button">move</a>
|
||||||
<a href="javascript:fcopy('<?=$o['id']?>', '.')" class="button">copy</a>
|
<a href="javascript:fcopy('<?php echo$o['id']?>', '.')" class="button">copy</a>
|
||||||
<?/*?>
|
<?php /*?>
|
||||||
<a href="javascript:freplicate('<?=$o['name']?>', '<?=$o['id']?>')" class="button">replicate</a>
|
<a href="javascript:freplicate('<?php echo$o['name']?>', '<?php echo$o['id']?>')" class="button">replicate</a>
|
||||||
<?*/?>
|
<?php */?>
|
||||||
<a href="gbHtmlPerms.php?id=<?=$o['id']?>" class="button">permissions</a>
|
<a href="gbHtmlPerms.php?id=<?php echo$o['id']?>" class="button">permissions</a>
|
||||||
<a href="gbHttp.php?act=delete&id=<?=$o['id']?>" class="button"
|
<a href="gbHttp.php?act=delete&id=<?php echo$o['id']?>" class="button"
|
||||||
onClick="return confirm('Delete object "<?=$o['name']?>"?')">DEL</a>
|
onClick="return confirm('Delete object "<?php echo$o['name']?>"?')">DEL</a>
|
||||||
<?if($o['type']=='File'){?>
|
<?php if($o['type']=='File'){?>
|
||||||
<a href="gbHttp.php?act=getFile&id=<?=$o['id']?>" class="button">Access</a>
|
<a href="gbHttp.php?act=getFile&id=<?php echo$o['id']?>" class="button">Access</a>
|
||||||
<a href="gbHttp.php?act=getInfo&id=<?=$o['id']?>" class="button">Analyze</a>
|
<a href="gbHttp.php?act=getInfo&id=<?php echo$o['id']?>" class="button">Analyze</a>
|
||||||
<a href="gbHttp.php?act=getMdata&id=<?=$o['id']?>" class="button">MetaData</a>
|
<a href="gbHttp.php?act=getMdata&id=<?php echo$o['id']?>" class="button">MetaData</a>
|
||||||
<?}?>
|
<?php }?>
|
||||||
<?if($o['type']=='Replica'){?>
|
<?php if($o['type']=='Replica'){?>
|
||||||
(-><?=$o['target']?>)
|
(-><?php echo$o['target']?>)
|
||||||
<?}?>
|
<?php }?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?} if(count($tpldata['listdata'])==0){?>
|
<?php } if(count($tpldata['listdata'])==0){?>
|
||||||
<tr><td>No objects</td></tr>
|
<tr><td>No objects</td></tr>
|
||||||
<?}?>
|
<?php }?>
|
||||||
</table>
|
</table>
|
||||||
<?}?>
|
<?php }?>
|
||||||
|
|
||||||
<?if($tpldata['showEdit']){?>
|
<?php if($tpldata['showEdit']){?>
|
||||||
<form method="post" enctype="multipart/form-data" action="gbHttp.php">
|
<form method="post" enctype="multipart/form-data" action="gbHttp.php">
|
||||||
<?#<form method="post" enctype="multipart/form-data" action="http://localhost:8000">?>
|
<?php #<form method="post" enctype="multipart/form-data" action="http://localhost:8000">?>
|
||||||
<table>
|
<table>
|
||||||
<tr><td>File name:</td><td><input type="text" name="filename" value=""></td></tr>
|
<tr><td>File name:</td><td><input type="text" name="filename" value=""></td></tr>
|
||||||
<tr><td>Media file:</td><td><input type="file" name="mediafile"></td></tr>
|
<tr><td>Media file:</td><td><input type="file" name="mediafile"></td></tr>
|
||||||
<tr><td>Metadata file:</td><td><input type="file" name="mdatafile"></td></tr>
|
<tr><td>Metadata file:</td><td><input type="file" name="mdatafile"></td></tr>
|
||||||
<?for($i=0; $i<0; $i++){?>
|
<?php for($i=0; $i<0; $i++){?>
|
||||||
<tr><td>
|
<tr><td>
|
||||||
<select name="elnames[<?=$i?>]">
|
<select name="elnames[<?php echo$i?>]">
|
||||||
<?$ii=0?>
|
<?php $ii=0?>
|
||||||
<?foreach($fldsname as $fld=>$descr){?>
|
<?php foreach($fldsname as $fld=>$descr){?>
|
||||||
<option value="<?=$fld?>"<?=($i==$ii++ ? ' selected' : '')?>><?=$descr?></option>
|
<option value="<?php echo$fld?>"<?php echo($i==$ii++ ? ' selected' : '')?>><?php echo$descr?></option>
|
||||||
<?}?>
|
<?php }?>
|
||||||
</select>
|
</select>
|
||||||
</td><td><input type="text" name="elvals[<?=$i?>]" value=""></td></tr>
|
</td><td><input type="text" name="elvals[<?php echo$i?>]" value=""></td></tr>
|
||||||
<?}?>
|
<?php }?>
|
||||||
<tr><td colspan="2"><input type="submit" value="Send!"></td></tr>
|
<tr><td colspan="2"><input type="submit" value="Send!"></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<input type="hidden" name="MAX_FILE_SIZE" value="1048576">
|
<input type="hidden" name="MAX_FILE_SIZE" value="1048576">
|
||||||
<input type="hidden" name="act" value="upload">
|
<input type="hidden" name="act" value="upload">
|
||||||
<input type="hidden" name="id" value="<?=$tpldata['id']?>">
|
<input type="hidden" name="id" value="<?php echo$tpldata['id']?>">
|
||||||
</form>
|
</form>
|
||||||
<?}?>
|
<?php }?>
|
||||||
|
|
||||||
<?if($tpldata['showSForm']){?>
|
<?php if($tpldata['showSForm']){?>
|
||||||
<form method="post" action="gbHtmlBrowse.php">
|
<form method="post" action="gbHtmlBrowse.php">
|
||||||
<table>
|
<table>
|
||||||
<tr><td>Search string:</td><td><input type="text" name="srch" value=""></td></tr>
|
<tr><td>Search string:</td><td><input type="text" name="srch" value=""></td></tr>
|
||||||
<tr><td colspan="2"><input type="submit" value="Send!"></td></tr>
|
<tr><td colspan="2"><input type="submit" value="Send!"></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<input type="hidden" name="act" value="search">
|
<input type="hidden" name="act" value="search">
|
||||||
<input type="hidden" name="id" value="<?=$tpldata['id']?>">
|
<input type="hidden" name="id" value="<?php echo$tpldata['id']?>">
|
||||||
</form>
|
</form>
|
||||||
<?}?>
|
<?php }?>
|
||||||
|
|
||||||
<?if($tpldata['showSRes']){?>
|
<?php if($tpldata['showSRes']){?>
|
||||||
<ul>
|
<ul>
|
||||||
<? if(is_array($tpldata['search'])) foreach($tpldata['search'] as $k=>$v){?>
|
<?php if(is_array($tpldata['search'])) foreach($tpldata['search'] as $k=>$v){?>
|
||||||
<li><a href="gbHttp.php?act=getMdata&id=<?=$gb->_idFromGunid($v['gunid'])?>"><?=$v['gunid']?></a>
|
<li><a href="gbHttp.php?act=getMdata&id=<?php echo$gb->_idFromGunid($v['gunid'])?>"><?php echo$v['gunid']?></a>
|
||||||
<? }else{?>
|
<?php }else{?>
|
||||||
No items found
|
No items found
|
||||||
<? }?>
|
<?php }?>
|
||||||
</ul>
|
</ul>
|
||||||
<?}?>
|
<?php }?>
|
||||||
|
|
||||||
<?php if($tpldata['msg']){?>
|
<?php if($tpldata['msg']){?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?
|
<?php
|
||||||
// $Id: gbHtmlLogin.php,v 1.1 2004/09/12 21:59:08 tomas Exp $
|
// $Id: gbHtmlLogin.php,v 1.2 2004/09/21 00:27:41 tomas Exp $
|
||||||
require_once"gbHtml_h.php";
|
require_once"gbHtml_h.php";
|
||||||
|
|
||||||
// prefill data structure for template
|
// prefill data structure for template
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: gbHtmlPerms.php,v 1.1 2004/09/12 21:59:09 tomas Exp $
|
// $Id: gbHtmlPerms.php,v 1.2 2004/09/21 00:27:41 tomas Exp $
|
||||||
require_once"gbHtml_h.php";
|
require_once"gbHtml_h.php";
|
||||||
require_once"gbHtmlTestAuth.php";
|
require_once"gbHtmlTestAuth.php";
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ $tpldata['msg'] = $_SESSION['alertMsg']; unset($_SESSION['alertMsg']);
|
||||||
|
|
||||||
<h1>Permission editor</h1>
|
<h1>Permission editor</h1>
|
||||||
<?php if(is_array($tpldata['pathdata'])){?>
|
<?php if(is_array($tpldata['pathdata'])){?>
|
||||||
<h2><a href="gbHtmlBrowse.php?id=<?=$id?>" title="Tree editor">Path</a>:
|
<h2><a href="gbHtmlBrowse.php?id=<?php echo$id?>" title="Tree editor">Path</a>:
|
||||||
<?php foreach($tpldata['pathdata'] as $k=>$it) {?>
|
<?php foreach($tpldata['pathdata'] as $k=>$it) {?>
|
||||||
<?php echo$it["name"]?></a><span class="slash">/</span>
|
<?php echo$it["name"]?></a><span class="slash">/</span>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
|
@ -64,12 +64,12 @@ $tpldata['msg'] = $_SESSION['alertMsg']; unset($_SESSION['alertMsg']);
|
||||||
<?php if(is_array($tpldata['perms'])&&count($tpldata['perms'])>0) foreach($tpldata['perms'] as $k=>$row) {
|
<?php if(is_array($tpldata['perms'])&&count($tpldata['perms'])>0) foreach($tpldata['perms'] as $k=>$row) {
|
||||||
$da=($row['type']=='A' ? 'allow' : ($row['type']=='D' ? '<b>deny</b>' : $row['type']));?>
|
$da=($row['type']=='A' ? 'allow' : ($row['type']=='D' ? '<b>deny</b>' : $row['type']));?>
|
||||||
<tr class="<?php echo(($o=1-$o) ? 'odd' : 'ev')?>">
|
<tr class="<?php echo(($o=1-$o) ? 'odd' : 'ev')?>">
|
||||||
<td class="b"><a <?#href="alibExPList.php?id=<?php echo$row['subj']? >"?>><?php echo$row['login']?></a></td>
|
<td class="b"><a <?php #href="alibExPList.php?id=<?php echo$row['subj']? >"?>><?php echo$row['login']?></a></td>
|
||||||
<td class="b"><?php echo$row['action']?></td>
|
<td class="b"><?php echo$row['action']?></td>
|
||||||
<td><?php echo$da?></td>
|
<td><?php echo$da?></td>
|
||||||
<td>
|
<td>
|
||||||
<a href="gbHttp.php?act=removePerm&permid=<?php echo$row['permid']?>&oid=<?php echo$tpldata['id']?>&id=<?php echo$id?>"
|
<a href="gbHttp.php?act=removePerm&permid=<?php echo$row['permid']?>&oid=<?php echo$tpldata['id']?>&id=<?php echo$id?>"
|
||||||
class="lnkbutt" onClick="return confirm('Delete permission "<?=$da?> <?=$row['action']?>" for user <?php echo$row['login']?>?')">remove</a>
|
class="lnkbutt" onClick="return confirm('Delete permission "<?php echo$da?> <?php echo$row['action']?>" for user <?php echo$row['login']?>?')">remove</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php }else{?>
|
<?php }else{?>
|
||||||
|
@ -88,13 +88,13 @@ for action
|
||||||
<option value="_all">all</option>
|
<option value="_all">all</option>
|
||||||
<?php if(is_array($tpldata['actions'])) foreach($tpldata['actions'] as $k=>$it) {?>
|
<?php if(is_array($tpldata['actions'])) foreach($tpldata['actions'] as $k=>$it) {?>
|
||||||
<option value="<?php echo$it?>"><?php echo$it?></option>
|
<option value="<?php echo$it?>"><?php echo$it?></option>
|
||||||
<?}?>
|
<?php }?>
|
||||||
</select>
|
</select>
|
||||||
to subject
|
to subject
|
||||||
<select name="subj">
|
<select name="subj">
|
||||||
<?php if(is_array($tpldata['subjects'])) foreach($tpldata['subjects'] as $k=>$it) {?>
|
<?php if(is_array($tpldata['subjects'])) foreach($tpldata['subjects'] as $k=>$it) {?>
|
||||||
<option value="<?php echo$it['id']?>"><?php echo$it['login']?></option>
|
<option value="<?php echo$it['id']?>"><?php echo$it['login']?></option>
|
||||||
<?}?>
|
<?php }?>
|
||||||
</select>
|
</select>
|
||||||
<input type="hidden" name="act" value="addPerm">
|
<input type="hidden" name="act" value="addPerm">
|
||||||
<input type="hidden" name="id" value="<?php echo$tpldata['id']?>">
|
<input type="hidden" name="id" value="<?php echo$tpldata['id']?>">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: gbHtmlSubj.php,v 1.1 2004/09/12 21:59:11 tomas Exp $
|
// $Id: gbHtmlSubj.php,v 1.2 2004/09/21 00:27:41 tomas Exp $
|
||||||
require_once"gbHtml_h.php";
|
require_once"gbHtml_h.php";
|
||||||
require_once"gbHtmlTestAuth.php";
|
require_once"gbHtmlTestAuth.php";
|
||||||
|
|
||||||
|
@ -70,12 +70,12 @@ $d['msg'] = $_SESSION['alertMsg']; unset($_SESSION['alertMsg']);
|
||||||
<tr class="<?php echo(($o=1-$o) ? 'odd' : 'ev')?>">
|
<tr class="<?php echo(($o=1-$o) ? 'odd' : 'ev')?>">
|
||||||
<td><?php echo$c['id']?></td>
|
<td><?php echo$c['id']?></td>
|
||||||
<td class="b">
|
<td class="b">
|
||||||
<?if($c['type']=='G'){?>
|
<?php if($c['type']=='G'){?>
|
||||||
<a href="gbHtmlSubj.php?id=<?php echo$c['id']?>"><?php echo$c['login']?></a>
|
<a href="gbHtmlSubj.php?id=<?php echo$c['id']?>"><?php echo$c['login']?></a>
|
||||||
<?}else{?><?php echo$c['login']?>
|
<?php }else{?><?php echo$c['login']?>
|
||||||
<?}?>
|
<?php }?>
|
||||||
</td
|
</td
|
||||||
<td><?if($c['type']=='G'){?>(G:<?php echo$c['cnt']?>)<?}else{?> (U)<?}?></td>
|
<td><?php if($c['type']=='G'){?>(G:<?php echo$c['cnt']?>)<?php }else{?> (U)<?php }?></td>
|
||||||
<td>
|
<td>
|
||||||
<a class="lnkbutt" href="gbHttp.php?act=removeSubj&login=<?php echo urlencode($c['login'])?>">remove</a>
|
<a class="lnkbutt" href="gbHttp.php?act=removeSubj&login=<?php echo urlencode($c['login'])?>">remove</a>
|
||||||
<a class="lnkbutt" href="gbHtmlSubj.php?act=passwd&uid=<?php echo urlencode($c['id'])?>">change password</a>
|
<a class="lnkbutt" href="gbHtmlSubj.php?act=passwd&uid=<?php echo urlencode($c['id'])?>">change password</a>
|
||||||
|
@ -107,12 +107,12 @@ Add subject with name: <input type="text" name="login" value="" size="10">
|
||||||
<tr class="<?php echo(($o=1-$o) ? 'odd' : 'ev')?>">
|
<tr class="<?php echo(($o=1-$o) ? 'odd' : 'ev')?>">
|
||||||
<td><?php echo$row['id']?></td>
|
<td><?php echo$row['id']?></td>
|
||||||
<td class="b">
|
<td class="b">
|
||||||
<?if($row['type']=='G'){?>
|
<?php if($row['type']=='G'){?>
|
||||||
<a href="gbHtmlSubj.php?id=<?php echo$row['id']?>"><?php echo$row['login']?></a>
|
<a href="gbHtmlSubj.php?id=<?php echo$row['id']?>"><?php echo$row['login']?></a>
|
||||||
<?}else{?><?php echo$row['login']?>
|
<?php }else{?><?php echo$row['login']?>
|
||||||
<?}?>
|
<?php }?>
|
||||||
</td
|
</td
|
||||||
<td><?if($row['type']=='G'){?> (G)<?}else{?> (U)<?}?></td>
|
<td><?php if($row['type']=='G'){?> (G)<?php }else{?> (U)<?php }?></td>
|
||||||
<td>
|
<td>
|
||||||
<a class="lnkbutt"
|
<a class="lnkbutt"
|
||||||
href="gbHttp.php?act=removeSubjFromGr&login=<?php echo urlencode($row['login'])?>&gname=<?php echo urlencode($d['gname'])?>&reid=<?php echo$d['id']?>">
|
href="gbHttp.php?act=removeSubjFromGr&login=<?php echo urlencode($row['login'])?>&gname=<?php echo urlencode($d['gname'])?>&reid=<?php echo$d['id']?>">
|
||||||
|
@ -130,7 +130,7 @@ Add subject
|
||||||
<select name="login">
|
<select name="login">
|
||||||
<?php if(is_array($d['subj'])) foreach($d['subj'] as $k=>$row) {?>
|
<?php if(is_array($d['subj'])) foreach($d['subj'] as $k=>$row) {?>
|
||||||
<option value="<?php echo$row['login']?>"><?php echo$row['login']?></option>
|
<option value="<?php echo$row['login']?>"><?php echo$row['login']?></option>
|
||||||
<?}?>
|
<?php }?>
|
||||||
</select>
|
</select>
|
||||||
to group <?php echo$d['gname']?>
|
to group <?php echo$d['gname']?>
|
||||||
<input type="hidden" name="act" value="addSubj2Gr">
|
<input type="hidden" name="act" value="addSubj2Gr">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?
|
<?php
|
||||||
// $Id: gbHtmlTestAuth.php,v 1.1 2004/09/12 21:59:11 tomas Exp $
|
// $Id: gbHtmlTestAuth.php,v 1.2 2004/09/21 00:27:41 tomas Exp $
|
||||||
$login = $gb->getSessLogin($_REQUEST[$config['authCookieName']]);
|
$login = $gb->getSessLogin($_REQUEST[$config['authCookieName']]);
|
||||||
if(!isset($login)||$login==''){
|
if(!isset($login)||$login==''){
|
||||||
$_SESSION['alertMsg'] = "Login required";
|
$_SESSION['alertMsg'] = "Login required";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?
|
<?php
|
||||||
$gb->initDb();
|
$gb->initDb();
|
||||||
$gb->init();
|
$gb->init();
|
||||||
#system("rm -f {$config['storageDir']}/*.bin {$config['storageDir']}/*.xml");
|
#system("rm -f {$config['storageDir']}/*.bin {$config['storageDir']}/*.xml");
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
require_once '../conf.php';
|
require_once '../conf.php';
|
||||||
require_once 'DB.php';
|
require_once 'DB.php';
|
||||||
require_once '../GreenBox.php';
|
require_once '../../../storageServer/var/GreenBox.php';
|
||||||
|
|
||||||
#PEAR::setErrorHandling(PEAR_ERROR_TRIGGER, E_USER_WARNING);
|
#PEAR::setErrorHandling(PEAR_ERROR_TRIGGER, E_USER_WARNING);
|
||||||
#PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'errCallBack');
|
#PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'errCallBack');
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?
|
<?php
|
||||||
require_once"gbHtml_h.php";
|
require_once"gbHtml_h.php";
|
||||||
#header("Content-type: text/plain"); echo"GET:\n"; print_r($_GET); echo"POST:\n"; print_r($_POST); echo"REQUEST:\n"; print_r($_REQUEST); echo"FILES:\n"; print_r($_FILES); exit;
|
#header("Content-type: text/plain"); echo"GET:\n"; print_r($_GET); echo"POST:\n"; print_r($_POST); echo"REQUEST:\n"; print_r($_REQUEST); echo"FILES:\n"; print_r($_FILES); exit;
|
||||||
#echo"<pre>\n"; print_r($_SERVER); exit;
|
#echo"<pre>\n"; print_r($_SERVER); exit;
|
||||||
|
|
|
@ -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/index.php,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/index.php,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -32,9 +32,9 @@ exit;
|
||||||
/*
|
/*
|
||||||
?>
|
?>
|
||||||
<html><head>
|
<html><head>
|
||||||
<title>Storage module</title>
|
<title>StorageServer module</title>
|
||||||
</head><body>
|
</head><body>
|
||||||
<h3>Storage module</h3>
|
<h3>StorageServer module</h3>
|
||||||
<br>
|
<br>
|
||||||
<a href="../html/gbHtmlLogin.php" accesskey="H"><b>H</b>TML client</a><br>
|
<a href="../html/gbHtmlLogin.php" accesskey="H"><b>H</b>TML client</a><br>
|
||||||
<a href="../xmlrpc/" accesskey="X"><b>X</b>mlRpc test</a><br>
|
<a href="../xmlrpc/" accesskey="X"><b>X</b>mlRpc test</a><br>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?
|
<?php
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2004 Media Development Loan Fund
|
Copyright (c) 2004 Media Development Loan Fund
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: tomas $
|
Author : $Author: tomas $
|
||||||
Version : $Revision: 1.2 $
|
Version : $Revision: 1.3 $
|
||||||
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 $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -87,5 +87,10 @@ else{
|
||||||
echo "\nStorage is probably installed OK\n";
|
echo "\nStorage is probably installed OK\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo "Install Transport submodule ...\n";
|
||||||
|
require_once "../Transport.php";
|
||||||
|
$tr =& new Transport(&$dbc, $config);
|
||||||
|
$r = $tr->install();
|
||||||
|
|
||||||
$dbc->disconnect();
|
$dbc->disconnect();
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?
|
<?php
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2004 Media Development Loan Fund
|
Copyright (c) 2004 Media Development Loan Fund
|
||||||
|
@ -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/uninstall.php,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/install/uninstall.php,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -54,8 +54,13 @@ $dbc->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||||
$gb = &new GreenBox(&$dbc, $config);
|
$gb = &new GreenBox(&$dbc, $config);
|
||||||
|
|
||||||
# $dbc->setErrorHandling(PEAR_ERROR_RETURN);
|
# $dbc->setErrorHandling(PEAR_ERROR_RETURN);
|
||||||
echo "Trying to uninstall all ...\n";
|
echo "Trying to uninstall storageServer ...\n";
|
||||||
$gb->uninstall();
|
$gb->uninstall();
|
||||||
|
|
||||||
|
echo "Uninstall Tranport submodule ...\n";
|
||||||
|
require_once "../Transport.php";
|
||||||
|
$tr =& new Transport(&$dbc, $config);
|
||||||
|
$r = $tr->uninstall();
|
||||||
|
|
||||||
$dbc->disconnect();
|
$dbc->disconnect();
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/php -q
|
#!/usr/bin/php -q
|
||||||
<?
|
<?php
|
||||||
header("Content-type: text/plain");
|
header("Content-type: text/plain");
|
||||||
echo "TEST\n";
|
echo "TEST\n";
|
||||||
|
|
||||||
|
|
|
@ -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/xmlrpc/testRunner.sh,v $
|
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/testRunner.sh,v $
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -31,7 +31,6 @@ COMM=$1
|
||||||
shift
|
shift
|
||||||
GUNID=$1
|
GUNID=$1
|
||||||
|
|
||||||
#XMLRPC=http://localhost:80/tom/work/mdlf/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php
|
|
||||||
XMLRPC=http://localhost:80/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php
|
XMLRPC=http://localhost:80/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php
|
||||||
echo "XMLRPC server URL (check it in troubles):"
|
echo "XMLRPC server URL (check it in troubles):"
|
||||||
echo $XMLRPC
|
echo $XMLRPC
|
||||||
|
@ -71,7 +70,7 @@ storeAudioClip() {
|
||||||
echo "storeAudioClip:"
|
echo "storeAudioClip:"
|
||||||
MEDIA=../tests/ex1.mp3
|
MEDIA=../tests/ex1.mp3
|
||||||
METADATA=../tests/testStorage.xml
|
METADATA=../tests/testStorage.xml
|
||||||
RGUNID=`$XR_CLI storeAudioClip "$SESSID" 'X' "$MEDIA" "$METADATA"`
|
RGUNID=`$XR_CLI storeAudioClip "$SESSID" '' "$MEDIA" "$METADATA"`
|
||||||
echo $RGUNID
|
echo $RGUNID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,180 +1,336 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: xrLocStor.php,v 1.1 2004/09/12 21:59:27 tomas Exp $
|
/*------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 2004 Media Development Loan Fund
|
||||||
|
|
||||||
|
This file is part of the LiveSupport project.
|
||||||
|
http://livesupport.campware.org/
|
||||||
|
To report bugs, send an e-mail to bugs@campware.org
|
||||||
|
|
||||||
|
LiveSupport is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
LiveSupport is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with LiveSupport; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
|
||||||
|
Author : $Author: tomas $
|
||||||
|
Version : $Revision: 1.2 $
|
||||||
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php,v $
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------*/
|
||||||
include_once "xmlrpc.inc";
|
include_once "xmlrpc.inc";
|
||||||
include_once "xmlrpcs.inc";
|
include_once "xmlrpcs.inc";
|
||||||
require_once '../conf.php';
|
require_once '../conf.php';
|
||||||
require_once 'DB.php';
|
require_once 'DB.php';
|
||||||
require_once '../GreenBox.php';
|
|
||||||
require_once '../LocStor.php';
|
require_once '../LocStor.php';
|
||||||
|
|
||||||
#PEAR::setErrorHandling(PEAR_ERROR_TRIGGER, E_USER_WARNING);
|
|
||||||
#PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'errCallBack');
|
|
||||||
PEAR::setErrorHandling(PEAR_ERROR_RETURN);
|
PEAR::setErrorHandling(PEAR_ERROR_RETURN);
|
||||||
#PEAR::setErrorHandling(PEAR_ERROR_PRINT);
|
|
||||||
|
|
||||||
function errCallBack($err)
|
|
||||||
{
|
|
||||||
echo "<pre>gm:\n".$err->getMessage()."\ndi:\n".$err->getDebugInfo()."\nui:\n".$err->getUserInfo()."\n";
|
|
||||||
echo "<hr>BackTrace:\n";
|
|
||||||
print_r($err->backtrace);
|
|
||||||
echo "</pre>\n";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$dbc = DB::connect($config['dsn'], TRUE);
|
$dbc = DB::connect($config['dsn'], TRUE);
|
||||||
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
|
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||||
|
|
||||||
function v2xr($var, $struct=true){
|
|
||||||
if(is_array($var)){
|
|
||||||
$r = array();
|
|
||||||
foreach($var as $k=>$v) if($struct) $r[$k]=v2xr($v); else $r[]=v2xr($v);
|
|
||||||
return new xmlrpcval($r, ($struct ? "struct" : "array"));
|
|
||||||
}else if(is_int($var)){
|
|
||||||
return new xmlrpcval($var, "int");
|
|
||||||
}else if(is_bool($var)){
|
|
||||||
return new xmlrpcval($var, "boolean");
|
|
||||||
}else{
|
|
||||||
return new xmlrpcval($var, "string");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class XR_LocStor extends LocStor{
|
class XR_LocStor extends LocStor{
|
||||||
function _xr_getPars($input)
|
|
||||||
{
|
/**
|
||||||
$p = $input->getParam(0);
|
* Convert PHP variables to XMLRPC objects
|
||||||
if(isset($p) && $p->scalartyp()=="struct"){
|
*
|
||||||
$p->structreset(); $r = array();
|
* @param var mixed - PHP variable
|
||||||
while(list($k,$v) = $p->structeach()){ $r[$k] = $v->scalarval(); }
|
* @param struct boolean - flag for using XMLRPC struct instead of array
|
||||||
return array(TRUE, $r);
|
* @return XMLRPC object
|
||||||
|
*/
|
||||||
|
function _v2xr($var, $struct=true){
|
||||||
|
if(is_array($var)){
|
||||||
|
$r = array();
|
||||||
|
foreach($var as $k=>$v){
|
||||||
|
if($struct) $r[$k]=$this->_v2xr($v);
|
||||||
|
else $r[]=$this->_v2xr($v);
|
||||||
|
}
|
||||||
|
return new xmlrpcval($r, ($struct ? "struct" : "array"));
|
||||||
|
}else if(is_int($var)){
|
||||||
|
return new xmlrpcval($var, "int");
|
||||||
|
}else if(is_bool($var)){
|
||||||
|
return new xmlrpcval($var, "boolean");
|
||||||
|
}else{
|
||||||
|
return new xmlrpcval($var, "string");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Convert XMLRPC struct to PHP array
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
*/
|
||||||
|
function _xr_getPars($input)
|
||||||
|
{
|
||||||
|
$p = $input->getParam(0);
|
||||||
|
if(isset($p) && $p->scalartyp()=="struct"){
|
||||||
|
$p->structreset(); $r = array();
|
||||||
|
while(list($k,$v) = $p->structeach()){ $r[$k] = $v->scalarval(); }
|
||||||
|
return array(TRUE, $r);
|
||||||
|
}
|
||||||
|
else return array(FALSE, new xmlrpcresp(0, 801,
|
||||||
|
"xr_login: wrong 1st parameter, struct expected."
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test XMLRPC - strupper and return given string,
|
||||||
|
* also return loginname of logged user
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
*/
|
||||||
|
function xr_test($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
return new xmlrpcresp($this->_v2xr(array(
|
||||||
|
'str'=>strtoupper($r['teststring']),
|
||||||
|
'login'=>$this->getSessLogin($r['sessid']),
|
||||||
|
'sessid'=>$r['sessid']
|
||||||
|
), true));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call LocStor::authenticate
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
*/
|
||||||
|
function xr_authenticate($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
$res = $this->authenticate($r['login'], $r['pass']);
|
||||||
|
return new xmlrpcresp(new xmlrpcval($res, "boolean"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call LocStor::login
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
*/
|
||||||
|
function xr_login($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
if(!($res = $this->login($r['login'], $r['pass'])))
|
||||||
|
return new xmlrpcresp(0, 802,
|
||||||
|
"xr_login: login failed - incorrect username or password."
|
||||||
|
);
|
||||||
|
else
|
||||||
|
return new xmlrpcresp($this->_v2xr($res, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call LocStor::logout
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
*/
|
||||||
|
function xr_logout($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
$res = $this->logout($r['sessid']);
|
||||||
|
if(!PEAR::isError($res))
|
||||||
|
return new xmlrpcresp($this->_v2xr('Bye', false));
|
||||||
|
else
|
||||||
|
return new xmlrpcresp(0, 803,
|
||||||
|
"xr_logout: logout failed - not logged."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call LocStor::existsAudioClip
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
*/
|
||||||
|
function xr_existsAudioClip($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
#$this->debugLog(join(', ', $r));
|
||||||
|
$res = $this->existsAudioClip($r['sessid'], $r['gunid']);
|
||||||
|
#$this->debugLog($res);
|
||||||
|
if(PEAR::isError($res))
|
||||||
|
return new xmlrpcresp(0, 803,
|
||||||
|
"xr_existsAudioClip: ".$res->getMessage().
|
||||||
|
" ".$res->getUserInfo()
|
||||||
|
);
|
||||||
|
return new xmlrpcresp(new xmlrpcval($res, "boolean"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call LocStor::storeAudioClip
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
*/
|
||||||
|
function xr_storeAudioClip($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
$res = $this->storeAudioClip(
|
||||||
|
$r['sessid'], $r['gunid'], $r['mediaFileLP'], $r['mdataFileLP']
|
||||||
|
);
|
||||||
|
if(!PEAR::isError($res))
|
||||||
|
return new xmlrpcresp(new xmlrpcval($res, "string"));
|
||||||
|
else
|
||||||
|
return new xmlrpcresp(0, 803,
|
||||||
|
"xr_storeAudioClip: ".$res->getMessage().
|
||||||
|
" ".$res->getUserInfo()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call LocStor::deleteAudioClip
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
*/
|
||||||
|
function xr_deleteAudioClip($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
$res = $this->deleteAudioClip($r['sessid'], $r['gunid']);
|
||||||
|
if(!PEAR::isError($res))
|
||||||
|
return new xmlrpcresp(new xmlrpcval($res, "boolean"));
|
||||||
|
else
|
||||||
|
return new xmlrpcresp(0, 803,
|
||||||
|
"xr_deleteAudioClip: ".$res->getMessage().
|
||||||
|
" ".$res->getUserInfo()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call LocStor::updateAudioClipMetadata
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
*/
|
||||||
|
function xr_updateAudioClipMetadata($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
$res = $this->updateAudioClipMetadata(
|
||||||
|
$r['sessid'], $r['gunid'], $r['mdataFileLP']
|
||||||
|
);
|
||||||
|
if(!PEAR::isError($res))
|
||||||
|
return new xmlrpcresp(new xmlrpcval($res, "boolean"));
|
||||||
|
else
|
||||||
|
return new xmlrpcresp(0, 803,
|
||||||
|
"xr_updateAudioClip: ".$res->getMessage().
|
||||||
|
" ".$res->getUserInfo()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call LocStor::searchMetadata
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
*/
|
||||||
|
function xr_searchMetadata($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
$res = $this->searchMetadata($r['sessid'], $r['criteria']);
|
||||||
|
if(!PEAR::isError($res))
|
||||||
|
return new xmlrpcresp(new xmlrpcval($res, "boolean"));
|
||||||
|
else
|
||||||
|
return new xmlrpcresp(0, 803,
|
||||||
|
"xr_searchAudioClip: ".$res->getMessage().
|
||||||
|
" ".$res->getUserInfo()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call LocStor::accessRawAudioData
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
*/
|
||||||
|
function xr_accessRawAudioData($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
$res = $this->accessRawAudioData($r['sessid'], $r['gunid']);
|
||||||
|
if(!PEAR::isError($res))
|
||||||
|
return new xmlrpcresp(new xmlrpcval($res, "string"));
|
||||||
|
else
|
||||||
|
return new xmlrpcresp(0, 803,
|
||||||
|
"xr_accessRawAudioData: ".$res->getMessage().
|
||||||
|
" ".$res->getUserInfo()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call LocStor::releaseRawAudioData
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
*/
|
||||||
|
function xr_releaseRawAudioData($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
$res = $this->releaseRawAudioData($r['sessid'], $r['tmpLink']);
|
||||||
|
if(!PEAR::isError($res))
|
||||||
|
return new xmlrpcresp(new xmlrpcval($res, "boolean"));
|
||||||
|
else
|
||||||
|
return new xmlrpcresp(0, 803,
|
||||||
|
"xr_releaseRawAudioData: ".$res->getMessage().
|
||||||
|
" ".$res->getUserInfo()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call LocStor::getAudioClip
|
||||||
|
*
|
||||||
|
* @param input XMLRPC struct
|
||||||
|
*/
|
||||||
|
function xr_getAudioClip($input)
|
||||||
|
{
|
||||||
|
list($ok, $r) = $this->_xr_getPars($input);
|
||||||
|
if(!$ok) return $r;
|
||||||
|
$res = $this->getAudioClip($r['sessid'], $r['gunid'], $r['metaData']);
|
||||||
|
if(!PEAR::isError($res))
|
||||||
|
return new xmlrpcresp(new xmlrpcval($res, "string"));
|
||||||
|
else
|
||||||
|
return new xmlrpcresp(0, 803,
|
||||||
|
"xr_getAudioClip: ".$res->getMessage()." ".$res->getUserInfo()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else return array(FALSE, new xmlrpcresp(0, 801, "xr_login: wrong 1st parameter, struct expected."));
|
|
||||||
}
|
|
||||||
function xr_test($input)
|
|
||||||
{
|
|
||||||
list($ok, $r) = $this->_xr_getPars($input);
|
|
||||||
if(!$ok) return $r;
|
|
||||||
return new xmlrpcresp(v2xr(array(
|
|
||||||
'str'=>strtoupper($r['teststring']),
|
|
||||||
'login'=>$this->getSessLogin($r['sessid']),
|
|
||||||
'sessid'=>$r['sessid']
|
|
||||||
), true));
|
|
||||||
}
|
|
||||||
function xr_authenticate($input)
|
|
||||||
{
|
|
||||||
list($ok, $r) = $this->_xr_getPars($input);
|
|
||||||
if(!$ok) return $r;
|
|
||||||
$res = $this->authenticate($r['login'], $r['pass']);
|
|
||||||
return new xmlrpcresp(new xmlrpcval($res, "boolean"));
|
|
||||||
}
|
|
||||||
function xr_login($input)
|
|
||||||
{
|
|
||||||
list($ok, $r) = $this->_xr_getPars($input);
|
|
||||||
if(!$ok) return $r;
|
|
||||||
if(!($res = $this->login($r['login'], $r['pass'])))
|
|
||||||
return new xmlrpcresp(0, 802, "xr_login: login failed - incorrect username or password.");
|
|
||||||
else
|
|
||||||
return new xmlrpcresp(v2xr($res, false));
|
|
||||||
}
|
|
||||||
function xr_logout($input)
|
|
||||||
{
|
|
||||||
list($ok, $r) = $this->_xr_getPars($input);
|
|
||||||
if(!$ok) return $r;
|
|
||||||
$res = $this->logout($r['sessid']);
|
|
||||||
if(!PEAR::isError($res)) return new xmlrpcresp(v2xr('Bye', false));
|
|
||||||
else return new xmlrpcresp(0, 803, "xr_logout: logout failed - not logged.");
|
|
||||||
}
|
|
||||||
function xr_existsAudioClip($input)
|
|
||||||
{
|
|
||||||
list($ok, $r) = $this->_xr_getPars($input);
|
|
||||||
if(!$ok) return $r;
|
|
||||||
# $this->debugLog(join(', ', $r));
|
|
||||||
$res = $this->existsAudioClip($r['sessid'], $r['gunid']);
|
|
||||||
# $this->debugLog($res);
|
|
||||||
if(PEAR::isError($res))
|
|
||||||
return new xmlrpcresp(0, 803, "xr_existsAudioClip: ".$res->getMessage()." ".$res->getUserInfo());
|
|
||||||
return new xmlrpcresp(new xmlrpcval($res, "boolean"));
|
|
||||||
}
|
|
||||||
function xr_storeAudioClip($input)
|
|
||||||
{
|
|
||||||
list($ok, $r) = $this->_xr_getPars($input);
|
|
||||||
if(!$ok) return $r;
|
|
||||||
$res = $this->storeAudioClip($r['sessid'], $r['gunid'], $r['mediaFileLP'], $r['mdataFileLP']);
|
|
||||||
if(!PEAR::isError($res)) return new xmlrpcresp(new xmlrpcval($res, "string"));
|
|
||||||
else return new xmlrpcresp(0, 803, "xr_storeAudioClip: ".$res->getMessage()." ".$res->getUserInfo());
|
|
||||||
}
|
|
||||||
function xr_deleteAudioClip($input)
|
|
||||||
{
|
|
||||||
list($ok, $r) = $this->_xr_getPars($input);
|
|
||||||
if(!$ok) return $r;
|
|
||||||
$res = $this->deleteAudioClip($r['sessid'], $r['gunid']);
|
|
||||||
if(!PEAR::isError($res)) return new xmlrpcresp(new xmlrpcval($res, "boolean"));
|
|
||||||
else return new xmlrpcresp(0, 803, "xr_deleteAudioClip: ".$res->getMessage()." ".$res->getUserInfo());
|
|
||||||
}
|
|
||||||
function xr_updateAudioClipMetadata($input)
|
|
||||||
{
|
|
||||||
list($ok, $r) = $this->_xr_getPars($input);
|
|
||||||
if(!$ok) return $r;
|
|
||||||
$res = $this->updateAudioClipMetadata($r['sessid'], $r['gunid'], $r['mdataFileLP']);
|
|
||||||
if(!PEAR::isError($res)) return new xmlrpcresp(new xmlrpcval($res, "boolean"));
|
|
||||||
else return new xmlrpcresp(0, 803, "xr_updateAudioClip: ".$res->getMessage()." ".$res->getUserInfo());
|
|
||||||
}
|
|
||||||
function xr_searchMetadata($input)
|
|
||||||
{
|
|
||||||
list($ok, $r) = $this->_xr_getPars($input);
|
|
||||||
if(!$ok) return $r;
|
|
||||||
$res = $this->searchMetadata($r['sessid'], $r['criteria']);
|
|
||||||
if(!PEAR::isError($res)) return new xmlrpcresp(new xmlrpcval($res, "boolean"));
|
|
||||||
else return new xmlrpcresp(0, 803, "xr_searchAudioClip: ".$res->getMessage()." ".$res->getUserInfo());
|
|
||||||
}
|
|
||||||
function xr_accessRawAudioData($input)
|
|
||||||
{
|
|
||||||
list($ok, $r) = $this->_xr_getPars($input);
|
|
||||||
if(!$ok) return $r;
|
|
||||||
$res = $this->accessRawAudioData($r['sessid'], $r['gunid']);
|
|
||||||
if(!PEAR::isError($res)) return new xmlrpcresp(new xmlrpcval($res, "string"));
|
|
||||||
else return new xmlrpcresp(0, 803, "xr_accessRawAudioData: ".$res->getMessage()." ".$res->getUserInfo());
|
|
||||||
}
|
|
||||||
function xr_releaseRawAudioData($input)
|
|
||||||
{
|
|
||||||
list($ok, $r) = $this->_xr_getPars($input);
|
|
||||||
if(!$ok) return $r;
|
|
||||||
$res = $this->releaseRawAudioData($r['sessid'], $r['tmpLink']);
|
|
||||||
if(!PEAR::isError($res)) return new xmlrpcresp(new xmlrpcval($res, "boolean"));
|
|
||||||
else return new xmlrpcresp(0, 803, "xr_releaseRawAudioData: ".$res->getMessage()." ".$res->getUserInfo());
|
|
||||||
}
|
|
||||||
function xr_getAudioClip($input)
|
|
||||||
{
|
|
||||||
list($ok, $r) = $this->_xr_getPars($input);
|
|
||||||
if(!$ok) return $r;
|
|
||||||
$res = $this->getAudioClip($r['sessid'], $r['gunid'], $r['metaData']);
|
|
||||||
if(!PEAR::isError($res)) return new xmlrpcresp(new xmlrpcval($res, "string"));
|
|
||||||
else return new xmlrpcresp(0, 803, "xr_getAudioClip: ".$res->getMessage()." ".$res->getUserInfo());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$locStor = &new XR_LocStor(&$dbc, $config);
|
$locStor = &new XR_LocStor(&$dbc, $config);
|
||||||
|
|
||||||
$methods = array(
|
$methods = array(
|
||||||
'test' => 'Tests toupper and checks sessid, params: teststring, sessid.',
|
'test' => 'Tests toupper and checks sessid, params: '.
|
||||||
|
'teststring, sessid.',
|
||||||
'authenticate' => 'Checks authentication.',
|
'authenticate' => 'Checks authentication.',
|
||||||
'login' => 'Login to storage.',
|
'login' => 'Login to storage.',
|
||||||
'logout' => 'Logout from storage.',
|
'logout' => 'Logout from storage.',
|
||||||
'existsAudioClip' => 'Checks if an Audio clip with the specified id is stored in local storage.',
|
'existsAudioClip' => 'Checks if an Audio clip with the specified '.
|
||||||
'storeAudioClip' => 'Store a new audio clip or replace an existing one.',
|
'id is stored in local storage.',
|
||||||
|
'storeAudioClip' => 'Store a new audio clip or replace '.
|
||||||
|
'an existing one.',
|
||||||
'deleteAudioClip' => 'Delete an existing Audio clip.',
|
'deleteAudioClip' => 'Delete an existing Audio clip.',
|
||||||
'updateAudioClipMetadata' => 'Update the metadata of an Audio clip stored in Local storage.',
|
'updateAudioClipMetadata' => 'Update the metadata of an Audio clip '.
|
||||||
'searchMetadata' => 'Search through the metadata of stored AudioClips, and return all matching clip ids.',
|
'stored in Local storage.',
|
||||||
'accessRawAudioData' => 'Get access to raw audio data of an AudioClip.',
|
'searchMetadata' => 'Search through the metadata of stored '.
|
||||||
'releaseRawAudioData' => 'Release access for raw audio data.',
|
'AudioClips, return all matching clip ids.',
|
||||||
|
'accessRawAudioData' => 'Get access to raw audio data.',
|
||||||
|
'releaseRawAudioData' => 'Release access to raw audio data.',
|
||||||
'getAudioClip' => 'Return the contents of an Audio clip.'
|
'getAudioClip' => 'Return the contents of an Audio clip.'
|
||||||
);
|
);
|
||||||
|
|
||||||
$defs = array();
|
$defs = array();
|
||||||
foreach($methods as $method=>$description){
|
foreach($methods as $method=>$description){
|
||||||
$defs["locstor.$method"] = array(
|
$defs["locstor.$method"] = array(
|
||||||
"function" => array(&$locStor, "xr_$method"),
|
"function" => array(&$locStor, "xr_$method"),
|
||||||
"signature" => array(array($xmlrpcStruct, $xmlrpcStruct)),
|
"signature" => array(array($xmlrpcStruct, $xmlrpcStruct)),
|
||||||
"docstring" => $description
|
"docstring" => $description
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$s=new xmlrpc_server( $defs );
|
$s=new xmlrpc_server( $defs );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue