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
|
||||
#
|
||||
# This file is part of the LiveSupport project.
|
||||
|
@ -20,7 +20,7 @@
|
|||
#
|
||||
#
|
||||
# Author : $Author: tomas $
|
||||
# Version : $Revision: 1.2 $
|
||||
# Version : $Revision: 1.3 $
|
||||
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/Attic/Makefile,v $
|
||||
#
|
||||
# @configure_input@
|
||||
|
@ -63,6 +63,7 @@ USR_LIB_DIR = ${USR_DIR}/lib
|
|||
DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config
|
||||
|
||||
HTTP_GROUP = apache
|
||||
#HTTP_GROUP = nobody
|
||||
|
||||
PHP_DIR = ${BASE_DIR}/var
|
||||
INSTALL_DIR = ${PHP_DIR}/install
|
||||
|
@ -90,7 +91,8 @@ TEST_RUNNER = ${PHP_DIR}/xmlrpc/testRunner.sh
|
|||
#-------------------------------------------------------------------------------
|
||||
# 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
|
||||
|
||||
|
@ -117,6 +119,10 @@ check: all ${TEST_RUNNER}
|
|||
#-------------------------------------------------------------------------------
|
||||
# Specific targets
|
||||
#-------------------------------------------------------------------------------
|
||||
transtest:
|
||||
@echo "Transfer module test (needs ArchiveServer installed):"
|
||||
cd var/tests; php -q transTest.php
|
||||
|
||||
db_init:
|
||||
cd var/install; php -q install.php
|
||||
|
||||
|
@ -130,6 +136,8 @@ ${DOXYGEN_DIR}:
|
|||
${MKDIR} ${DOXYGEN_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}
|
||||
chown .${HTTP_GROUP} ${STOR_DIR}
|
||||
chmod g+ws ${STOR_DIR}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#
|
||||
#
|
||||
# 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 $
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
|||
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
|
||||
# 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.
|
||||
# This could be handy for archiving the generated documentation or
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?
|
||||
<?php
|
||||
/*------------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2004 Media Development Loan Fund
|
||||
|
@ -23,7 +23,7 @@
|
|||
|
||||
|
||||
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 $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -38,8 +38,8 @@ define('GBERR_NOTF', 47);
|
|||
|
||||
define('GBERR_NOTIMPL', 50);
|
||||
|
||||
require_once '../../../alib/var/alib.php';
|
||||
require_once '../StoredFile.php';
|
||||
require_once "../../../alib/var/alib.php";
|
||||
require_once "StoredFile.php";
|
||||
|
||||
/**
|
||||
* GreenBox class
|
||||
|
@ -47,7 +47,7 @@ require_once '../StoredFile.php';
|
|||
* LiveSupport file storage module
|
||||
*
|
||||
* @author $Author: tomas $
|
||||
* @version $Revision: 1.2 $
|
||||
* @version $Revision: 1.3 $
|
||||
* @see Alib
|
||||
*/
|
||||
class GreenBox extends Alib{
|
||||
|
@ -800,7 +800,7 @@ class GreenBox extends Alib{
|
|||
*/
|
||||
function testData($d='')
|
||||
{
|
||||
$exdir = dirname(getcwd()).'/tests';
|
||||
$exdir = '../../../storageServer/var/tests';
|
||||
$s = $this->sessid;
|
||||
$o[] = $this->addSubj('test1', 'a');
|
||||
$o[] = $this->addSubj('test2', 'a');
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?
|
||||
<?php
|
||||
/*------------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2004 Media Development Loan Fund
|
||||
|
@ -23,12 +23,12 @@
|
|||
|
||||
|
||||
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 $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
require_once '../GreenBox.php';
|
||||
require_once "GreenBox.php";
|
||||
|
||||
/**
|
||||
* LocStor class
|
||||
|
@ -100,7 +100,7 @@ class LocStor extends GreenBox{
|
|||
$oid = $this->addObj($tmpid , 'File', $parid);
|
||||
if(PEAR::isError($oid)) return $oid;
|
||||
$ac =& StoredFile::insert(
|
||||
&$this, $oid, '', $mediaFileLP, $mdataFileLP
|
||||
&$this, $oid, '', $mediaFileLP, $mdataFileLP, $gunid
|
||||
);
|
||||
if(PEAR::isError($ac)) return $ac;
|
||||
$res = $this->renameFile($oid, $ac->gunid, $sessid);
|
||||
|
|
|
@ -23,13 +23,13 @@
|
|||
|
||||
|
||||
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 $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
require_once '../RawMediaData.php';
|
||||
require_once '../MetaData.php';
|
||||
require_once '../../../getid3/var/getid3.php';
|
||||
require_once "RawMediaData.php";
|
||||
require_once "MetaData.php";
|
||||
require_once "../../../getid3/var/getid3.php";
|
||||
|
||||
/**
|
||||
* StoredFile class
|
||||
|
@ -77,11 +77,12 @@ class StoredFile{
|
|||
* @param name string, name of new file
|
||||
* @param mediaFileLP string, local path to media 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
|
||||
*/
|
||||
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->id = $oid;
|
||||
$ac->type = "unKnown";
|
||||
|
@ -136,7 +137,9 @@ class StoredFile{
|
|||
if(PEAR::isError($row)) return $row;
|
||||
if(is_null($row)){
|
||||
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->type = $row['type'];
|
||||
|
@ -157,7 +160,7 @@ class StoredFile{
|
|||
WHERE tmpLink='$tmpLink' AND sessid='$sessid'");
|
||||
if(PEAR::isError($gunid)) return $gunid;
|
||||
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);
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?
|
||||
<?php
|
||||
/*------------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2004 Media Development Loan Fund
|
||||
|
@ -23,7 +23,7 @@
|
|||
|
||||
|
||||
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 $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -36,8 +36,8 @@ $config = array(
|
|||
'phptype' => 'pgsql',
|
||||
'database' => 'LiveSupport-test',
|
||||
),
|
||||
'tblNamePrefix' => 'gb_',
|
||||
'authCookieName'=> 'gbsid',
|
||||
'tblNamePrefix' => 'ls_',
|
||||
'authCookieName'=> 'lssid',
|
||||
'RootNode' => 'RootNode',
|
||||
'tmpRootPass' => 'q',
|
||||
'objtypes' => array(
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?
|
||||
<?php
|
||||
#echo"<pre>\n"; print_r($_FILES); print_r($_REQUEST); print_r($_SERVER); exit;
|
||||
require_once"gbHtml_h.php";
|
||||
require_once"gbHtmlTestAuth.php";
|
||||
|
@ -115,7 +115,7 @@ $tpldata['showMenu']=true;
|
|||
function newFolder(){
|
||||
var nn=prompt('New folder name:');
|
||||
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>
|
||||
|
@ -123,117 +123,117 @@ $tpldata['showMenu']=true;
|
|||
<div id="rmenu">
|
||||
Logged as: <span class="b"><?php echo$tpldata['loggedAs']?></span><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>
|
||||
</div>
|
||||
|
||||
<?if($tpldata['showMenu']){?>
|
||||
<?php if($tpldata['showMenu']){?>
|
||||
<h3>
|
||||
<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="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>
|
||||
<?}?>
|
||||
<?php }?>
|
||||
|
||||
<?if($tpldata['showPath']){?>
|
||||
<?php if($tpldata['showPath']){?>
|
||||
<h3>
|
||||
<a href="gbHtmlBrowse.php?id=<?=$tpldata['id']?>&tree=Y" class="button">Tree</a>
|
||||
<?foreach($tpldata['pathdata'] as $o){?>
|
||||
<a href="gbHtmlBrowse.php?id=<?=urlencode($o['id'])?>"><?=$o['name']?></a>
|
||||
<?if($o['type']=='Folder'){?><span class="slash b">/</span><?}?>
|
||||
<?}?>:
|
||||
<a href="gbHtmlBrowse.php?id=<?php echo$tpldata['id']?>&tree=Y" class="button">Tree</a>
|
||||
<?php foreach($tpldata['pathdata'] as $o){?>
|
||||
<a href="gbHtmlBrowse.php?id=<?php echo urlencode($o['id'])?>"><?php echo$o['name']?></a>
|
||||
<?php if($o['type']=='Folder'){?><span class="slash b">/</span><?php }?>
|
||||
<?php }?>:
|
||||
<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>
|
||||
</h3>
|
||||
<?}?>
|
||||
<?php }?>
|
||||
|
||||
<?if($tpldata['showTree']) if($tpldata['tree']){?>
|
||||
<?foreach($tpldata['treedata'] as $o){?>
|
||||
<?=str_repeat(' ', ($tpldata['tree']?intval($o['level']):3)*2)?>
|
||||
<a href="gbHtmlBrowse.php?id=<?=$o['id']?>"><?=$o['name']?></a>
|
||||
<?php if($tpldata['showTree']) if($tpldata['tree']){?>
|
||||
<?php foreach($tpldata['treedata'] as $o){?>
|
||||
<?php echo str_repeat(' ', ($tpldata['tree']?intval($o['level']):3)*2)?>
|
||||
<a href="gbHtmlBrowse.php?id=<?php echo$o['id']?>"><?php echo$o['name']?></a>
|
||||
<br>
|
||||
<?}?>
|
||||
<?}else{?>
|
||||
<?php }?>
|
||||
<?php }else{?>
|
||||
<table border="0">
|
||||
<?foreach($tpldata['listdata'] as $o){?>
|
||||
<?php foreach($tpldata['listdata'] as $o){?>
|
||||
<tr><td valign="top">
|
||||
<?=str_repeat(' ', ($tpldata['tree']?intval($o['level']):3)*2)?><span id="ID<?=$o['id']?>"
|
||||
><a <?if($o['type']=='Folder'){?>href="gbHtmlBrowse.php?id=<?=$o['id']?>"<?}?>><?=$o['name']?></a
|
||||
<?php echo str_repeat(' ', ($tpldata['tree']?intval($o['level']):3)*2)?><span id="ID<?php echo$o['id']?>"
|
||||
><a <?php if($o['type']=='Folder'){?>href="gbHtmlBrowse.php?id=<?php echo$o['id']?>"<?php }?>><?php echo$o['name']?></a
|
||||
></span>
|
||||
</td><td>
|
||||
<?$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:fmove('<?=$o['id']?>', '.')" class="button">move</a>
|
||||
<a href="javascript:fcopy('<?=$o['id']?>', '.')" class="button">copy</a>
|
||||
<?/*?>
|
||||
<a href="javascript:freplicate('<?=$o['name']?>', '<?=$o['id']?>')" class="button">replicate</a>
|
||||
<?*/?>
|
||||
<a href="gbHtmlPerms.php?id=<?=$o['id']?>" class="button">permissions</a>
|
||||
<a href="gbHttp.php?act=delete&id=<?=$o['id']?>" class="button"
|
||||
onClick="return confirm('Delete object "<?=$o['name']?>"?')">DEL</a>
|
||||
<?if($o['type']=='File'){?>
|
||||
<a href="gbHttp.php?act=getFile&id=<?=$o['id']?>" class="button">Access</a>
|
||||
<a href="gbHttp.php?act=getInfo&id=<?=$o['id']?>" class="button">Analyze</a>
|
||||
<a href="gbHttp.php?act=getMdata&id=<?=$o['id']?>" class="button">MetaData</a>
|
||||
<?}?>
|
||||
<?if($o['type']=='Replica'){?>
|
||||
(-><?=$o['target']?>)
|
||||
<?}?>
|
||||
<?php $a=array('Folder'=>'D', 'File'=>'F', 'Replica'=>'R'); echo$a[$o['type']]?>
|
||||
<a href="javascript:frename('<?php echo$o['name']?>', '<?php echo$o['id']?>')" class="button">rename</a>
|
||||
<a href="javascript:fmove('<?php echo$o['id']?>', '.')" class="button">move</a>
|
||||
<a href="javascript:fcopy('<?php echo$o['id']?>', '.')" class="button">copy</a>
|
||||
<?php /*?>
|
||||
<a href="javascript:freplicate('<?php echo$o['name']?>', '<?php echo$o['id']?>')" class="button">replicate</a>
|
||||
<?php */?>
|
||||
<a href="gbHtmlPerms.php?id=<?php echo$o['id']?>" class="button">permissions</a>
|
||||
<a href="gbHttp.php?act=delete&id=<?php echo$o['id']?>" class="button"
|
||||
onClick="return confirm('Delete object "<?php echo$o['name']?>"?')">DEL</a>
|
||||
<?php if($o['type']=='File'){?>
|
||||
<a href="gbHttp.php?act=getFile&id=<?php echo$o['id']?>" class="button">Access</a>
|
||||
<a href="gbHttp.php?act=getInfo&id=<?php echo$o['id']?>" class="button">Analyze</a>
|
||||
<a href="gbHttp.php?act=getMdata&id=<?php echo$o['id']?>" class="button">MetaData</a>
|
||||
<?php }?>
|
||||
<?php if($o['type']=='Replica'){?>
|
||||
(-><?php echo$o['target']?>)
|
||||
<?php }?>
|
||||
</td>
|
||||
</tr>
|
||||
<?} if(count($tpldata['listdata'])==0){?>
|
||||
<?php } if(count($tpldata['listdata'])==0){?>
|
||||
<tr><td>No objects</td></tr>
|
||||
<?}?>
|
||||
<?php }?>
|
||||
</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="http://localhost:8000">?>
|
||||
<?php #<form method="post" enctype="multipart/form-data" action="http://localhost:8000">?>
|
||||
<table>
|
||||
<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>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>
|
||||
<select name="elnames[<?=$i?>]">
|
||||
<?$ii=0?>
|
||||
<?foreach($fldsname as $fld=>$descr){?>
|
||||
<option value="<?=$fld?>"<?=($i==$ii++ ? ' selected' : '')?>><?=$descr?></option>
|
||||
<?}?>
|
||||
<select name="elnames[<?php echo$i?>]">
|
||||
<?php $ii=0?>
|
||||
<?php foreach($fldsname as $fld=>$descr){?>
|
||||
<option value="<?php echo$fld?>"<?php echo($i==$ii++ ? ' selected' : '')?>><?php echo$descr?></option>
|
||||
<?php }?>
|
||||
</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>
|
||||
</table>
|
||||
<input type="hidden" name="MAX_FILE_SIZE" value="1048576">
|
||||
<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>
|
||||
<?}?>
|
||||
<?php }?>
|
||||
|
||||
<?if($tpldata['showSForm']){?>
|
||||
<?php if($tpldata['showSForm']){?>
|
||||
<form method="post" action="gbHtmlBrowse.php">
|
||||
<table>
|
||||
<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>
|
||||
</table>
|
||||
<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>
|
||||
<?}?>
|
||||
<?php }?>
|
||||
|
||||
<?if($tpldata['showSRes']){?>
|
||||
<?php if($tpldata['showSRes']){?>
|
||||
<ul>
|
||||
<? 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>
|
||||
<? }else{?>
|
||||
<?php if(is_array($tpldata['search'])) foreach($tpldata['search'] as $k=>$v){?>
|
||||
<li><a href="gbHttp.php?act=getMdata&id=<?php echo$gb->_idFromGunid($v['gunid'])?>"><?php echo$v['gunid']?></a>
|
||||
<?php }else{?>
|
||||
No items found
|
||||
<? }?>
|
||||
<?php }?>
|
||||
</ul>
|
||||
<?}?>
|
||||
<?php }?>
|
||||
|
||||
<?php if($tpldata['msg']){?>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?
|
||||
// $Id: gbHtmlLogin.php,v 1.1 2004/09/12 21:59:08 tomas Exp $
|
||||
<?php
|
||||
// $Id: gbHtmlLogin.php,v 1.2 2004/09/21 00:27:41 tomas Exp $
|
||||
require_once"gbHtml_h.php";
|
||||
|
||||
// prefill data structure for template
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?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"gbHtmlTestAuth.php";
|
||||
|
||||
|
@ -52,7 +52,7 @@ $tpldata['msg'] = $_SESSION['alertMsg']; unset($_SESSION['alertMsg']);
|
|||
|
||||
<h1>Permission editor</h1>
|
||||
<?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 echo$it["name"]?></a><span class="slash">/</span>
|
||||
<?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) {
|
||||
$da=($row['type']=='A' ? 'allow' : ($row['type']=='D' ? '<b>deny</b>' : $row['type']));?>
|
||||
<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><?php echo$da?></td>
|
||||
<td>
|
||||
<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>
|
||||
</tr>
|
||||
<?php }else{?>
|
||||
|
@ -88,13 +88,13 @@ for action
|
|||
<option value="_all">all</option>
|
||||
<?php if(is_array($tpldata['actions'])) foreach($tpldata['actions'] as $k=>$it) {?>
|
||||
<option value="<?php echo$it?>"><?php echo$it?></option>
|
||||
<?}?>
|
||||
<?php }?>
|
||||
</select>
|
||||
to subject
|
||||
<select name="subj">
|
||||
<?php if(is_array($tpldata['subjects'])) foreach($tpldata['subjects'] as $k=>$it) {?>
|
||||
<option value="<?php echo$it['id']?>"><?php echo$it['login']?></option>
|
||||
<?}?>
|
||||
<?php }?>
|
||||
</select>
|
||||
<input type="hidden" name="act" value="addPerm">
|
||||
<input type="hidden" name="id" value="<?php echo$tpldata['id']?>">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?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"gbHtmlTestAuth.php";
|
||||
|
||||
|
@ -70,12 +70,12 @@ $d['msg'] = $_SESSION['alertMsg']; unset($_SESSION['alertMsg']);
|
|||
<tr class="<?php echo(($o=1-$o) ? 'odd' : 'ev')?>">
|
||||
<td><?php echo$c['id']?></td>
|
||||
<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>
|
||||
<?}else{?><?php echo$c['login']?>
|
||||
<?}?>
|
||||
<?php }else{?><?php echo$c['login']?>
|
||||
<?php }?>
|
||||
</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>
|
||||
<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>
|
||||
|
@ -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')?>">
|
||||
<td><?php echo$row['id']?></td>
|
||||
<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>
|
||||
<?}else{?><?php echo$row['login']?>
|
||||
<?}?>
|
||||
<?php }else{?><?php echo$row['login']?>
|
||||
<?php }?>
|
||||
</td
|
||||
<td><?if($row['type']=='G'){?> (G)<?}else{?> (U)<?}?></td>
|
||||
<td><?php if($row['type']=='G'){?> (G)<?php }else{?> (U)<?php }?></td>
|
||||
<td>
|
||||
<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']?>">
|
||||
|
@ -130,7 +130,7 @@ Add subject
|
|||
<select name="login">
|
||||
<?php if(is_array($d['subj'])) foreach($d['subj'] as $k=>$row) {?>
|
||||
<option value="<?php echo$row['login']?>"><?php echo$row['login']?></option>
|
||||
<?}?>
|
||||
<?php }?>
|
||||
</select>
|
||||
to group <?php echo$d['gname']?>
|
||||
<input type="hidden" name="act" value="addSubj2Gr">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?
|
||||
// $Id: gbHtmlTestAuth.php,v 1.1 2004/09/12 21:59:11 tomas Exp $
|
||||
<?php
|
||||
// $Id: gbHtmlTestAuth.php,v 1.2 2004/09/21 00:27:41 tomas Exp $
|
||||
$login = $gb->getSessLogin($_REQUEST[$config['authCookieName']]);
|
||||
if(!isset($login)||$login==''){
|
||||
$_SESSION['alertMsg'] = "Login required";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?
|
||||
<?php
|
||||
$gb->initDb();
|
||||
$gb->init();
|
||||
#system("rm -f {$config['storageDir']}/*.bin {$config['storageDir']}/*.xml");
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?
|
||||
<?php
|
||||
session_start();
|
||||
require_once '../conf.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_CALLBACK, 'errCallBack');
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?
|
||||
<?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;
|
||||
#echo"<pre>\n"; print_r($_SERVER); exit;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
|
||||
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 $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -32,9 +32,9 @@ exit;
|
|||
/*
|
||||
?>
|
||||
<html><head>
|
||||
<title>Storage module</title>
|
||||
<title>StorageServer module</title>
|
||||
</head><body>
|
||||
<h3>Storage module</h3>
|
||||
<h3>StorageServer module</h3>
|
||||
<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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?
|
||||
<?php
|
||||
/*------------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2004 Media Development Loan Fund
|
||||
|
@ -23,7 +23,7 @@
|
|||
|
||||
|
||||
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 $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -87,5 +87,10 @@ else{
|
|||
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();
|
||||
?>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?
|
||||
<?php
|
||||
/*------------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2004 Media Development Loan Fund
|
||||
|
@ -23,7 +23,7 @@
|
|||
|
||||
|
||||
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 $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -54,8 +54,13 @@ $dbc->setFetchMode(DB_FETCHMODE_ASSOC);
|
|||
$gb = &new GreenBox(&$dbc, $config);
|
||||
|
||||
# $dbc->setErrorHandling(PEAR_ERROR_RETURN);
|
||||
echo "Trying to uninstall all ...\n";
|
||||
echo "Trying to uninstall storageServer ...\n";
|
||||
$gb->uninstall();
|
||||
|
||||
echo "Uninstall Tranport submodule ...\n";
|
||||
require_once "../Transport.php";
|
||||
$tr =& new Transport(&$dbc, $config);
|
||||
$r = $tr->uninstall();
|
||||
|
||||
$dbc->disconnect();
|
||||
?>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/php -q
|
||||
<?
|
||||
<?php
|
||||
header("Content-type: text/plain");
|
||||
echo "TEST\n";
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#
|
||||
#
|
||||
# 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 $
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
|
@ -31,7 +31,6 @@ COMM=$1
|
|||
shift
|
||||
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
|
||||
echo "XMLRPC server URL (check it in troubles):"
|
||||
echo $XMLRPC
|
||||
|
@ -71,7 +70,7 @@ storeAudioClip() {
|
|||
echo "storeAudioClip:"
|
||||
MEDIA=../tests/ex1.mp3
|
||||
METADATA=../tests/testStorage.xml
|
||||
RGUNID=`$XR_CLI storeAudioClip "$SESSID" 'X' "$MEDIA" "$METADATA"`
|
||||
RGUNID=`$XR_CLI storeAudioClip "$SESSID" '' "$MEDIA" "$METADATA"`
|
||||
echo $RGUNID
|
||||
}
|
||||
|
||||
|
|
|
@ -1,33 +1,59 @@
|
|||
<?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 "xmlrpcs.inc";
|
||||
require_once '../conf.php';
|
||||
require_once 'DB.php';
|
||||
require_once '../GreenBox.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_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->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
|
||||
function v2xr($var, $struct=true){
|
||||
|
||||
class XR_LocStor extends LocStor{
|
||||
|
||||
/**
|
||||
* Convert PHP variables to XMLRPC objects
|
||||
*
|
||||
* @param var mixed - PHP variable
|
||||
* @param struct boolean - flag for using XMLRPC struct instead of array
|
||||
* @return XMLRPC object
|
||||
*/
|
||||
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);
|
||||
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");
|
||||
|
@ -36,9 +62,12 @@ function v2xr($var, $struct=true){
|
|||
}else{
|
||||
return new xmlrpcval($var, "string");
|
||||
}
|
||||
}
|
||||
|
||||
class XR_LocStor extends LocStor{
|
||||
}
|
||||
/**
|
||||
* Convert XMLRPC struct to PHP array
|
||||
*
|
||||
* @param input XMLRPC struct
|
||||
*/
|
||||
function _xr_getPars($input)
|
||||
{
|
||||
$p = $input->getParam(0);
|
||||
|
@ -47,18 +76,33 @@ class XR_LocStor extends LocStor{
|
|||
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."));
|
||||
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(v2xr(array(
|
||||
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);
|
||||
|
@ -66,106 +110,218 @@ class XR_LocStor extends LocStor{
|
|||
$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.");
|
||||
return new xmlrpcresp(0, 802,
|
||||
"xr_login: login failed - incorrect username or password."
|
||||
);
|
||||
else
|
||||
return new xmlrpcresp(v2xr($res, false));
|
||||
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(v2xr('Bye', false));
|
||||
else return new xmlrpcresp(0, 803, "xr_logout: logout failed - not logged.");
|
||||
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));
|
||||
#$this->debugLog(join(', ', $r));
|
||||
$res = $this->existsAudioClip($r['sessid'], $r['gunid']);
|
||||
# $this->debugLog($res);
|
||||
#$this->debugLog($res);
|
||||
if(PEAR::isError($res))
|
||||
return new xmlrpcresp(0, 803, "xr_existsAudioClip: ".$res->getMessage()." ".$res->getUserInfo());
|
||||
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());
|
||||
$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());
|
||||
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());
|
||||
$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());
|
||||
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());
|
||||
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());
|
||||
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());
|
||||
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);
|
||||
|
||||
$methods = array(
|
||||
'test' => 'Tests toupper and checks sessid, params: teststring, sessid.',
|
||||
'test' => 'Tests toupper and checks sessid, params: '.
|
||||
'teststring, sessid.',
|
||||
'authenticate' => 'Checks authentication.',
|
||||
'login' => 'Login to storage.',
|
||||
'logout' => 'Logout from storage.',
|
||||
'existsAudioClip' => 'Checks if an Audio clip with the specified id is stored in local storage.',
|
||||
'storeAudioClip' => 'Store a new audio clip or replace an existing one.',
|
||||
'existsAudioClip' => 'Checks if an Audio clip with the specified '.
|
||||
'id is stored in local storage.',
|
||||
'storeAudioClip' => 'Store a new audio clip or replace '.
|
||||
'an existing one.',
|
||||
'deleteAudioClip' => 'Delete an existing Audio clip.',
|
||||
'updateAudioClipMetadata' => 'Update the metadata of an Audio clip stored in Local storage.',
|
||||
'searchMetadata' => 'Search through the metadata of stored AudioClips, and return all matching clip ids.',
|
||||
'accessRawAudioData' => 'Get access to raw audio data of an AudioClip.',
|
||||
'releaseRawAudioData' => 'Release access for raw audio data.',
|
||||
'updateAudioClipMetadata' => 'Update the metadata of an Audio clip '.
|
||||
'stored in Local storage.',
|
||||
'searchMetadata' => 'Search through the metadata of stored '.
|
||||
'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.'
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue