obsolete example directory
This commit is contained in:
parent
71f930feef
commit
89e9be4041
|
@ -1,19 +0,0 @@
|
|||
<!--
|
||||
/*body { font-family:'Arial CE', 'Helvetica CE', Arial, helvetica, sans-serif; background-color:#eee; }*/
|
||||
body { font-family:sans-serif; background-color:#eee; }
|
||||
h1 { border:0px solid black; margin-bottom:2px; font-size:x-large; }
|
||||
h2 { border:0px solid black; margin-bottom:2px; margin-top:2px; font-size:large; }
|
||||
h3 { border:0px solid black; margin-bottom:1ex; margin-top:2px; font-size:medium; font-weight:bold; }
|
||||
table { border-collapse:collapse; margin:1ex 0px; }
|
||||
tr.odd { background-color:#ccc; }
|
||||
tr.ev { background-color:#aaa; }
|
||||
td { border:0px solid black; padding:2px 1em; }
|
||||
pre { border:solid black; border-width:1px 0px; padding:1em 1px;}
|
||||
.b { font-weight:bold; }
|
||||
.slash { padding:0px 0px; }
|
||||
.lnkbutt { padding:0px 4px; font-weigt:bolder; }
|
||||
.hidden { display:none; }
|
||||
.button { border:1px outset; background-color:#eee; padding:0px 4px; }
|
||||
.button:hover { background-color:#fff; }
|
||||
.button:active { border:1px inset; }
|
||||
-->
|
|
@ -1,258 +0,0 @@
|
|||
<?php
|
||||
#echo"<pre>\n"; print_r($_FILES); print_r($_REQUEST); print_r($_SERVER); exit;
|
||||
require_once"gbHtml_h.php";
|
||||
require_once"gbHtmlTestAuth.php";
|
||||
|
||||
$fldsname=array('author'=>'Author', 'title'=>'Title', 'creator'=>'Creator',
|
||||
'description'=>'Description', 'subject'=>'Subject', 'genre'=>'Genre');
|
||||
|
||||
$sessid = $_REQUEST[$config['authCookieName']];
|
||||
$userid = $gb->getSessUserId($sessid);
|
||||
$login = $gb->getSessLogin($sessid);
|
||||
|
||||
#$path = ($_REQUEST['path']=='' ? '/' : $_REQUEST['path']);
|
||||
$id = (!$_REQUEST['id'] ? $gb->storId : $_REQUEST['id']);
|
||||
|
||||
#echo"<pre>\nsessid=$sessid\nuserid=$userid\nlogin=$login\n"; exit;
|
||||
|
||||
$tpldata = array(
|
||||
'msg' => $_SESSION['alertMsg'],
|
||||
'loggedAs' => $login,
|
||||
'id' => $id,
|
||||
); unset($_SESSION['alertMsg']);
|
||||
|
||||
switch($_REQUEST['act']){
|
||||
case"getHomeDir":
|
||||
$id = $gb->getObjId($login, $gb->storId);
|
||||
$tpldata['id'] = $id;
|
||||
default:
|
||||
# echo"<pre>\n$path\n$upath<hr>\n"; print_r($_FILES); print_r($_REQUEST); exit;
|
||||
$tpldata=array_merge($tpldata, array(
|
||||
'pathdata' => $gb->getPath($id, $sessid),
|
||||
'listdata' => ($gb->getFileType($id)=='Folder'?
|
||||
$gb->listFolder($id, $sessid):array()
|
||||
),
|
||||
'tree' => ($_REQUEST['tree']=='Y'),
|
||||
'showPath' => true,
|
||||
'showTree' => true,
|
||||
));
|
||||
if($_REQUEST['tree']=='Y'){
|
||||
$tpldata['treedata'] = $gb->getSubTree($id, $sessid);
|
||||
}
|
||||
break;
|
||||
case"newfile":
|
||||
$tpldata=array(
|
||||
'pathdata' => $gb->getPath($id, $sessid),
|
||||
'showEdit' => true,
|
||||
'id' => $id,
|
||||
);
|
||||
break;
|
||||
case"sform":
|
||||
$tpldata=array(
|
||||
# 'pathdata' => $gb->getPath($path, $sessid),
|
||||
'showSForm' => true,
|
||||
'id' => $id,
|
||||
);
|
||||
break;
|
||||
case"search":
|
||||
$tpldata=array(
|
||||
# 'pathdata' => $gb->getPath($path, $sessid),
|
||||
'search' => $gb->localSearch($_REQUEST['srch'], $sessid),
|
||||
'showSRes' => true,
|
||||
'id' => $id,
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
if(PEAR::isError($tpldata['listdata'])){
|
||||
$tpldata['msg'] = $tpldata['listdata']->getMessage();
|
||||
$tpldata['listdata'] = array();
|
||||
}
|
||||
#echo"<pre>\n$path<hr>\n"; print_r($tpldata['pathdata']); print_r($tpldata); exit;
|
||||
|
||||
$tpldata['showMenu']=true;
|
||||
|
||||
|
||||
// =================== template: ===================
|
||||
|
||||
?>
|
||||
<html><head>
|
||||
<title>Storage - browser</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="default.css">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
#rmenu { float:right; margin-right:1em; border:1px solid black; background-color:#ddd; padding:2px 1ex; }
|
||||
#parent, #parent a { background-color:#888; font-weight:bold; color:white; }
|
||||
#tree { width:50%; }
|
||||
-->
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
function frename(name, id){
|
||||
var s=document.getElementById('ID'+id);
|
||||
s.innerHTML='<form action="gbHttp.php" method="post" style="display:inline">'+
|
||||
'<input type="text" name="newname" value="'+name+'" size="12">'+
|
||||
'<input type="hidden" name="id" value="'+id+'">'+
|
||||
'<input type="hidden" name="act" value="rename">'+
|
||||
'</form>';
|
||||
}
|
||||
function fmove(id, relPath){
|
||||
var newPath=prompt('Destination folder (relative path, e.g. "..", "folderName", "../folderName):', relPath);
|
||||
if(newPath==null || newPath=='') return;
|
||||
location.href='gbHttp.php?id='+id+'&act=move&newPath='+newPath;
|
||||
}
|
||||
function fcopy(id, relPath){
|
||||
var newPath=prompt('Destination folder (relative path, e.g. "..", "folderName", "../folderName):', relPath);
|
||||
if(newPath==null || newPath=='') return;
|
||||
location.href='gbHttp.php?id='+id+'&act=copy&newPath='+newPath;
|
||||
}
|
||||
function freplicate(name, id){
|
||||
var np=prompt('Destination folder (relative path, e.g. "..", "folderName", "../folderName):', id);
|
||||
if(np==null || np=='') return;
|
||||
location.href='gbHttp.php?id='+id+'&act=repl&newparid='+np;
|
||||
}
|
||||
function newFolder(){
|
||||
var nn=prompt('New folder name:');
|
||||
if(nn==null) return;
|
||||
location.href='gbHttp.php?id=<?php echo$tpldata['id']?>&act=newFolder&newname='+nn;
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
</head><body>
|
||||
<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=<?php echo$tpldata['id']?>">Permission editor</a><br>
|
||||
<a href="gbHtmlSubj.php">User/Group editor</a><br>
|
||||
</div>
|
||||
|
||||
<?php if($tpldata['showMenu']){?>
|
||||
<h3>
|
||||
<a href="gbHtmlBrowse.php?act=getHomeDir" class="button">Home directory</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=<?php echo$tpldata['id']?>&act=sform" class="button"><span class="hidden">[</span>Search<span class="hidden">]</span></a>-->
|
||||
</h3>
|
||||
<?php }?>
|
||||
|
||||
<?php if($tpldata['showPath']){?>
|
||||
<h3>
|
||||
<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=<?php echo$id?>" class="button">permissions</a>
|
||||
</span>
|
||||
</h3>
|
||||
<?php }?>
|
||||
|
||||
<?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>
|
||||
<?php }?>
|
||||
<?php }else{?>
|
||||
<table border="0">
|
||||
<tr><th>fname</th><th>gunid</th><th>actions</th></tr>
|
||||
<?php foreach($tpldata['listdata'] as $o){?>
|
||||
<tr><td valign="top">
|
||||
<?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 valign="top">
|
||||
<i><?php echo($o['gunid'] ? "({$o['gunid']})" : '' )?></i>
|
||||
</td><td>
|
||||
<?php $a=array('Folder'=>'D', 'File'=>'F', 'Replica'=>'R', 'audioclip'=>'A', 'playlist'=>'P', 'webstream'=>'S'); echo$a[$o['type']]?>
|
||||
<a href="javascript:frename('<?php echo$o['name']?>', '<?php echo$o['id']?>')" class="button">rename</a>
|
||||
<?#php if($o['type']!='Folder'){?>
|
||||
<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 }?>
|
||||
<?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' || $o['type']=='audioclip'){?>
|
||||
<a href="../xmlrpc/simpleGet.php?sessid=<?php echo$sessid?>&id=<?php echo$o['gunid']?>" class="button">simpleGet</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']=='playlist'){?>
|
||||
<a href="../xmlrpc/simpleGet.php?sessid=<?php echo$sessid?>&id=<?php echo$o['gunid']?>" class="button">simpleGet</a>
|
||||
<a href="gbHttp.php?act=getMdata&id=<?php echo$o['id']?>" class="button">MetaData</a>
|
||||
<?php }?>
|
||||
<?php if($o['type']=='webstream'){?>
|
||||
<a href="../xmlrpc/simpleGet.php?sessid=<?php echo$sessid?>&id=<?php echo$o['gunid']?>" class="button">simpleGet</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>
|
||||
<?php } if(count($tpldata['listdata'])==0){?>
|
||||
<tr><td>No objects</td></tr>
|
||||
<?php }?>
|
||||
</table>
|
||||
<?php }?>
|
||||
|
||||
<?php if($tpldata['showEdit']){?>
|
||||
<form method="post" enctype="multipart/form-data" action="gbHttp.php">
|
||||
<?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>
|
||||
<?php for($i=0; $i<0; $i++){?>
|
||||
<tr><td>
|
||||
<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[<?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="<?php echo$tpldata['id']?>">
|
||||
</form>
|
||||
<?php }?>
|
||||
|
||||
<?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="<?php echo$tpldata['id']?>">
|
||||
</form>
|
||||
<?php }?>
|
||||
|
||||
<?php if($tpldata['showSRes']){?>
|
||||
<ul>
|
||||
<?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">
|
||||
<!--
|
||||
alert('<?php echo str_replace("'", "\\'", $tpldata['msg'])?>');
|
||||
-->
|
||||
</script><noscript><?php echo$tpldata['msg']?></noscript>
|
||||
<?php }?>
|
||||
</body></html>
|
|
@ -1,74 +0,0 @@
|
|||
<?php
|
||||
// $Id: gbHtmlLogin.php,v 1.3 2004/12/09 00:42:42 tomas Exp $
|
||||
require_once"gbHtml_h.php";
|
||||
|
||||
// prefill data structure for template
|
||||
$d = array(
|
||||
'users' => $gb->getSubjects(),
|
||||
'actions' => $gb->getAllActions(),
|
||||
'objects' => $gb->getAllObjects(),
|
||||
'msg' => $_SESSION['alertMsg']
|
||||
);
|
||||
unset($_SESSION['alertMsg']);
|
||||
|
||||
// forms prefill:
|
||||
if(is_array($_SESSION['lastPost'])) $d = array_merge($d, array(
|
||||
'lastSubj' => $_SESSION['lastPost']['subj'],
|
||||
'lastAction'=> $_SESSION['lastPost']['permAction'],
|
||||
'lastObj' => $_SESSION['lastPost']['obj']
|
||||
));
|
||||
unset($_SESSION['lastPost']);
|
||||
|
||||
#header("Content-type: text/plain"); print_r($d); exit;
|
||||
#require_once"gbHtml_f.php";
|
||||
|
||||
// =================== template: ===================
|
||||
?>
|
||||
<html><head>
|
||||
<title>Storage - login</title>
|
||||
<link rel="stylesheet" type="text/css" href="default.css">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
#help { float:right; margin-right:1em; border:1px solid black; background-color:#ddd; padding:2px 1ex; }
|
||||
-->
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
function preloadLogin(u, p)
|
||||
{
|
||||
var f=document.getElementById('loginform');
|
||||
f.login.value=u;
|
||||
f.pass.value=p;
|
||||
f.submit();
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
</head><body>
|
||||
|
||||
<div id="help">
|
||||
Test accounts/pass:
|
||||
<ul style="margin:1px 0px">
|
||||
<li><a href="javascript:preloadLogin('root', 'q')">root/q</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h1>Storage - login</h1>
|
||||
|
||||
<form action="gbHttp.php" method="post" id="loginform">
|
||||
<table>
|
||||
<tr><td>Login:</td><td><input type="text" name="login"></td></tr>
|
||||
<tr><td>Password:</td><td><input type="password" name="pass"></td></tr>
|
||||
<tr><td colspan="2"><input type="hidden" name="act" value="login">
|
||||
<input type="submit" value="Go!">
|
||||
</td></tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<?php if($d['msg']){ //error message printing: ?>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
alert('<?php echo$d['msg']?>');
|
||||
-->
|
||||
</script>
|
||||
<?php }?>
|
||||
<body></html>
|
|
@ -1,112 +0,0 @@
|
|||
<?php
|
||||
// $Id: gbHtmlPerms.php,v 1.3 2004/12/09 00:42:42 tomas Exp $
|
||||
require_once"gbHtml_h.php";
|
||||
require_once"gbHtmlTestAuth.php";
|
||||
|
||||
$userid = $gb->getSessUserId($_REQUEST[$config['authCookieName']]);
|
||||
$login = $gb->getSessLogin($_REQUEST[$config['authCookieName']]);
|
||||
|
||||
$id = (!$_REQUEST['id'] ? $gb->storId : $_REQUEST['id']);
|
||||
|
||||
#header("Content-type: text/plain"); print_r($_REQUEST); exit;
|
||||
#header("Content-type: text/plain"); echo $gb->dumpTree($id, ' ')."\n"; exit;
|
||||
|
||||
// prefill data structure for template
|
||||
$tpldata = array(
|
||||
'pathdata' => $gb->getPath($id),
|
||||
'perms' => $gb->getObjPerms($id),
|
||||
'actions' => $gb->getAllowedActions($gb->getObjType($id)),
|
||||
'subjects' => $gb->getSubjects(),
|
||||
'id' => $id,
|
||||
'loggedAs' => $login,
|
||||
);
|
||||
$tpldata['msg'] = $_SESSION['alertMsg']; unset($_SESSION['alertMsg']);
|
||||
|
||||
#header("Content-type: text/plain"); print_r($tpldata); exit;
|
||||
|
||||
|
||||
#require_once"gbHtml_f.php";
|
||||
|
||||
// =================== template: ===================
|
||||
?>
|
||||
<html><head>
|
||||
<title>Storage - permission editor</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="default.css">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
#menu { float:right; margin-right:1em; border:1px solid black; background-color:#ddd; padding:2px 1ex; }
|
||||
#tbl { width:60%; }
|
||||
-->
|
||||
</style>
|
||||
</head><body>
|
||||
<div id="menu">
|
||||
Logged as: <span class="b"><?php echo$tpldata['loggedAs']?></span><br>
|
||||
<a href="gbHttp.php?act=logout">Logout</a><br>
|
||||
<?php if(is_array($tpldata['pathdata'])){?>
|
||||
<a href="gbHtmlBrowse.php?id=<?php echo$id?>">Browser</a><br>
|
||||
<?php }else{?>
|
||||
<a href="gbHtmlBrowse.php">Tree editor</a><br>
|
||||
<?php }?>
|
||||
<a href="gbHtmlSubj.php">User/Group editor</a><br>
|
||||
</div>
|
||||
|
||||
<h1>Permission editor</h1>
|
||||
<?php if(is_array($tpldata['pathdata'])){?>
|
||||
<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 }?>
|
||||
<?php }?>
|
||||
</h2>
|
||||
|
||||
<table id="tbl" border="0" cellpadding="5">
|
||||
<tr><td>subject name</td><td>action</td><td>permission</td><td></td></tr>
|
||||
<?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 <?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 "<?php echo$da?> <?php echo$row['action']?>" for user <?php echo$row['login']?>?')">remove</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }else{?>
|
||||
<tr class="odd"><td colspan="4">none</td></tr>
|
||||
<?php }?>
|
||||
</table>
|
||||
|
||||
<form action="gbHttp.php" method="post">
|
||||
Add permission
|
||||
<select name="allowDeny">
|
||||
<option value="A">Allow</option>
|
||||
<option value="D">Deny</option>
|
||||
</select>
|
||||
for action
|
||||
<select name="permAction">
|
||||
<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']?>">
|
||||
<input type="submit" value="Do it!">
|
||||
</form>
|
||||
|
||||
<?php if($tpldata['msg']){?>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
alert('<?php echo$tpldata['msg']?>');
|
||||
-->
|
||||
</script><noscript><hr><b><?php echo$tpldata['msg']?></b></hr></noscript>
|
||||
<?php }?>
|
||||
</body></html>
|
|
@ -1,163 +0,0 @@
|
|||
<?php
|
||||
// $Id: gbHtmlSubj.php,v 1.3 2004/12/09 00:42:42 tomas Exp $
|
||||
require_once"gbHtml_h.php";
|
||||
require_once"gbHtmlTestAuth.php";
|
||||
|
||||
switch($_REQUEST['act']){
|
||||
case "passwd":
|
||||
$type='passwd';
|
||||
break;
|
||||
default:
|
||||
if(isset($_GET['id']) && is_numeric($_GET['id'])){
|
||||
$id = $_GET['id']; $type='group';
|
||||
}else $type='list';
|
||||
}
|
||||
|
||||
#header("Content-type: text/plain"); print_r($gb->listGroup($id)); exit;
|
||||
|
||||
// prefill data structure for template
|
||||
switch($type){
|
||||
case "list":
|
||||
$d = array(
|
||||
'subj' => $gb->getSubjectsWCnt(),
|
||||
'loggedAs' => $login
|
||||
);
|
||||
break;
|
||||
case "group":
|
||||
$d = array(
|
||||
'rows' => $gb->listGroup($id),
|
||||
'id' => $id,
|
||||
'loggedAs' => $login,
|
||||
'gname' => $gb->getSubjName($id),
|
||||
'subj' => $gb->getSubjects()
|
||||
);
|
||||
break;
|
||||
case "passwd":
|
||||
break;
|
||||
default:
|
||||
}
|
||||
$d['msg'] = $_SESSION['alertMsg']; unset($_SESSION['alertMsg']);
|
||||
|
||||
#header("Content-type: text/plain"); print_r($d); echo($list ? 'Y' : 'N')."\n"; exit;
|
||||
#require_once"gbHtml_f.php";
|
||||
|
||||
// =================== template: ===================
|
||||
?>
|
||||
<html><head>
|
||||
<title>Storage - user and roles editor</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="default.css">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
#menu { float:right; margin-right:1em; border:1px solid black; background-color:#ddd; padding:2px 1ex; }
|
||||
#parent, #parent a { background-color:#888; font-weight:bold; color:white; }
|
||||
#tree { width:60%; }
|
||||
-->
|
||||
</style>
|
||||
</head><body>
|
||||
<div id="menu">
|
||||
Logged as: <span class="b"><?php echo$d['loggedAs']?></span><br>
|
||||
<a href="gbHttp.php?act=logout">logout</a><br>
|
||||
<a href="gbHtmlBrowse.php?act=getHomeDir">Browser</a><br>
|
||||
</div>
|
||||
|
||||
<h1>User/Group editor</h1>
|
||||
|
||||
<?php switch($type){ case "list":?>
|
||||
<h3>Subjects:</h3>
|
||||
<table id="tree" border="0" cellpadding="5">
|
||||
<tr><td>id</td><td>login</td><td>user/group</td><td></td></tr>
|
||||
<?php if(is_array($d['subj'])&&count($d['subj'])>0) foreach($d['subj'] as $k=>$c) {?>
|
||||
<tr class="<?php echo(($o=1-$o) ? 'odd' : 'ev')?>">
|
||||
<td><?php echo$c['id']?></td>
|
||||
<td class="b">
|
||||
<?php if($c['type']=='G'){?>
|
||||
<a href="gbHtmlSubj.php?id=<?php echo$c['id']?>"><?php echo$c['login']?></a>
|
||||
<?php }else{?><?php echo$c['login']?>
|
||||
<?php }?>
|
||||
</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>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }else{?>
|
||||
<tr class="odd"><td colspan="4">none</td></tr>
|
||||
<?php }?>
|
||||
</table>
|
||||
|
||||
<form action="gbHttp.php" method="post">
|
||||
Add subject with name: <input type="text" name="login" value="" size="10">
|
||||
[and password: <input type="password" name="pass" value="" size="10">]
|
||||
<input type="hidden" name="act" value="addSubj">
|
||||
<input type="submit" value="Do it!">
|
||||
</form>
|
||||
|
||||
<?php break; case "group":?>
|
||||
|
||||
<h2>Subjects in group <?php echo$d['gname']?>:</h2>
|
||||
|
||||
<table id="tree" border="0" cellpadding="5">
|
||||
<tr id="parent">
|
||||
<td colspan="5">
|
||||
<a href="gbHtmlSubj.php">All subjects</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if(is_array($d['rows'])&&count($d['rows'])>0) foreach($d['rows'] as $k=>$row) {?>
|
||||
<tr class="<?php echo(($o=1-$o) ? 'odd' : 'ev')?>">
|
||||
<td><?php echo$row['id']?></td>
|
||||
<td class="b">
|
||||
<?php if($row['type']=='G'){?>
|
||||
<a href="gbHtmlSubj.php?id=<?php echo$row['id']?>"><?php echo$row['login']?></a>
|
||||
<?php }else{?><?php echo$row['login']?>
|
||||
<?php }?>
|
||||
</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']?>">
|
||||
removeFromGroup
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }else{?>
|
||||
<tr class="odd"><td colspan="3">none</td></tr>
|
||||
<?php }?>
|
||||
</table>
|
||||
|
||||
<form action="gbHttp.php" method="post">
|
||||
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">
|
||||
<input type="hidden" name="reid" value="<?php echo$d['id']?>">
|
||||
<input type="hidden" name="gname" value="<?php echo$d['gname']?>">
|
||||
<input type="submit" value="Do it!">
|
||||
</form>
|
||||
|
||||
<?php break; case "passwd":?>
|
||||
<form action="gbHttp.php" method="post">
|
||||
<table>
|
||||
<tr><td>Old password:</td><td><input type="password" name="oldpass" value=""></td></tr>
|
||||
<tr><td>New password:</td><td><input type="password" name="pass" value=""></td></tr>
|
||||
<tr><td>Retype:</td><td><input type="password" name="pass2" value=""></td></tr>
|
||||
<tr><td colspan="2"><input type="submit" value="Submit"></td></tr>
|
||||
</table>
|
||||
<input type="hidden" name="uid" value="<?php echo $_REQUEST['uid']?>">
|
||||
<input type="hidden" name="act" value="passwd">
|
||||
</form>
|
||||
<?php default: }?>
|
||||
|
||||
<?php if($d['msg']){?>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
alert('<?php echo$d['msg']?>');
|
||||
-->
|
||||
</script>
|
||||
<?php }?>
|
||||
</body></html>
|
|
@ -1,9 +0,0 @@
|
|||
<?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";
|
||||
header("Location: gbHtmlLogin.php");
|
||||
exit;
|
||||
}
|
||||
?>
|
|
@ -1,13 +0,0 @@
|
|||
<?php
|
||||
$gb->initDb();
|
||||
$gb->init();
|
||||
#system("rm -f {$config['storageDir']}/*.bin {$config['storageDir']}/*.xml");
|
||||
$d = $gb->testData();
|
||||
$gb->putFile('/folder1/folder1_2/folder1_2_1', 'fileA', "123\n345\n", "<xml/>", 'at');
|
||||
$gb->createReplica('/folder1/folder1_2/folder1_2_1/fileA', '/folder1/folder1_2/folder1_2_1', 'replFA', 'at');
|
||||
$gb->putFile('/folder1/folder1_2/folder1_2_1', 'fileB', "123\n345\n789\n", "<xml/>", 'at');
|
||||
$gb->ovewriteMetadata('/folder1/folder1_2/folder1_2_1/fileA', "<xml>\n</xml>", 'at');
|
||||
|
||||
$gb->deleteFile('/folder1/folder1_2/folder1_2_1/fileB', 'at');
|
||||
|
||||
?>
|
|
@ -1,25 +0,0 @@
|
|||
<?php
|
||||
session_start();
|
||||
require_once '../conf.php';
|
||||
require_once 'DB.php';
|
||||
require_once '../../../storageServer/var/GreenBox.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);
|
||||
$gb = &new GreenBox($dbc, $config);
|
||||
|
||||
?>
|
|
@ -1,394 +0,0 @@
|
|||
<?php
|
||||
/*------------------------------------------------------------------------------
|
||||
|
||||
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.17 $
|
||||
Location : $ $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
require_once"gbHtml_h.php";
|
||||
|
||||
/**
|
||||
* storageServer WWW-form interface
|
||||
*
|
||||
* @author $Author: tomas $
|
||||
* @version $Revision: 1.17 $
|
||||
* @see Alib
|
||||
* @see GreenBox
|
||||
*/
|
||||
|
||||
|
||||
// debugging utilities:
|
||||
#header("Content-type: text/plain"); echo"GET:\n"; print_r($_GET); exit;
|
||||
#header("Content-type: text/plain"); echo"POST:\n"; print_r($_POST); exit;
|
||||
#header("Content-type: text/plain"); echo"REQUEST:\n"; print_r($_REQUEST); exit;
|
||||
#header("Content-type: text/plain"); echo"FILES:\n"; print_r($_FILES); exit;
|
||||
#echo"<pre>$redirUrl\n"; print_r($_REQUEST); exit;
|
||||
|
||||
define('BROWSER', "gbHtmlBrowse.php");
|
||||
|
||||
$sessid = $_REQUEST[$config['authCookieName']];
|
||||
$userid = $gb->getSessUserId($sessid);
|
||||
$login = $gb->getSessLogin($sessid);
|
||||
|
||||
$id = (!$_REQUEST['id'] ? $gb->storId : $_REQUEST['id']);
|
||||
|
||||
$redirUrl="gbHtmlBrowse.php?id=$id";
|
||||
|
||||
switch($_REQUEST['act']){
|
||||
// --- authentication ---
|
||||
/**
|
||||
* login
|
||||
*
|
||||
* Login to the storageServer.
|
||||
* It set sessid to the cookie with name defined in ../conf.php
|
||||
*
|
||||
* @param login string, username
|
||||
* @param pass string, password
|
||||
*/
|
||||
case"login";
|
||||
$sessid = $gb->login($_REQUEST['login'], $_REQUEST['pass']);
|
||||
if($sessid && !$dbc->isError($sessid)){
|
||||
setcookie($config['authCookieName'], $sessid);
|
||||
$redirUrl="gbHtmlBrowse.php";
|
||||
$fid = $gb->getObjId($_REQUEST['login'], $gb->storId);
|
||||
if(!$dbc->isError($fid)) $redirUrl.="?id=$fid";
|
||||
}else{
|
||||
$redirUrl="gbHtmlLogin.php"; $_SESSION['alertMsg']='Login failed.';
|
||||
}
|
||||
break;
|
||||
/**
|
||||
* logout
|
||||
*
|
||||
* Logut from storageServer, takes sessid from cookie
|
||||
*
|
||||
*/
|
||||
case"logout";
|
||||
$gb->logout($sessid);
|
||||
setcookie($config['authCookieName'], '');
|
||||
$redirUrl="gbHtmlLogin.php";
|
||||
break;
|
||||
|
||||
// --- files ---
|
||||
/**
|
||||
* upload
|
||||
*
|
||||
* Provides file upload and store it to the storage
|
||||
*
|
||||
* @param filename string, name for the uploaded file
|
||||
* @param mediafile file uploded by HTTP, raw binary media file
|
||||
* @param mdatafile file uploded by HTTP, metadata XML file
|
||||
* @param id int, destination folder id
|
||||
*/
|
||||
case"upload":
|
||||
$tmpgunid = md5(
|
||||
microtime().$_SERVER['SERVER_ADDR'].rand()."org.mdlf.livesupport"
|
||||
);
|
||||
$ntmp = "{$gb->bufferDir}/$tmpgunid";
|
||||
# $ntmp = tempnam(""{$gb->bufferDir}", 'gbTmp_');
|
||||
$mdtmp = "";
|
||||
move_uploaded_file($_FILES['mediafile']['tmp_name'], $ntmp);
|
||||
chmod($ntmp, 0664);
|
||||
if($_FILES['mdatafile']['tmp_name']){
|
||||
$mdtmp = "$ntmp.xml";
|
||||
if(move_uploaded_file($_FILES['mdatafile']['tmp_name'], $mdtmp)){
|
||||
chmod($mdtmp, 0664);
|
||||
}
|
||||
}
|
||||
$r = $gb->putFile($id, $_REQUEST['filename'], $ntmp, $mdtmp, $sessid);
|
||||
if($dbc->isError($r)) $_SESSION['alertMsg'] = $r->getMessage();
|
||||
else{
|
||||
@unlink($ntmp);
|
||||
@unlink($mdtmp);
|
||||
}
|
||||
$redirUrl = BROWSER."?id=$id";
|
||||
break;
|
||||
/**
|
||||
* newFolder
|
||||
*
|
||||
* Create new folder in the storage
|
||||
*
|
||||
* @param newname string, name for the new folder
|
||||
* @param id int, destination folder id
|
||||
*/
|
||||
case"newFolder":
|
||||
$r = $gb->createFolder($id, $_REQUEST['newname'], $sessid);
|
||||
if($dbc->isError($r)) $_SESSION['alertMsg'] = $r->getMessage();
|
||||
$redirUrl = BROWSER."?id=$id";
|
||||
break;
|
||||
/**
|
||||
* rename
|
||||
*
|
||||
* Change the name of file or folder
|
||||
*
|
||||
* @param newname string, new name for the file or folder
|
||||
* @param id int, destination folder id
|
||||
*/
|
||||
case"rename":
|
||||
$parid = $gb->getParent($id);
|
||||
$r = $gb->renameFile($id, $_REQUEST['newname'], $sessid);
|
||||
if($dbc->isError($r)) $_SESSION['alertMsg'] = $r->getMessage();
|
||||
$redirUrl = BROWSER."?id=$parid";
|
||||
break;
|
||||
/**
|
||||
* move
|
||||
*
|
||||
* Move file to another folder
|
||||
* TODO: format of destinantion path should be properly defined
|
||||
*
|
||||
* @param newPath string, destination relative path
|
||||
* @param id int, destination folder id
|
||||
*/
|
||||
case"move":
|
||||
$newPath = urlencode($_REQUEST['newPath']);
|
||||
$did = $gb->getObjIdFromRelPath($id, $newPath);
|
||||
if($dbc->isError($did)){
|
||||
$_SESSION['alertMsg'] = $did->getMessage();
|
||||
$redirUrl = BROWSER."?id=$parid";
|
||||
break;
|
||||
}
|
||||
$parid = $gb->getParent($id);
|
||||
$r = $gb->moveFile($id, $did, $sessid);
|
||||
if($dbc->isError($r)){
|
||||
$_SESSION['alertMsg'] = $r->getMessage();
|
||||
$redirUrl = BROWSER."?id=$parid";
|
||||
break;
|
||||
}
|
||||
$redirUrl = BROWSER."?id=$did";
|
||||
break;
|
||||
/**
|
||||
* copy
|
||||
*
|
||||
* Copy file to another folder
|
||||
* TODO: format of destinantion path should be properly defined
|
||||
*
|
||||
* @param newPath string, destination relative path
|
||||
* @param id int, destination folder id
|
||||
*/
|
||||
case"copy":
|
||||
$newPath = urldecode($_REQUEST['newPath']);
|
||||
$did = $gb->getObjIdFromRelPath($id, $newPath);
|
||||
$parid = $gb->getParent($id);
|
||||
$r = $gb->copyFile($id, $did, $sessid);
|
||||
if($dbc->isError($r)){
|
||||
$_SESSION['alertMsg'] = $r->getMessage();
|
||||
#$_SESSION['alertMsg'] = $r->getMessage()." ".$r->getUserInfo();
|
||||
$redirUrl = BROWSER."?id=$parid";
|
||||
}
|
||||
else $redirUrl = BROWSER."?id=$did";
|
||||
break;
|
||||
/**
|
||||
* delete
|
||||
*
|
||||
* Delete of stored file
|
||||
*
|
||||
* @param id int, local id of deleted file or folder
|
||||
*/
|
||||
case"delete":
|
||||
$parid = $gb->getParent($id);
|
||||
$r = $gb->deleteFile($id, $sessid);
|
||||
if($dbc->isError($r)) $_SESSION['alertMsg'] = $r->getMessage();
|
||||
$redirUrl = BROWSER."?id=$parid";
|
||||
break;
|
||||
/**
|
||||
* getMdata
|
||||
*
|
||||
* Show file's metadata as XML
|
||||
*
|
||||
* @param id int, local id of stored file
|
||||
*/
|
||||
case"getMdata":
|
||||
header("Content-type: text/xml");
|
||||
$r = $gb->getMdata($id, $sessid);
|
||||
print_r($r);
|
||||
exit;
|
||||
break;
|
||||
/**
|
||||
* getInfo
|
||||
*
|
||||
* Call getid3 library to analyze media file and show some results
|
||||
*
|
||||
* @param
|
||||
* @param
|
||||
*/
|
||||
case"getInfo":
|
||||
header("Content-type: text/plain");
|
||||
$ia = $gb->analyzeFile($id, $sessid);
|
||||
echo"fileformat: {$ia['fileformat']}\n";
|
||||
echo"mime: {$ia['mime_type']}\n";
|
||||
echo"channels: {$ia['audio']['channels']}\n";
|
||||
echo"sample_rate: {$ia['audio']['sample_rate']}\n";
|
||||
echo"playtime_seconds: {$ia['playtime_seconds']}\n";
|
||||
echo"bits_per_sample: {$ia['audio']['bits_per_sample']}\n";
|
||||
echo"channelmode: {$ia['audio']['channelmode']}\n";
|
||||
echo"title: {$ia['id3v1']['title']}\n";
|
||||
echo"artist: {$ia['id3v1']['artist']}\n";
|
||||
echo"comment: {$ia['id3v1']['comment']}\n";
|
||||
exit;
|
||||
break;
|
||||
|
||||
// --- subjs ----
|
||||
/**
|
||||
* addSubj
|
||||
*
|
||||
* Create new user or group (empty pass => create group)
|
||||
*
|
||||
* @param login string, login name from new user
|
||||
* @param pass string, password for new user
|
||||
*/
|
||||
case"addSubj";
|
||||
$redirUrl="gbHtmlSubj.php";
|
||||
if($gb->checkPerm($userid, 'subjects')){
|
||||
$res = $gb->addSubj($_REQUEST['login'],
|
||||
($_REQUEST['pass']=='' ? NULL:$_REQUEST['pass'] ));
|
||||
}else{
|
||||
$_SESSION['alertMsg']='Access denied.';
|
||||
break;
|
||||
}
|
||||
if($dbc->isError($res)) $_SESSION['alertMsg'] = $res->getMessage();
|
||||
break;
|
||||
/**
|
||||
* removeSubj
|
||||
*
|
||||
* Remove existing user or group
|
||||
*
|
||||
* @param login string, login name of removed user
|
||||
*/
|
||||
case"removeSubj";
|
||||
$redirUrl="gbHtmlSubj.php";
|
||||
if($gb->checkPerm($userid, 'subjects')){
|
||||
$res = $gb->removeSubj($_REQUEST['login']);
|
||||
}else{
|
||||
$_SESSION['alertMsg']='Access denied.';
|
||||
break;
|
||||
}
|
||||
if($dbc->isError($res)) $_SESSION['alertMsg'] = $res->getMessage();
|
||||
break;
|
||||
/**
|
||||
* addSubj2
|
||||
*
|
||||
* add subject to group
|
||||
*
|
||||
* @param login string, login name of user added to group
|
||||
* @param gname string, group name
|
||||
*/
|
||||
case"addSubj2Gr";
|
||||
$redirUrl="gbHtmlSubj.php?id={$_REQUEST['reid']}";
|
||||
if($gb->checkPerm($userid, 'subjects')){
|
||||
$res = $gb->addSubj2Gr($_REQUEST['login'], $_REQUEST['gname']);
|
||||
}else{
|
||||
$_SESSION['alertMsg']='Access denied.';
|
||||
break;
|
||||
}
|
||||
if($dbc->isError($res)) $_SESSION['alertMsg'] = $res->getMessage();
|
||||
break;
|
||||
/**
|
||||
* removeSubjFromGr
|
||||
*
|
||||
* remove subject from group
|
||||
*
|
||||
* @param login string, login name of user removed from group
|
||||
* @param gname string, group name
|
||||
*/
|
||||
case"removeSubjFromGr";
|
||||
$redirUrl="gbHtmlSubj.php?id={$_REQUEST['reid']}";
|
||||
if($gb->checkPerm($userid, 'subjects')){
|
||||
$res=$gb->removeSubjFromGr($_REQUEST['login'], $_REQUEST['gname']);
|
||||
}else{
|
||||
$_SESSION['alertMsg']='Access denied.';
|
||||
break;
|
||||
}
|
||||
if($dbc->isError($res)) $_SESSION['alertMsg'] = $res->getMessage();
|
||||
break;
|
||||
/**
|
||||
* passwd
|
||||
*
|
||||
* Change password for specified user
|
||||
*
|
||||
* @param uid int, local user id
|
||||
* @param oldpass string, old user password
|
||||
* @param pass string, new password
|
||||
* @param pass2 string, retype of new password
|
||||
*/
|
||||
case"passwd";
|
||||
$redirUrl="gbHtmlSubj.php";
|
||||
$ulogin = $gb->getSubjName($_REQUEST['uid']);
|
||||
if($userid != $_REQUEST['uid'] &&
|
||||
! $gb->checkPerm($userid, 'subjects')){
|
||||
$_SESSION['alertMsg']='Access denied..';
|
||||
break;
|
||||
}
|
||||
if(FALSE === $gb->authenticate($ulogin, $_REQUEST['oldpass'])){
|
||||
$_SESSION['alertMsg']='Wrong old pasword.';
|
||||
break;
|
||||
}
|
||||
if($_REQUEST['pass'] !== $_REQUEST['pass2']){
|
||||
$_SESSION['alertMsg'] = "Passwords do not match. ".
|
||||
"({$_REQUEST['pass']}/{$_REQUEST['pass2']})";
|
||||
break;
|
||||
}
|
||||
$gb->passwd($ulogin, $_REQUEST['oldpass'], $_REQUEST['pass']);
|
||||
break;
|
||||
|
||||
// --- perms ---
|
||||
/**
|
||||
* addPerm
|
||||
*
|
||||
* Add new permission record
|
||||
*
|
||||
* @param subj int, local user/group id
|
||||
* @param permAction string, type of action from set predefined in conf.php
|
||||
* @param id int, local id of file/object
|
||||
* @param allowDeny char, A or D
|
||||
*/
|
||||
case"addPerm";
|
||||
$redirUrl="gbHtmlPerms.php?id=$id";
|
||||
$res = $gb->addPerm($sessid, $_REQUEST['subj'], $_REQUEST['permAction'],
|
||||
$_REQUEST['id'], $_REQUEST['allowDeny']);
|
||||
if($dbc->isError($res)){
|
||||
$_SESSION['alertMsg'] = $res->getMessage()." (".$res->getCode().")";
|
||||
}
|
||||
break;
|
||||
/**
|
||||
* removePerm
|
||||
*
|
||||
* Remove permission record
|
||||
*
|
||||
* @param permid int, local id of permission record
|
||||
*/
|
||||
case"removePerm";
|
||||
$res = $gb->removePerm($sessid, $_REQUEST['permid']);
|
||||
if($dbc->isError($res)){
|
||||
$_SESSION['alertMsg'] = $res->getMessage()." (".$res->getCode().")";
|
||||
}
|
||||
$redirUrl="gbHtmlPerms.php?id=$id";
|
||||
break;
|
||||
|
||||
default:
|
||||
$_SESSION['alertMsg']="Unknown method: {$_REQUEST['act']}";
|
||||
$redirUrl="gbHtmlLogin.php";
|
||||
}
|
||||
|
||||
header("Location: $redirUrl");
|
||||
?>
|
|
@ -1,33 +0,0 @@
|
|||
<?php
|
||||
/*------------------------------------------------------------------------------
|
||||
|
||||
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/html/Attic/index.php,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
header ("location: gbHtmlLogin.php");
|
||||
exit;
|
||||
?>
|
Loading…
Reference in New Issue