[Openupload-svn-update] SF.net SVN: openupload:[254] trunk
Status: Beta
Brought to you by:
tsdogs
|
From: <ts...@us...> - 2009-02-07 13:45:47
|
Revision: 254
http://openupload.svn.sourceforge.net/openupload/?rev=254&view=rev
Author: tsdogs
Date: 2009-02-07 13:45:45 +0000 (Sat, 07 Feb 2009)
Log Message:
-----------
Add configurable security on file removal option.
Modified Paths:
--------------
trunk/lib/modules/default/admin.inc.php
trunk/lib/modules/default/files.inc.php
trunk/templates/default/modules/admin/options.tpl
Modified: trunk/lib/modules/default/admin.inc.php
===================================================================
--- trunk/lib/modules/default/admin.inc.php 2009-02-07 13:44:37 UTC (rev 253)
+++ trunk/lib/modules/default/admin.inc.php 2009-02-07 13:45:45 UTC (rev 254)
@@ -806,6 +806,7 @@
$config['use_short_links']=isset($_POST['use_short_links'])?'yes':'no';
$config['id_max_length']=$_POST['id_max_length'];
$config['id_use_alpha']=isset($_POST['id_use_alpha'])?'yes':'no';;
+ $config['allow_unprotected_removal']=isset($_POST['allow_unprotected_removal'])?'yes':'no';;
$config['progress']=$_POST['progress'];
$config['logging']['enabled']=isset($_POST['logging'])?'yes':'no';
$config['logging']['db_level']=$_POST['log_db_level'];
Modified: trunk/lib/modules/default/files.inc.php
===================================================================
--- trunk/lib/modules/default/files.inc.php 2009-02-07 13:44:37 UTC (rev 253)
+++ trunk/lib/modules/default/files.inc.php 2009-02-07 13:45:45 UTC (rev 254)
@@ -437,7 +437,10 @@
$_SESSION['user']['r']=$finfo;
$this->tpl->assign('files',$finfo);
$this->tpl->assign('finfo',$finfo[0]);
- $result = app()->pluginAction('removeRequest',$finfo,false);
+ if (app()->config['allow_unprotected_removal']=='yes')
+ $result = true;
+ else
+ $result = app()->pluginAction('removeRequest',$finfo,false);
if ($result) {
app()->log('info','removeRequest','','ALLOW',$id);
$_SESSION['user']['r'][0]['canremove']='ok'; /* file has no protection */
@@ -464,7 +467,10 @@
} else {
$finfo = $_SESSION['user']['r'];
/* check wether the plugins are ok */
- $result = app()->pluginAction('removeConfirm',$finfo);
+ if (app()->config['allow_unprotected_removal']=='yes')
+ $result = true;
+ else
+ $result = app()->pluginAction('removeConfirm',$finfo);
if (!$result)
$this->prevStep();
/* now we can remove the file */
Modified: trunk/templates/default/modules/admin/options.tpl
===================================================================
--- trunk/templates/default/modules/admin/options.tpl 2009-02-07 13:44:37 UTC (rev 253)
+++ trunk/templates/default/modules/admin/options.tpl 2009-02-07 13:45:45 UTC (rev 254)
@@ -41,7 +41,9 @@
<tr><td>{tr}Max num. of file uploaded per upload{/tr}:</td><td><input type="text" name="multiupload" value="{$config.multiupload}"></td></tr>
<tr><td>{tr}Use shorter links?{/tr}:</td><td><input type="checkbox" name="use_short_links" value="yes" {if $config.use_short_links=='yes'}checked{/if}
<tr><td>{tr}Length of IDs (suggested min 6){/tr}:</td><td><input type="text" name="id_max_length" value="{$config.id_max_length}"></td></tr>
-<tr><td>{tr}Use alphanumerical IDs?{/tr}:</td><td><input type="checkbox" name="id_use_alpha" value="yes" {if $config.id_use_alpha=='yes'}checked{/if} <tr><td>{tr}Upload tracking method{/tr}:</td><td><select name="progress">
+<tr><td>{tr}Use alphanumerical IDs?{/tr}:</td><td><input type="checkbox" name="id_use_alpha" value="yes" {if $config.id_use_alpha=='yes'}checked{/if}</td></tr>
+<tr><td>{tr}Allow unprotected file removal?{/tr}:</td><td><input type="checkbox" name="allow_unprotected_removal" value="yes" {if $config.allow_unprotected_removal=='yes'}checked{/if}</td></tr>
+<tr><td>{tr}Upload tracking method{/tr}:</td><td><select name="progress">
{foreach from=$progress item=t}
<option value="{$t}" {if $t==$config.progress}selected{/if}>{$t}</option>
{/foreach}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|