[Openupload-svn-update] SF.net SVN: openupload:[168] trunk
Status: Beta
Brought to you by:
tsdogs
|
From: <ts...@us...> - 2008-11-21 17:26:10
|
Revision: 168
http://openupload.svn.sourceforge.net/openupload/?rev=168&view=rev
Author: tsdogs
Date: 2008-11-21 17:26:05 +0000 (Fri, 21 Nov 2008)
Log Message:
-----------
enable multiple files removal, and change default e-mail not to include file name/size
Modified Paths:
--------------
trunk/lib/modules/default/files.inc.php
trunk/templates/default/modules/files/removeRequest.tpl
trunk/templates/default/modules/files/removeResult.tpl
trunk/templates/default/plugins/email/notify.tpl
Modified: trunk/lib/modules/default/files.inc.php
===================================================================
--- trunk/lib/modules/default/files.inc.php 2008-11-21 17:01:26 UTC (rev 167)
+++ trunk/lib/modules/default/files.inc.php 2008-11-21 17:26:05 UTC (rev 168)
@@ -379,22 +379,23 @@
$id = '';
if (isset($_GET['id'])) {
$id = $_GET['id'];
- } else if (isset($_SESSION['user']['r']['id'])) {
- $id = $_SESSION['user']['r']['id'];
+ } else if (isset($_SESSION['user']['r'][0]['id'])) {
+ $id = $_SESSION['user']['r'][0]['id'];
}
/* check if download exists, and what are the properties */
if ($id != '') {
$finfo = $this->loadFile($id);
- if ($finfo['id']!=$id) {
+ if ($finfo[0]['id']!=$id) {
app()->error(tr('Wrong file id!'));
redirect();
- } else if ($_GET['removeid']!=$finfo['remove']) {
+ } else if ($_GET['removeid']!=$finfo[0]['remove']) {
app()->error(tr('Wrong file id!')); /* don't give the user much info on this */
redirect();
} else {
$_SESSION['user']['r']=$finfo;
- $this->tpl->assign('finfo',$finfo);
- $result = app()->pluginAction('removeRequest',$finfo,false);
+ $this->tpl->assign('files',$finfo);
+ $this->tpl->assign('finfo',$finfo[0]);
+ $result = app()->pluginAction('removeRequest',$finfo[0],false);
if (!$result) {
redirect();
}
@@ -407,7 +408,7 @@
function removeConfirm() {
$finfo = $_SESSION['user']['r'];
-//TODO: Remove all the files...
+
/* here we do the actual download of the file */
if (!isset($_SESSION['user']['r'])) {
redirect();
@@ -418,11 +419,13 @@
if (!$result)
$this->prevStep();
/* now we can remove the file */
- app()->db->delete('files',array('id' => $finfo['id']));
- app()->db->delete('file_options',array('file_id' => $finfo['id']));
- $file = app()->config['DATA_PATH'].'/'.$finfo['id'];
- unlink($file);
- app()->log('notice','removeConfirm','','REMOVED',$finfo['id']);
+ foreach ($finfo as $f) {
+ app()->db->delete('files',array('id' => $f['id']));
+ app()->db->delete('file_options',array('file_id' => $f['id']));
+ $file = app()->config['DATA_PATH'].'/'.$f['id'];
+ unlink($file);
+ }
+ app()->log('notice','removeConfirm','','REMOVED',$finfo[0]['id']);
/* display removal confirmation */
$this->nextStep();
}
@@ -434,7 +437,8 @@
} else {
$finfo = $_SESSION['user']['r'];
$result = app()->pluginAction('removeResult',$finfo,false);
- $this->tpl->assign('finfo',$finfo);
+ $this->tpl->assign('files',$finfo);
+ $this->tpl->assign('finfo',$finfo[0]);
unset($_SESSION['user']['r']); /* remove any file reference */
}
}
Modified: trunk/templates/default/modules/files/removeRequest.tpl
===================================================================
--- trunk/templates/default/modules/files/removeRequest.tpl 2008-11-21 17:01:26 UTC (rev 167)
+++ trunk/templates/default/modules/files/removeRequest.tpl 2008-11-21 17:26:05 UTC (rev 168)
@@ -4,8 +4,10 @@
<input type="hidden" name="step" value="{$nextstep}">
<table border="0">
<tr><td>{tr}File description{/tr}:</td><td><b>{$finfo.description}</b></td></tr>
-<tr><td>{tr}File name{/tr}:</td><td><b>{$finfo.name}</b></td></tr>
-<tr><td>{tr}File size{/tr}:</td><td><b>{$finfo.size}</b></td></tr>
+{foreach from=$files item=f}
+<tr><td>{tr}File name{/tr}:</td><td><b>{$f.name}</b></td></tr>
+<tr><td>{tr}File size{/tr}:</td><td>{$f.size|fsize_format}</td></tr>
+{/foreach}
<tr><td>{tr}Uploaded on{/tr}:</td><td><b>{$finfo.upload_date}</b></td></tr>
{$plugins}
<tr><td colspan="2" align="right"><input class="submit" type="submit" value="{tr}Confirm removal{/tr}">
Modified: trunk/templates/default/modules/files/removeResult.tpl
===================================================================
--- trunk/templates/default/modules/files/removeResult.tpl 2008-11-21 17:01:26 UTC (rev 167)
+++ trunk/templates/default/modules/files/removeResult.tpl 2008-11-21 17:26:05 UTC (rev 168)
@@ -1,8 +1,6 @@
{tr}FILE HAS BEEN SUCCESSFULLY REMOVED{/tr}:<br>
<table border="0">
<tr><td>{tr}File description{/tr}:</td><td><b>{$finfo.description}</b></td></tr>
-<tr><td>{tr}File name{/tr}:</td><td><b>{$finfo.name}</b></td></tr>
-<tr><td>{tr}File size{/tr}:</td><td><b>{$finfo.size}</b></td></tr>
<tr><td>{tr}Uploaded on{/tr}:</td><td><b>{$finfo.upload_date}</b></td></tr>
{$plugins}
</table>
Modified: trunk/templates/default/plugins/email/notify.tpl
===================================================================
--- trunk/templates/default/plugins/email/notify.tpl 2008-11-21 17:01:26 UTC (rev 167)
+++ trunk/templates/default/plugins/email/notify.tpl 2008-11-21 17:26:05 UTC (rev 168)
@@ -6,9 +6,6 @@
{tr}You are receiving this message because someone uploaded a file on our OpenUpload server for you.{/tr}
-{tr}File ID{/tr}: {$finfo.id}
-{tr}File name{/tr}: {$finfo.name}
-{tr}File size{/tr}: {$finfo.size|fsize_format}
{tr}Description{/tr}: {$finfo.description}
{if $finfo.plainpassword!=''}
{tr}Password{/tr}: {$finfo.plainpassword}
@@ -88,9 +85,6 @@
<p>{tr}You are receiving this message because someone uploaded a file on our OpenUpload server for you.{/tr}</p>
<table border="0">
-<tr><td>{tr}File ID{/tr}:</td><td>{$finfo.id}</td></tr>
-<tr><td>{tr}File name{/tr}:</td><td>{$finfo.name}</td></tr>
-<tr><td>{tr}File size{/tr}:</td><td>{$finfo.size|fsize_format}</td></tr>
<tr><td>{tr}Description{/tr}:</td><td>{$finfo.description}</td></tr>
{if $finfo.plainpassword!=''}
<tr><td>{tr}Password{/tr}:</td><td>{$finfo.plainpassword}</td></tr>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|