diff options
author | steckbrief <steckbrief@chefmail.de> | 2017-05-27 20:33:11 +0200 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2017-05-27 20:34:06 +0200 |
commit | b7515c5d9c5fc3c622376818570c05a03c74fe17 (patch) | |
tree | 38ebba18eb38d16f94afd821430ced2bcf63a739 /managing-ui/lib/functions.webui.inc.php | |
parent | 6bd2862f8f6b37f145097767ebbbedbc5e243443 (diff) |
managing-ui: initial commit0.2
added possibility to manage uploaded files
simple php ui to delete uploaded files
Diffstat (limited to 'managing-ui/lib/functions.webui.inc.php')
-rw-r--r-- | managing-ui/lib/functions.webui.inc.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/managing-ui/lib/functions.webui.inc.php b/managing-ui/lib/functions.webui.inc.php new file mode 100644 index 0000000..63f3b98 --- /dev/null +++ b/managing-ui/lib/functions.webui.inc.php @@ -0,0 +1,34 @@ +<?php + + +function readSlots($jid) { + global $config; + + $slots = array(); + $slots['sent'] = array(); + $slots['received'] = array(); + if ($handle = opendir($config['slot_registry_dir'])) { + while (false !== ($entry = readdir($handle))) { + if ($entry != "." && $entry != ".." && $entry != ".htaccess") { + $slotUUID = $entry; + $params = loadSlotParameters($slotUUID, $config); + if (getBareJid($params['user_jid']) == $jid) { + $filePath = getUploadFilePath($slotUUID, $config, $params['filename']); + $params['file_exists'] = file_exists($filePath); + $params['creation_time'] = -1; + if ($params['file_exists']) { + $params['creation_time'] = filemtime($filePath); + } + $params['uuid'] = $slotUUID; + $slots['sent'][] = $params; + } else if (array_key_exists('receipient_jid', $params) && getBareJid($params['receipient_jid']) == $jid) { + $slots['received'][] = $params; + } else if (!array_key_exists('receipient_jid', $params)) { // In httpupload storage-backend version < 0.2 the receipient_jid was not stored + $params['receipient_jid'] = "Unknown"; + } + } + } + } + return $slots; +} +?>
\ No newline at end of file |