[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] filemanager/inc/hook_deleteaccount.inc.php, 1.3
From: |
nomail |
Subject: |
[Phpgroupware-cvs] filemanager/inc/hook_deleteaccount.inc.php, 1.3 |
Date: |
Thu, 30 Dec 2004 10:17:57 +0100 |
Update of /filemanager/inc
Modified Files:
Branch:
hook_deleteaccount.inc.php
date: 2004/12/30 09:17:57; author: skwashd; state: Exp; lines: +48 -14
Log Message:
clean up, merge, remove crud and apply patch #3525
=====================================================================
Index: filemanager/inc/hook_deleteaccount.inc.php
diff -u filemanager/inc/hook_deleteaccount.inc.php:1.2
filemanager/inc/hook_deleteaccount.inc.php:1.3
--- filemanager/inc/hook_deleteaccount.inc.php:1.2 Tue Sep 4 04:58:12 2001
+++ filemanager/inc/hook_deleteaccount.inc.php Thu Dec 30 09:17:57 2004
@@ -9,20 +9,54 @@
* option) any later version. *
\**************************************************************************/
/* $Id$ */
- /*
- global $phpgw;
- global $account_id;
- */
- /* NOTE: This is untested */
- /* WIP: it should get all files owned by $account_id, not just in
/home/account_id */
- /* Should also be capable of transfering files to another user */
+
+ /* Needs more work - skwashd
+ $GLOBALS['phpgw']->vfs = createObject('phpgwapi.vfs');
+
+ $GLOBALS['phpgw']->vfs->fakebase =
$GLOBALS['phpgw_info']['server']['files_dir'];
+ $GLOBALS['phpgw']->vfs->working_id = $_POST['account_id'];
+ $GLOBALS['phpgw']->vfs->working_lid =
$GLOBALS['phpgw']->accounts->id2name($_POST['account_id']);
-/*
- $phpgw->vfs->working_id = $account_id;
- $ls_array = $phpgw->vfs->ls ($phpgw->vfs->fakebase . "/" . $account_id,
array (RELATIVE_NONE));
- while (list ($num, $entry) = each ($ls_array))
+
+ if(false)// @isset($_POST['new_owner']) && intval($_POST['new_owner']) )
{
- $phpgw->vfs->rm ($entry["dir"] . "/" . $entry["name"], array
(RELATIVE_NONE));
+ $ls_array = array();
+ $ls_array = $GLOBALS['phpgw']->vfs->ls(
+ array(
+ 'string' => '/',
+ 'checksubdirs' => True,
+ 'relatives' => array (RELATIVE_ROOT)
+ )
+ );
+
+ if( count($ls_array) > 1 )//root dir is 1
+ {
+ foreach ($ls_array as $num => $entry)
+ {
+ if( $entry['owner_id'] ==
$GLOBALS['account_id'] )
+ {
+ echo "<pre>$num => "; print_r($entry);
echo "</pre><br />\n";
+ $ok =
$GLOBALS['phpgw']->vfs->set_attributes(
+ array(
+ 'string' =>
$entry['directory'] .'/'
+
. $entry['name'],
+ 'attributes' =>
array('owner_id' => $_POST['new_owner']),
+ 'relatives' =>
array(RELATIVE_ROOT)
+ )
+ );
+ if(!$ok)
+ {
+ echo 'NQR changing: ' .
$entry['directory'] .'/'. $entry['name'] . "<br />\n";
+ }
+ }
+ }
+ }
}
-*/
+ else
+ {
+ //delete from journal but not from disk - too many risks -
skwashd
+ $GLOBALS['phpgw']->db->query('DELETE FROM phpgw_vfs'
+ . ' WHERE owner_id = ' .
intval($_POST['account_id']), __LINE__, __FILE__);
+ }
+ */
?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] filemanager/inc/hook_deleteaccount.inc.php, 1.3,
nomail <=