[Openupload-svn-update] SF.net SVN: openupload:[188] trunk/plugins/expire.inc.php
Status: Beta
Brought to you by:
tsdogs
|
From: <ts...@us...> - 2008-12-11 11:06:23
|
Revision: 188
http://openupload.svn.sourceforge.net/openupload/?rev=188&view=rev
Author: tsdogs
Date: 2008-12-11 11:06:19 +0000 (Thu, 11 Dec 2008)
Log Message:
-----------
Expire date plugin
Added Paths:
-----------
trunk/plugins/expire.inc.php
Added: trunk/plugins/expire.inc.php
===================================================================
--- trunk/plugins/expire.inc.php (rev 0)
+++ trunk/plugins/expire.inc.php 2008-12-11 11:06:19 UTC (rev 188)
@@ -0,0 +1,27 @@
+<?php
+
+class expirePlugin extends OpenUploadPlugin {
+
+ function expirePlugin() {
+ $this->description = tr('Maximum number of days an upload will be kept on the server.');
+ $this->options = array(
+ array('name' => 'days', 'description' => tr('N. Of Days'), 'type' => 'text'),
+ );
+ $this->fields = array('expire');
+ }
+
+ function uploadComplete(&$finfo,$acl) {
+ if ($acl!='enable') return true;
+ $group = $this->getGroup('days');
+ /* now set */
+ if (!isset($this->config['days'][$group]) and isset($this->config['days']['*'])>0) {
+ $this->config['days'][$group]=$this->config['days']['*'];
+ }
+ if ($this->config['days'][$group]>0) {
+ $finfo[0]['expire']=date('Y-m-d',time()+($this->config['days'][$group]*24*60*60));
+ }
+ return true;
+ }
+
+}
+?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|