Few comments added
This commit is contained in:
parent
fe6a11cab1
commit
1a14163965
4 changed files with 215 additions and 44 deletions
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: gbHtmlLogin.php,v 1.2 2004/09/21 00:27:41 tomas Exp $
|
// $Id: gbHtmlLogin.php,v 1.3 2004/12/09 00:42:42 tomas Exp $
|
||||||
require_once"gbHtml_h.php";
|
require_once"gbHtml_h.php";
|
||||||
|
|
||||||
// prefill data structure for template
|
// prefill data structure for template
|
||||||
|
@ -21,7 +21,8 @@ unset($_SESSION['lastPost']);
|
||||||
|
|
||||||
#header("Content-type: text/plain"); print_r($d); exit;
|
#header("Content-type: text/plain"); print_r($d); exit;
|
||||||
#require_once"gbHtml_f.php";
|
#require_once"gbHtml_f.php";
|
||||||
// template follows:
|
|
||||||
|
// =================== template: ===================
|
||||||
?>
|
?>
|
||||||
<html><head>
|
<html><head>
|
||||||
<title>Storage - login</title>
|
<title>Storage - login</title>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: gbHtmlPerms.php,v 1.2 2004/09/21 00:27:41 tomas Exp $
|
// $Id: gbHtmlPerms.php,v 1.3 2004/12/09 00:42:42 tomas Exp $
|
||||||
require_once"gbHtml_h.php";
|
require_once"gbHtml_h.php";
|
||||||
require_once"gbHtmlTestAuth.php";
|
require_once"gbHtmlTestAuth.php";
|
||||||
|
|
||||||
|
@ -26,7 +26,8 @@ $tpldata['msg'] = $_SESSION['alertMsg']; unset($_SESSION['alertMsg']);
|
||||||
|
|
||||||
|
|
||||||
#require_once"gbHtml_f.php";
|
#require_once"gbHtml_f.php";
|
||||||
// template follows:
|
|
||||||
|
// =================== template: ===================
|
||||||
?>
|
?>
|
||||||
<html><head>
|
<html><head>
|
||||||
<title>Storage - permission editor</title>
|
<title>Storage - permission editor</title>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: gbHtmlSubj.php,v 1.2 2004/09/21 00:27:41 tomas Exp $
|
// $Id: gbHtmlSubj.php,v 1.3 2004/12/09 00:42:42 tomas Exp $
|
||||||
require_once"gbHtml_h.php";
|
require_once"gbHtml_h.php";
|
||||||
require_once"gbHtmlTestAuth.php";
|
require_once"gbHtmlTestAuth.php";
|
||||||
|
|
||||||
|
@ -40,7 +40,8 @@ $d['msg'] = $_SESSION['alertMsg']; unset($_SESSION['alertMsg']);
|
||||||
|
|
||||||
#header("Content-type: text/plain"); print_r($d); echo($list ? 'Y' : 'N')."\n"; exit;
|
#header("Content-type: text/plain"); print_r($d); echo($list ? 'Y' : 'N')."\n"; exit;
|
||||||
#require_once"gbHtml_f.php";
|
#require_once"gbHtml_f.php";
|
||||||
// template follows:
|
|
||||||
|
// =================== template: ===================
|
||||||
?>
|
?>
|
||||||
<html><head>
|
<html><head>
|
||||||
<title>Storage - user and roles editor</title>
|
<title>Storage - user and roles editor</title>
|
||||||
|
|
|
@ -1,38 +1,89 @@
|
||||||
<?php
|
<?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.5 $
|
||||||
|
Location : $ $
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------*/
|
||||||
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;
|
|
||||||
#echo"<pre>\n"; print_r($_SERVER); exit;
|
/**
|
||||||
|
* storageServer WWW-form interface
|
||||||
|
*
|
||||||
|
* @author $Author: tomas $
|
||||||
|
* @version $Revision: 1.5 $
|
||||||
|
* @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");
|
define('BROWSER', "gbHtmlBrowse.php");
|
||||||
|
|
||||||
|
|
||||||
$sessid = $_REQUEST[$config['authCookieName']];
|
$sessid = $_REQUEST[$config['authCookieName']];
|
||||||
$userid = $gb->getSessUserId($sessid);
|
$userid = $gb->getSessUserId($sessid);
|
||||||
$login = $gb->getSessLogin($sessid);
|
$login = $gb->getSessLogin($sessid);
|
||||||
|
|
||||||
#$path = ($_REQUEST['path']=='' ? '/' : $_REQUEST['path']);
|
|
||||||
#$upath = urlencode($path);
|
|
||||||
#$id = $gb->_idFromPath($path);
|
|
||||||
$id = (!$_REQUEST['id'] ? $gb->storId : $_REQUEST['id']);
|
$id = (!$_REQUEST['id'] ? $gb->storId : $_REQUEST['id']);
|
||||||
|
|
||||||
|
|
||||||
#if(PEAR::isError($id)){ $_SESSION['msg'] = $id->getMessage(); header("Location: ".BROWSER."?id=$id"); exit; }
|
|
||||||
$redirUrl="gbHtmlBrowse.php?id=$id";
|
$redirUrl="gbHtmlBrowse.php?id=$id";
|
||||||
|
|
||||||
switch($_REQUEST['act']){
|
switch($_REQUEST['act']){
|
||||||
// --- authentication ---
|
// --- 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";
|
case"login";
|
||||||
# echo"<pre>\n"; print_r($_REQUEST); exit;
|
|
||||||
$sessid = $gb->login($_REQUEST['login'], $_REQUEST['pass']);
|
$sessid = $gb->login($_REQUEST['login'], $_REQUEST['pass']);
|
||||||
if($sessid && !PEAR::isError($sessid)){
|
if($sessid && !PEAR::isError($sessid)){
|
||||||
# echo"<pre>$sessid\n"; print_r($_REQUEST); exit;
|
|
||||||
setcookie($config['authCookieName'], $sessid);
|
setcookie($config['authCookieName'], $sessid);
|
||||||
$redirUrl="gbHtmlBrowse.php";
|
$redirUrl="gbHtmlBrowse.php";
|
||||||
$fid = $gb->getObjId($_REQUEST['login'], $gb->storId);
|
$fid = $gb->getObjId($_REQUEST['login'], $gb->storId);
|
||||||
if(!PEAR::isError($fid)) $redirUrl.="?id=$fid";
|
if(!PEAR::isError($fid)) $redirUrl.="?id=$fid";
|
||||||
}else{ $redirUrl="gbHtmlLogin.php"; $_SESSION['alertMsg']='Login failed.'; }
|
}else{
|
||||||
# echo"<pre>$redirUrl\n"; print_r($_REQUEST); exit;
|
$redirUrl="gbHtmlLogin.php"; $_SESSION['alertMsg']='Login failed.';
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
/**
|
||||||
|
* logout
|
||||||
|
*
|
||||||
|
* Logut from storageServer, takes sessid from cookie
|
||||||
|
*
|
||||||
|
*/
|
||||||
case"logout";
|
case"logout";
|
||||||
$gb->logout($sessid);
|
$gb->logout($sessid);
|
||||||
setcookie($config['authCookieName'], '');
|
setcookie($config['authCookieName'], '');
|
||||||
|
@ -40,12 +91,25 @@ switch($_REQUEST['act']){
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// --- files ---
|
// --- 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":
|
case"upload":
|
||||||
$tmpgunid = md5(microtime().$_SERVER['SERVER_ADDR'].rand()."org.mdlf.livesupport");
|
$tmpgunid = md5(
|
||||||
|
microtime().$_SERVER['SERVER_ADDR'].rand()."org.mdlf.livesupport"
|
||||||
|
);
|
||||||
$ntmp = "{$gb->bufferDir}/$tmpgunid";
|
$ntmp = "{$gb->bufferDir}/$tmpgunid";
|
||||||
# $ntmp = tempnam(""{$gb->bufferDir}", 'gbTmp_');
|
# $ntmp = tempnam(""{$gb->bufferDir}", 'gbTmp_');
|
||||||
$mdtmp = "";
|
$mdtmp = "";
|
||||||
move_uploaded_file($_FILES['mediafile']['tmp_name'], $ntmp); chmod($ntmp, 0664);
|
move_uploaded_file($_FILES['mediafile']['tmp_name'], $ntmp);
|
||||||
|
chmod($ntmp, 0664);
|
||||||
if($_FILES['mdatafile']['tmp_name']){
|
if($_FILES['mdatafile']['tmp_name']){
|
||||||
$mdtmp = "$ntmp.xml";
|
$mdtmp = "$ntmp.xml";
|
||||||
if(move_uploaded_file($_FILES['mdatafile']['tmp_name'], $mdtmp)){
|
if(move_uploaded_file($_FILES['mdatafile']['tmp_name'], $mdtmp)){
|
||||||
|
@ -61,17 +125,42 @@ switch($_REQUEST['act']){
|
||||||
}
|
}
|
||||||
$redirUrl = BROWSER."?id=$id";
|
$redirUrl = BROWSER."?id=$id";
|
||||||
break;
|
break;
|
||||||
|
/**
|
||||||
|
* newFolder
|
||||||
|
*
|
||||||
|
* Create new folder in the storage
|
||||||
|
*
|
||||||
|
* @param newname string, name for the new folder
|
||||||
|
* @param id int, destination folder id
|
||||||
|
*/
|
||||||
case"newFolder":
|
case"newFolder":
|
||||||
$r = $gb->createFolder($id, $_REQUEST['newname'], $sessid);
|
$r = $gb->createFolder($id, $_REQUEST['newname'], $sessid);
|
||||||
if(PEAR::isError($r)) $_SESSION['alertMsg'] = $r->getMessage();
|
if(PEAR::isError($r)) $_SESSION['alertMsg'] = $r->getMessage();
|
||||||
$redirUrl = BROWSER."?id=$id";
|
$redirUrl = BROWSER."?id=$id";
|
||||||
break;
|
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":
|
case"rename":
|
||||||
$parid = $gb->getparent($id);
|
$parid = $gb->getparent($id);
|
||||||
$r = $gb->renameFile($id, $_REQUEST['newname'], $sessid);
|
$r = $gb->renameFile($id, $_REQUEST['newname'], $sessid);
|
||||||
if(PEAR::isError($r)) $_SESSION['alertMsg'] = $r->getMessage();
|
if(PEAR::isError($r)) $_SESSION['alertMsg'] = $r->getMessage();
|
||||||
$redirUrl = BROWSER."?id=$parid";
|
$redirUrl = BROWSER."?id=$parid";
|
||||||
break;
|
break;
|
||||||
|
/**
|
||||||
|
* 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":
|
case"move":
|
||||||
$newPath = urlencode($_REQUEST['newPath']);
|
$newPath = urlencode($_REQUEST['newPath']);
|
||||||
$did = $gb->getObjIdFromRelPath($id, $newPath);
|
$did = $gb->getObjIdFromRelPath($id, $newPath);
|
||||||
|
@ -83,11 +172,19 @@ switch($_REQUEST['act']){
|
||||||
}
|
}
|
||||||
else $redirUrl = BROWSER."?id=$did";
|
else $redirUrl = BROWSER."?id=$did";
|
||||||
break;
|
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":
|
case"copy":
|
||||||
$newPath = urldecode($_REQUEST['newPath']);
|
$newPath = urldecode($_REQUEST['newPath']);
|
||||||
$did = $gb->getObjIdFromRelPath($id, $newPath);
|
$did = $gb->getObjIdFromRelPath($id, $newPath);
|
||||||
$parid = $gb->getparent($id);
|
$parid = $gb->getparent($id);
|
||||||
# echo"<pre>\n$id\t$newPath\t$did\n"; print_r($did); exit;
|
|
||||||
$r = $gb->copyFile($id, $did, $sessid);
|
$r = $gb->copyFile($id, $did, $sessid);
|
||||||
if(PEAR::isError($r)){
|
if(PEAR::isError($r)){
|
||||||
$_SESSION['alertMsg'] = $r->getMessage();
|
$_SESSION['alertMsg'] = $r->getMessage();
|
||||||
|
@ -95,13 +192,12 @@ switch($_REQUEST['act']){
|
||||||
}
|
}
|
||||||
else $redirUrl = BROWSER."?id=$did";
|
else $redirUrl = BROWSER."?id=$did";
|
||||||
break;
|
break;
|
||||||
/* NOT WORKING - sorry
|
/**
|
||||||
case"repl":
|
* delete
|
||||||
$unewpath = urlencode($_REQUEST['newpath']);
|
*
|
||||||
$r = $gb->createReplica($id, $_REQUEST['newpath'], '', $sessid);
|
* Delete of stored file
|
||||||
if(PEAR::isError($r)) $_SESSION['alertMsg'] = $r->getMessage();
|
*
|
||||||
$redirUrl = BROWSER."?id=$newparid";
|
* @param id int, local id of deleted file or folder
|
||||||
break;
|
|
||||||
*/
|
*/
|
||||||
case"delete":
|
case"delete":
|
||||||
$parid = $gb->getparent($id);
|
$parid = $gb->getparent($id);
|
||||||
|
@ -109,20 +205,42 @@ switch($_REQUEST['act']){
|
||||||
if(PEAR::isError($r)) $_SESSION['alertMsg'] = $r->getMessage();
|
if(PEAR::isError($r)) $_SESSION['alertMsg'] = $r->getMessage();
|
||||||
$redirUrl = BROWSER."?id=$parid";
|
$redirUrl = BROWSER."?id=$parid";
|
||||||
break;
|
break;
|
||||||
|
/**
|
||||||
|
* getFile
|
||||||
|
*
|
||||||
|
* Call access method and show access path.
|
||||||
|
* Example only - not really useable.
|
||||||
|
* TODO: resource should be released by release method call
|
||||||
|
*
|
||||||
|
* @param id int, local id of accessed file
|
||||||
|
*/
|
||||||
case"getFile":
|
case"getFile":
|
||||||
# echo"<pre>$t, $ctype\n"; exit;
|
|
||||||
# $r = $gb->getFile($id, $sessid);
|
|
||||||
$r = $gb->access($id, $sessid);
|
$r = $gb->access($id, $sessid);
|
||||||
if(PEAR::isError($r)) $_SESSION['alertMsg'] = $r->getMessage();
|
if(PEAR::isError($r)) $_SESSION['alertMsg'] = $r->getMessage();
|
||||||
else echo $r;
|
else echo $r;
|
||||||
exit;
|
exit;
|
||||||
break;
|
break;
|
||||||
|
/**
|
||||||
|
* getMdata
|
||||||
|
*
|
||||||
|
* Show file's metadata as XML
|
||||||
|
*
|
||||||
|
* @param id int, local id of stored file
|
||||||
|
*/
|
||||||
case"getMdata":
|
case"getMdata":
|
||||||
header("Content-type: text/xml");
|
header("Content-type: text/xml");
|
||||||
$r = $gb->getMdata($id, $sessid);
|
$r = $gb->getMdata($id, $sessid);
|
||||||
print_r($r);
|
print_r($r);
|
||||||
exit;
|
exit;
|
||||||
break;
|
break;
|
||||||
|
/**
|
||||||
|
* getInfo
|
||||||
|
*
|
||||||
|
* Call getid3 library to analyze media file and show some results
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @param
|
||||||
|
*/
|
||||||
case"getInfo":
|
case"getInfo":
|
||||||
header("Content-type: text/plain");
|
header("Content-type: text/plain");
|
||||||
$ia = $gb->analyzeFile($id, $sessid);
|
$ia = $gb->analyzeFile($id, $sessid);
|
||||||
|
@ -134,26 +252,56 @@ switch($_REQUEST['act']){
|
||||||
echo"title: {$ia['id3v1']['title']}\n";
|
echo"title: {$ia['id3v1']['title']}\n";
|
||||||
echo"artist: {$ia['id3v1']['artist']}\n";
|
echo"artist: {$ia['id3v1']['artist']}\n";
|
||||||
echo"comment: {$ia['id3v1']['comment']}\n";
|
echo"comment: {$ia['id3v1']['comment']}\n";
|
||||||
# echo": {$ia['id3v1']['']}\n";
|
|
||||||
# print_r($ia);
|
|
||||||
exit;
|
exit;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// --- subjs ----
|
// --- 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";
|
case"addSubj";
|
||||||
$redirUrl="gbHtmlSubj.php";
|
$redirUrl="gbHtmlSubj.php";
|
||||||
if($gb->checkPerm($userid, 'subjects'))
|
if($gb->checkPerm($userid, 'subjects')){
|
||||||
$res = $gb->addSubj($_REQUEST['login'], ($_REQUEST['pass']=='' ? NULL:$_REQUEST['pass'] ));
|
$res = $gb->addSubj($_REQUEST['login'],
|
||||||
else{ $_SESSION['alertMsg']='Access denied.'; break; }
|
($_REQUEST['pass']=='' ? NULL:$_REQUEST['pass'] ));
|
||||||
|
}else{
|
||||||
|
$_SESSION['alertMsg']='Access denied.';
|
||||||
|
break;
|
||||||
|
}
|
||||||
if(PEAR::isError($res)) $_SESSION['alertMsg'] = $res->getMessage();
|
if(PEAR::isError($res)) $_SESSION['alertMsg'] = $res->getMessage();
|
||||||
break;
|
break;
|
||||||
|
/**
|
||||||
|
* removeSubj
|
||||||
|
*
|
||||||
|
* Remove existing user or group
|
||||||
|
*
|
||||||
|
* @param login string, login name of removed user
|
||||||
|
*/
|
||||||
case"removeSubj";
|
case"removeSubj";
|
||||||
$redirUrl="gbHtmlSubj.php";
|
$redirUrl="gbHtmlSubj.php";
|
||||||
if($gb->checkPerm($userid, 'subjects'))
|
if($gb->checkPerm($userid, 'subjects')){
|
||||||
$res = $gb->removeSubj($_REQUEST['login']);
|
$res = $gb->removeSubj($_REQUEST['login']);
|
||||||
else{ $_SESSION['alertMsg']='Access denied.'; break; }
|
}else{
|
||||||
|
$_SESSION['alertMsg']='Access denied.';
|
||||||
|
break;
|
||||||
|
}
|
||||||
if(PEAR::isError($res)) $_SESSION['alertMsg'] = $res->getMessage();
|
if(PEAR::isError($res)) $_SESSION['alertMsg'] = $res->getMessage();
|
||||||
break;
|
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";
|
case"passwd";
|
||||||
$redirUrl="gbHtmlSubj.php";
|
$redirUrl="gbHtmlSubj.php";
|
||||||
$ulogin = $gb->getSubjName($_REQUEST['uid']);
|
$ulogin = $gb->getSubjName($_REQUEST['uid']);
|
||||||
|
@ -167,22 +315,43 @@ switch($_REQUEST['act']){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if($_REQUEST['pass'] !== $_REQUEST['pass2']){
|
if($_REQUEST['pass'] !== $_REQUEST['pass2']){
|
||||||
$_SESSION['alertMsg']="Passwords do not match. ({$_REQUEST['pass']}/{$_REQUEST['pass2']})";
|
$_SESSION['alertMsg'] = "Passwords do not match. ".
|
||||||
|
"({$_REQUEST['pass']}/{$_REQUEST['pass2']})";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$gb->passwd($ulogin, $_REQUEST['oldpass'], $_REQUEST['pass']);
|
$gb->passwd($ulogin, $_REQUEST['oldpass'], $_REQUEST['pass']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// --- perms ---
|
// --- 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";
|
case"addPerm";
|
||||||
if($gb->checkPerm($userid, 'editPerms', $_REQUEST['id']))
|
if($gb->checkPerm($userid, 'editPerms', $_REQUEST['id'])){
|
||||||
$gb->addPerm($_REQUEST['subj'], $_REQUEST['permAction'], $_REQUEST['id'], $_REQUEST['allowDeny']);
|
$gb->addPerm($_REQUEST['subj'], $_REQUEST['permAction'],
|
||||||
else $_SESSION['alertMsg']='Access denied.';
|
$_REQUEST['id'], $_REQUEST['allowDeny']);
|
||||||
|
}else{
|
||||||
|
$_SESSION['alertMsg']='Access denied.';
|
||||||
|
}
|
||||||
$redirUrl="gbHtmlPerms.php?id=$id";
|
$redirUrl="gbHtmlPerms.php?id=$id";
|
||||||
break;
|
break;
|
||||||
|
/**
|
||||||
|
* removePerm
|
||||||
|
*
|
||||||
|
* Remove permission record
|
||||||
|
*
|
||||||
|
* @param permid int, local id of permission record
|
||||||
|
*/
|
||||||
case"removePerm";
|
case"removePerm";
|
||||||
if($gb->checkPerm($userid, 'editPerms', $_REQUEST['oid']))
|
if($gb->checkPerm($userid, 'editPerms', $_REQUEST['oid']))
|
||||||
$gb->removePerm($_GET['permid']);
|
$gb->removePerm($_REQUEST['permid']);
|
||||||
else $_SESSION['alertMsg']='Access denied.';
|
else $_SESSION['alertMsg']='Access denied.';
|
||||||
$redirUrl="gbHtmlPerms.php?id=$id";
|
$redirUrl="gbHtmlPerms.php?id=$id";
|
||||||
break;
|
break;
|
||||||
|
@ -192,6 +361,5 @@ switch($_REQUEST['act']){
|
||||||
$redirUrl="gbHtmlLogin.php";
|
$redirUrl="gbHtmlLogin.php";
|
||||||
}
|
}
|
||||||
|
|
||||||
#echo"<pre>$redirUrl\n"; print_r($_REQUEST); exit;
|
|
||||||
header("Location: $redirUrl");
|
header("Location: $redirUrl");
|
||||||
?>
|
?>
|
Loading…
Add table
Add a link
Reference in a new issue