openupload-svn-update Mailing List for Open Upload (Page 10)
Status: Beta
Brought to you by:
tsdogs
You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(100) |
Nov
(72) |
Dec
(44) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(7) |
Feb
(47) |
Mar
(30) |
Apr
(11) |
May
(10) |
Jun
(8) |
Jul
(1) |
Aug
(22) |
Sep
|
Oct
|
Nov
(13) |
Dec
|
| 2010 |
Jan
|
Feb
|
Mar
(17) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(10) |
Dec
(1) |
| 2011 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ts...@us...> - 2008-12-09 17:06:46
|
Revision: 171
http://openupload.svn.sourceforge.net/openupload/?rev=171&view=rev
Author: tsdogs
Date: 2008-12-09 17:06:42 +0000 (Tue, 09 Dec 2008)
Log Message:
-----------
Add delete confirmation and multi delete options to admin
Modified Paths:
--------------
trunk/templates/default/modules/admin/banned.tpl
trunk/templates/default/modules/admin/files.tpl
trunk/templates/default/modules/admin/groups.tpl
trunk/templates/default/modules/admin/langs.tpl
trunk/templates/default/modules/admin/pluginsacl.tpl
trunk/templates/default/modules/admin/users.tpl
Added Paths:
-----------
trunk/templates/default/modules/admin/deletescript.tpl
Modified: trunk/templates/default/modules/admin/banned.tpl
===================================================================
--- trunk/templates/default/modules/admin/banned.tpl 2008-11-25 19:15:58 UTC (rev 170)
+++ trunk/templates/default/modules/admin/banned.tpl 2008-12-09 17:06:42 UTC (rev 171)
@@ -1,7 +1,12 @@
{include file="default/modules/admin/adminmenu.tpl"}
+<script>
+msg1 = '{tr}Are you sure you want to delete the selected baned ips?{/tr}';
+msg2 = '{tr}Are you sure you want to delete the selected banned ip?{/tr}';
+{include file="default/modules/admin/deletescript.tpl"}
+</script>
<div id="toolbar">
<a href="{$script}?action={$action}&step=2"><img src="{tpl file=/img/admin/tadd.png}"></a>
-<img src="{tpl file=/img/admin/tdelete.png}">
+<a href="{$script}?action={$action}&step={$step}" onclick="return multidelete();"><img src="{tpl file=/img/admin/tdelete.png}"></a>
</div>
<br>
{if $pages>2}
@@ -15,6 +20,9 @@
{/section} </center>
{/if}
<br>
+<form name="deleteform" id="deleteform" action="{$script}" method="POST">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="5">
<table border="0" id="dbtable">
<tr>
<th width="10">S</th>
@@ -26,12 +34,12 @@
{foreach from=$banned item=b}
{cycle values="row1,row2" advance=true assign=rid}
<tr>
- <td id="{$rid}"><input type="checkbox" name="ban_{$d.id}" value="1"></td>
+ <td id="{$rid}"><input type="checkbox" name="ban_{$b.id}" value="1"></td>
<td id="{$rid}" style="text-align: left;"><a href="{$script}?action={$action}&step=3&id={$b.id}">{$b.ip}</a></td>
<td id="{$rid}">{$b.access}</td>
<td id="{$rid}">{$b.priority}</td>
<td id="{$rid}">
- <a title="delete" href="{$script}?action={$action}&step=4&id={$b.id}"><img src="{tpl file=/img/admin/delete.png}"></a>
+ <a title="delete" href="{$script}?action={$action}&step=4&id={$b.id}" onclick="return rowdelete();"><img src="{tpl file=/img/admin/delete.png}"></a>
</td>
</tr>
{/foreach}
Added: trunk/templates/default/modules/admin/deletescript.tpl
===================================================================
--- trunk/templates/default/modules/admin/deletescript.tpl (rev 0)
+++ trunk/templates/default/modules/admin/deletescript.tpl 2008-12-09 17:06:42 UTC (rev 171)
@@ -0,0 +1,11 @@
+{literal}
+function multidelete() {
+ if (window.confirm(msg1))
+ document.getElementById('deleteform').submit();
+ return false;
+}
+
+function rowdelete() {
+ return window.confirm(msg2);
+}
+{/literal}
Modified: trunk/templates/default/modules/admin/files.tpl
===================================================================
--- trunk/templates/default/modules/admin/files.tpl 2008-11-25 19:15:58 UTC (rev 170)
+++ trunk/templates/default/modules/admin/files.tpl 2008-12-09 17:06:42 UTC (rev 171)
@@ -1,4 +1,12 @@
{include file="default/modules/admin/adminmenu.tpl"}
+<script>
+msg1 = '{tr}Are you sure you want to delete the selected files?{/tr}';
+msg2 = '{tr}Are you sure you want to delete the selected file?{/tr}';
+{include file="default/modules/admin/deletescript.tpl"}
+</script>
+<div id="toolbar">
+<a href="{$script}?action={$action}&step={$step}" onclick="return multidelete();"><img src="{tpl file=/img/admin/tdelete.png}"></a>
+</div>
<br>
{if $pages>2}
<center>{section name=page loop=$pages start=1 max=20}
@@ -11,6 +19,9 @@
{/section} </center>
{/if}
<br>
+<form name="deleteform" id="deleteform" action="{$script}" method="POST">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="4">
<table border="0" id="dbtable">
<tr>
<th width="10">S</th>
@@ -32,7 +43,7 @@
<img align="right" src="{tpl file=/img/admin/ban.png}" ></a>{$f.ip} </td>
<td id="{$rid}">{$f.upload_date}</td>
<td id="{$rid}">
- <a title="delete" href="{$script}?action={$action}&step=2&id={$f.id}"><img src="{tpl file=/img/admin/delete.png}"></a></td>
+ <a title="delete" href="{$script}?action={$action}&step=2&id={$f.id}" onclick="return rowdelete();"><img src="{tpl file=/img/admin/delete.png}"></a></td>
</tr>
{/foreach}
</table>
\ No newline at end of file
Modified: trunk/templates/default/modules/admin/groups.tpl
===================================================================
--- trunk/templates/default/modules/admin/groups.tpl 2008-11-25 19:15:58 UTC (rev 170)
+++ trunk/templates/default/modules/admin/groups.tpl 2008-12-09 17:06:42 UTC (rev 171)
@@ -1,9 +1,17 @@
{include file="default/modules/admin/adminmenu.tpl"}
+<script>
+msg1 = '{tr}Are you sure you want to delete the selected groups?{/tr}';
+msg2 = '{tr}Are you sure you want to delete the selected group?{/tr}';
+{include file="default/modules/admin/deletescript.tpl"}
+</script>
<div id="toolbar">
<a href="{$script}?action={$action}&step=2&id={$u.id}"><img src="{tpl file=/img/admin/tadd_group.png}"></a>
-<img src="{tpl file=/img/admin/tdelete_group.png}">
+<a href="{$script}?action={$action}&step={$step}" onclick="return multidelete();"><img src="{tpl file=/img/admin/tdelete_group.png}"></a>
</div>
<br>
+<form name="deleteform" id="deleteform" action="{$script}" method="POST">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="5">
<table border="0" id="dbtable">
<tr>
<th width="10">S</th>
@@ -20,7 +28,8 @@
<td id="{$rid}">
<a href="{$script}?action={$action}&step=3&id={$g.name}"><img src="{tpl file=/img/admin/edit_group.png}"></a>
- <a href="{$script}?action={$action}&step=4&id={$g.name}"><img src="{tpl file=/img/admin/delete_group.png}"></a></td>
+ <a href="{$script}?action={$action}&step=4&id={$g.name}" onclick="return rowdelete();"><img src="{tpl file=/img/admin/delete_group.png}"></a></td>
</tr>
{/foreach}
-</table>
\ No newline at end of file
+</table>
+</form>
\ No newline at end of file
Modified: trunk/templates/default/modules/admin/langs.tpl
===================================================================
--- trunk/templates/default/modules/admin/langs.tpl 2008-11-25 19:15:58 UTC (rev 170)
+++ trunk/templates/default/modules/admin/langs.tpl 2008-12-09 17:06:42 UTC (rev 171)
@@ -1,9 +1,17 @@
{include file="default/modules/admin/adminmenu.tpl"}
+<script>
+msg1 = '{tr}Are you sure you want to delete the selected languages?{/tr}';
+msg2 = '{tr}Are you sure you want to delete the selected language?{/tr}';
+{include file="default/modules/admin/deletescript.tpl"}
+</script>
<div id="toolbar">
<a href="{$script}?action={$action}&step=2&id={$u.id}"><img src="{tpl file=/img/admin/tadd.png}"></a>
-<img src="{tpl file=/img/admin/tdelete.png}">
+<a href="{$script}?action={$action}&step={$step}" onclick="return multidelete();"><img src="{tpl file=/img/admin/tdelete.png}"></a>
</div>
<br>
+<form name="deleteform" id="deleteform" action="{$script}" method="POST">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="6">
<table border="0" id="dbtable">
<tr>
<th width="10">S</th>
@@ -16,7 +24,7 @@
{foreach from=$langlist item=l}
{cycle values="row1,row2" advance=true assign=rid}
<tr>
- <td id="{$rid}"><input type="checkbox" name="user_{$l.id}" value="1"></td>
+ <td id="{$rid}"><input type="checkbox" name="lang_{$l.id}" value="1"></td>
<td id="{$rid}"><a href="{$script}?action={$action}&step=3&id={$l.id}">{$l.id}</a></td>
<td id="{$rid}">{$l.name}</td>
<td id="{$rid}">{$l.locale}</td>
@@ -27,7 +35,8 @@
<td id="{$rid}">
<a href="{$script}?action={$action}&step=3&id={$l.id}"><img src="{tpl file=/img/admin/edit_lang.png}"></a>
- <a href="{$script}?action={$action}&step=4&id={$l.id}"><img src="{tpl file=/img/admin/delete.png}"></a></td>
+ <a href="{$script}?action={$action}&step=4&id={$l.id}" onclick="return rowdelete();"><img src="{tpl file=/img/admin/delete.png}"></a></td>
</tr>
{/foreach}
-</table>
\ No newline at end of file
+</table>
+</form>
\ No newline at end of file
Modified: trunk/templates/default/modules/admin/pluginsacl.tpl
===================================================================
--- trunk/templates/default/modules/admin/pluginsacl.tpl 2008-11-25 19:15:58 UTC (rev 170)
+++ trunk/templates/default/modules/admin/pluginsacl.tpl 2008-12-09 17:06:42 UTC (rev 171)
@@ -1,9 +1,17 @@
{include file="default/modules/admin/adminmenu.tpl"}
+<script>
+msg1 = '{tr}Are you sure you want to delete the selected plugins?{/tr}';
+msg2 = '{tr}Are you sure you want to delete the selected plugin?{/tr}';
+{include file="default/modules/admin/deletescript.tpl"}
+</script>
<div id="toolbar">
<a href="{$script}?action={$action}&step=2&id={$u.id}"><img src="{tpl file=/img/admin/plugins.png}"></a>
-<img src="{tpl file=/img/admin/tdelete.png}">
+<a href="{$script}?action={$action}&step={$step}" onclick="return multidelete();"><img src="{tpl file=/img/admin/tdelete.png}"></a>
</div>
<br>
+<form name="deleteform" id="deleteform" action="{$script}" method="POST">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="5">
<table border="0" id="dbtable">
<tr>
<th width="10">S</th>
@@ -24,7 +32,7 @@
<td id="{$rid}">
<a href="{$script}?action={$action}&step=3&id={$p.id}"><img src="{tpl file=/img/admin/edit_plugin.png}"></a>
- <a href="{$script}?action={$action}&step=4&id={$p.id}"><img src="{tpl file=/img/admin/delete.png}"></a></td>
+ <a href="{$script}?action={$action}&step=4&id={$p.id}" onclick="return rowdelete();"><img src="{tpl file=/img/admin/delete.png}"></a></td>
</tr>
{/foreach}
</table>
\ No newline at end of file
Modified: trunk/templates/default/modules/admin/users.tpl
===================================================================
--- trunk/templates/default/modules/admin/users.tpl 2008-11-25 19:15:58 UTC (rev 170)
+++ trunk/templates/default/modules/admin/users.tpl 2008-12-09 17:06:42 UTC (rev 171)
@@ -1,9 +1,17 @@
{include file="default/modules/admin/adminmenu.tpl"}
+<script>
+msg1 = '{tr}Are you sure you want to delete the selected users?{/tr}';
+msg2 = '{tr}Are you sure you want to delete the selected user?{/tr}';
+{include file="default/modules/admin/deletescript.tpl"}
+</script>
<div id="toolbar">
<a href="{$script}?action={$action}&step=2&id={$u.id}"><img src="{tpl file=/img/admin/tadd_user.png}"></a>
-<img src="{tpl file=/img/admin/tdelete_user.png}">
+<a href="{$script}?action={$action}&step={$step}" onclick="return multidelete();"><img src="{tpl file=/img/admin/tdelete_user.png}"></a>
</div>
<br>
+<form name="deleteform" id="deleteform" action="{$script}" method="POST">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="6">
<table border="0" id="dbtable">
<tr>
<th width="10">S</th>
@@ -29,7 +37,8 @@
<td id="{$rid}">
<a href="{$script}?action={$action}&step=3&id={$u.login}"><img src="{tpl file=/img/admin/edit_user.png}"></a>
- <a href="{$script}?action={$action}&step=4&id={$u.login}"><img src="{tpl file=/img/admin/delete_user.png}"></a></td>
+ <a href="{$script}?action={$action}&step=4&id={$u.login}" onclick="return rowdelete();"><img src="{tpl file=/img/admin/delete_user.png}"></a></td>
</tr>
{/foreach}
-</table>
\ No newline at end of file
+</table>
+</form>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-25 19:16:04
|
Revision: 170
http://openupload.svn.sourceforge.net/openupload/?rev=170&view=rev
Author: tsdogs
Date: 2008-11-25 19:15:58 +0000 (Tue, 25 Nov 2008)
Log Message:
-----------
logging, settings and docs
Modified Paths:
--------------
trunk/CHANGELOG
trunk/TODO
trunk/lib/modules/default/admin.inc.php
trunk/lib/modules/default/files.inc.php
trunk/templates/default/modules/admin/admin.tpl
trunk/templates/default/modules/admin/adminmenu.tpl
trunk/templates/default/modules/admin/settings.tpl
trunk/templates/default/modules/files/uploadForm.tpl
trunk/www/setup.inc.php
Added Paths:
-----------
trunk/templates/default/modules/admin/logs.tpl
trunk/templates/default/modules/admin/options.tpl
trunk/templates/default/modules/admin/settingsmenu.tpl
trunk/www/templates/default/img/admin/log.png
Modified: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG 2008-11-21 19:02:43 UTC (rev 169)
+++ trunk/CHANGELOG 2008-11-25 19:15:58 UTC (rev 170)
@@ -1,5 +1,8 @@
Changelog from release 0.3b to 0.4
+* General
+ Reviewed the logo
+
* Fixed BUGS
- Registration wasn't working 'cause of a api rename bug
@@ -13,6 +16,9 @@
- New rights editing interface.
- Plugin options
+* Logs
+ - Createed logs which can be used for statistics.
+
* Upload
- Display upload progress, requires either uploadprogress / apc pecl extensions
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2008-11-21 19:02:43 UTC (rev 169)
+++ trunk/TODO 2008-11-25 19:15:58 UTC (rev 170)
@@ -1,9 +1,8 @@
TODO list not priority ordered.
******* MUST BE DONE BEFORE RELEASE 0.4 *******
-General
-- Review the logo. (in progress...)
+
Bugs
- Fix all bugs I find in 0.3 (I hope somebody else will report some if they exsist)
@@ -12,6 +11,7 @@
Plugins
- Upload different filesize limiting depending on group
+- Plugin defualt option for groups.
Maintainence
- Create a script to clean up the files/tmpfiles.
@@ -20,9 +20,6 @@
- Add setup script (almost ready)
- Config administration
-Logs
-- Create logs which can then create statistics.
-
Administration
- Enable multiple table operations (deletion mainly)
Modified: trunk/lib/modules/default/admin.inc.php
===================================================================
--- trunk/lib/modules/default/admin.inc.php 2008-11-21 19:02:43 UTC (rev 169)
+++ trunk/lib/modules/default/admin.inc.php 2008-11-25 19:15:58 UTC (rev 170)
@@ -7,6 +7,7 @@
),
"adminsettings" => array (
1 => "settings",
+ 2 => "options",
),
"adminplugins" => array (
1 => "plugins",
@@ -59,6 +60,9 @@
4 => "langdel",
5 => "langtoggle",
),
+ "adminlogs" => array (
+ 1 => "logs",
+ ),
);
var $page;
@@ -578,6 +582,60 @@
$this->tpl->assign('config',app()->config);
}
+ function database() {
+ }
+
+function listModules($path,$ext = 'inc.php') {
+ /* now list the available database types */
+ $dir = opendir($path);
+ $result = array();
+ while ($d = readdir($dir)) {
+ if ($ext != '') {
+ $n = explode('.',$d,2);
+ if ($n[1]==$ext)
+ $result[] = $n[0];
+ } else {
+ $result[] = $d;
+ }
+ }
+ closedir($dir);
+ return $result;
+}
+
+ function options() {
+ $loglevels = array ( 'Disabled', 'Errors', 'Security', 'Warnings', 'Statistics', 'Info');
+ $tr = $this->listModules(app()->config['INSTALL_ROOT'].'/lib/modules/tr');
+ $auth = $this->listModules(app()->config['INSTALL_ROOT'].'/lib/modules/auth');
+ $tmp = $this->listModules(app()->config['INSTALL_ROOT'].'/templates','');
+ foreach ($tmp as $t) {
+ if ($t != '..' and $t != '.' and strpos($t,'.')!==0) {
+ $templates[]=$t;
+ }
+ }
+ $progress_values = array('none');
+ if (function_exists('uploadprogress_get_info')) {
+ $progress_values[]='uploadprogress';
+ }
+ if (function_exists('apc_fetch')) {
+ if (ini_get('apc.enabled')) {
+ if (ini_get('apc.rfc1867')) {
+ $progress_values[]='apc';
+ }
+ }
+ }
+ if (isset($_POST['save'])) {
+ } else if (isset($_POST['download'])) {
+ } else {
+ $this->tpl->assign('config',app()->config);
+ }
+
+ $this->tpl->assign('auth',$auth);
+ $this->tpl->assign('tr',$tr);
+ $this->tpl->assign('progress',$progress_values);
+ $this->tpl->assign('templates',$templates);
+ $this->tpl->assign('loglevels',$loglevels);
+ }
+
function banned() {
$NUM = 50;
@@ -761,5 +819,31 @@
}
$this->nextStep(1);
}
+
+ function logs() {
+ global $_GET;
+
+ $NUM = 50;
+
+ $page = 1;
+ if (isset($_GET['page'])) {
+ $page=$_GET['page'];
+ }
+ $filter = array();
+ if (isset($_GET['level'])) {
+ if ($_GET['level']!='') {
+ $filter = array('level' => $_GET['level']);
+ }
+ }
+ $limit = ($NUM*($page-1)).','.$NUM;
+ $count = app()->db->count('activitylog',$filter);
+ $this->tpl->assign('pages',ceil($count / $NUM)+1);
+ $this->tpl->assign('pagen',$page);
+ $this->tpl->assign('level',$_GET['level']);
+ $logs = app()->db->read('activitylog',$filter,array('log_time desc'),$limit);
+ $this->tpl->assign('logs',$logs);
+
+ }
+
}
?>
\ No newline at end of file
Modified: trunk/lib/modules/default/files.inc.php
===================================================================
--- trunk/lib/modules/default/files.inc.php 2008-11-21 19:02:43 UTC (rev 169)
+++ trunk/lib/modules/default/files.inc.php 2008-11-25 19:15:58 UTC (rev 170)
@@ -128,7 +128,7 @@
default:
$msg = tr('Upload failed for Unknown error code: %1',$_FILES['upload']['error']); break;
}
- app()->log('warning','uploadOptions','','FAIL','Upload error: '.$msg);
+ app()->log('warning','uploadOptions','','DENY','Upload error: '.$msg);
app()->error(tr($msg));
$this->nextStep(1);
} else if ($_FILES['upload']['size']>app()->user->info('max_upload_size')) {
@@ -227,7 +227,7 @@
rename($_SESSION['user']['u'][$i]['tmp'],app()->config['DATA_PATH'].'/'.$finfo['id']);
$_SESSION['user']['u'][$i]=$finfo;
}
- app()->log('notice','uploadConfirm','','OK',$mainid);
+ app()->log('notice','uploadConfirm','','ALLOW',$mainid);
$this->nextStep();
}
}
@@ -433,7 +433,7 @@
$file = app()->config['DATA_PATH'].'/'.$f['id'];
unlink($file);
}
- app()->log('notice','removeConfirm','','REMOVED',$finfo[0]['id']);
+ app()->log('notice','removeConfirm','','ALLOW',$finfo[0]['id']);
/* display removal confirmation */
$this->nextStep();
}
Modified: trunk/templates/default/modules/admin/admin.tpl
===================================================================
--- trunk/templates/default/modules/admin/admin.tpl 2008-11-21 19:02:43 UTC (rev 169)
+++ trunk/templates/default/modules/admin/admin.tpl 2008-11-25 19:15:58 UTC (rev 170)
@@ -13,7 +13,7 @@
<tr>
<td align="center"><a href="{$script}?action=adminlangs"><img src="{tpl file=/img/admin/langs.png}" border="0" ><br>{tr}Languages{/tr}</a></td>
<td align="center"><a href="{$script}?action=adminbanned"><img src="{tpl file=/img/admin/banned.png}" border="0" ><br>{tr}Banned IPs{/tr}</a></td>
- <td align="center"> </td>
+ <td align="center"><a href="{$script}?action=adminlogs"><img src="{tpl file=/img/admin/log.png}" border="0" ><br>{tr}Logs / Statistics{/tr}</td>
</tr>
{$plugins}
</table>
\ No newline at end of file
Modified: trunk/templates/default/modules/admin/adminmenu.tpl
===================================================================
--- trunk/templates/default/modules/admin/adminmenu.tpl 2008-11-21 19:02:43 UTC (rev 169)
+++ trunk/templates/default/modules/admin/adminmenu.tpl 2008-11-25 19:15:58 UTC (rev 170)
@@ -7,7 +7,8 @@
<li><a href="{$script}?action=admingroups">{tr}Groups{/tr}</a></li>
<li><a href="{$script}?action=adminrights">{tr}Rights{/tr}</a></li>
<li><a href="{$script}?action=adminlangs">{tr}Languages{/tr}</a></li>
- <li style="border-right: 0px;"><a href="{$script}?action=adminbanned">{tr}Banned{/tr}</a></li>
+ <li><a href="{$script}?action=adminbanned">{tr}Banned{/tr}</a></li>
+ <li style="border-right: 0px;"><a href="{$script}?action=adminlogs">{tr}Logs{/tr}</a></li>
</ul>
</div>
<br>
\ No newline at end of file
Added: trunk/templates/default/modules/admin/logs.tpl
===================================================================
--- trunk/templates/default/modules/admin/logs.tpl (rev 0)
+++ trunk/templates/default/modules/admin/logs.tpl 2008-11-25 19:15:58 UTC (rev 170)
@@ -0,0 +1,54 @@
+{include file="default/modules/admin/adminmenu.tpl"}
+<br>
+<div id="filter">
+<form action="index.php" id="filterform" method="GET">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="{$step}">
+<input type="hidden" name="page" value="1">
+{tr}Filter{/tr}:<select name="level" onchange="document.getElementById('filterform').submit()">
+<option value="" {if $level==""}selected{/if}>-- {tr}All{/tr} --</option>
+<option value="error" {if $level=="error"}selected{/if}>{tr}Errors{/tr}</option>
+<option value="security" {if $level=="security"}selected{/if}>{tr}Security{/tr}</option>
+<option value="warning" {if $level=="warning"}selected{/if}>{tr}Warnings{/tr}</option>
+<option value="notice" {if $level=="notice"}selected{/if}>{tr}Notice{/tr}</option>
+<option value="info" {if $level=="info"}selected{/if}>{tr}Info{/tr}</option>
+</select>
+</form>
+{if $pages>2}
+<center>{section name=page loop=$pages start=1 max=20}
+{if $pagen==$smarty.section.page.index}
+<b style="font-size: 12pt">{$smarty.section.page.index}</b>
+{else}
+<a style="font-size: 12pt" href="{$script}?action={$action}&page={$smarty.section.page.index}">{$smarty.section.page.index}</a>
+{/if}
+
+{/section} </center>
+{/if}
+<br>
+<table border="0" id="dbtable">
+<tr>
+ <th width="100">{tr}Date{/tr}</th>
+ <th width="100">{tr}Type{/tr}</th>
+ <th width="100">{tr}User{/tr}</th>
+ <th width="100">{tr}Module{/tr}</th>
+ <th width="100">{tr}Action{/tr}</th>
+ <th width="100">{tr}Real Action{/tr}</th>
+ <th width="100">{tr}Plugin{/tr}</th>
+ <th width="100">{tr}Result{/tr}</th>
+ <th width="200">{tr}Additional Info{/tr}</th>
+</tr>
+{foreach from=$logs item=l}
+{cycle values="row1,row2" advance=true assign=rid}
+<tr>
+ <td id="{$rid}">{$l.log_time}</td>
+ <td id="{$rid}">{$l.level}</td>
+ <td id="{$rid}">{$l.user_login}</td>
+ <td id="{$rid}">{$l.module}</td>
+ <td id="{$rid}">{$l.action}</td>
+ <td id="{$rid}">{$l.realaction}</td>
+ <td id="{$rid}">{$l.plugin}</td>
+ <td id="{$rid}">{$l.result}</td>
+ <td id="{$rid}">{$l.additional}</td>
+</tr>
+{/foreach}
+</table>
\ No newline at end of file
Added: trunk/templates/default/modules/admin/options.tpl
===================================================================
--- trunk/templates/default/modules/admin/options.tpl (rev 0)
+++ trunk/templates/default/modules/admin/options.tpl 2008-11-25 19:15:58 UTC (rev 170)
@@ -0,0 +1,60 @@
+{include file="default/modules/admin/adminmenu.tpl"}
+{include file="default/modules/admin/settingsmenu.tpl"}
+
+<form method="POST" action="index.php">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="{$step}">
+<table border="0">
+<tr><td>Translation module:</td><td>
+<select name="translator">
+<option value="">-- Select one --</option>
+{foreach from=$tr item=t}
+ <option value="{$t}" {if $t==$config.translator}selected{/if}>{$t}</option>
+{/foreach}
+</select>
+</td></tr>
+<tr><td>Default language:</td><td><input type="text" name="defaultlang" value="{$config.defaultlang}"></td></tr>
+<tr><td>Authentication module:<br>(LDAP Configuration needs to be done<br> by hand for now)</td><td>
+<select name="auth">
+<option value="">-- Select one --</option>
+{foreach from=$auth item=t}
+ <option value="{$t}" {if $t==$config.auth}selected{/if}>{$t}</option>
+{/foreach}
+</select>
+</td></tr>
+<tr><td>Site title:</td><td><input type="text" name="sitetitle" value="{$config.site.title}"></td></tr>
+<tr><td>WebMaster E-mail:</td><td><input type="text" name="webmaster" value="{$config.site.webmaster}"></td></tr>
+<tr><td>Site E-mail:</td><td><input type="text" name="email" value="{$config.site.email}"></td></tr>
+<tr><td>Confirm registration with e-mail:</td><td><input type="checkbox" name="confirmregistration" value="yes"
+{if ($config.registration.email_confirm=='yes')}checked{/if}></td></tr>
+<tr><td>Template:</td><td>
+<select name="template">
+<option value="">-- Select one --</option>
+{foreach from=$templates item=t}
+ <option value="{$t}" {if $t==$config.template}selected{/if}>{$t}</option>
+{/foreach}
+</select>
+</td></tr>
+<tr><td>Template Footer:</td><td><textarea name="sitefooter" cols="50" rows="5">{$config.site.footer}</textarea></td></tr>
+<tr><td>Maximum upload size (in MB):</td><td><input type="text" name="max_upload_size" value="{$config.max_upload_size}"></td></tr>
+<tr><td>Maximum download time (in Min)<br>0 disables it:</td><td><input type="text" name="max_download_time" value="{$config.max_download_time}"></td></tr>
+<tr><td>Max num. of file uploaded per upload:</td><td><input type="text" name="multiupload" value="{$config.multiupload}"></td></tr>
+<tr><td>Upload tracking method:</td><td><select name="progress">
+{foreach from=$progress item=t}
+ <option value="{$t}" {if $t==$config.progress}selected{/if}>{$t}</option>
+{/foreach}
+</select></td></tr>
+<tr><td>Enable activity logging?:</td><td><input type="checkbox" name="logging" value="yes" {if $config.logging.enabled=='yes'}checked{/if} ></td></tr>
+<tr><td>Database logging level:</td><td><select name="log_db_level">
+{foreach from=$loglevels item=x key=t}
+ <option value="{$t}" {if $t==$config.logging.db_level}selected{/if}>{$x}</option>
+{/foreach}
+</select></td></tr>
+<tr><td>Syslog logging level:</td><td><select name="log_syslog_level">
+{foreach from=$loglevels item=x key=t}
+ <option value="{$t}" {if $t==$config.logging.syslog_level}selected{/if}>{$x}</option>
+{/foreach}
+</select></td></tr>
+<TR><TD colspan="2"><input type="submit" name="save" value="Save Changes"> <input type="submit" name="downad" value="Download config file"></TD></TR>
+</table>
+</form>
Modified: trunk/templates/default/modules/admin/settings.tpl
===================================================================
--- trunk/templates/default/modules/admin/settings.tpl 2008-11-21 19:02:43 UTC (rev 169)
+++ trunk/templates/default/modules/admin/settings.tpl 2008-11-25 19:15:58 UTC (rev 170)
@@ -1,7 +1,6 @@
{include file="default/modules/admin/adminmenu.tpl"}
+{include file="default/modules/admin/settingsmenu.tpl"}
-Please edit the config.inc.php to change settings for now.<br>
-<br/>
This are the configured settings for a review:<br>
<table border="1">
Added: trunk/templates/default/modules/admin/settingsmenu.tpl
===================================================================
--- trunk/templates/default/modules/admin/settingsmenu.tpl (rev 0)
+++ trunk/templates/default/modules/admin/settingsmenu.tpl 2008-11-25 19:15:58 UTC (rev 170)
@@ -0,0 +1,7 @@
+<div id="menu">
+<ul>
+ <li><a href="{$script}?action=adminsettings&setp=1">{tr}Settings{/tr}</a></li>
+ <li style="border-right: 0px;"><a href="{$script}?action=adminsettings&step=2">{tr}Options{/tr}</a></li>
+</ul>
+</div>
+<br>
\ No newline at end of file
Modified: trunk/templates/default/modules/files/uploadForm.tpl
===================================================================
--- trunk/templates/default/modules/files/uploadForm.tpl 2008-11-21 19:02:43 UTC (rev 169)
+++ trunk/templates/default/modules/files/uploadForm.tpl 2008-11-25 19:15:58 UTC (rev 170)
@@ -20,7 +20,7 @@
}
}
function reportError(request) {
- $F('upload') = "Errore...";
+ $F('upload') = "Error...";
}
</script>
Modified: trunk/www/setup.inc.php
===================================================================
--- trunk/www/setup.inc.php 2008-11-21 19:02:43 UTC (rev 169)
+++ trunk/www/setup.inc.php 2008-11-25 19:15:58 UTC (rev 170)
@@ -689,6 +689,7 @@
$CONFIG['site']['title']=$_POST['sitetitle'];
$CONFIG['site']['webmaster']= $_POST['webmaster'];
$CONFIG['site']['email']= $_POST['email'];
+ $CONFIG['site']['template'] = $_POST['template'];
$CONFIG['site']['footer']=str_replace('\"','"',$_POST['sitefooter']);
$CONFIG['registration']['email_confirm']=isset($_POST['confirmregistration'])?$_POST['confirmregistration']:'no';
$CONFIG['max_upload_size']=$_POST['max_upload_size'];
@@ -743,6 +744,7 @@
$CONFIG['site']['webmaster']= '';
$CONFIG['site']['email']= '';
$CONFIG['site']['footer']='<a href="http://openupload.sf.net">Open Upload</a> - Created by Alessandro Briosi © 2008';
+ $CONFIG['site']['template'] = 'default';
$CONFIG['registration']['email_confirm']='yes';
$CONFIG['max_upload_size']=100;
$CONFIG['max_download_time']=120;
@@ -784,7 +786,7 @@
<option value="">-- Select one --</option>
<?php foreach ($templates as $t) {
if ($t != '..' and $t != '.' and strpos($t,'.')!==0) {
- $selected = $CONFIG['auth']==$t?'selected':'';
+ $selected = $CONFIG['site']['template']==$t?'selected':'';
echo '<option value="'.$t.'" '.$selected.'>'.$t.'</option>';
}
} ?>
Added: trunk/www/templates/default/img/admin/log.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/admin/log.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-21 19:02:48
|
Revision: 169
http://openupload.svn.sourceforge.net/openupload/?rev=169&view=rev
Author: tsdogs
Date: 2008-11-21 19:02:43 +0000 (Fri, 21 Nov 2008)
Log Message:
-----------
Updated to better handle multiuploaded files
Fixed double click bug on non protected files.
Modified Paths:
--------------
trunk/lib/modules/default/files.inc.php
trunk/plugins/captcha.inc.php
trunk/plugins/email.inc.php
trunk/plugins/mimetypes.inc.php
trunk/plugins/password.inc.php
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:26:05 UTC (rev 168)
+++ trunk/lib/modules/default/files.inc.php 2008-11-21 19:02:43 UTC (rev 169)
@@ -153,20 +153,20 @@
$_SESSION['user']['u'][$i]['size']=$_FILES[$u]['size'];
$_SESSION['user']['u'][$i]['ip']=$_SERVER['REMOTE_ADDR'];
$_SESSION['user']['u'][$i]['user_login']=app()->user->info('login');
- $result = app()->pluginAction('uploadComplete',$_SESSION['user']['u'][$i]);
- if (!$result) { /* some plugin blocked the upload */
- /* remove the file */
- unset($_SESSION['user']['u']);
- redirect();
- }
}
}
+ $result = app()->pluginAction('uploadComplete',$_SESSION['user']['u']);
+ if (!$result) { /* some plugin blocked the upload */
+ /* remove the file */
+ unset($_SESSION['user']['u']);
+ redirect();
+ }
$this->nextStep(app()->step);
}
} else if (!isset($_SESSION['user']['u'][0])) {
redirect();
}
- $result = app()->pluginAction('uploadOptions',$_SESSION['user']['u'][0]);
+ $result = app()->pluginAction('uploadOptions',$_SESSION['user']['u']);
if (!$result) { /* some plugin blocked the upload */
/* remove the files */
unset($_SESSION['user']['u']);
@@ -185,23 +185,24 @@
/* send an e-mail if requested */
/* display the information on the upload */
if (isset($_POST['description'])) {
- /* move the file to the actual location */
+ /* now check plugins and if ok add file otherwise redirect */
+ $result = app()->pluginAction('uploadConfirm',$_SESSION['user']['u']);
+ if (!$result)
+ $this->prevStep();
for ($i = 0; $i<count($_SESSION['user']['u']); $i++) {
$finfo = $_SESSION['user']['u'][$i];
$finfo['description'] = $_POST['description'];
- /* now check plugins and if ok add file otherwise redirect */
if ($i==0) {
- $result = app()->pluginAction('uploadConfirm',$finfo);
- if (!$result)
- $this->prevStep();
$finfo['id']= app()->db->newRandomId('files','id');
$mainid = $finfo['id'];
+ $remove = app()->db->newRandomId('files','remove');
+ $date = date('Y-m-d H:i:s');
} else {
$finfo['id']=$mainid.'_'.$i;
}
/* everything ok then add the file */
- $finfo['remove']= app()->db->newRandomId('files','remove');
- $finfo['upload_date'] = date('Y-m-d H:i:s');
+ $finfo['remove']= $remove;
+ $finfo['upload_date'] = $date;
app()->db->insert('files',$finfo,array('id','name','mime','description','size','remove','user_login','ip','upload_date'));
if ($i==0) {
foreach (app()->plugins as $plugin) {
@@ -222,22 +223,24 @@
$pinfo['value']=$mainid;
app()->db->insert('file_options',$pinfo,array('file_id','module','name','value'));
}
+ /* move the file to the actual location */
rename($_SESSION['user']['u'][$i]['tmp'],app()->config['DATA_PATH'].'/'.$finfo['id']);
$_SESSION['user']['u'][$i]=$finfo;
- app()->log('notice','uploadConfirm','','OK',$finfo['id']);
}
+ app()->log('notice','uploadConfirm','','OK',$mainid);
$this->nextStep();
}
}
function uploadFileInfo() {
if (isset($_SESSION['user']['u'][0]['id'])) {
- $finfo = $_SESSION['user']['u'][0];
+ $finfo = $_SESSION['user']['u'];
/* get the file info */
- $finfo['downloadlink']= app()->config['WWW_SERVER'].app()->config['WWW_ROOT'].'/?action=d&id='.$finfo['id'];
- $finfo['removelink']= app()->config['WWW_SERVER'].app()->config['WWW_ROOT'].'/?action=r&id='.$finfo['id'].'&removeid='.$finfo['remove'];
+ $finfo[0]['downloadlink']= app()->config['WWW_SERVER'].app()->config['WWW_ROOT'].'/?action=d&id='.$finfo[0]['id'];
+ $finfo[0]['removelink']= app()->config['WWW_SERVER'].app()->config['WWW_ROOT'].'/?action=r&id='.$finfo[0]['id'].'&removeid='.$finfo[0]['remove'];
$result = app()->pluginAction('uploadFileInfo',$finfo,false);
- $this->tpl->assign('finfo',$finfo);
+ $this->tpl->assign('finfo',$finfo[0]);
+ $this->tpl->assign('files',$finfo);
$this->tpl->assign('webbase',app()->config['WWW_SERVER'].app()->config['WWW_ROOT']);
} else {
redirect();
@@ -294,11 +297,13 @@
$this->prevStep();
} else {
$_SESSION['user']['d']=$finfo;
+ $_SESSION['user']['d'][0]['protected'] = true;
$this->tpl->assign('finfo',$finfo[0]);
$this->tpl->assign('files',$finfo);
- $result = app()->pluginAction('downloadRequest',$finfo[0],false);
+ $result = app()->pluginAction('downloadRequest',$finfo,false);
if ($result) {
app()->log('info','downloadRequest','','ALLOW',$id);
+ $_SESSION['user']['d'][0]['protected']=false;
$this->nextStep();
}
}
@@ -318,7 +323,7 @@
} else {
$finfo = $_SESSION['user']['d'];
/* check wether the plugins are ok */
- $result = app()->pluginAction('downloadConfirm',$finfo[0]);
+ $result = app()->pluginAction('downloadConfirm',$finfo);
if (!$result)
$this->prevStep();
for ($i = 0; $i<count($finfo); $i++)
@@ -346,10 +351,10 @@
} else {
$finfo = $_SESSION['user']['d'];
/* check wether the plugins are ok */
- $result = app()->pluginAction('serveFile',$finfo[$num]);
+ $result = app()->pluginAction('serveFile',$finfo);
if (!$result)
$this->nextStep(3,'d');
- $_SESSION['user']['d'][$num]['candownload']='ok';
+ //$_SESSION['user']['d'][$num]['candownload']='ok';
/* if we got this far the download should begin serving */
$file = app()->config['DATA_PATH'].'/'.$finfo[$num]['id'];
$filesize = filesize($file);
@@ -367,7 +372,10 @@
header('Content-Disposition: attachment; filename="'.$finfo[$num]['name'].'"');
readfile($file);
/* file should have been sent now let's reset the download info */
- $_SESSION['user']['d'][$num]['candownload']='ko';
+ if (!$_SESSION['user']['d'][0]['protected'])
+ $_SESSION['user']['d'][$num]['candownload']='ok';
+ else
+ $_SESSION['user']['d'][$num]['candownload']='ko';
exit(0);
}
}
@@ -395,7 +403,7 @@
$_SESSION['user']['r']=$finfo;
$this->tpl->assign('files',$finfo);
$this->tpl->assign('finfo',$finfo[0]);
- $result = app()->pluginAction('removeRequest',$finfo[0],false);
+ $result = app()->pluginAction('removeRequest',$finfo,false);
if (!$result) {
redirect();
}
Modified: trunk/plugins/captcha.inc.php
===================================================================
--- trunk/plugins/captcha.inc.php 2008-11-21 17:26:05 UTC (rev 168)
+++ trunk/plugins/captcha.inc.php 2008-11-21 19:02:43 UTC (rev 169)
@@ -17,12 +17,12 @@
global $_POST;
if ($acl!='enable') return true;
- $finfo['captcha'] = $_POST['captcha'];
+ $finfo[0]['captcha'] = $_POST['captcha'];
return true;
}
function downloadRequest($finfo,$acl) {
- if ($finfo['captcha']==1) {
+ if ($finfo[0]['captcha']==1) {
$this->assign('captcha_img',app()->config['WWW_ROOT'].'/plugins/captcha.php');
$this->display('downloadRequest');
return false;
@@ -33,7 +33,7 @@
function downloadConfirm($finfo,$acl) {
global $_POST;
- if ($finfo['captcha']==1) {
+ if ($finfo[0]['captcha']==1) {
require_once(app()->config['INSTALL_ROOT'].'/plugins/securimage/securimage.php');
$securimage = new Securimage();
$result = $securimage->check($_POST['captcha_code']);
Modified: trunk/plugins/email.inc.php
===================================================================
--- trunk/plugins/email.inc.php 2008-11-21 17:26:05 UTC (rev 168)
+++ trunk/plugins/email.inc.php 2008-11-21 19:02:43 UTC (rev 169)
@@ -17,25 +17,25 @@
if ($acl!='enable') return true;
/* do e-mail checking and so */
/* $this->display('upload'); */
- $finfo['emailme']=$_POST['emailme'];
- $finfo['emailfrom']=app()->config['site']['email'];
- $finfo['emailto']=$_POST['emailto'];
- $finfo['email_removelink']=$_POST['removelink'];
- $finfo['subject']=$_POST['subject'];
- $finfo['message']=$_POST['message'];
- if ($finfo['emailme']=="yes") {
+ $finfo[0]['emailme']=$_POST['emailme'];
+ $finfo[0]['emailfrom']=app()->config['site']['email'];
+ $finfo[0]['emailto']=$_POST['emailto'];
+ $finfo[0]['email_removelink']=$_POST['removelink'];
+ $finfo[0]['subject']=$_POST['subject'];
+ $finfo[0]['message']=$_POST['message'];
+ if ($finfo[0]['emailme']=="yes") {
if ($_SESSION['user']['email']=='') {
/* check valid e-mail */
if (!validEmail($_POST['email'])) {
app()->error(tr('Your e-mail address isn\'t valid!'));
return false;
}
- $finfo['emailfrom']=$_POST['email'];
+ $finfo[0]['emailfrom']=$_POST['email'];
} else {
- $finfo['emailfrom']=$_SESSION['user']['name'].' <'.$_SESSION['user']['email'].'>';
+ $finfo[0]['emailfrom']=$_SESSION['user']['name'].' <'.$_SESSION['user']['email'].'>';
}
}
- if ($finfo['emailto']!='') {
+ if ($finfo[0]['emailto']!='') {
if (!validEmail($_POST['emailto'])) {
app()->error(tr('Destination e-mail address isn\'t valid!'));
return false;
@@ -51,21 +51,20 @@
if ($acl!='enable') return true;
/* send the e-mails */
app()->tpl->assign('finfo',$finfo);
- if ($finfo['emailme']=="yes") {
+ if ($finfo[0]['emailme']=="yes") {
app()->tpl->assign('remove','yes');
- $subject = app()->config['site']['title'].': '.tr("Information about your uploaded file: %1",$finfo['name']);
- sendMail(app()->config['site']['email'],'noreply',$finfo['emailfrom'],$subject,'plugins/email/notify');
+ $subject = app()->config['site']['title'].': '.tr("Information about your uploaded file: %1",$finfo[0]['description']);
+ sendMail(app()->config['site']['email'],'noreply',$finfo[0]['emailfrom'],$subject,'plugins/email/notify');
}
- if ($finfo['emailto']!='') {
- $subject = $finfo['subject']!=''?$finfo['subject']:tr("An upload was delivered to you");
+ if ($finfo[0]['emailto']!='') {
+ $subject = $finfo[0]['subject']!=''?$finfo[0]['subject']:tr("An upload was delivered to you");
$subject = app()->config['site']['title'].': '.$subject;
- app()->tpl->assign('remove',$finfo['email_removelink']);
- sendMail($finfo['emailfrom'],$finfo['emailfrom'],$finfo['emailto'],$subject,'plugins/email/notify');
+ app()->tpl->assign('remove',$finfo[0]['email_removelink']);
+ sendMail($finfo[0]['emailfrom'],$finfo[0]['emailfrom'],$finfo[0]['emailto'],$subject,'plugins/email/notify');
}
/* don't send it twice */
- $finfo['emailme']=='';
- $finfo['emailto']=='';
-//exit();
+ $finfo[0]['emailme']=='';
+ $finfo[0]['emailto']=='';
return true;
}
}
\ No newline at end of file
Modified: trunk/plugins/mimetypes.inc.php
===================================================================
--- trunk/plugins/mimetypes.inc.php 2008-11-21 17:26:05 UTC (rev 168)
+++ trunk/plugins/mimetypes.inc.php 2008-11-21 19:02:43 UTC (rev 169)
@@ -46,9 +46,15 @@
$group = $this->getGroup();
if (count($this->config['allowed'][$group])==0) {
app()->error(tr('WARNING: no mime types defined. Plugin has been disabled!'));
- } else if (array_search($finfo['mime'],$this->config['allowed'][$group])===FALSE) {
- app()->error(tr('This file type (%1) is not allowed on this site!',$finfo['mime']));
- return false;
+ } else {
+ $result = true;
+ foreach ($finfo as $f) {
+ if (array_search($f['mime'],$this->config['allowed'][$group])===FALSE) {
+ app()->error(tr('This file type (%1) is not allowed on this site!',$f['mime']));
+ $result = false;
+ }
+ }
+ return $result;
}
return true;
}
Modified: trunk/plugins/password.inc.php
===================================================================
--- trunk/plugins/password.inc.php 2008-11-21 17:26:05 UTC (rev 168)
+++ trunk/plugins/password.inc.php 2008-11-21 19:02:43 UTC (rev 169)
@@ -17,17 +17,17 @@
global $_POST;
if (isset($_POST['protect']) and $acl=='enable') {
- $finfo['plainpassword'] = $_POST['protect'];
- $finfo['password'] = crypt($_POST['protect']);
+ $finfo[0]['plainpassword'] = $_POST['protect'];
+ $finfo[0]['password'] = crypt($_POST['protect']);
} else {
- $finfo['password'] = crypt("");
- $finfo['plainpassword'] = "";
+ $finfo[0]['password'] = crypt("");
+ $finfo[0]['plainpassword'] = "";
}
return true;
}
function downloadRequest($finfo,$acl) {
- if (($finfo['password']!='') and ($finfo['password']!=crypt("",$finfo['password'])) ) {
+ if (($finfo[0]['password']!='') and ($finfo[0]['password']!=crypt("",$finfo[0]['password'])) ) {
$this->display('downloadRequest');
return false;
}
@@ -37,8 +37,8 @@
function downloadConfirm($finfo,$acl) {
global $_POST;
- if (($finfo['password']!='') and ($finfo['password']!=crypt("",$finfo['password'])) ) {
- $result = $finfo['password']==crypt($_POST['protect'],$finfo['password']);
+ if (($finfo[0]['password']!='') and ($finfo[0]['password']!=crypt("",$finfo[0]['password'])) ) {
+ $result = $finfo[0]['password']==crypt($_POST['protect'],$finfo[0]['password']);
if (!$result) app()->error(tr('Wrong password!'));
return $result;
} else {
Modified: trunk/templates/default/plugins/email/notify.tpl
===================================================================
--- trunk/templates/default/plugins/email/notify.tpl 2008-11-21 17:26:05 UTC (rev 168)
+++ trunk/templates/default/plugins/email/notify.tpl 2008-11-21 19:02:43 UTC (rev 169)
@@ -6,23 +6,23 @@
{tr}You are receiving this message because someone uploaded a file on our OpenUpload server for you.{/tr}
-{tr}Description{/tr}: {$finfo.description}
-{if $finfo.plainpassword!=''}
-{tr}Password{/tr}: {$finfo.plainpassword}
+{tr}Description{/tr}: {$finfo[0].description}
+{if $finfo[0].plainpassword!=''}
+{tr}Password{/tr}: {$finfo[0].plainpassword}
{/if}
-{if ($finfo.message!="")}
+{if ($finfo[0].message!="")}
{tr}User message{/tr}:
-{$finfo.message}
+{$finfo[0].message}
{/if}
{tr}To download the file open the following link in a browser{/tr}
-{$finfo.downloadlink}
+{$finfo[0].downloadlink}
{if isset($remove)}
{tr}To remove the file from our server open the following link in a browser{/tr}
-{$finfo.removelink}
+{$finfo[0].removelink}
{/if}
{if isset($adminemail)}
@@ -85,30 +85,29 @@
<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}Description{/tr}:</td><td>{$finfo.description}</td></tr>
-{if $finfo.plainpassword!=''}
-<tr><td>{tr}Password{/tr}:</td><td>{$finfo.plainpassword}</td></tr>
+<tr><td>{tr}Description{/tr}:</td><td>{$finfo[0].description}</td></tr>
+{if $finfo[0].plainpassword!=''}
+<tr><td>{tr}Password{/tr}:</td><td>{$finfo[0].plainpassword}</td></tr>
{/if}
</table>
-{if ($finfo.message!="")}
+{if ($finfo[0].message!="")}
<p>{tr}User message{/tr}<br>:
-{$finfo.message}
+{$finfo[0].message}
</p>
{/if}
<p>{tr}To download the file open the following link in a browser{/tr}<br>
-<a href="{$finfo.downloadlink}">{$finfo.downloadlink}</a></p>
+<a href="{$finfo[0].downloadlink}">{$finfo[0].downloadlink}</a></p>
{if isset($remove)}
<p>{tr}To remove the file from our server open the following link in a browser{/tr}<br>
-<a href="{$finfo.removelink}">{$finfo.removelink}</a>
+<a href="{$finfo[0].removelink}">{$finfo[0].removelink}</a>
{/if}
{if isset($adminemail)}
<p>{tr}For complains please send an email to{/tr}: <a href="mailto:{$adminemail}">{$adminemail}</a></p>
{/if}
-<div id="footer">OpenUpload © by Alessandro Briosi
-<a href="http://openupload.sourceforge.net>http://openupload.sourceforge.net</a></div>
+<div id="footer"><a href="http://openupload.sourceforge.net>OpenUpload</a> © by Alessandro Briosi</div>
</body>
</html>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <ts...@us...> - 2008-11-21 17:01:30
|
Revision: 167
http://openupload.svn.sourceforge.net/openupload/?rev=167&view=rev
Author: tsdogs
Date: 2008-11-21 17:01:26 +0000 (Fri, 21 Nov 2008)
Log Message:
-----------
Enable activity logging, fix setup script db structure.
Modified Paths:
--------------
trunk/lib/main.inc.php
trunk/lib/modules/default/auth.inc.php
trunk/lib/modules/default/files.inc.php
trunk/lib/user.inc.php
trunk/www/setup.inc.php
Modified: trunk/lib/main.inc.php
===================================================================
--- trunk/lib/main.inc.php 2008-11-21 15:56:22 UTC (rev 166)
+++ trunk/lib/main.inc.php 2008-11-21 17:01:26 UTC (rev 167)
@@ -89,6 +89,13 @@
$this->loadACL();
$this->initModules();
+
+ $this->loglevels['error'] = array('id' => 1, 'syslog' => LOG_ERR );
+ $this->loglevels['security'] = array('id' => 2, 'syslog' => LOG_WARNING );
+ $this->loglevels['warning'] = array('id' => 3, 'syslog' => LOG_WARNING );
+ $this->loglevels['notice'] = array('id' => 4, 'syslog' => LOG_NOTICE );
+ $this->loglevels['info'] = array('id' => 5, 'syslog' => LOG_INFO );
+ $this->loglevels['debug'] = array('id' => 9, 'syslog' => LOG_DEBUG );
}
function getBrowserLang() {
@@ -135,13 +142,51 @@
function message($msg) {
global $_SESSION;
$_SESSION['user']['messages'][] = $msg;
+ $this->log('info','','','MESSAGE',$msg);
}
function error($msg) {
global $_SESSION;
$_SESSION['user']['errors'][] = $msg;
+ $this->log('info','','','ERROR',$msg);
}
+ function log($level,$realaction,$plugin,$result,$moreinfo) {
+ global $_SERVER;
+
+ // log: datetime, ip, user, module, action, realaction, plugin, resulting code, additional info
+ if (isset($this->config['logging'])) {
+ if ($this->config['logging']['enabled']=='yes') {
+ $ip = $_SERVER['REMOTE_ADDR'];
+ $login = $this->user->info('login');
+ $module = $this->actions[$this->action];
+ $action = $this->action;
+ if ($this->config['logging']['db_level']>=$this->loglevels[$level]['id']) {
+ if (is_object($this->db)) {
+ $this->db->insert('activitylog',
+ array('level' => $level,
+ 'log_time' => date('Y-m-d H:i:s'),
+ 'ip' => $ip,
+ 'user_login' => $login,
+ 'module' => $module,
+ 'action' => $action,
+ 'realaction' => $realaction,
+ 'plugin' => $plugin,
+ 'result' => $result,
+ 'moreinfo' => $moreinfo
+ ) );
+ }
+ }
+ if ($this->config['logging']['syslog_level']>=$this->loglevels[$level]['id']) {
+ $msg = '[openupload] IP='.$ip.' LOGIN='.$this->user->info('login').
+ ' MODULE='.$module.' ACTION='.$action.' REALACTION='.$realaction.
+ ' PLUGIN='.$plugin.' RESULT='.$result.' MSG='.$moreinfo;
+ syslog($this->loglevels[$level]['syslog'],$msg);
+ }
+ }
+ }
+ }
+
function initModules() {
/* initialize configured modules */
foreach ($this->config['modules'] as $module) {
@@ -213,7 +258,11 @@
$acl = $this->pluginAcl[$plugin->name]['access'];
}
if (!$plugin->$action($finfo,$acl)) {
- if ($stop) return false;
+ if ($stop) {
+ app()->log('security',$action,$plugin->name,'DENY','');
+ return false;
+ }
+ app()->log('info',$action,$plugin->name,'DENY','non blocking');
$result = false;
}
$this->pluginHTML .= $plugin->pluginHTML;
@@ -270,7 +319,7 @@
$result = $this->checkSingleACL($group,$module,$action);
}
- if ($this->config['debug_acl'] and $result == 'deny') {
+ if (isset($this->config['debug_acl']) and $this->config['debug_acl'] and $result == 'deny') {
echo '<pre>ACL: '.$result.' - group: '.$group.', module: '.$module.', action: '.$action."\n";
print_r($this->acl);
echo '</pre>';
@@ -377,6 +426,7 @@
}
/* check for banned IP */
if ($this->banned() != 'allow') {
+ $this->log('security','banned','','DENY','');
$this->page['content'] = $this->fetch('banned');
$this->page['title']= tr('IP Banned');
$this->tpl->assign('page',app()->page);
@@ -387,6 +437,7 @@
/* depending on the acl some actions need authentication others don't */
if (!isset($this->actions[$this->action])) {
/* no module can handle this action */
+ $this->log('error','none','','NOT FOUND','');
redirect();
}
/* get the handling module */
@@ -400,6 +451,7 @@
/* check if login is allowed (it should always be */
if ($this->checkACL($group,'auth','login')!='allow') {
/* Login is not allowed there is an error, display the default page with a warning */
+ $this->log('error','checkACL','','DENY','default action not allowed!!!');
$this->tpl->assign('user',$this->user->info());
$this->tpl->assign('langs',$this->langs);
unset($_SESSION['user']['messages']);
@@ -447,6 +499,7 @@
$this->page['content']=$this->fetch('modules/'.$m->name.'/'.$fun);
$this->tpl->assign('page',$this->page);
$this->display($this->mainPage);
+ $this->log('info',$fun,'','ALLOW','');
$this->db->free();
}
}
Modified: trunk/lib/modules/default/auth.inc.php
===================================================================
--- trunk/lib/modules/default/auth.inc.php 2008-11-21 15:56:22 UTC (rev 166)
+++ trunk/lib/modules/default/auth.inc.php 2008-11-21 17:01:26 UTC (rev 167)
@@ -89,6 +89,7 @@
global $_POST;
if (app()->auth->features['useradmin']!='yes') {
+ app()->log('error','registerForm','','ERROR','Registration not supporte by Auth Module');
app()->error(tr('Registration is not supported by Auth Module'));
redirect();
}
@@ -209,6 +210,7 @@
$user['active']=1;
$user['regid']=''; /* disable possibility to reactivate it if disabled by the admin */
app()->db->update('users',$user,array('id' => $user['id']),array('active','regid'));
+ app()->log('notice','registerEnable','','OK',$user['login']);
}
}
}
Modified: trunk/lib/modules/default/files.inc.php
===================================================================
--- trunk/lib/modules/default/files.inc.php 2008-11-21 15:56:22 UTC (rev 166)
+++ trunk/lib/modules/default/files.inc.php 2008-11-21 17:01:26 UTC (rev 167)
@@ -118,18 +118,21 @@
if (isset($_FILES['upload'])) {
if ($_FILES['upload']['error']>0) {
switch ($_FILES['upload']['error']) { /* taken from here: http://it.php.net/manual/en/features.file-upload.errors.php */
- case 1: app()->error(tr('Maximum upload size for site wide configuration reached')); break;
- case 2: app()->error(tr('Maximum file size exceeded!')); break;
- case 3: app()->error(tr('Partial file transfer error!')); break;
- case 4: app()->error(tr('No file was uploaded!')); break;
- case 6: app()->error(tr('Missing temporary directory')); break;
- case 7: app()->error(tr('Can\'t write to temporary diretory!')); break;
- case 8: app()->error(tr('Upload blocked by extension!')); break;
+ case 1: $msg = 'Maximum upload size for site wide configuration reached'; break;
+ case 2: $msg = 'Maximum file size exceeded!'; break;
+ case 3: $msg = 'Partial file transfer error!'; break;
+ case 4: $msg = 'No file was uploaded!'; break;
+ case 6: $msg = 'Missing temporary directory'; break;
+ case 7: $msg = 'Can\'t write to temporary diretory!'; break;
+ case 8: $msg = 'Upload blocked by extension!'; break;
default:
- app()->error(tr('Upload failed for Unknown error code: %1',$_FILES['upload']['error'])); break;
+ $msg = tr('Upload failed for Unknown error code: %1',$_FILES['upload']['error']); break;
}
+ app()->log('warning','uploadOptions','','FAIL','Upload error: '.$msg);
+ app()->error(tr($msg));
$this->nextStep(1);
} else if ($_FILES['upload']['size']>app()->user->info('max_upload_size')) {
+ app()->log('warning','uploadOptions','','DENY','Maximum file size exceeded!');
app()->error(tr('Maximum file size exceeded!'));
break;
} else {
@@ -221,6 +224,7 @@
}
rename($_SESSION['user']['u'][$i]['tmp'],app()->config['DATA_PATH'].'/'.$finfo['id']);
$_SESSION['user']['u'][$i]=$finfo;
+ app()->log('notice','uploadConfirm','','OK',$finfo['id']);
}
$this->nextStep();
}
@@ -285,6 +289,7 @@
if ($id != '') {
$finfo = $this->loadFile($id);
if ($finfo[0]['id']!=$id) {
+ app()->log('warning','downloadRequest','','DENY','File does not exist: ID:'.$id);
app()->error(tr('Requested file does not exist!'));
$this->prevStep();
} else {
@@ -293,6 +298,7 @@
$this->tpl->assign('files',$finfo);
$result = app()->pluginAction('downloadRequest',$finfo[0],false);
if ($result) {
+ app()->log('info','downloadRequest','','ALLOW',$id);
$this->nextStep();
}
}
@@ -353,6 +359,7 @@
} else {
set_time_limit(7200); /* 2 hours should be enough */
}
+ app()->log('notice','serveFile','','ALLOW',$finfo[$num]['id']);
/* disable and clean output buffer so it won't reach memory limit */
ob_end_clean();
header('Content-Type: '.$finfo[$num]['mime']);
@@ -400,7 +407,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();
@@ -415,6 +422,7 @@
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']);
/* display removal confirmation */
$this->nextStep();
}
Modified: trunk/lib/user.inc.php
===================================================================
--- trunk/lib/user.inc.php 2008-11-21 15:56:22 UTC (rev 166)
+++ trunk/lib/user.inc.php 2008-11-21 17:01:26 UTC (rev 167)
@@ -15,6 +15,7 @@
$messages = $_SESSION['user']['messages'];
$errors = $_SESSION['user']['errors'];
+ app()->log('security','authenticate','','ALLOW','User logged out');
unset($_SESSION['user']);
$_SESSION['user']['messages'] = $messages;
$_SESSION['user']['errors'] = $errors;
@@ -81,10 +82,12 @@
/* retrieve user info */
$_SESSION['user'] = $this->auth->userinfo($username);
/* make the post not be resent on refresh */
+ app()->log('security','authenticate','','ALLOW','User logged in');
return true;
} else {
// set the error message for the login
app()->error(tr('Login incorrect!'));
+ app()->log('security','authenticate','','DENY','Login failed: '.$username);
}
}
return false;
Modified: trunk/www/setup.inc.php
===================================================================
--- trunk/www/setup.inc.php 2008-11-21 15:56:22 UTC (rev 166)
+++ trunk/www/setup.inc.php 2008-11-21 17:01:26 UTC (rev 167)
@@ -115,13 +115,10 @@
'module' => array ( 'type' => 'char', 'size' => 50, 'extra' => '', 'null' => 'NOT NULL', ),
'name' => array ( 'type' => 'char', 'size' => 50, 'extra' => '', 'null' => 'NOT NULL', ),
'value' => array ( 'type' => 'char', 'size' => 200, 'extra' => '', 'null' => 'NOT NULL', ),
- 'user_login' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => 'NOT NULL', ),
- 'ip' => array ( 'type' => 'char', 'size' => 40, 'extra' => '', 'null' => 'NOT NULL', ),
- 'upload_date' => array ( 'type' => 'datetime', 'size' => 0, 'extra' => '', 'null' => 'NOT NULL', ),
),
'keys' => array (
'id' => array ( 'primary' => true, 'fields' => array ('id'), ),
- 'file_id' => array ( 'primary' => false, 'unique' => 'false', 'fields' => array('file_id') ),
+ 'file_id' => array ( 'primary' => false, 'unique' => false, 'fields' => array('file_id') ),
),
),
'groups' => array (
@@ -187,6 +184,24 @@
'login' => array ( 'primary' => false, 'unique' => true, 'fields' => array('id'), ),
),
),
+ 'activitylog' => array (
+ 'fields' => array (
+ 'id' => array ( 'type' => 'int', 'size' => 20, 'extra' => 'auto_increment', 'null' => 'NOT NULL', ),
+ 'level' => array ( 'type' => 'char', 'size' => 20, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'log_time' => array ( 'type' => 'datetime', 'size' => 0, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'ip' => array ( 'type' => 'char', 'size' => 20, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'user_login' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'module' => array ( 'type' => 'char', 'size' => 50, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'action' => array ( 'type' => 'char', 'size' => 50, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'realaction' => array ( 'type' => 'char', 'size' => 50, 'extra' => '', 'null' => '', ),
+ 'plugin' => array ( 'type' => 'char', 'size' => 50, 'extra' => '', 'null' => '', ),
+ 'result' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => '', ),
+ 'moreinfo' => array ( 'type' => 'text', 'size' => 0, 'extra' => '', 'null' => '', ),
+ ),
+ 'keys' => array (
+ 'id' => array ( 'primary' => true, 'fields' => array('id'), ),
+ ),
+ ),
);
@@ -680,6 +695,9 @@
$CONFIG['max_download_time']=$_POST['max_download_time'];
$CONFIG['multiupload']=$_POST['multiupload'];
$CONFIG['progress']=$_POST['progress'];
+ $CONFIG['logging']['enabled']=isset($_POST['logging'])?'yes':'no';
+ $CONFIG['logging']['db_level']=$_POST['log_db_level'];
+ $CONFIG['logging']['syslog_level']=$_POST['log_syslog_level'];
if ($CONFIG['translator']=='') {
$error = true;
@@ -730,6 +748,9 @@
$CONFIG['max_download_time']=120;
$CONFIG['multiupload']=1;
$CONFIG['progress']=$_SESSION['progress_values'][count($_SESSION['progress_values'])-1];
+ $CONFIG['logging']['enabled']='yes';
+ $CONFIG['logging']['db_level']=4;
+ $CONFIG['logging']['syslog_level']=0;
}
?>
<form method="POST" action="index.php">
@@ -781,6 +802,25 @@
}
?>
</select></td></tr>
+<tr><td>Enable activity logging?:</td><td><input type="checkbox" name="logging" value="yes" <?php if ($CONFIG['logging']['enabled']=='yes') echo 'checked'; ?> ></td></tr>
+
+<tr><td>Database logging level:</td><td><select name="log_db_level">
+<?php
+ $loglevels = array ( 'Disabled', 'Errors', 'Security', 'Warnings', 'Statistics', 'Info');
+ foreach ($loglevels as $k => $l) {
+ $sel = $CONFIG['logging']['db_level']==$k?'selected':'';
+ echo '<option value="'.$k.'" '.$sel.'>'.$l.'</option>';
+ }
+?>
+</select></td></tr>
+<tr><td>Syslog logging level:</td><td><select name="log_syslog_level">
+<?php
+ foreach ($loglevels as $k => $l) {
+ $sel = $CONFIG['logging']['syslog_level']==$k?'selected':'';
+ echo '<option value="'.$k.'" '.$sel.'>'.$l.'</option>';
+ }
+?>
+</select></td></tr>
<TR><TD colspan="2"><input type="submit" value="Next >>"></TD></TR>
</table>
</form>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-21 15:56:31
|
Revision: 166
http://openupload.svn.sourceforge.net/openupload/?rev=166&view=rev
Author: tsdogs
Date: 2008-11-21 15:56:22 +0000 (Fri, 21 Nov 2008)
Log Message:
-----------
fix missing fields in files structure
Modified Paths:
--------------
trunk/www/setup.inc.php
Modified: trunk/www/setup.inc.php
===================================================================
--- trunk/www/setup.inc.php 2008-11-20 19:08:13 UTC (rev 165)
+++ trunk/www/setup.inc.php 2008-11-21 15:56:22 UTC (rev 166)
@@ -96,6 +96,7 @@
'fields' => array (
'id' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => 'NOT NULL', ),
'name' => array ( 'type' => 'char', 'size' => 200, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'mime' => array ( 'type' => 'char', 'size' => 200, 'extra' => '', 'null' => 'NOT NULL', ),
'description' => array ( 'type' => 'text', 'size' => 0, 'extra' => '', 'null' => 'NOT NULL', ),
'size' => array ( 'type' => 'int', 'size' => 12, 'extra' => '', 'null' => 'NOT NULL', ),
'remove' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => 'NOT NULL', ),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-20 19:08:17
|
Revision: 165
http://openupload.svn.sourceforge.net/openupload/?rev=165&view=rev
Author: tsdogs
Date: 2008-11-20 19:08:13 +0000 (Thu, 20 Nov 2008)
Log Message:
-----------
Add a Null translator (which does not translate at all)
Added Paths:
-----------
trunk/lib/modules/tr/null.inc.php
Added: trunk/lib/modules/tr/null.inc.php
===================================================================
--- trunk/lib/modules/tr/null.inc.php (rev 0)
+++ trunk/lib/modules/tr/null.inc.php 2008-11-20 19:08:13 UTC (rev 165)
@@ -0,0 +1,14 @@
+<?php
+
+/* No translation at all */
+
+class NullTranslator extends translatorBase {
+
+ function NullTranslator() {
+ }
+
+ function translate($txt,$domain = 'openupload') {
+ return $txt;
+ }
+}
+?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-20 19:05:37
|
Revision: 164
http://openupload.svn.sourceforge.net/openupload/?rev=164&view=rev
Author: tsdogs
Date: 2008-11-20 19:05:32 +0000 (Thu, 20 Nov 2008)
Log Message:
-----------
Be sure translator is loaded before calling the translation
Modified Paths:
--------------
trunk/lib/general.inc.php
Modified: trunk/lib/general.inc.php
===================================================================
--- trunk/lib/general.inc.php 2008-11-20 18:39:47 UTC (rev 163)
+++ trunk/lib/general.inc.php 2008-11-20 19:05:32 UTC (rev 164)
@@ -59,7 +59,8 @@
function translate($txt,$domain,$args) {
/* now we retrieve the translated message */
- $txt = app()->tr->translate($txt,$domain);
+ if (is_object(app()->tr))
+ $txt = app()->tr->translate($txt,$domain);
/* if there are arguments replace them */
if (count($args)>0) {
$trargs = array();
@@ -77,7 +78,7 @@
* @name tr
* @param $txt
* @param ...
- * @description translates a string either from template or from code.
+ * @description translates a string from code string.
*
*/
function tr($txt) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-20 18:39:49
|
Revision: 163
http://openupload.svn.sourceforge.net/openupload/?rev=163&view=rev
Author: tsdogs
Date: 2008-11-20 18:39:47 +0000 (Thu, 20 Nov 2008)
Log Message:
-----------
Fix acl accordingly with INSTALL documentation.
Modified Paths:
--------------
trunk/sql/mysql/3_mode_private.sql
trunk/sql/mysql/3_mode_restricted.sql
trunk/sql/pgsql/3_mode_private.sql
trunk/sql/pgsql/3_mode_restricted.sql
trunk/sql/txt/modes/acl_private.txt
trunk/sql/txt/modes/acl_restricted.txt
Modified: trunk/sql/mysql/3_mode_private.sql
===================================================================
--- trunk/sql/mysql/3_mode_private.sql 2008-11-20 18:33:02 UTC (rev 162)
+++ trunk/sql/mysql/3_mode_private.sql 2008-11-20 18:39:47 UTC (rev 163)
@@ -4,8 +4,10 @@
INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(5, 'auth', 'register', '*', 'deny');
INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(6, 'auth', '*', 'unregistered', 'deny');
INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(7, 'auth', '*', '*', 'allow');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(8, 'files', '*', 'unregistered', 'deny');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(9, 'files', '*', '*', 'allow');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(8, 'files', 'd', 'unregistered', 'allow');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(9, 'files', 'g', 'unregistered', 'allow');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(10, 'files', '*', 'unregistered', 'deny');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(11, 'files', '*', '*', 'allow');
--
-- Dump dei dati per la tabella `plugin_acl`
Modified: trunk/sql/mysql/3_mode_restricted.sql
===================================================================
--- trunk/sql/mysql/3_mode_restricted.sql 2008-11-20 18:33:02 UTC (rev 162)
+++ trunk/sql/mysql/3_mode_restricted.sql 2008-11-20 18:39:47 UTC (rev 163)
@@ -1,7 +1,7 @@
--
-- Dump dei dati per la tabella `acl`
--
-INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(5, 'auth', 'register', '*', 'deny');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(5, 'auth', 'register', '*', 'allow');
INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(6, 'auth', '*', 'unregistered', 'deny');
INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(7, 'auth', '*', '*', 'allow');
INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(8, 'files', 'd', 'unregistered', 'allow');
Modified: trunk/sql/pgsql/3_mode_private.sql
===================================================================
--- trunk/sql/pgsql/3_mode_private.sql 2008-11-20 18:33:02 UTC (rev 162)
+++ trunk/sql/pgsql/3_mode_private.sql 2008-11-20 18:39:47 UTC (rev 163)
@@ -4,8 +4,10 @@
INSERT INTO acl VALUES (5, 'auth', 'register', '*', 'deny');
INSERT INTO acl VALUES (6, 'auth', '*', 'unregistered', 'deny');
INSERT INTO acl VALUES (7, 'auth', '*', '*', 'allow');
-INSERT INTO acl VALUES (8, 'files', '*', 'unregistered', 'deny');
-INSERT INTO acl VALUES (9, 'files', '*', '*', 'allow');
+INSERT INTO acl VALUES (8, 'files', 'd', 'unregistered', 'allow');
+INSERT INTO acl VALUES (9, 'files', 'g', 'unregistered', 'allow');
+INSERT INTO acl VALUES (10, 'files', '*', 'unregistered', 'deny');
+INSERT INTO acl VALUES (11, 'files', '*', '*', 'allow');
--
-- Dump dei dati per la tabella `plugin_acl`
Modified: trunk/sql/pgsql/3_mode_restricted.sql
===================================================================
--- trunk/sql/pgsql/3_mode_restricted.sql 2008-11-20 18:33:02 UTC (rev 162)
+++ trunk/sql/pgsql/3_mode_restricted.sql 2008-11-20 18:39:47 UTC (rev 163)
@@ -1,7 +1,7 @@
--
-- Dump dei dati per la tabella acl
--
-INSERT INTO acl VALUES (5, 'auth', 'register', '*', 'deny');
+INSERT INTO acl VALUES (5, 'auth', 'register', '*', 'allow');
INSERT INTO acl VALUES (6, 'auth', '*', 'unregistered', 'deny');
INSERT INTO acl VALUES (7, 'auth', '*', '*', 'allow');
INSERT INTO acl VALUES (8, 'files', 'd', 'unregistered', 'allow');
Modified: trunk/sql/txt/modes/acl_private.txt
===================================================================
--- trunk/sql/txt/modes/acl_private.txt 2008-11-20 18:33:02 UTC (rev 162)
+++ trunk/sql/txt/modes/acl_private.txt 2008-11-20 18:39:47 UTC (rev 163)
@@ -2,9 +2,12 @@
1|*|*|admins|allow
2|admin|*|admins|allow
3|admin|*|*|deny
+4|auth|login|unregistered|allow
5|auth|register|*|deny
6|auth|*|unregistered|deny
7|auth|*|*|allow
-8|files|*|unregistered|deny
-9|files|*|*|allow
-10|auth|login|unregistered|allow
+8|files|d|unregistered|allow
+9|files|g|unregistered|allow
+10|files|*|unregistered|deny
+11|files|*|*|allow
+
Modified: trunk/sql/txt/modes/acl_restricted.txt
===================================================================
--- trunk/sql/txt/modes/acl_restricted.txt 2008-11-20 18:33:02 UTC (rev 162)
+++ trunk/sql/txt/modes/acl_restricted.txt 2008-11-20 18:39:47 UTC (rev 163)
@@ -4,7 +4,7 @@
3|admin|*|*|deny
4|auth|login|unregistered|allow
5|auth|register|*|deny
-6|auth|*|unregistered|deny
+6|auth|*|unregistered|allow
7|auth|*|*|allow
8|files|d|unregistered|allow
9|files|g|unregistered|allow
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-20 18:33:13
|
Revision: 162
http://openupload.svn.sourceforge.net/openupload/?rev=162&view=rev
Author: tsdogs
Date: 2008-11-20 18:33:02 +0000 (Thu, 20 Nov 2008)
Log Message:
-----------
it ain't perfect but pgsql support is now on.
Reworked the whole SQL syntax to be more usable by the database functions.
ACL should now correspond to the documentation
Modified Paths:
--------------
trunk/www/setup.inc.php
Modified: trunk/www/setup.inc.php
===================================================================
--- trunk/www/setup.inc.php 2008-11-20 15:09:40 UTC (rev 161)
+++ trunk/www/setup.inc.php 2008-11-20 18:33:02 UTC (rev 162)
@@ -49,6 +49,7 @@
);
/* DATABASE INITIALIZATION QUERY */
+
$MYSQL_QUERY = array (
'dropdb' => 'DROP DATABASE IF EXISTS `%1`',
'createdb' => 'CREATE DATABASE `%1`',
@@ -56,162 +57,236 @@
'createuser' => '',
'grant' => 'GRANT ALL PRIVILEGES ON %2.* TO "%1"@"localhost" IDENTIFIED BY "%3"',
'droptable' => 'DROP TABLE IF EXISTS `%1%2`',
- 'structure' => array (
- 'acl' => 'CREATE TABLE `%1acl` (
- `id` int(11) NOT NULL auto_increment,
- `module` varchar(100) NOT NULL,
- `action` varchar(100) NOT NULL,
- `group_name` varchar(50) NOT NULL,
- `access` varchar(10) NOT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0',
- 'banned' => 'CREATE TABLE `%1banned` (
- `id` int(11) NOT NULL auto_increment,
- `ip` varchar(50) NOT NULL,
- `access` varchar(50) NOT NULL,
- `priority` int(11) NOT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0',
- 'files' => 'CREATE TABLE `%1files` (
- `id` varchar(100) NOT NULL,
- `name` varchar(200) NOT NULL,
- `mime` varchar(200) NOT NULL,
- `description` tinytext NOT NULL,
- `size` int(12) NOT NULL,
- `remove` varchar(100) NOT NULL,
- `user_login` varchar(100) NOT NULL,
- `ip` varchar(40) NOT NULL,
- `upload_date` datetime NOT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1',
- 'file_options' => 'CREATE TABLE `%1file_options` (
- `id` bigint(20) NOT NULL auto_increment,
- `file_id` varchar(100) NOT NULL,
- `module` varchar(50) NOT NULL,
- `name` varchar(50) NOT NULL,
- `value` varchar(200) NOT NULL,
- PRIMARY KEY (`id`),
- KEY `file_id` (`file_id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0',
- 'groups' => 'CREATE TABLE `%1groups` (
- `name` varchar(50) NOT NULL,
- `description` varchar(250) default NULL,
- PRIMARY KEY (`name`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1',
- 'langs' => 'CREATE TABLE `%1langs` (
- `id` varchar(10) NOT NULL,
- `name` varchar(100) NOT NULL,
- `locale` varchar(10) NOT NULL,
- `browser` varchar(200) default NULL,
- `charset` varchar(50) NOT NULL,
- `active` tinyint(1) NOT NULL default \'1\',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1',
- 'plugin_acl' => 'CREATE TABLE `%1plugin_acl` (
- `id` int(11) NOT NULL auto_increment,
- `group_name` varchar(50) NOT NULL,
- `plugin` varchar(100) NOT NULL,
- `access` varchar(10) NOT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `group_name` (`group_name`,`plugin`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0',
- 'plugin_options' => 'CREATE TABLE `%1plugin_options` (
- `id` int(11) NOT NULL auto_increment,
- `plugin` varchar(100) NOT NULL,
- `group_name` varchar(100) NOT NULL,
- `name` varchar(100) NOT NULL,
- `value` text,
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0',
- 'users' => 'CREATE TABLE `%1users` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `login` varchar(100) NOT NULL,
- `password` varchar(100) NOT NULL,
- `name` varchar(200) NOT NULL,
- `group_name` varchar(50) NOT NULL default \'registered\',
- `email` varchar(250) NOT NULL,
- `lang` varchar(10) NOT NULL default \'en\',
- `reg_date` datetime NOT NULL,
- `regid` varchar(50) NOT NULL default \'\',
- `active` tinyint(3) unsigned NOT NULL default \'1\',
- PRIMARY KEY (`id`),
- UNIQUE KEY `login` (`login`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0',
- ),
- 'base' => array (
- "INSERT INTO `%0banned` (`id`, `ip`, `access`, `priority`) VALUES(1, '127.0.0.1', 'allow', 1)",
- "INSERT INTO `%0banned` (`id`, `ip`, `access`, `priority`) VALUES(2, '0.0.0.0/0', 'allow', 9999999)",
- "INSERT INTO `%0groups` (`name`, `description`) VALUES('%3', 'Administrators group')",
- "INSERT INTO `%0groups` (`name`, `description`) VALUES('%4', 'Registered Users')",
- "INSERT INTO `%0groups` (`name`, `description`) VALUES('%5', 'Unregistered users')",
- "INSERT INTO `%0langs` (`id`, `name`, `locale`, `browser`, `charset`, `active`) VALUES('en', 'English', 'en_EN', '[en];[en-EN]', 'iso-8559-1', 1)",
- "INSERT INTO `%0langs` (`id`, `name`, `locale`, `browser`, `charset`, `active`) VALUES('it', 'Italiano', 'it_IT.utf8', '[it];[it-IT]', 'utf8', 1)",
- "INSERT INTO `%0langs` (`id`, `name`, `locale`, `browser`, `charset`, `active`) VALUES('fr', 'Français', 'fr_FR.utf8', '[fr];[fr-FR]', 'utf8', 1)",
- "INSERT INTO `%0users` (`id`, `login`, `password`, `name`, `group_name`, `email`, `lang`, `reg_date`, `regid`, `active`) VALUES(1, '%1', '%2', 'Administrator', '%3', '%6', 'en', now(), '', 1)",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(1, '*', '*', '%3', 'allow')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(2, 'admin', '*', '%3', 'allow')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(3, 'admin', '*', '*', 'deny')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(4, 'auth', 'login', '%5', 'allow')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(1, '%3', 'password', 'enable')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(2, '%3', 'captcha', 'enable')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(3, '%3', 'email', 'enable')",
- "INSERT INTO `%0plugin_options` (`id`, `plugin`, `group_name`, `name`, `value`) VALUES (1, 'mimetypes', '%5', 'message', 'Pdf, JPEG')",
- "INSERT INTO `%0plugin_options` (`id`, `plugin`, `group_name`, `name`, `value`) VALUES (2, 'mimetypes', '%5', 'allowed', 'application/pdf
-image/jpeg')",
- ),
- 'mode_1' => array (
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(5, 'auth', 'register', '*', 'deny')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(6, 'auth', '*', '%5', 'deny')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(7, 'auth', '*', '*', 'allow')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(8, 'files', '*', '%5', 'deny')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(9, 'files', '*', '*', 'allow')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(4, '%4', 'password', 'enable')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(5, '%4', 'captcha', 'enable')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(6, '%4', 'email', 'enable')",
- ),
- 'mode_2' => array (
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(5, 'auth', 'register', '*', 'deny')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(6, 'auth', '*', '%5', 'deny')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(7, 'auth', '*', '*', 'allow')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(8, 'files', 'd', '%5', 'allow')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(9, 'files', 'g', '%5', 'allow')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(10, 'files', '*', '%5', 'deny')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(11, 'files', '*', '*', 'allow')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(4, '%4', 'password', 'enable')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(5, '%4', 'captcha', 'enable')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(6, '%4', 'email', 'enable')",
- ),
- 'mode_3' => array (
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(5, 'auth', 'register', '%5', 'allow')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(6, 'auth', '*', '%5', 'deny')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(7, 'auth', 'register', '*', 'deny')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(8, 'auth', '*', '*', 'allow')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(9, 'files', '*', '*', 'allow')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(4, '%4', 'password', 'enable')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(5, '%4', 'captcha', 'enable')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(6, '%4', 'email', 'enable')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(7, '%5', 'mimetypes', 'enable')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(8, '%5', 'captcha', 'enable')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(9, '%5', 'password', 'enable')",
-),
- 'mode_4' => array (
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(5, 'auth', '*', '*', 'deny')",
- "INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(6, 'files', '*', '*', 'allow')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(4, '%5', 'password', 'enable')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(5, '%5', 'captcha', 'enable')",
- "INSERT INTO `%0plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(6, '%5', 'email', 'enable')",
- ),
);
+
$PGSQL_QUERY = array (
'dropdb' => 'DROP DATABASE "%1"',
'createdb' => 'CREATE DATABASE "%1"',
'dropuser' => '',
'createuser' => '',
'grant' => '',
- 'droptable' => 'DROP TABLE IF EXISTS `%2`',
+ 'droptable' => 'DROP TABLE IF EXISTS %1%2',
);
+$DB_STRUCTURE = array (
+ 'acl' => array (
+ 'fields' => array (
+ 'id' => array ( 'type' => 'int', 'size' => 11, 'extra' => 'auto_increment', 'null' => 'NOT NULL', ),
+ 'module' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'action' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'group_name' => array ( 'type' => 'char', 'size' => 50, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'access' => array ( 'type' => 'char', 'size' => 10, 'extra' => '', 'null' => 'NOT NULL', ),
+ ),
+ 'keys' => array (
+ 'id' => array ( 'primary' => true, 'fields' => array ('id'), ),
+ ),
+ ),
+ 'banned' => array (
+ 'fields' => array (
+ 'id' => array ( 'type' => 'int', 'size' => 11, 'extra' => 'auto_increment', 'null' => 'NOT NULL', ),
+ 'ip' => array ( 'type' => 'char', 'size' => 50, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'access' => array ( 'type' => 'char', 'size' => 50, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'priority' => array ( 'type' => 'int', 'size' => 11, 'extra' => '', 'null' => 'NOT NULL', ),
+ ),
+ 'keys' => array (
+ 'id' => array ( 'primary' => true, 'fields' => array ('id'), ),
+ ),
+ ),
+ 'files' => array (
+ 'fields' => array (
+ 'id' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'name' => array ( 'type' => 'char', 'size' => 200, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'description' => array ( 'type' => 'text', 'size' => 0, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'size' => array ( 'type' => 'int', 'size' => 12, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'remove' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'user_login' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'ip' => array ( 'type' => 'char', 'size' => 40, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'upload_date' => array ( 'type' => 'datetime', 'size' => 0, 'extra' => '', 'null' => 'NOT NULL', ),
+ ),
+ 'keys' => array (
+ 'id' => array ( 'primary' => true, 'fields' => array ('id'), ),
+ ),
+ ),
+ 'file_options' => array (
+ 'fields' => array (
+ 'id' => array ( 'type' => 'int', 'size' => 20, 'extra' => 'auto_increment', 'null' => 'NOT NULL', ),
+ 'file_id' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'module' => array ( 'type' => 'char', 'size' => 50, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'name' => array ( 'type' => 'char', 'size' => 50, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'value' => array ( 'type' => 'char', 'size' => 200, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'user_login' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'ip' => array ( 'type' => 'char', 'size' => 40, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'upload_date' => array ( 'type' => 'datetime', 'size' => 0, 'extra' => '', 'null' => 'NOT NULL', ),
+ ),
+ 'keys' => array (
+ 'id' => array ( 'primary' => true, 'fields' => array ('id'), ),
+ 'file_id' => array ( 'primary' => false, 'unique' => 'false', 'fields' => array('file_id') ),
+ ),
+ ),
+ 'groups' => array (
+ 'fields' => array (
+ 'name' => array ( 'type' => 'char', 'size' => 50, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'description' => array ( 'type' => 'char', 'size' => 250, 'extra' => '', 'null' => '', ),
+ ),
+ 'keys' => array (
+ 'name' => array ( 'primary' => true, 'fields' => array('name'), ),
+ ),
+ ),
+ 'langs' => array (
+ 'fields' => array (
+ 'id' => array ( 'type' => 'char', 'size' => 10, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'name' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'locale' => array ( 'type' => 'char', 'size' => 10, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'browser' => array ( 'type' => 'char', 'size' => 200, 'extra' => '', 'null' => '', ),
+ 'charset' => array ( 'type' => 'char', 'size' => 50, 'extra' => '', 'null' => '', ),
+ 'active' => array ( 'type' => 'int', 'size' => 1, 'extra' => '', 'null' => '', 'default' => '1'),
+ ),
+ 'keys' => array (
+ 'id' => array ( 'primary' => true, 'fields' => array('id'), ),
+ ),
+ ),
+ 'plugin_acl' => array (
+ 'fields' => array (
+ 'id' => array ( 'type' => 'int', 'size' => 10, 'extra' => 'auto_increment', 'null' => 'NOT NULL', ),
+ 'group_name' => array ( 'type' => 'char', 'size' => 50, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'plugin' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'access' => array ( 'type' => 'char', 'size' => 10, 'extra' => '', 'null' => 'NOT NULL', ),
+ ),
+ 'keys' => array (
+ 'id' => array ( 'primary' => true, 'fields' => array('id'), ),
+ ),
+ ),
+ 'plugin_options' => array (
+ 'fields' => array (
+ 'id' => array ( 'type' => 'int', 'size' => 10, 'extra' => 'auto_increment', 'null' => 'NOT NULL', ),
+ 'plugin' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'group_name' => array ( 'type' => 'char', 'size' => 50, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'name' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'value' => array ( 'type' => 'text', 'size' => 0, 'extra' => '', 'null' => 'NOT NULL', ),
+ ),
+ 'keys' => array (
+ 'id' => array ( 'primary' => true, 'fields' => array('id'), ),
+ ),
+ ),
+ 'users' => array (
+ 'fields' => array (
+ 'id' => array ( 'type' => 'int', 'size' => 10, 'extra' => 'auto_increment', 'null' => 'NOT NULL', ),
+ 'login' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'password' => array ( 'type' => 'char', 'size' => 100, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'name' => array ( 'type' => 'char', 'size' => 200, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'group_name' => array ( 'type' => 'char', 'size' => 50, 'extra' => '', 'null' => 'NOT NULL', 'default' => 'registered'),
+ 'email' => array ( 'type' => 'char', 'size' => 250, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'lang' => array ( 'type' => 'char', 'size' => 10, 'extra' => '', 'null' => 'NOT NULL', 'default' => 'en'),
+ 'reg_date' => array ( 'type' => 'datetime', 'size' => 0, 'extra' => '', 'null' => 'NOT NULL', ),
+ 'regid' => array ( 'type' => 'char', 'size' => 50, 'extra' => '', 'null' => 'NOT NULL', 'default' => ''),
+ 'active' => array ( 'type' => 'int', 'size' => 1, 'extra' => '', 'null' => 'NOT NULL', ),
+ ),
+ 'keys' => array (
+ 'id' => array ( 'primary' => true, 'fields' => array('id'), ),
+ 'login' => array ( 'primary' => false, 'unique' => true, 'fields' => array('id'), ),
+ ),
+ ),
+);
+
+$DB_DATA = array (
+ 'base' => array (
+ 'acl' => array (
+ array('id' => 1, 'module' => '*', 'action' => '*', 'group_name' => '%3', 'access' => 'allow' ),
+ array('id' => 2, 'module' => 'admin', 'action' => '*', 'group_name' => '%3', 'access' => 'allow' ),
+ array('id' => 3, 'module' => 'admin', 'action' => '*', 'group_name' => '*', 'access' => 'deny' ),
+ array('id' => 4, 'module' => 'auth', 'action' => 'login', 'group_name' => '%5', 'access' => 'allow' ),
+ ),
+ 'groups' => array (
+ array ('name' => '%3' ,'description' => 'Administrators group' ),
+ array ('name' => '%4' ,'description' => 'Registered Users' ),
+ array ('name' => '%5' ,'description' => 'Unregistered users' ),
+ ),
+ 'banned' => array (
+ array ( 'id' => 1, 'ip' => '127.0.0.1', 'access' => 'allow', 'priority' => 1),
+ array ( 'id' => 2, 'ip' => '0.0.0.0/0', 'access' => 'allow', 'priority' => 9999999),
+ ),
+ 'langs' => array (
+ array ('id' => 'en', 'name' => 'English', 'locale' => 'en_EN', 'browser' => '[en];[en-EN]', 'charset' => 'utf8', 'active' => 1),
+ array ('id' => 'it', 'name' => 'Italiano', 'locale' => 'it_IT.utf8', 'browser' => '[it];[it-IT]', 'charset' => 'utf8', 'active' => 1),
+ array ('id' => 'fr', 'name' => 'Français', 'locale' => 'fr_FR.utf8', 'browser' => '[fr];[fr-FR]', 'charset' => 'utf8', 'active' => 1),
+ ),
+ 'users' => array (
+ array ( 'id' => 1, 'login' => '%1', 'password' => '%2', 'name' => 'Administrator', 'group_name' => '%3', 'email' => '%6',
+ 'lang' => 'en', 'reg_date' => '', 'regid' => '', 'active' => 1 ),
+ ),
+ 'plugin_acl' => array (
+ array ( 'id' => '1', 'group_name' => '%3', 'plugin' => 'password', 'access' => 'enable'),
+ array ( 'id' => '2', 'group_name' => '%3', 'plugin' => 'captcha', 'access' => 'enable'),
+ array ( 'id' => '3', 'group_name' => '%3', 'plugin' => 'email', 'access' => 'enable'),
+ ),
+ 'plugin_options' => array (
+ array ( 'id' => '1', 'plugin' => 'mimetypes', 'group_name' => '%5', 'name' => 'message', 'value' => 'Pdf, Jpeg'),
+ array ( 'id' => '2', 'plugin' => 'mimetypes', 'group_name' => '%5', 'name' => 'allowed', 'value' => 'application/pdf'."\n".'image/jpeg'),
+ ),
+ ),
+ 'mode_1' => array (
+ 'acl' => array (
+ array('id' => 5, 'module' => 'auth', 'action' => 'register', 'group_name' => '*', 'access' => 'deny' ),
+ array('id' => 6, 'module' => 'auth', 'action' => '*', 'group_name' => '%5', 'access' => 'deny' ),
+ array('id' => 7, 'module' => 'auth', 'action' => '*', 'group_name' => '*', 'access' => 'allow' ),
+ array('id' => 8, 'module' => 'files', 'action' => 'd', 'group_name' => '%5', 'access' => 'allow' ),
+ array('id' => 9, 'module' => 'files', 'action' => 'g', 'group_name' => '%5', 'access' => 'allow' ),
+ array('id' => 10, 'module' => 'files', 'action' => '*', 'group_name' => '%5', 'access' => 'deny' ),
+ array('id' => 11, 'module' => 'files', 'action' => '*', 'group_name' => '*', 'access' => 'allow' ),
+ ),
+ 'plugin_acl' => array (
+ array ( 'id' => 4, 'group_name' => '%4', 'plugin' => 'password', 'access' => 'enable'),
+ array ( 'id' => 5, 'group_name' => '%4', 'plugin' => 'captcha', 'access' => 'enable'),
+ array ( 'id' => 6, 'group_name' => '%4', 'plugin' => 'email', 'access' => 'enable'),
+ ),
+ ),
+ 'mode_2' => array (
+ 'acl' => array (
+ array('id' => 5, 'module' => 'auth', 'action' => 'register', 'group_name' => '%5', 'access' => 'allow' ),
+ array('id' => 6, 'module' => 'auth', 'action' => '*', 'group_name' => '%5', 'access' => 'deny' ),
+ array('id' => 7, 'module' => 'auth', 'action' => '*', 'group_name' => '*', 'access' => 'allow' ),
+ array('id' => 8, 'module' => 'files', 'action' => 'd', 'group_name' => '%5', 'access' => 'allow' ),
+ array('id' => 9, 'module' => 'files', 'action' => 'g', 'group_name' => '%5', 'access' => 'allow' ),
+ array('id' => 10, 'module' => 'files', 'action' => '*', 'group_name' => '%5', 'access' => 'deny' ),
+ array('id' => 11, 'module' => 'files', 'action' => '*', 'group_name' => '*', 'access' => 'allow' ),
+ ),
+ 'plugin_acl' => array (
+ array ( 'id' => 4, 'group_name' => '%4', 'plugin' => 'password', 'access' => 'enable'),
+ array ( 'id' => 5, 'group_name' => '%4', 'plugin' => 'captcha', 'access' => 'enable'),
+ array ( 'id' => 6, 'group_name' => '%4', 'plugin' => 'email', 'access' => 'enable'),
+ ),
+ ),
+ 'mode_3' => array (
+ 'acl' => array (
+ array('id' => 5, 'module' => 'auth', 'action' => 'register', 'group_name' => '%5', 'access' => 'allow' ),
+ array('id' => 6, 'module' => 'auth', 'action' => '*', 'group_name' => '%5', 'access' => 'deny' ),
+ array('id' => 7, 'module' => 'auth', 'action' => '*', 'group_name' => 'register', 'access' => 'deny' ),
+ array('id' => 8, 'module' => 'auth', 'action' => '*', 'group_name' => '*', 'access' => 'deny' ),
+ array('id' => 9, 'module' => 'files', 'action' => '*', 'group_name' => '*', 'access' => 'deny' ),
+ ),
+ 'plugin_acl' => array (
+ array ( 'id' => 4, 'group_name' => '%4', 'plugin' => 'password', 'access' => 'enable'),
+ array ( 'id' => 5, 'group_name' => '%4', 'plugin' => 'captcha', 'access' => 'enable'),
+ array ( 'id' => 6, 'group_name' => '%4', 'plugin' => 'email', 'access' => 'enable'),
+ array ( 'id' => 7, 'group_name' => '%5', 'plugin' => 'mimetypes', 'access' => 'enable'),
+ array ( 'id' => 8, 'group_name' => '%5', 'plugin' => 'captcha', 'access' => 'enable'),
+ array ( 'id' => 9, 'group_name' => '%5', 'plugin' => 'password', 'access' => 'enable'),
+ ),
+ ),
+ 'mode_4' => array (
+ 'acl' => array (
+ array('id' => 5, 'module' => 'auth', 'action' => '*', 'group_name' => '*', 'access' => 'deny' ),
+ array('id' => 6, 'module' => 'files', 'action' => '*', 'group_name' => '*', 'access' => 'allow' ),
+ ),
+ 'plugin_acl' => array (
+ array ( 'id' => 4, 'group_name' => '%5', 'plugin' => 'password', 'access' => 'enable'),
+ array ( 'id' => 5, 'group_name' => '%5', 'plugin' => 'captcha', 'access' => 'enable'),
+ array ( 'id' => 6, 'group_name' => '%5', 'plugin' => 'email', 'access' => 'enable'),
+ ),
+ ),
+
+);
/* try to guess the appropriate settings from the $_SERVER */
$step = (isset($_GET['step']))?$_GET['step']:1;
$step = (isset($_POST['step']))?$_POST['step']:$step;
@@ -859,12 +934,164 @@
return true;
}
+function dbcreatetable($table,$fields,$keys,$debug=false) {
+ global $CONFIG;
+
+ switch ($CONFIG['database']['type']) {
+ case 'mysql':
+ $query = 'CREATE TABLE `'.$table.'` (';
+ foreach ($fields as $k => $f) {
+ $field = '`'.$k.'`';
+ switch ($f['type']) {
+ case 'char':
+ $field .= ' VARCHAR('.$f['size'].')';
+ break;
+ case 'int':
+ $field .= ' INT('.$f['size'].')';
+ break;
+ case 'text':
+ $field .= ' TEXT';
+ break;
+ case 'datetime':
+ $field .= ' DATETIME';
+ break;
+ case 'date':
+ $field .= ' DATE';
+ break;
+ }
+ $field .= ' '.$f['null'].' '.$f['extra'];
+ $query .= $field.','."\n";
+ }
+ $keylist = '';
+ foreach ($keys as $n => $k) {
+ $key = '';
+ foreach ($k['fields'] as $f) {
+ if ($key!='') $key.=',';
+ $key .= '`'.$f.'`';
+ }
+ if ($k['primary']) {
+ $key = 'PRIMARY KEY ('.$key.')';
+ } else {
+ $key = 'KEY `'.$n.'` ('.$key.')';
+ if ($k['unique']) $key = ' UNIQUE '.$key;
+ }
+ if ($keylist!='') { $keylist .= ','; }
+ $keylist .= $key;
+ }
+ $query .= $keylist;
+ $query .= ')';
+ return dbquery($query,array(),$debug);
+ break;
+ case 'pgsql':
+ $fieldlist = '';
+ foreach ($fields as $k => $f) {
+ $field = $k;
+ switch ($f['type']) {
+ case 'char':
+ $field .= ' character varying('.$f['size'].')';
+ break;
+ case 'int':
+ $field .= ' INTEGER';
+ break;
+ case 'text':
+ $field .= ' TEXT';
+ break;
+ case 'datetime':
+ $field .= ' timestamp without time zone';
+ break;
+ case 'date':
+ $field .= ' DATE';
+ break;
+ }
+ $field .= ' '.$f['null'];
+ if ($fieldlist != '')
+ $fieldlist .= ','."\n";
+ $fieldlist .= $field;
+ }
+ $query = 'CREATE TABLE '.$table.' ('.$fieldlist.')';
+ $res = dbquery($query,array(),$debug);
+ if ($res) { /* add the keys */
+ foreach ($keys as $n => $k) {
+ $key = '';
+ foreach ($k['fields'] as $f) {
+ if ($key!='') $key.=',';
+ $key .= $f;
+ }
+ if ($k['primary']) {
+ $query = 'ALTER TABLE ONLY '.$table.' ADD CONSTRAINT '.$table.'_pkey PRIMARY KEY ('.$key.')';
+ } else {
+ $query = 'CREATE '.($k['unique']?'UNIQUE ':'').'INDEX '.$table.'_'.$n.'_idx ON '.$table.' USING btree ('.$key.')';
+ }
+ $res = dbquery($query,array(),$debug);
+ }
+ }
+ if ($res) {
+ foreach ($fields as $k => $f) {
+ if ($f['extra']=='auto_increment') {
+ $seq = $table.'_'.$k.'_seq';
+ $query = 'CREATE SEQUENCE '.$seq.' INCREMENT BY 1 NO MAXVALUE NO MINVALUE CACHE 1';
+ $res = dbquery($query,array(),$debug);
+ $query = 'ALTER SEQUENCE '.$seq.' OWNED BY '.$table.'.'.$k;
+ $res = dbquery($query,array(),$debug);
+ if ($res) {
+ $query = 'ALTER TABLE '.$table.' ALTER COLUMN '.$k.' SET DEFAULT nextval(\''.$seq.'\'::regclass)';
+ $res = dbquery($query,array(),$debug);
+ }
+ }
+ }
+ }
+ return $res;
+ break;
+ }
+ return false;
+}
+
+
+function dbinsert($table,$data,$params,$debug) {
+ global $CONFIG;
+ global $DB_STRUCTURE;
+
+ switch ($CONFIG['database']['type']) {
+ case 'mysql':
+ $fields = '';
+ $values = '';
+ foreach ($data as $f => $v) {
+ if ($fields != '') $fields .= ',';
+ if ($values != '') $values .= ',';
+ $fields .= '`'.$f.'`';
+ $values .= '"'.mysql_real_escape_string($v).'"';
+ }
+ $query = 'INSERT INTO `%0'.$table.'` ('.$fields.') VALUES ('.$values.')';
+ break;
+ case 'pgsql':
+ $fields = '';
+ $values = '';
+ foreach ($data as $f => $v) {
+ if ($fields != '') $fields .= ',';
+ if ($values != '') $values .= ',';
+ $fields .= $f;
+ if ($DB_STRUCTURE[$table]['fields'][$f]['type']=='int')
+ $values .= $v;
+ else if ($DB_STRUCTURE[$table]['fields'][$f]['type']=='datetime')
+ $values .= 'now()';
+ else
+ $values .= '\''.pg_escape_string($v).'\'';
+ }
+ $query = 'INSERT INTO %0'.$table.' ('.$fields.') VALUES ('.$values.')';
+ break;
+ }
+ return dbquery($query,$params,$debug);
+}
+
+
function createdb($step) {
global $CONFIG;
global $_SESSION;
global $_POST;
global $MYSQL_QUERY;
global $PGSQL_QUERY;
+ global $DB_STRUCTURE;
+ global $DB_DATA;
if (isset($_SESSION['substep']) and !(isset($_POST['restart']))) {
$substep = $_SESSION['substep'];
@@ -947,11 +1174,11 @@
if ($execute) {
if (dbconnect($CONFIG['database']['host'],$CONFIG['database']['user'],$CONFIG['database']['password'],$CONFIG['database']['name'],$debug)) {
$params['%1']=$CONFIG['database']['prefix'];
- foreach ($query['structure'] as $t => $q) {
+ foreach ($DB_STRUCTURE as $t => $q) {
$params['%2']=$t;
if (!dbquery($query['droptable'],$params,$debug))
$error = true;
- if (!dbquery($q,$params,$debug)) {
+ if (!dbcreatetable($CONFIG['database']['prefix'].$t,$q['fields'],$q['keys'],$debug)) {
msg('Table creation FAILED: '.$t,'fail');
$error = true;
} else {
@@ -984,12 +1211,14 @@
$params['%4']=$_SESSION['options']['registered'];
$params['%5']=$_SESSION['options']['unregistered'];
$params['%6']=$CONFIG['site']['webmaster'];
- foreach ($query['base'] as $t => $q) {
- if (!dbquery($q,$params,$debug)) {
- msg('Query failed... n. '.$t,'fail');
- $error = true;
- } else {
- msg('Data insert SUCCESS: '.$t,'ok');
+ foreach ($DB_DATA['base'] as $t => $q) {
+ foreach ($q as $x) {
+ if (!dbinsert($t,$x,$params,$debug)) {
+ msg('Query failed... n. '.$t,'fail');
+ $error = true;
+ } else {
+ msg('Data insert SUCCESS: '.$t,'ok');
+ }
}
}
} else {
@@ -1019,12 +1248,14 @@
$params['%4']=$_SESSION['options']['registered'];
$params['%5']=$_SESSION['options']['unregistered'];
$params['%6']=$CONFIG['site']['webmaster'];
- foreach ($query['mode_'.$mode] as $t => $q) {
- if (!dbquery($q,$params,$debug)) {
- msg('Query failed... n. '.$t,'fail');
- $error = true;
- } else {
- msg('Data insert SUCCESS: '.$t,'ok');
+ foreach ($DB_DATA['mode_'.$mode] as $t => $q) {
+ foreach ($q as $x) {
+ if (!dbinsert($t,$x,$params,$debug)) {
+ msg('Query failed... n. '.$t,'fail');
+ $error = true;
+ } else {
+ msg('Data insert SUCCESS: '.$t,'ok');
+ }
}
}
} else {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-20 15:09:44
|
Revision: 161
http://openupload.svn.sourceforge.net/openupload/?rev=161&view=rev
Author: tsdogs
Date: 2008-11-20 15:09:40 +0000 (Thu, 20 Nov 2008)
Log Message:
-----------
fix number of uploads, and add progress tracking method.
Modified Paths:
--------------
trunk/www/setup.inc.php
Modified: trunk/www/setup.inc.php
===================================================================
--- trunk/www/setup.inc.php 2008-11-19 20:17:54 UTC (rev 160)
+++ trunk/www/setup.inc.php 2008-11-20 15:09:40 UTC (rev 161)
@@ -277,6 +277,7 @@
function setupcheck($step) {
global $_POST;
+ global $_SESSION;
$message = 'Let\'s check your php installation';
if (isset($_POST['check'])) {
@@ -323,7 +324,32 @@
msg('GD Support: not found','fail');
msg('GD is needed for captcha plugin');
}
+ echo '<div id="message"><b>Upload progress traking (only one is needed)</b></div>';
+ $progress_values = array('none');
+ if (function_exists('uploadprogress_get_info')) {
+ msg('UploadProgress Support: exsists','ok');
+ $progress_values[]='uploadprogress';
+ } else {
+ msg('UploadProgress: not found','fail');
+ }
+ if (function_exists('apc_fetch')) {
+ $msg = 'APC Support: exsists';
+ if (ini_get('apc.enabled')) {
+ $msg .= ', Enabled: yes';
+ if (ini_get('apc.rfc1867')) {
+ $progress_values[]='apc';
+ msg($msg.', rfc1867 enabled: yes','ok');
+ } else {
+ msg($msg.', rfc1867 enabled: NO','fail');
+ }
+ } else {
+ msg($msg.', Enabled: NO','fail');
+ }
+ } else {
+ msg('APC: not found','fail');
+ }
echo '<hr>';
+ $_SESSION['progress_values']=$progress_values;
$checked = true;
$message ='If everything looks good proceed!';
}
@@ -558,6 +584,7 @@
function options($step) {
global $_POST;
global $CONFIG;
+ global $_SESSION;
$tr = listModules($CONFIG['INSTALL_ROOT'].'/lib/modules/tr');
$auth = listModules($CONFIG['INSTALL_ROOT'].'/lib/modules/auth');
@@ -575,7 +602,8 @@
$CONFIG['registration']['email_confirm']=isset($_POST['confirmregistration'])?$_POST['confirmregistration']:'no';
$CONFIG['max_upload_size']=$_POST['max_upload_size'];
$CONFIG['max_download_time']=$_POST['max_download_time'];
- $CONFIG['multiupload']=$_POST['max_download_time'];
+ $CONFIG['multiupload']=$_POST['multiupload'];
+ $CONFIG['progress']=$_POST['progress'];
if ($CONFIG['translator']=='') {
$error = true;
@@ -605,6 +633,10 @@
$error = true;
msg('Please insert a max number of uploaded files per upload','fail');
}
+ if ($CONFIG['progress']=='') {
+ $error = true;
+ msg('Please select a method to trak the uploaded files','fail');
+ }
if (!$error) {
return $step+1;
}
@@ -621,6 +653,7 @@
$CONFIG['max_upload_size']=100;
$CONFIG['max_download_time']=120;
$CONFIG['multiupload']=1;
+ $CONFIG['progress']=$_SESSION['progress_values'][count($_SESSION['progress_values'])-1];
}
?>
<form method="POST" action="index.php">
@@ -664,6 +697,14 @@
<tr><td>Maximum upload size (in MB):</td><td><input type="text" name="max_upload_size" value="<?php echo $CONFIG['max_upload_size']; ?>"></td></tr>
<tr><td>Maximum download time (in Min)<br>0 disables it:</td><td><input type="text" name="max_download_time" value="<?php echo $CONFIG['max_download_time']; ?>"></td></tr>
<tr><td>Max num. of file uploaded per upload:</td><td><input type="text" name="multiupload" value="<?php echo $CONFIG['multiupload']; ?>"></td></tr>
+<tr><td>Upload tracking method:</td><td><select name="progress">
+<?php
+ foreach ($_SESSION['progress_values'] as $v) {
+ $sel = $CONFIG['progress']==$v?'selected':'';
+ echo '<option value="'.$v.'" '.$sel.'>'.$v.'</option>';
+ }
+?>
+</select></td></tr>
<TR><TD colspan="2"><input type="submit" value="Next >>"></TD></TR>
</table>
</form>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-19 20:17:56
|
Revision: 160
http://openupload.svn.sourceforge.net/openupload/?rev=160&view=rev
Author: tsdogs
Date: 2008-11-19 20:17:54 +0000 (Wed, 19 Nov 2008)
Log Message:
-----------
logo update and docs
Modified Paths:
--------------
trunk/CHANGELOG
trunk/TODO
web/img/openupload.jpg
web/index.html
Modified: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG 2008-11-19 20:09:53 UTC (rev 159)
+++ trunk/CHANGELOG 2008-11-19 20:17:54 UTC (rev 160)
@@ -13,6 +13,9 @@
- New rights editing interface.
- Plugin options
+* Upload
+- Display upload progress, requires either uploadprogress / apc pecl extensions
+
* Plugins
- Options are now group based and in the database
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2008-11-19 20:09:53 UTC (rev 159)
+++ trunk/TODO 2008-11-19 20:17:54 UTC (rev 160)
@@ -7,11 +7,8 @@
Bugs
- Fix all bugs I find in 0.3 (I hope somebody else will report some if they exsist)
-Upload
-- Display upload progress (a bit too triky and workarounds ain't really nice)
-
Database
-- txtdb deep testing
+- txtdb deep testing (switch ?)
Plugins
- Upload different filesize limiting depending on group
@@ -42,6 +39,9 @@
Database
- txtdb needs some work. might need file locks.
+Upload
+- Handle upload progress with other methods..
+
Administration
- Review the general administration module
- Config administration
Modified: web/img/openupload.jpg
===================================================================
(Binary files differ)
Modified: web/index.html
===================================================================
--- web/index.html 2008-11-19 20:09:53 UTC (rev 159)
+++ web/index.html 2008-11-19 20:17:54 UTC (rev 160)
@@ -13,7 +13,7 @@
}
#header {
height: 115px;
- border-bottom: 2px solid #3161cf;
+ border-bottom: 2px solid #ee7625;
}
#logo {
float: left;
@@ -50,7 +50,7 @@
font-size: 14pt;
font-weight: bold;
margin-bottom: 2px;
- border-bottom: 1px solid #000;
+ border-bottom: 1px solid #ee7625;
}
#text {
text-align: justify;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-19 20:09:57
|
Revision: 159
http://openupload.svn.sourceforge.net/openupload/?rev=159&view=rev
Author: tsdogs
Date: 2008-11-19 20:09:53 +0000 (Wed, 19 Nov 2008)
Log Message:
-----------
change the logo
Modified Paths:
--------------
trunk/www/templates/default/img/openupload.jpg
trunk/www/templates/default/main.css
Modified: trunk/www/templates/default/img/openupload.jpg
===================================================================
(Binary files differ)
Modified: trunk/www/templates/default/main.css
===================================================================
--- trunk/www/templates/default/main.css 2008-11-19 17:52:11 UTC (rev 158)
+++ trunk/www/templates/default/main.css 2008-11-19 20:09:53 UTC (rev 159)
@@ -35,8 +35,10 @@
}
#title {
- background-color: #3161cf;
- color: #ffffff;
+ background-color: #5f81cf;
+ border-bottom: 2px solid #ee7625;
+ border-top: 2px solid #ee7625;
+ color: #fff;
font-size: 12pt;
font-weight: bold;
clear: right;
@@ -44,6 +46,7 @@
padding-top: 3px;
padding-bottom:3px;
text-align: left;
+ height: 20px;
}
#menu {
bottom: 0px;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-19 17:52:17
|
Revision: 158
http://openupload.svn.sourceforge.net/openupload/?rev=158&view=rev
Author: tsdogs
Date: 2008-11-19 17:52:11 +0000 (Wed, 19 Nov 2008)
Log Message:
-----------
Add basic upload progress indicator support
Modified Paths:
--------------
trunk/www/config.inc.php.example
Modified: trunk/www/config.inc.php.example
===================================================================
--- trunk/www/config.inc.php.example 2008-11-19 17:41:46 UTC (rev 157)
+++ trunk/www/config.inc.php.example 2008-11-19 17:52:11 UTC (rev 158)
@@ -103,6 +103,12 @@
# $CONFIG['ldap']['gid']='distinguishedname';
# $CONFIG['ldap']['groupfields'] = array ( 'cn' => 'name', 'name' => 'description' );
+/* UPLOAD PROGRESS: specify the type
+ * Requires php extensions to be installed
+ */
+# $CONFIG['progress'] = 'apc';
+# $CONFIG['progress'] = 'uploadprogress';
+$CONFIG['progress']='none';
/* PLUGINS: here you enable the plugins
* they will need to enable the functionality
@@ -153,9 +159,5 @@
/* SITE FOOTER STRING */
$CONFIG['site']['footer'] = '<a href="http://openupload.sf.net">Open Upload</a> - Created by Alessandro Briosi © 2008';
-/* PLUGINS SPECIFIC CONFIGURATION */
-$CONFIG['mimetypes'][]='application/pdf';
-$CONFIG['mimetypes'][]='image/jpeg';
-$CONFIG['mimetypes'][]='image/png';
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-19 17:41:52
|
Revision: 157
http://openupload.svn.sourceforge.net/openupload/?rev=157&view=rev
Author: tsdogs
Date: 2008-11-19 17:41:46 +0000 (Wed, 19 Nov 2008)
Log Message:
-----------
Add basic upload progress indicator support
Modified Paths:
--------------
trunk/lib/main.inc.php
trunk/lib/modules/default/files.inc.php
trunk/templates/default/index.tpl
trunk/templates/default/modules/files/uploadForm.tpl
Added Paths:
-----------
trunk/templates/default/modules/files/uploadProgress.tpl
trunk/www/templates/default/img/wait.gif
trunk/www/templates/default/js/
trunk/www/templates/default/js/index.html
trunk/www/templates/default/js/prototype.js
Modified: trunk/lib/main.inc.php
===================================================================
--- trunk/lib/main.inc.php 2008-11-19 17:37:14 UTC (rev 156)
+++ trunk/lib/main.inc.php 2008-11-19 17:41:46 UTC (rev 157)
@@ -351,6 +351,7 @@
function run($action = '',$step = 0) {
global $_SERVER;
global $_SESSION;
+ global $_GET;
$this->mainPage = 'index';
@@ -435,6 +436,8 @@
$this->tpl->assign('user',$_SESSION['user']);
$m->$fun();
+ if ($_GET['type']=='ajax') return;
+
/* now display the final page */
$this->tpl->assign('user',$this->user->info());
$this->tpl->assign('langs',$this->langs);
Modified: trunk/lib/modules/default/files.inc.php
===================================================================
--- trunk/lib/modules/default/files.inc.php 2008-11-19 17:37:14 UTC (rev 156)
+++ trunk/lib/modules/default/files.inc.php 2008-11-19 17:41:46 UTC (rev 157)
@@ -7,6 +7,7 @@
2 => "uploadOptions",
3 => "uploadConfirm",
4 => "uploadFileInfo",
+ 99 => "uploadProgress",
),
"d" => array (
1 => "downloadForm",
@@ -55,9 +56,60 @@
global $_SESSION;
unset($_SESSION['user']['u']);
+ $_SESSION['user']['identifier']=randomName(40,40);
+ switch (app()->config['progress']) {
+ case 'uploadprogress':
+ $this->tpl->assign('identifiername','UPLOAD_IDENTIFIER');
+ break;
+ case 'apc':
+ $this->tpl->assign('identifiername',ini_get('apc.rfc1867_name'));
+ break;
+ default:
+ $this->tpl->assign('identifiername','UPLOAD_IDENTIFIER');
+ break;
+ }
+ app()->tpl->assign('identifier',$_SESSION['user']['identifier']);
$result = app()->pluginAction('uploadForm',$finfo);
}
+ function uploadProgress() {
+ global $_SESSION;
+
+ if (isset($_SESSION['user']['identifier'])) {
+ ob_clean();
+ header("Cache-Control: no-cache, must-revalidate");
+ header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+
+ $progress = array('complete' => 0, 'total' => 0, 'percentage' => 0, 'files' => 0);
+ switch (app()->config['progress']) {
+ case 'uploadprogress':
+ $res = uploadprogress_get_info($_SESSION['user']['identifier']);
+ if (isset($res['bytes_uploaded'])) {
+ $progress['complete'] = $res['bytes_uploaded'];
+ if ($res['bytes_total']>0)
+ $progress['total'] = $res['bytes_total'];
+ $progress['percentage'] = floor(($res['bytes_uploaded'] / $res['bytes_total'])*100);
+ $progress['files'] = $res['files_uploaded'];
+ }
+ break;
+ case 'apc':
+ $res = apc_fetch(ini_get('apc.rfc1867_prefix').$_SESSION['user']['identifier']);
+ if ($res) {
+ $progress['complete'] = $res['current'];
+ $progress['total'] = $res['total'];
+ if ($res['total']>0)
+ $progress['percentage'] = floor(($res['current'] / $res['total'])*100);
+ $progress['files'] = 0;
+ }
+ break;
+ }
+ app()->tpl->assign('progress',$progress);
+ app()->display('modules/files/uploadProgress');
+ exit;
+ }
+ exit;
+ }
+
function uploadOptions() {
global $_SESSION;
global $_FILES;
Modified: trunk/templates/default/index.tpl
===================================================================
--- trunk/templates/default/index.tpl 2008-11-19 17:37:14 UTC (rev 156)
+++ trunk/templates/default/index.tpl 2008-11-19 17:41:46 UTC (rev 157)
@@ -2,6 +2,7 @@
<head>
<title>{$site.title} - {tr}{$page.title}{/tr}</title>
<link rel="stylesheet" type="text/css" href="{tpl file=/main.css}">
+<script language="javascript" type="text/javascript" src="{tpl file=/js/prototype.js}"></script>
</head>
<body>
<!-- header -->
Modified: trunk/templates/default/modules/files/uploadForm.tpl
===================================================================
--- trunk/templates/default/modules/files/uploadForm.tpl 2008-11-19 17:37:14 UTC (rev 156)
+++ trunk/templates/default/modules/files/uploadForm.tpl 2008-11-19 17:41:46 UTC (rev 157)
@@ -8,14 +8,30 @@
if (obj)
obj.style.visibility = 'visible';
}
+
+function uploadProgress() {
+ obj = document.getElementById('upload');
+ if (obj) {
+ var ajax = new Ajax.Updater(
+ {success: 'upload'},
+ 'index.php',
+ {method: 'get', parameters: 'action=u&step=99&type=ajax', onFailure: reportError});
+ setTimeout('uploadProgress()',1000);
+ }
+}
+function reportError(request) {
+ $F('upload') = "Errore...";
+}
+
</script>
-{/literal}
+{/literal}<br>
<div id="upload">
<form method="post" enctype='multipart/form-data' action="{$script}" name="uploadform">
<input type="hidden" name="action" value="{$action}">
<input type="hidden" name="step" value="{$nextstep}">
{if isset($user.max_upload_size)}
<input type="hidden" name="MAX_FILE_SIZE" value="{$user.max_upload_size}">
+<input type="hidden" id="file_id" name="{$identifiername}" value="{$identifier}">
{/if}
{tr}Select the file to be uploaded{/tr}<br>
<input type="file" class="file" size="60" name="upload" onchange="if (this.value!='') unhide(1);"><br>
@@ -34,7 +50,7 @@
{/if}
{$plugins}
<div id="uploadbutton" style="visibility:hidden"><br>
- <a href="{$script}" onclick="document.uploadform.submit();return false;">
+ <a href="{$script}" onclick="setTimeout('uploadProgress()',1000); document.uploadform.submit(); return false;">
<img src="{tpl file=/img/upload.png}" border="0"><br>
{tr}Upload{/tr}</a>
</div>
Added: trunk/templates/default/modules/files/uploadProgress.tpl
===================================================================
--- trunk/templates/default/modules/files/uploadProgress.tpl (rev 0)
+++ trunk/templates/default/modules/files/uploadProgress.tpl 2008-11-19 17:41:46 UTC (rev 157)
@@ -0,0 +1,5 @@
+<center><img src="{tpl file=/img/wait.gif}"> {tr}Uploading{/tr}:
+{if $progress.complete>0}{$progress.complete|fsize_format} of {$progress.total|fsize_format} <b>({$progress.percentage}%)</b>
+{else}
+{tr}please wait ...{/tr}
+{/if}</center>
\ No newline at end of file
Added: trunk/www/templates/default/img/wait.gif
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/wait.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/js/index.html
===================================================================
--- trunk/www/templates/default/js/index.html (rev 0)
+++ trunk/www/templates/default/js/index.html 2008-11-19 17:41:46 UTC (rev 157)
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<title>NO ACCESS</title>
+<meta http-equiv="REFRESH" content="0;url=../../../"></HEAD>
+<BODY>
+No direct access is allowed on this folder.
+</BODY>
+</HTML>
\ No newline at end of file
Added: trunk/www/templates/default/js/prototype.js
===================================================================
--- trunk/www/templates/default/js/prototype.js (rev 0)
+++ trunk/www/templates/default/js/prototype.js 2008-11-19 17:41:46 UTC (rev 157)
@@ -0,0 +1,4320 @@
+/* Prototype JavaScript framework, version 1.6.0.3
+ * (c) 2005-2008 Sam Stephenson
+ *
+ * Prototype is freely distributable under the terms of an MIT-style license.
+ * For details, see the Prototype web site: http://www.prototypejs.org/
+ *
+ *--------------------------------------------------------------------------*/
+
+var Prototype = {
+ Version: '1.6.0.3',
+
+ Browser: {
+ IE: !!(window.attachEvent &&
+ navigator.userAgent.indexOf('Opera') === -1),
+ Opera: navigator.userAgent.indexOf('Opera') > -1,
+ WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
+ Gecko: navigator.userAgent.indexOf('Gecko') > -1 &&
+ navigator.userAgent.indexOf('KHTML') === -1,
+ MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
+ },
+
+ BrowserFeatures: {
+ XPath: !!document.evaluate,
+ SelectorsAPI: !!document.querySelector,
+ ElementExtensions: !!window.HTMLElement,
+ SpecificElementExtensions:
+ document.createElement('div')['__proto__'] &&
+ document.createElement('div')['__proto__'] !==
+ document.createElement('form')['__proto__']
+ },
+
+ ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
+ JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
+
+ emptyFunction: function() { },
+ K: function(x) { return x }
+};
+
+if (Prototype.Browser.MobileSafari)
+ Prototype.BrowserFeatures.SpecificElementExtensions = false;
+
+
+/* Based on Alex Arnell's inheritance implementation. */
+var Class = {
+ create: function() {
+ var parent = null, properties = $A(arguments);
+ if (Object.isFunction(properties[0]))
+ parent = properties.shift();
+
+ function klass() {
+ this.initialize.apply(this, arguments);
+ }
+
+ Object.extend(klass, Class.Methods);
+ klass.superclass = parent;
+ klass.subclasses = [];
+
+ if (parent) {
+ var subclass = function() { };
+ subclass.prototype = parent.prototype;
+ klass.prototype = new subclass;
+ parent.subclasses.push(klass);
+ }
+
+ for (var i = 0; i < properties.length; i++)
+ klass.addMethods(properties[i]);
+
+ if (!klass.prototype.initialize)
+ klass.prototype.initialize = Prototype.emptyFunction;
+
+ klass.prototype.constructor = klass;
+
+ return klass;
+ }
+};
+
+Class.Methods = {
+ addMethods: function(source) {
+ var ancestor = this.superclass && this.superclass.prototype;
+ var properties = Object.keys(source);
+
+ if (!Object.keys({ toString: true }).length)
+ properties.push("toString", "valueOf");
+
+ for (var i = 0, length = properties.length; i < length; i++) {
+ var property = properties[i], value = source[property];
+ if (ancestor && Object.isFunction(value) &&
+ value.argumentNames().first() == "$super") {
+ var method = value;
+ value = (function(m) {
+ return function() { return ancestor[m].apply(this, arguments) };
+ })(property).wrap(method);
+
+ value.valueOf = method.valueOf.bind(method);
+ value.toString = method.toString.bind(method);
+ }
+ this.prototype[property] = value;
+ }
+
+ return this;
+ }
+};
+
+var Abstract = { };
+
+Object.extend = function(destination, source) {
+ for (var property in source)
+ destination[property] = source[property];
+ return destination;
+};
+
+Object.extend(Object, {
+ inspect: function(object) {
+ try {
+ if (Object.isUndefined(object)) return 'undefined';
+ if (object === null) return 'null';
+ return object.inspect ? object.inspect() : String(object);
+ } catch (e) {
+ if (e instanceof RangeError) return '...';
+ throw e;
+ }
+ },
+
+ toJSON: function(object) {
+ var type = typeof object;
+ switch (type) {
+ case 'undefined':
+ case 'function':
+ case 'unknown': return;
+ case 'boolean': return object.toString();
+ }
+
+ if (object === null) return 'null';
+ if (object.toJSON) return object.toJSON();
+ if (Object.isElement(object)) return;
+
+ var results = [];
+ for (var property in object) {
+ var value = Object.toJSON(object[property]);
+ if (!Object.isUndefined(value))
+ results.push(property.toJSON() + ': ' + value);
+ }
+
+ return '{' + results.join(', ') + '}';
+ },
+
+ toQueryString: function(object) {
+ return $H(object).toQueryString();
+ },
+
+ toHTML: function(object) {
+ return object && object.toHTML ? object.toHTML() : String.interpret(object);
+ },
+
+ keys: function(object) {
+ var keys = [];
+ for (var property in object)
+ keys.push(property);
+ return keys;
+ },
+
+ values: function(object) {
+ var values = [];
+ for (var property in object)
+ values.push(object[property]);
+ return values;
+ },
+
+ clone: function(object) {
+ return Object.extend({ }, object);
+ },
+
+ isElement: function(object) {
+ return !!(object && object.nodeType == 1);
+ },
+
+ isArray: function(object) {
+ return object != null && typeof object == "object" &&
+ 'splice' in object && 'join' in object;
+ },
+
+ isHash: function(object) {
+ return object instanceof Hash;
+ },
+
+ isFunction: function(object) {
+ return typeof object == "function";
+ },
+
+ isString: function(object) {
+ return typeof object == "string";
+ },
+
+ isNumber: function(object) {
+ return typeof object == "number";
+ },
+
+ isUndefined: function(object) {
+ return typeof object == "undefined";
+ }
+});
+
+Object.extend(Function.prototype, {
+ argumentNames: function() {
+ var names = this.toString().match(/^[\s\(]*function[^(]*\(([^\)]*)\)/)[1]
+ .replace(/\s+/g, '').split(',');
+ return names.length == 1 && !names[0] ? [] : names;
+ },
+
+ bind: function() {
+ if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this;
+ var __method = this, args = $A(arguments), object = args.shift();
+ return function() {
+ return __method.apply(object, args.concat($A(arguments)));
+ }
+ },
+
+ bindAsEventListener: function() {
+ var __method = this, args = $A(arguments), object = args.shift();
+ return function(event) {
+ return __method.apply(object, [event || window.event].concat(args));
+ }
+ },
+
+ curry: function() {
+ if (!arguments.length) return this;
+ var __method = this, args = $A(arguments);
+ return function() {
+ return __method.apply(this, args.concat($A(arguments)));
+ }
+ },
+
+ delay: function() {
+ var __method = this, args = $A(arguments), timeout = args.shift() * 1000;
+ return window.setTimeout(function() {
+ return __method.apply(__method, args);
+ }, timeout);
+ },
+
+ defer: function() {
+ var args = [0.01].concat($A(arguments));
+ return this.delay.apply(this, args);
+ },
+
+ wrap: function(wrapper) {
+ var __method = this;
+ return function() {
+ return wrapper.apply(this, [__method.bind(this)].concat($A(arguments)));
+ }
+ },
+
+ methodize: function() {
+ if (this._methodized) return this._methodized;
+ var __method = this;
+ return this._methodized = function() {
+ return __method.apply(null, [this].concat($A(arguments)));
+ };
+ }
+});
+
+Date.prototype.toJSON = function() {
+ return '"' + this.getUTCFullYear() + '-' +
+ (this.getUTCMonth() + 1).toPaddedString(2) + '-' +
+ this.getUTCDate().toPaddedString(2) + 'T' +
+ this.getUTCHours().toPaddedString(2) + ':' +
+ this.getUTCMinutes().toPaddedString(2) + ':' +
+ this.getUTCSeconds().toPaddedString(2) + 'Z"';
+};
+
+var Try = {
+ these: function() {
+ var returnValue;
+
+ for (var i = 0, length = arguments.length; i < length; i++) {
+ var lambda = arguments[i];
+ try {
+ returnValue = lambda();
+ break;
+ } catch (e) { }
+ }
+
+ return returnValue;
+ }
+};
+
+RegExp.prototype.match = RegExp.prototype.test;
+
+RegExp.escape = function(str) {
+ return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
+};
+
+/*--------------------------------------------------------------------------*/
+
+var PeriodicalExecuter = Class.create({
+ initialize: function(callback, frequency) {
+ this.callback = callback;
+ this.frequency = frequency;
+ this.currentlyExecuting = false;
+
+ this.registerCallback();
+ },
+
+ registerCallback: function() {
+ this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+ },
+
+ execute: function() {
+ this.callback(this);
+ },
+
+ stop: function() {
+ if (!this.timer) return;
+ clearInterval(this.timer);
+ this.timer = null;
+ },
+
+ onTimerEvent: function() {
+ if (!this.currentlyExecuting) {
+ try {
+ this.currentlyExecuting = true;
+ this.execute();
+ } finally {
+ this.currentlyExecuting = false;
+ }
+ }
+ }
+});
+Object.extend(String, {
+ interpret: function(value) {
+ return value == null ? '' : String(value);
+ },
+ specialChar: {
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '\\': '\\\\'
+ }
+});
+
+Object.extend(String.prototype, {
+ gsub: function(pattern, replacement) {
+ var result = '', source = this, match;
+ replacement = arguments.callee.prepareReplacement(replacement);
+
+ while (source.length > 0) {
+ if (match = source.match(pattern)) {
+ result += source.slice(0, match.index);
+ result += String.interpret(replacement(match));
+ source = source.slice(match.index + match[0].length);
+ } else {
+ result += source, source = '';
+ }
+ }
+ return result;
+ },
+
+ sub: function(pattern, replacement, count) {
+ replacement = this.gsub.prepareReplacement(replacement);
+ count = Object.isUndefined(count) ? 1 : count;
+
+ return this.gsub(pattern, function(match) {
+ if (--count < 0) return match[0];
+ return replacement(match);
+ });
+ },
+
+ scan: function(pattern, iterator) {
+ this.gsub(pattern, iterator);
+ return String(this);
+ },
+
+ truncate: function(length, truncation) {
+ length = length || 30;
+ truncation = Object.isUndefined(truncation) ? '...' : truncation;
+ return this.length > length ?
+ this.slice(0, length - truncation.length) + truncation : String(this);
+ },
+
+ strip: function() {
+ return this.replace(/^\s+/, '').replace(/\s+$/, '');
+ },
+
+ stripTags: function() {
+ return this.replace(/<\/?[^>]+>/gi, '');
+ },
+
+ stripScripts: function() {
+ return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
+ },
+
+ extractScripts: function() {
+ var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
+ var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
+ return (this.match(matchAll) || []).map(function(scriptTag) {
+ return (scriptTag.match(matchOne) || ['', ''])[1];
+ });
+ },
+
+ evalScripts: function() {
+ return this.extractScripts().map(function(script) { return eval(script) });
+ },
+
+ escapeHTML: function() {
+ var self = arguments.callee;
+ self.text.data = this;
+ return self.div.innerHTML;
+ },
+
+ unescapeHTML: function() {
+ var div = new Element('div');
+ div.innerHTML = this.stripTags();
+ return div.childNodes[0] ? (div.childNodes.length > 1 ?
+ $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) :
+ div.childNodes[0].nodeValue) : '';
+ },
+
+ toQueryParams: function(separator) {
+ var match = this.strip().match(/([^?#]*)(#.*)?$/);
+ if (!match) return { };
+
+ return match[1].split(separator || '&').inject({ }, function(hash, pair) {
+ if ((pair = pair.split('='))[0]) {
+ var key = decodeURIComponent(pair.shift());
+ var value = pair.length > 1 ? pair.join('=') : pair[0];
+ if (value != undefined) value = decodeURIComponent(value);
+
+ if (key in hash) {
+ if (!Object.isArray(hash[key])) hash[key] = [hash[key]];
+ hash[key].push(value);
+ }
+ else hash[key] = value;
+ }
+ return hash;
+ });
+ },
+
+ toArray: function() {
+ return this.split('');
+ },
+
+ succ: function() {
+ return this.slice(0, this.length - 1) +
+ String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
+ },
+
+ times: function(count) {
+ return count < 1 ? '' : new Array(count + 1).join(this);
+ },
+
+ camelize: function() {
+ var parts = this.split('-'), len = parts.length;
+ if (len == 1) return parts[0];
+
+ var camelized = this.charAt(0) == '-'
+ ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1)
+ : parts[0];
+
+ for (var i = 1; i < len; i++)
+ camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1);
+
+ return camelized;
+ },
+
+ capitalize: function() {
+ return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
+ },
+
+ underscore: function() {
+ return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase();
+ },
+
+ dasherize: function() {
+ return this.gsub(/_/,'-');
+ },
+
+ inspect: function(useDoubleQuotes) {
+ var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) {
+ var character = String.specialChar[match[0]];
+ return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16);
+ });
+ if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
+ return "'" + escapedString.replace(/'/g, '\\\'') + "'";
+ },
+
+ toJSON: function() {
+ return this.inspect(true);
+ },
+
+ unfilterJSON: function(filter) {
+ return this.sub(filter || Prototype.JSONFilter, '#{1}');
+ },
+
+ isJSON: function() {
+ var str = this;
+ if (str.blank()) return false;
+ str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '');
+ return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);
+ },
+
+ evalJSON: function(sanitize) {
+ var json = this.unfilterJSON();
+ try {
+ if (!sanitize || json.isJSON()) return eval('(' + json + ')');
+ } catch (e) { }
+ throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
+ },
+
+ include: function(pattern) {
+ return this.indexOf(pattern) > -1;
+ },
+
+ startsWith: function(pattern) {
+ return this.indexOf(pattern) === 0;
+ },
+
+ endsWith: function(pattern) {
+ var d = this.length - pattern.length;
+ return d >= 0 && this.lastIndexOf(pattern) === d;
+ },
+
+ empty: function() {
+ return this == '';
+ },
+
+ blank: function() {
+ return /^\s*$/.test(this);
+ },
+
+ interpolate: function(object, pattern) {
+ return new Template(this, pattern).evaluate(object);
+ }
+});
+
+if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, {
+ escapeHTML: function() {
+ return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
+ },
+ unescapeHTML: function() {
+ return this.stripTags().replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
+ }
+});
+
+String.prototype.gsub.prepareReplacement = function(replacement) {
+ if (Object.isFunction(replacement)) return replacement;
+ var template = new Template(replacement);
+ return function(match) { return template.evaluate(match) };
+};
+
+String.prototype.parseQuery = String.prototype.toQueryParams;
+
+Object.extend(String.prototype.escapeHTML, {
+ div: document.createElement('div'),
+ text: document.createTextNode('')
+});
+
+String.prototype.escapeHTML.div.appendChild(String.prototype.escapeHTML.text);
+
+var Template = Class.create({
+ initialize: function(template, pattern) {
+ this.template = template.toString();
+ this.pattern = pattern || Template.Pattern;
+ },
+
+ evaluate: function(object) {
+ if (Object.isFunction(object.toTemplateReplacements))
+ object = object.toTemplateReplacements();
+
+ return this.template.gsub(this.pattern, function(match) {
+ if (object == null) return '';
+
+ var before = match[1] || '';
+ if (before == '\\') return match[2];
+
+ var ctx = object, expr = match[3];
+ var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;
+ match = pattern.exec(expr);
+ if (match == null) return before;
+
+ while (match != null) {
+ var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1];
+ ctx = ctx[comp];
+ if (null == ctx || '' == match[3]) break;
+ expr = expr.substring('[' == match[3] ? match[1].length : match[0].length);
+ match = pattern.exec(expr);
+ }
+
+ return before + String.interpret(ctx);
+ });
+ }
+});
+Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
+
+var $break = { };
+
+var Enumerable = {
+ each: function(iterator, context) {
+ var index = 0;
+ try {
+ this._each(function(value) {
+ iterator.call(context, value, index++);
+ });
+ } catch (e) {
+ if (e != $break) throw e;
+ }
+ return this;
+ },
+
+ eachSlice: function(number, iterator, context) {
+ var index = -number, slices = [], array = this.toArray();
+ if (number < 1) return array;
+ while ((index += number) < array.length)
+ slices.push(array.slice(index, index+number));
+ return slices.collect(iterator, context);
+ },
+
+ all: function(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result = true;
+ this.each(function(value, index) {
+ result = result && !!iterator.call(context, value, index);
+ if (!result) throw $break;
+ });
+ return result;
+ },
+
+ any: function(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result = false;
+ this.each(function(value, index) {
+ if (result = !!iterator.call(context, value, index))
+ throw $break;
+ });
+ return result;
+ },
+
+ collect: function(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var results = [];
+ this.each(function(value, index) {
+ results.push(iterator.call(context, value, index));
+ });
+ return results;
+ },
+
+ detect: function(iterator, context) {
+ var result;
+ this.each(function(value, index) {
+ if (iterator.call(context, value, index)) {
+ result = value;
+ throw $break;
+ }
+ });
+ return result;
+ },
+
+ findAll: function(iterator, context) {
+ var results = [];
+ this.each(function(value, index) {
+ if (iterator.call(context, value, index))
+ results.push(value);
+ });
+ return results;
+ },
+
+ grep: function(filter, iterator, context) {
+ iterator = iterator || Prototype.K;
+ var results = [];
+
+ if (Object.isString(filter))
+ filter = new RegExp(filter);
+
+ this.each(function(value, index) {
+ if (filter.match(value))
+ results.push(iterator.call(context, value, index));
+ });
+ return results;
+ },
+
+ include: function(object) {
+ if (Object.isFunction(this.indexOf))
+ if (this.indexOf(object) != -1) return true;
+
+ var found = false;
+ this.each(function(value) {
+ if (value == object) {
+ found = true;
+ throw $break;
+ }
+ });
+ return found;
+ },
+
+ inGroupsOf: function(number, fillWith) {
+ fillWith = Object.isUndefined(fillWith) ? null : fillWith;
+ return this.eachSlice(number, function(slice) {
+ while(slice.length < number) slice.push(fillWith);
+ return slice;
+ });
+ },
+
+ inject: function(memo, iterator, context) {
+ this.each(function(value, index) {
+ memo = iterator.call(context, memo, value, index);
+ });
+ return memo;
+ },
+
+ invoke: function(method) {
+ var args = $A(arguments).slice(1);
+ return this.map(function(value) {
+ return value[method].apply(value, args);
+ });
+ },
+
+ max: function(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result;
+ this.each(function(value, index) {
+ value = iterator.call(context, value, index);
+ if (result == null || value >= result)
+ result = value;
+ });
+ return result;
+ },
+
+ min: function(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result;
+ this.each(function(value, index) {
+ value = iterator.call(context, value, index);
+ if (result == null || value < result)
+ result = value;
+ });
+ return result;
+ },
+
+ partition: function(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var trues = [], falses = [];
+ this.each(function(value, index) {
+ (iterator.call(context, value, index) ?
+ trues : falses).push(value);
+ });
+ return [trues, falses];
+ },
+
+ pluck: function(property) {
+ var results = [];
+ this.each(function(value) {
+ results.push(value[property]);
+ });
+ return results;
+ },
+
+ reject: function(iterator, context) {
+ var results = [];
+ this.each(function(value, index) {
+ if (!iterator.call(context, value, index))
+ results.push(value);
+ });
+ return results;
+ },
+
+ sortBy: function(iterator, context) {
+ return this.map(function(value, index) {
+ return {
+ value: value,
+ criteria: iterator.call(context, value, index)
+ };
+ }).sort(function(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }).pluck('value');
+ },
+
+ toArray: function() {
+ return this.map();
+ },
+
+ zip: function() {
+ var iterator = Prototype.K, args = $A(arguments);
+ if (Object.isFunction(args.last()))
+ iterator = args.pop();
+
+ var collections = [this].concat(args).map($A);
+ return this.map(function(value, index) {
+ return iterator(collections.pluck(index));
+ });
+ },
+
+ size: function() {
+ return this.toArray().length;
+ },
+
+ inspect: function() {
+ return '#<Enumerable:' + this.toArray().inspect() + '>';
+ }
+};
+
+Object.extend(Enumerable, {
+ map: Enumerable.collect,
+ find: Enumerable.detect,
+ select: Enumerable.findAll,
+ filter: Enumerable.findAll,
+ member: Enumerable.include,
+ entries: Enumerable.toArray,
+ every: Enumerable.all,
+ some: Enumerable.any
+});
+function $A(iterable) {
+ if (!iterable) return [];
+ if (iterable.toArray) return iterable.toArray();
+ var length = iterable.length || 0, results = new Array(length);
+ while (length--) results[length] = iterable[length];
+ return results;
+}
+
+if (Prototype.Browser.WebKit) {
+ $A = function(iterable) {
+ if (!iterable) return [];
+ // In Safari, only use the `toArray` method if it's not a NodeList.
+ // A NodeList is a function, has an function `item` property, and a numeric
+ // `length` property. Adapted from Google Doctype.
+ if (!(typeof iterable === 'function' && typeof iterable.length ===
+ 'number' && typeof iterable.item === 'function') && iterable.toArray)
+ return iterable.toArray();
+ var length = iterable.length || 0, results = new Array(length);
+ while (length--) results[length] = iterable[length];
+ return results;
+ };
+}
+
+Array.from = $A;
+
+Object.extend(Array.prototype, Enumerable);
+
+if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse;
+
+Object.extend(Array.prototype, {
+ _each: function(iterator) {
+ for (var i = 0, length = this.length; i < length; i++)
+ iterator(this[i]);
+ },
+
+ clear: function() {
+ this.length = 0;
+ return this;
+ },
+
+ first: function() {
+ return this[0];
+ },
+
+ last: function() {
+ return this[this.length - 1];
+ },
+
+ compact: function() {
+ return this.select(function(value) {
+ return value != null;
+ });
+ },
+
+ flatten: function() {
+ return this.inject([], function(array, value) {
+ return array.concat(Object.isArray(value) ?
+ value.flatten() : [value]);
+ });
+ },
+
+ without: function() {
+ var values = $A(arguments);
+ return this.select(function(value) {
+ return !values.include(value);
+ });
+ },
+
+ reverse: function(inline) {
+ return (inline !== false ? this : this.toArray())._reverse();
+ },
+
+ reduce: function() {
+ return this.length > 1 ? this : this[0];
+ },
+
+ uniq: function(sorted) {
+ return this.inject([], function(array, value, index) {
+ if (0 == index || (sorted ? array.last() != value : !array.include(value)))
+ array.push(value);
+ return array;
+ });
+ },
+
+ intersect: function(array) {
+ return this.uniq().findAll(function(item) {
+ return array.detect(function(value) { return item === value });
+ });
+ },
+
+ clone: function() {
+ return [].concat(this);
+ },
+
+ size: function() {
+ return this.length;
+ },
+
+ inspect: function() {
+ return '[' + this.map(Object.inspect).join(', ') + ']';
+ },
+
+ toJSON: function() {
+ var results = [];
+ this.each(function(object) {
+ var value = Object.toJSON(object);
+ if (!Object.isUndefined(value)) results.push(value);
+ });
+ return '[' + results.join(', ') + ']';
+ }
+});
+
+// use native browser JS 1.6 implementation if available
+if (Object.isFunction(Array.prototype.forEach))
+ Array.prototype._each = Array.prototype.forEach;
+
+if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) {
+ i || (i = 0);
+ var length = this.length;
+ if (i < 0) i = length + i;
+ for (; i < length; i++)
+ if (this[i] === item) return i;
+ return -1;
+};
+
+if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) {
+ i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
+ var n = this.slice(0, i).reverse().indexOf(item);
+ return (n < 0) ? n : i - n - 1;
+};
+
+Array.prototype.toArray = Array.prototype.clone;
+
+function $w(string) {
+ if (!Object.isString(string)) return [];
+ string = string.strip();
+ return string ? string.split(/\s+/) : [];
+}
+
+if (Prototype.Browser.Opera){
+ Array.prototype.concat = function() {
+ var array = [];
+ for (var i = 0, length = this.length; i < length; i++) array.push(this[i]);
+ for (var i = 0, length = arguments.length; i < length; i++) {
+ if (Object.isArray(arguments[i])) {
+ for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++)
+ array.push(arguments[i][j]);
+ } else {
+ array.push(arguments[i]);
+ }
+ }
+ return array;
+ };
+}
+Object.extend(Number.prototype, {
+ toColorPart: function() {
+ return this.toPaddedString(2, 16);
+ },
+
+ succ: function() {
+ return this + 1;
+ },
+
+ times: function(iterator, context) {
+ $R(0, this, true).each(iterator, context);
+ return this;
+ },
+
+ toPaddedString: function(length, radix) {
+ var string = this.toString(radix || 10);
+ return '0'.times(length - string.length) + string;
+ },
+
+ toJSON: function() {
+ return isFinite(this) ? this.toString() : 'null';
+ }
+});
+
+$w('abs round ceil floor').each(function(method){
+ Number.prototype[method] = Math[method].methodize();
+});
+function $H(object) {
+ return new Hash(object);
+};
+
+var Hash = Class.create(Enumerable, (function() {
+
+ function toQueryPair(key, value) {
+ if (Object.isUndefined(value)) return key;
+ return key + '=' + encodeURIComponent(String.interpret(value));
+ }
+
+ return {
+ initialize: function(object) {
+ this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
+ },
+
+ _each: function(iterator) {
+ for (var key in this._object) {
+ var value = this._object[key], pair = [key, value];
+ pair.key = key;
+ pair.value = value;
+ iterator(pair);
+ }
+ },
+
+ set: function(key, value) {
+ return this._object[key] = value;
+ },
+
+ get: function(key) {
+ // simulating poorly supported hasOwnProperty
+ if (this._object[key] !== Object.prototype[key])
+ return this._object[key];
+ },
+
+ unset: function(key) {
+ var value = this._object[key];
+ delete this._object[key];
+ return value;
+ },
+
+ toObject: function() {
+ return Object.clone(this._object);
+ },
+
+ keys: function() {
+ return this.pluck('key');
+ },
+
+ values: function() {
+ return this.pluck('value');
+ },
+
+ index: function(value) {
+ var match = this.detect(function(pair) {
+ return pair.value === value;
+ });
+ return match && match.key;
+ },
+
+ merge: function(object) {
+ return this.clone().update(object);
+ },
+
+ update: function(object) {
+ return new Hash(object).inject(this, function(result, pair) {
+ result.set(pair.key, pair.value);
+ return result;
+ });
+ },
+
+ toQueryString: function() {
+ return this.inject([], function(results, pair) {
+ var key = encodeURIComponent(pair.key), values = pair.value;
+
+ if (values && typeof values == 'object') {
+ if (Object.isArray(values))
+ return results.concat(values.map(toQueryPair.curry(key)));
+ } else results.push(toQueryPair(key, values));
+ return results;
+ }).join('&');
+ },
+
+ inspect: function() {
+ return '#<Hash:{' + this.map(function(pair) {
+ return pair.map(Object.inspect).join(': ');
+ }).join(', ') + '}>';
+ },
+
+ toJSON: function() {
+ return Object.toJSON(this.toObject());
+ },
+
+ clone: function() {
+ return new Hash(this);
+ }
+ }
+})());
+
+Hash.prototype.toTemplateReplacements = Hash.prototype.toObject;
+Hash.from = $H;
+var ObjectRange = Class.create(Enumerable, {
+ initialize: function(start, end, exclusive) {
+ this.start = start;
+ this.end = end;
+ this.exclusive = exclusive;
+ },
+
+ _each: function(iterator) {
+ var value = this.start;
+ while (this.include(value)) {
+ iterator(value);
+ value = value.succ();
+ }
+ },
+
+ include: function(value) {
+ if (value < this.start)
+ return false;
+ if (this.exclusive)
+ return value < this.end;
+ return value <= this.end;
+ }
+});
+
+var $R = function(start, end, exclusive) {
+ return new ObjectRange(start, end, exclusive);
+};
+
+var Ajax = {
+ getTransport: function() {
+ return Try.these(
+ function() {return new XMLHttpRequest()},
+ function() {return new ActiveXObject('Msxml2.XMLHTTP')},
+ function() {return new ActiveXObject('Microsoft.XMLHTTP')}
+ ) || false;
+ },
+
+ activeRequestCount: 0
+};
+
+Ajax.Responders = {
+ responders: [],
+
+ _each: function(iterator) {
+ this.responders._each(iterator);
+ },
+
+ register: function(responder) {
+ if (!this.include(responder))
+ this.responders.push(responder);
+ },
+
+ unregister: function(responder) {
+ this.responders = this.responders.without(responder);
+ },
+
+ dispatch: function(callback, request, transport, json) {
+ this.each(function(responder) {
+ if (Object.isFunction(responder[callback])) {
+ try {
+ responder[callback].apply(responder, [request, transport, json]);
+ } catch (e) { }
+ }
+ });
+ }
+};
+
+Object.extend(Ajax.Responders, Enumerable);
+
+Ajax.Responders.register({
+ onCreate: function() { Ajax.activeRequestCount++ },
+ onComplete: function() { Ajax.activeRequestCount-- }
+});
+
+Ajax.Base = Class.create({
+ initialize: function(options) {
+ this.options = {
+ method: 'post',
+ asynchronous: true,
+ contentType: 'application/x-www-form-urlencoded',
+ encoding: 'UTF-8',
+ parameters: '',
+ evalJSON: true,
+ evalJS: true
+ };
+ Object.extend(this.options, options || { });
+
+ this.options.method = this.options.method.toLowerCase();
+
+ if (Object.isString(this.options.parameters))
+ this.options.parameters = this.options.parameters.toQueryParams();
+ else if (Object.isHash(this.options.parameters))
+ this.options.parameters = this.options.parameters.toObject();
+ }
+});
+
+Ajax.Request = Class.create(Ajax.Base, {
+ _complete: false,
+
+ initialize: function($super, url, options) {
+ $super(options);
+ this.transport = Ajax.getTransport();
+ this.request(url);
+ },
+
+ request: function(url) {
+ this.url = url;
+ this.method = this.options.method;
+ var params = Object.clone(this.options.parameters);
+
+ if (!['get', 'post'].include(this.method)) {
+ // simulate other verbs over post
+ params['_method'] = this.method;
+ this.method = 'post';
+ }
+
+ this.parameters = params;
+
+ if (params = Object.toQueryString(params)) {
+ // when GET, append parameters to URL
+ if (this.method == 'get')
+ this.url += (this.url.include('?') ? '&' : '?') + params;
+ else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
+ params += '&_=';
+ }
+
+ try {
+ var response = new Ajax.Response(this);
+ if (this.options.onCreate) this.options.onCreate(response);
+ Ajax.Responders.dispatch('onCreate', this, response);
+
+ this.transport.open(this.method.toUpperCase(), this.url,
+ this.options.asynchronous);
+
+ if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1);
+
+ this.transport.onreadystatechange = this.onStateChange.bind(this);
+ this.setRequestHeaders();
+
+ this.body = this.method == 'post' ? (this.options.postBody || params) : null;
+ this.transport.send(this.body);
+
+ /* Force Firefox to handle ready state 4 for synchronous requests */
+ if (!this.options.asynchronous && this.transport.overrideMimeType)
+ this.onStateChange();
+
+ }
+ catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ onStateChange: function() {
+ var readyState = this.transport.readyState;
+ if (readyState > 1 && !((readyState == 4) && this._complete))
+ this.respondToReadyState(this.transport.readyState);
+ },
+
+ setRequestHeaders: function() {
+ var headers = {
+ 'X-Requested-With': 'XMLHttpRequest',
+ 'X-Prototype-Version': Prototype.Version,
+ 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
+ };
+
+ if (this.method == 'post') {
+ headers['Content-type'] = this.options.contentType +
+ (this.options.encoding ? '; charset=' + this.options.encoding : '');
+
+ /* Force "Connection: close" for older Mozilla browsers to work
+ * around a bug where XMLHttpRequest sends an incorrect
+ * Content-length header. See Mozilla Bugzilla #246651.
+ */
+ if (this.transport.overrideMimeType &&
+ (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
+ headers['Connection'] = 'close';
+ }
+
+ // user-defined headers
+ if (typeof this.options.requestHeaders == 'object') {
+ var extras = this.options.requestHeaders;
+
+ if (Object.isFunction(extras.push))
+ for (var i = 0, length = extras.length; i < length; i += 2)
+ headers[extras[i]] = extras[i+1];
+ else
+ $H(extras).each(function(pair) { headers[pair.key] = pair.value });
+ }
+
+ for (var name in headers)
+ this.transport.setRequestHeader(name, headers[name]);
+ },
+
+ success: function() {
+ var status = this.getStatus();
+ return !status || (status >= 200 && status < 300);
+ },
+
+ getStatus: function() {
+ try {
+ return this.transport.status || 0;
+ } catch (e) { return 0 }
+ },
+
+ respondToReadyState: function(readyState) {
+ var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
+
+ if (state == 'Complete') {
+ try {
+ this._complete = true;
+ (this.options['on' + response.status]
+ || this.options['on' + (this.success() ? 'Success' : 'Failure')]
+ || Prototype.emptyFunction)(response, response.headerJSON);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ var contentType = response.getHeader('Content-type');
+ if (this.options.evalJS == 'force'
+ || (this.options.evalJS && this.isSameOrigin() && contentType
+ && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
+ this.evalResponse();
+ }
+
+ try {
+ (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON);
+ Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ if (state == 'Complete') {
+ // avoid memory leak in MSIE: clean up
+ this.transport.onreadystatechange = Prototype.emptyFunction;
+ }
+ },
+
+ isSameOrigin: function() {
+ var m = this.url.match(/^\s*https?:\/\/[^\/]*/);
+ return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({
+ protocol: location.protocol,
+ domain: document.domain,
+ port: location.port ? ':' + location.port : ''
+ }));
+ },
+
+ getHeader: function(name) {
+ try {
+ return this.transport.getResponseHeader(name) || null;
+ } catch (e) { return null }
+ },
+
+ evalResponse: function() {
+ try {
+ return eval((this.transport.responseText || '').unfilterJSON());
+ } catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ dispatchException: function(exception) {
+ (this.options.onException || Prototype.emptyFunction)(this, exception);
+ Ajax.Responders.dispatch('onException', this, exception);
+ }
+});
+
+Ajax.Request.Events =
+ ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
+
+Ajax.Response = Class.create({
+ initialize: function(request){
+ this.request = request;
+ var transport = this.transport = request.transport,
+ readyState = this.readyState = transport.readyState;
+
+ if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
+ this.status = this.getStatus();
+ this.statusText = this.getStatusText();
+ this.responseText = String.interpret(transport.responseText);
+ this.headerJSON = this._getHeaderJSON();
+ }
+
+ if(readyState == 4) {
+ var xml = transport.responseXML;
+ this.responseXML = Object.isUndefined(xml) ? null : xml;
+ this.responseJSON = this._getResponseJSON();
+ }
+ },
+
+ status: 0,
+ statusText: '',
+
+ getStatus: Ajax.Request.prototype.getStatus,
+
+ getStatusText: function() {
+ try {
+ return this.transport.statusText || '';
+ } catch (e) { return '' }
+ },
+
+ getHeader: Ajax.Request.prototype.getHeader,
+
+ getAllHeaders: function() {
+ try {
+ return this.getAllResponseHeaders();
+ } catch (e) { return null }
+ },
+
+ getResponseHeader: function(name) {
+ return this.transport.getResponseHeader(name);
+ },
+
+ getAllResponseHeaders: function() {
+ return this.transport.getAllResponseHeaders();
+ },
+
+ _getHeaderJSON: function() {
+ var json = this.getHeader('X-JSON');
+ if (!json) return null;
+ json = decodeURIComponent(escape(json));
+ try {
+ return json.evalJSON(this.request.options.sanitizeJSON ||
+ !this.request.isSameOrigin());
+ } catch (e) {
+ this.request.dispatchException(e);
+ }
+ },
+
+ _getResponseJSON: function() {
+ var options = this.request.options;
+ if (!options.evalJSON || (options.evalJSON != 'force' &&
+ !(this.getHeader('Content-type') || '').include('application/json')) ||
+ this.responseText.blank())
+ return null;
+ try {
+ return this.responseText.evalJSON(options.sanitizeJSON ||
+ !this.request.isSameOrigin());
+ } catch (e) {
+ this.request.dispatchException(e);
+ }
+ }
+});
+
+Ajax.Updater = Class.create(Ajax.Request, {
+ initialize: function($super, container, url, options) {
+ this.container = {
+ success: (container.success || container),
+ failure: (container.failure || (container.success ? null : container))
+ };
+
+ options = Object.clone(options);
+ var onComplete = options.onComplete;
+ options.onComplete = (function(response, json) {
+ this.updateContent(response.responseText);
+ if (Object.isFunction(onComplete)) onComplete(response, json);
+ }).bind(this);
+
+ $super(url, options);
+ },
+
+ updateContent: function(responseText) {
+ var receiver = this.container[this.success() ? 'success' : 'failure'],
+ options = this.options;
+
+ if (!options.evalScripts) responseText = responseText.stripScripts();
+
+ if (receiver = $(receiver)) {
+ if (options.insertion) {
+ if (Object.isString(options.insertion)) {
+ var insertion = { }; insertion[options.insertion] = responseText;
+ receiver.insert(insertion);
+ }
+ else options.insertion(receiver, responseText);
+ }
+ else receiver.update(responseText);
+ }
+ }
+});
+
+Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
+ initialize: function($super, container, url, options) {
+ $super(options);
+ this.onComplete = this.options.onComplete;
+
+ this.frequency = (this.options.frequency || 2);
+ this.decay = (this.options.decay || 1);
+
+ this.updater = { };
+ this.container = container;
+ this.url = url;
+
+ this.start();
+ },
+
+ start: function() {
+ this.options.onComplete = this.updateComplete.bind(this);
+ this.onTimerEvent();
+ },
+
+ stop: function() {
+ this.updater.options.onComplete = undefined;
+ clearTimeout(this.timer);
+ (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
+ },
+
+ updateComplete: function(response) {
+ if (this.options.decay) {
+ this.decay = (response.responseText == this.lastText ?
+ this.decay * this.options.decay : 1);
+
+ this.lastText = response.responseText;
+ }
+ this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency);
+ },
+
+ onTimerEvent: function() {
+ this.updater = new Ajax.Updater(this.container, this.url, this.options);
+ }
+});
+function $(element) {
+ if (arguments.length > 1) {
+ for (var i = 0, elements = [], length = arguments.length; i < length; i++)
+ elements.push($(arguments[i]));
+ return elements;
+ }
+ if (Object.isString(element))
+ element = document.getElementById(element);
+ return Element.extend(element);
+}
+
+if (Prototype.BrowserFeatures.XPath) {
+ document._getElementsByXPath = function(expression, parentElement) {
+ var results = [];
+ var query = document.evaluate(expression, $(parentElement) || document,
+ null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
+ for (var i = 0, length = query.snapshotLength; i < length; i++)
+ results.push(Element.extend(query.snapshotItem(i)));
+ return results;
+ };
+}
+
+/*--------------------------------------------------------------------------*/
+
+if (!window.Node) var Node = { };
+
+if (!Node.ELEMENT_NODE) {
+ // DOM level 2 ECMAScript Language Binding
+ Object.extend(Node, {
+ ELEMENT_NODE: 1,
+ ATTRIBUTE_NODE: 2,
+ TEXT_NODE: 3,
+ CDATA_SECTION_NODE: 4,
+ ENTITY_REFERENCE_NODE: 5,
+ ENTITY_NODE: 6,
+ PROCESSING_INSTRUCTION_NODE: 7,
+ COMMENT_NODE: 8,
+ DOCUMENT_NODE: 9,
+ DOCUMENT_TYPE_NODE: 10,
+ DOCUMENT_FRAGMENT_NODE: 11,
+ NOTATION_NODE: 12
+ });
+}
+
+(function() {
+ var element = this.Element;
+ this.Element = function(tagName, attributes) {
+ attributes = attributes || { };
+ tagName = tagName.toLowerCase();
+ var cache = Element.cache;
+ if (Prototype.Browser.IE && attributes.name) {
+ tagName = '<' + tagName + ' name="' + attributes.name + '">';
+ delete attributes.name;
+ return Element.writeAttribute(document.createElement(tagName), attributes);
+ }
+ if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName));
+ return Element.writeAttribute(cache[tagName].cloneNode(false), attributes);
+ };
+ Object.extend(this.Element, element || { });
+ if (element) this.Element.prototype = element.prototype;
+}).call(window);
+
+Element.cache = { };
+
+Element.Methods = {
+ visible: function(element) {
+ return $(element).style.display != 'none';
+ },
+
+ toggle: function(element) {
+ element = $(element);
+ Element[Element.visible(element) ? 'hide' : 'show'](element);
+ return element;
+ },
+
+ hide: function(element) {
+ element = $(element);
+ element.style.display = 'none';
+ return element;
+ },
+
+ show: function(element) {
+ element = $(element);
+ element.style.display = '';
+ return element;
+ },
+
+ remove: function(element) {
+ element = $(element);
+ element.parentNode.removeChild(element);
+ return element;
+ },
+
+ update: function(element, content) {
+ element = $(element);
+ if (content && content.toElement) content = content.toElement();
+ if (Object.isElement(content)) return element.update().insert(content);
+ content = Object.toHTML(content);
+ element.innerHTML = content.stripScripts();
+ content.evalScripts.bind(content).defer();
+ return element;
+ },
+
+ replace: function(element, content) {
+ element = $(element);
+ if (content && content.toElement) content = content.toElement();
+ else if (!Object.isElement(content)) {
+ content = Object.toHTML(content);
+ var range = element.ownerDocument.createRange();
+ range.selectNode(element);
+ content.evalScripts.bind(content).defer();
+ content = range.createContextualFragment(content.stripScripts());
+ }
+ element.parentNode.replaceChild(content, element);
+ return element;
+ },
+
+ insert: function(element, insertions) {
+ element = $(element);
+
+ if (Object.isString(insertions) || Object.isNumber(insertions) ||
+ Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
+ insertions = {bottom:insertions};
+
+ var content, insert, tagName, childNodes;
+
+ for (var position in insertions) {
+ content = insertions[position];
+ position = position.toLowerCase();
+ insert = Element._insertionTranslations[position];
+
+ if (content && content.toElement) content = content.toElement();
+ if (Object.isElement(content)) {
+ insert(element, content);
+ continue;
+ }
+
+ content = Object.toHTML(content);
+
+ tagName = ((position == 'before' || position == 'after')
+ ? element.parentNode : element).tagName.toUpperCase();
+
+ childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
+
+ if (position == 'top' || position == 'after') childNodes.reverse();
+ childNodes.each(insert.curry(element));
+
+ content.evalScripts.bind(content).defer();
+ }
+
+ return element;
+ },
+
+ wrap: function(element, wrapper, attributes) {
+ element = $(element);
+ if (Object.isElement(wrapper))
+ $(wrapper).writeAttribute(attributes || { });
+ else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes);
+ else wrapper = new Element('div', wrapper);
+ if (element.parentNode)
+ element.parentNode.replaceChild(wrapper, element);
+ wrapper.appendChild(element);
+ return wrapper;
+ },
+
+ inspect: function(element) {
+ element = $(element);
+ var result = '<' + element.tagName.toLowerCase();
+ $H({'id': 'id', 'className': 'class'}).each(function(pair) {
+ var property = pair.first(), attribute = pair.last();
+ var value = (element[property] || '').toString();
+ if (value) result += ' ' + attribute + '=' + value.inspect(true);
+ });
+ return result + '>';
+ },
+
+ recursivelyCollect: function(element, property) {
+ element = $(element);
+ var elements = [];
+ while (element = element[property])
+ if (element.nodeType == 1)
+ elements.push(Element.extend(element));
+ return elements;
+ },
+
+ ancestors: function(element) {
+ return $(element).recursivelyCollect('parentNode');
+ },
+
+ descendants: function(element) {
+ return $(element).select("*");
+ },
+
+ firstDescendant: function(element) {
+ element = $(element).firstChild;
+ while (element && element.nodeType != 1) element = element.nextSibling;
+ return $(element);
+ },
+
+ immediateDescendants: function(element) {
+ if (!(element = $(element).firstChild)) return [];
+ while (element && element.nodeType != 1) element = element.nextSibling;
+ if (element) return [element].concat($(element).nextSiblings());
+ return [];
+ },
+
+ previousSiblings: function(element) {
+ return $(element).recursivelyCollect('previousSibling');
+ },
+
+ nextSiblings: function(element) {
+ return $(element).recursivelyCollect('nextSibling');
+ },
+
+ siblings: function(element) {
+ element = $(element);
+ return element.previousSiblings().reverse().concat(element.nextSiblings());
+ },
+
+ match: function(element, selector) {
+ if (Object.isString(selector))
+ selector = new Selector(selector);
+ return selector.match($(element));
+ },
+
+ up: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return $(element.parentNode);
+ var ancestors = element.ancestors();
+ return Object.isNumber(expression) ? ancestors[expression] :
+ Selector.findElement(ancestors, expression, index);
+ },
+
+ down: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return element.firstDescendant();
+ return Object.isNumber(expression) ? element.descendants()[expression] :
+ Element.select(element, expression)[index || 0];
+ },
+
+ previous: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element));
+ var previousSiblings = element.previousSiblings();
+ return Object.isNumber(expression) ? previousSiblings[expression] :
+ Selector.findElement(previousSiblings, expression, index);
+ },
+
+ next: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element));
+ var nextSiblings = element.nextSiblings();
+ return Object.isNumber(expression) ? nextSiblings[expression] :
+ Selector.findElement(nextSiblings, expression, index);
+ },
+
+ select: function() {
+ var args = $A(arguments), element = $(args.shift());
+ return Selector.findChildElements(element, args);
+ },
+
+ adjacent: function() {
+ var args = $A(arguments), element = $(args.shift());
+ return Selector.findChildElements(element.parentNode, args).without(element);
+ },
+
+ identify: function(element) {
+ element = $(element);
+ var id = element.readAttribute('id'), self = arguments.callee;
+ if (id) return id;
+ do { id = 'anonymous_element_' + self.counter++ } while ($(id));
+ element.writeAttribute('id', id);
+ return id;
+ },
+
+ readAttribute: function(element, name) {
+ element = $(element);
+ if (Prototype.Browser.IE) {
+ var t = Element._attributeTranslations.read;
+ if (t.values[name]) return t.values[name](element, name);
+ if (t.names[name]) name = t.names[name];
+ if (name.include(':')) {
+ return (!element.attributes || !element.attributes[name]) ? null :
+ element.attributes[name].value;
+ }
+ }
+ return element.getAttribute(name);
+ },
+
+ writeAttribute: function(element, name, value) {
+ element = $(element);
+ var attributes = { }, t = Element._attributeTranslations.write;
+
+ if (typeof name == 'object') attributes = name;
+ else attributes[name] = Object.isUndefined(value) ? true : value;
+
+ for (var attr in attributes) {
+ name = t.names[attr] || attr;
+ value = attributes[attr];
+ if (t.values[attr]) name = t.values[attr](element, value);
+ if (value === false || value === null)
+ element.removeAttribute(name);
+ else if (value === true)
+ element.setAttribute(name, name);
+ else element.setAttribute(name, value);
+ }
+ return element;
+ },
+
+ getHeight: function(element) {
+ return $(element).getDimensions().height;
+ },
+
+ getWidth: function(element) {
+ return $(element).getDimensions().width;
+ },
+
+ classNam...
[truncated message content] |
|
From: <ts...@us...> - 2008-11-19 17:37:19
|
Revision: 156
http://openupload.svn.sourceforge.net/openupload/?rev=156&view=rev
Author: tsdogs
Date: 2008-11-19 17:37:14 +0000 (Wed, 19 Nov 2008)
Log Message:
-----------
fix firefox warning
Modified Paths:
--------------
trunk/www/templates/default/main.css
Modified: trunk/www/templates/default/main.css
===================================================================
--- trunk/www/templates/default/main.css 2008-11-17 18:29:08 UTC (rev 155)
+++ trunk/www/templates/default/main.css 2008-11-19 17:37:14 UTC (rev 156)
@@ -67,7 +67,6 @@
display: inline-block;
padding-top: 5px;
padding-bottom: 20px;
- height: -200px;
}
#content {
display: table;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-17 18:29:10
|
Revision: 155
http://openupload.svn.sourceforge.net/openupload/?rev=155&view=rev
Author: tsdogs
Date: 2008-11-17 18:29:08 +0000 (Mon, 17 Nov 2008)
Log Message:
-----------
update todo
Modified Paths:
--------------
trunk/TODO
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2008-11-17 18:26:25 UTC (rev 154)
+++ trunk/TODO 2008-11-17 18:29:08 UTC (rev 155)
@@ -23,7 +23,7 @@
- Add setup script (almost ready)
- Config administration
-Loggins
+Logs
- Create logs which can then create statistics.
Administration
@@ -34,6 +34,7 @@
General
- enable modrewrite mode
- Upload and download of multiple files at the same time
+- E-mail customization in configuration
Users
- manage personal files (if allowed)
@@ -64,6 +65,7 @@
User additional fields for registration request.
Antivirus on upload
Deletion timeout (should it be a plugin? Maybe only for user interaction on it)
+ Compression of several files into one zip
Translation
- Add a database translator? not until base isn't complete.
@@ -78,6 +80,9 @@
- All is missing :)
- Document program api
+Setup/Configuration
+- Change php settings in .htaccess file (low priority)
+
Others
- Activity logging
- Terms of Use for site and registration
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-17 18:26:29
|
Revision: 154
http://openupload.svn.sourceforge.net/openupload/?rev=154&view=rev
Author: tsdogs
Date: 2008-11-17 18:26:25 +0000 (Mon, 17 Nov 2008)
Log Message:
-----------
add php settings infos for uploads
Modified Paths:
--------------
trunk/INSTALL
Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL 2008-11-17 18:15:14 UTC (rev 153)
+++ trunk/INSTALL 2008-11-17 18:26:25 UTC (rev 154)
@@ -28,6 +28,11 @@
- A running Web Server with PHP 5.x (version 4 has not been tested)
- Database (MySQL) (optional but raccomended)
- PHP and Web server must be configured to allow the file uploads
+ More specifically:
+ by default php allows uploads of max 2Mb file size.
+ You'll need to update the php.ini file to allow the maximum allowed size of your site, either by modifying the php.ini or
+ allowing Apache (or the web server) to let .htaccess override the limit. (i.e. AllowOverride Options)
+ In the www directory there is an example .htaccess file
- PHP must be installed with the DATABASE backend you want to use,
and GD image extensions for captcha to work.
- Also the LDAP extension needs to be installed if you plan to use
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-17 18:15:16
|
Revision: 153
http://openupload.svn.sourceforge.net/openupload/?rev=153&view=rev
Author: tsdogs
Date: 2008-11-17 18:15:14 +0000 (Mon, 17 Nov 2008)
Log Message:
-----------
update todo
Modified Paths:
--------------
trunk/TODO
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2008-11-17 18:10:34 UTC (rev 152)
+++ trunk/TODO 2008-11-17 18:15:14 UTC (rev 153)
@@ -2,7 +2,7 @@
******* MUST BE DONE BEFORE RELEASE 0.4 *******
General
-- Review the logo.
+- Review the logo. (in progress...)
Bugs
- Fix all bugs I find in 0.3 (I hope somebody else will report some if they exsist)
@@ -14,15 +14,18 @@
- txtdb deep testing
Plugins
-- Upload different filesize limiting depending on group (needs plugin options based on groups)
+- Upload different filesize limiting depending on group
Maintainence
- Create a script to clean up the files/tmpfiles.
Setup
-- Add setup script
+- Add setup script (almost ready)
- Config administration
+Loggins
+- Create logs which can then create statistics.
+
Administration
- Enable multiple table operations (deletion mainly)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-17 18:10:36
|
Revision: 152
http://openupload.svn.sourceforge.net/openupload/?rev=152&view=rev
Author: tsdogs
Date: 2008-11-17 18:10:34 +0000 (Mon, 17 Nov 2008)
Log Message:
-----------
update with French translation
Modified Paths:
--------------
trunk/sql/mysql/2_base.sql
trunk/sql/pgsql/2_base.sql
trunk/sql/txt/langs.txt
trunk/www/setup.inc.php
Modified: trunk/sql/mysql/2_base.sql
===================================================================
--- trunk/sql/mysql/2_base.sql 2008-11-17 18:09:06 UTC (rev 151)
+++ trunk/sql/mysql/2_base.sql 2008-11-17 18:10:34 UTC (rev 152)
@@ -34,6 +34,7 @@
INSERT INTO `langs` (`id`, `name`, `locale`, `browser`, `charset`, `active`) VALUES('en', 'English', 'en_EN', '[en];[en-EN]', 'iso-8559-1', 1);
INSERT INTO `langs` (`id`, `name`, `locale`, `browser`, `charset`, `active`) VALUES('it', 'Italiano', 'it_IT.utf8', '[it];[it-IT]', 'utf8', 1);
+INSERT INTO `langs` (`id`, `name`, `locale`, `browser`, `charset`, `active`) VALUES('fr', 'Français', 'fr_FR.utf8', '[fr];[fr-FR]', 'utf8', 1);
--
-- Dump dei dati per la tabella `users`
Modified: trunk/sql/pgsql/2_base.sql
===================================================================
--- trunk/sql/pgsql/2_base.sql 2008-11-17 18:09:06 UTC (rev 151)
+++ trunk/sql/pgsql/2_base.sql 2008-11-17 18:10:34 UTC (rev 152)
@@ -84,6 +84,7 @@
INSERT INTO langs VALUES ('en', 'English', 'en_EN', '[en];[en-EN]', 'iso-8559-1', 1);
INSERT INTO langs VALUES ('it', 'Italiano', 'it_IT.utf8', '[it];[it-IT]', 'utf8', 1);
+INSERT INTO langs VALUES ('fr', 'Français', 'fr_FR.utf8', '[fr];[fr-FR]', 'utf8', 1);
--
Modified: trunk/sql/txt/langs.txt
===================================================================
--- trunk/sql/txt/langs.txt 2008-11-17 18:09:06 UTC (rev 151)
+++ trunk/sql/txt/langs.txt 2008-11-17 18:10:34 UTC (rev 152)
@@ -1,3 +1,4 @@
id|name|locale|browser|charset|active
en|English|en_EN|[en];[en-EN]|iso-8559-1|1
it|Italiano|it_IT.utf8|[it];[it-IT]|utf8|1
+fr|Français|fr_FR.utf8|[fr];[fr-FR]|utf8|1
Modified: trunk/www/setup.inc.php
===================================================================
--- trunk/www/setup.inc.php 2008-11-17 18:09:06 UTC (rev 151)
+++ trunk/www/setup.inc.php 2008-11-17 18:10:34 UTC (rev 152)
@@ -146,6 +146,7 @@
"INSERT INTO `%0groups` (`name`, `description`) VALUES('%5', 'Unregistered users')",
"INSERT INTO `%0langs` (`id`, `name`, `locale`, `browser`, `charset`, `active`) VALUES('en', 'English', 'en_EN', '[en];[en-EN]', 'iso-8559-1', 1)",
"INSERT INTO `%0langs` (`id`, `name`, `locale`, `browser`, `charset`, `active`) VALUES('it', 'Italiano', 'it_IT.utf8', '[it];[it-IT]', 'utf8', 1)",
+ "INSERT INTO `%0langs` (`id`, `name`, `locale`, `browser`, `charset`, `active`) VALUES('fr', 'Français', 'fr_FR.utf8', '[fr];[fr-FR]', 'utf8', 1)",
"INSERT INTO `%0users` (`id`, `login`, `password`, `name`, `group_name`, `email`, `lang`, `reg_date`, `regid`, `active`) VALUES(1, '%1', '%2', 'Administrator', '%3', '%6', 'en', now(), '', 1)",
"INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(1, '*', '*', '%3', 'allow')",
"INSERT INTO `%0acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(2, 'admin', '*', '%3', 'allow')",
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-17 18:09:08
|
Revision: 151
http://openupload.svn.sourceforge.net/openupload/?rev=151&view=rev
Author: tsdogs
Date: 2008-11-17 18:09:06 +0000 (Mon, 17 Nov 2008)
Log Message:
-----------
Fix typos
Modified Paths:
--------------
trunk/locale/fr/LC_MESSAGES/openupload.po
trunk/locale/fr.inc.php
trunk/locale/it/LC_MESSAGES/openupload.po
trunk/locale/it.inc.php
trunk/templates/default/locale/fr/LC_MESSAGES/template.mo
trunk/templates/default/locale/fr/LC_MESSAGES/template.po
trunk/templates/default/locale/fr.inc.php
trunk/templates/default/locale/it/LC_MESSAGES/template.mo
trunk/templates/default/locale/it/LC_MESSAGES/template.po
trunk/templates/default/locale/it.inc.php
Modified: trunk/locale/fr/LC_MESSAGES/openupload.po
===================================================================
--- trunk/locale/fr/LC_MESSAGES/openupload.po 2008-11-17 18:07:46 UTC (rev 150)
+++ trunk/locale/fr/LC_MESSAGES/openupload.po 2008-11-17 18:09:06 UTC (rev 151)
@@ -185,11 +185,11 @@
msgstr "Cette extension de fichier n'est pas supportée!"
#: ../../../lib/modules/default/files.inc.php:77
-msgid "Upload failed for Unknonw error code: %1"
+msgid "Upload failed for Unknown error code: %1"
msgstr "L'envoi de fichier a échoué pour une raison inconnue. ERREUR: %1"
#: ../../../lib/modules/default/files.inc.php:194
-msgid "Requested file does not exsist!"
+msgid "Requested file does not exist!"
msgstr "Le fichier demandé n'existe pas!"
#: ../../../lib/modules/default/files.inc.php:280
Modified: trunk/locale/fr.inc.php
===================================================================
--- trunk/locale/fr.inc.php 2008-11-17 18:07:46 UTC (rev 150)
+++ trunk/locale/fr.inc.php 2008-11-17 18:09:06 UTC (rev 151)
@@ -40,8 +40,8 @@
$tr["Missing temporary directory"] = "Le répertoire temporaire est introuvable";
$tr["Can't write to temporary diretory!"] = "Impossible d'écrire dans le répertoire temporaire!";
$tr["Upload blocked by extension!"] = "Cette extension de fichier n'est pas supportée!";
-$tr["Upload failed for Unknonw error code: %1"] = "L'envoi de fichier a échoué pour une raison inconnue. ERREUR: %1";
-$tr["Requested file does not exsist!"] = "Le fichier demandé n'existe pas!";
+$tr["Upload failed for Unknown error code: %1"] = "L'envoi de fichier a échoué pour une raison inconnue. ERREUR: %1";
+$tr["Requested file does not exist!"] = "Le fichier demandé n'existe pas!";
$tr["Wrong file id!"] = "L'identifiant du fichier est erronné!";
$tr["Administration"] = "Administration";
$tr["User administration not supported by Auth Module"] = "L'administration des utilisateurs n'est pas permise par le module d'authentification (Auth)";
Modified: trunk/locale/it/LC_MESSAGES/openupload.po
===================================================================
--- trunk/locale/it/LC_MESSAGES/openupload.po 2008-11-17 18:07:46 UTC (rev 150)
+++ trunk/locale/it/LC_MESSAGES/openupload.po 2008-11-17 18:09:06 UTC (rev 151)
@@ -185,11 +185,11 @@
msgstr "Upload bloccato da un'estensione!"
#: ../../../lib/modules/default/files.inc.php:77
-msgid "Upload failed for Unknonw error code: %1"
+msgid "Upload failed for Unknown error code: %1"
msgstr "Upload fallito per una ragione sconosciuta. codice errore: %1"
#: ../../../lib/modules/default/files.inc.php:194
-msgid "Requested file does not exsist!"
+msgid "Requested file does not exist!"
msgstr "Il file richiesto non esiste!"
#: ../../../lib/modules/default/files.inc.php:280
Modified: trunk/locale/it.inc.php
===================================================================
--- trunk/locale/it.inc.php 2008-11-17 18:07:46 UTC (rev 150)
+++ trunk/locale/it.inc.php 2008-11-17 18:09:06 UTC (rev 151)
@@ -40,8 +40,8 @@
$tr["Missing temporary directory"] = "Manca la cartella per l'upload temporaneo";
$tr["Can't write to temporary diretory!"] = "Impossibile scrivere nella cartella temporanea!";
$tr["Upload blocked by extension!"] = "Upload bloccato da un'estensione!";
-$tr["Upload failed for Unknonw error code: %1"] = "Upload fallito per una ragione sconosciuta. codice errore: %1";
-$tr["Requested file does not exsist!"] = "Il file richiesto non esiste!";
+$tr["Upload failed for Unknown error code: %1"] = "Upload fallito per una ragione sconosciuta. codice errore: %1";
+$tr["Requested file does not exist!"] = "Il file richiesto non esiste!";
$tr["Wrong file id!"] = "ID del file errata!";
$tr["Administration"] = "Amministrazione";
$tr["User administration not supported by Auth Module"] = "Amministrazione utenti non supportata dal modulo di Autenticazione";
Modified: trunk/templates/default/locale/fr/LC_MESSAGES/template.mo
===================================================================
(Binary files differ)
Modified: trunk/templates/default/locale/fr/LC_MESSAGES/template.po
===================================================================
--- trunk/templates/default/locale/fr/LC_MESSAGES/template.po 2008-11-17 18:07:46 UTC (rev 150)
+++ trunk/templates/default/locale/fr/LC_MESSAGES/template.po 2008-11-17 18:09:06 UTC (rev 151)
@@ -3,8 +3,8 @@
"Project-Id-Version: OpenUpload default template\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-11-14 17:29+0100\n"
-"PO-Revision-Date: 2008-11-14 18:29+0100\n"
-"Last-Translator: Mathieu Robin-Vinet <mat...@ho...>\n"
+"PO-Revision-Date: 2008-11-17 19:05+0100\n"
+"Last-Translator: Alessandro Briosi <ts...@br...>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -374,7 +374,7 @@
msgstr "Envoyer"
#: ../../../default.c:398
-msgid "FILE HAS BEEN SUCCESSGULLY REMOVED"
+msgid "FILE HAS BEEN SUCCESSFULLY REMOVED"
msgstr "LE FICHIER A ETE SUPPRIME AVEC SUCCES"
#: ../../../default.c:431
@@ -434,11 +434,11 @@
msgstr "Changer"
#: ../../../default.c:500
-msgid "Registration succeded"
+msgid "Registration succeeded"
msgstr "Inscription effectuée avec succès"
#: ../../../default.c:503
-msgid "An e-mail has been sent for the accout activation"
+msgid "An e-mail has been sent for the account activation"
msgstr "Un courriel de confirmation a été envoyé"
#: ../../../default.c:506
Modified: trunk/templates/default/locale/fr.inc.php
===================================================================
--- trunk/templates/default/locale/fr.inc.php 2008-11-17 18:07:46 UTC (rev 150)
+++ trunk/templates/default/locale/fr.inc.php 2008-11-17 18:09:06 UTC (rev 151)
@@ -68,7 +68,7 @@
$tr["You can now proceed downloading the file"] = "Vous pouvez maintenant télécharger le fichier";
$tr["Download file"] = "Télécharger";
$tr["Complete upload"] = "Envoyer";
-$tr["FILE HAS BEEN SUCCESSGULLY REMOVED"] = "LE FICHIER A ETE SUPPRIME AVEC SUCCES";
+$tr["FILE HAS BEEN SUCCESSFULLY REMOVED"] = "LE FICHIER A ETE SUPPRIME AVEC SUCCES";
$tr["Dear "] = "Cher";
$tr["This e-mail message is sent to you to confirm your account registration has a valid e-mail address."] = "Ce message vous est envoyé pour confirmer que votre compte utilise une adresse de courriel valide";
$tr["Open the following link in a browser to confirm your account."] = "Cliquez sur le lient suivant pour confirmer votre inscription.";
@@ -82,8 +82,8 @@
$tr["Login here"] = "vous Authentifier ici";
$tr["Language"] = "Langue";
$tr["Change"] = "Changer";
-$tr["Registration succeded"] = "Inscription effectuée avec succès";
-$tr["An e-mail has been sent for the accout activation"] = "Un courriel de confirmation a été envoyé";
+$tr["Registration succeeded"] = "Inscription effectuée avec succès";
+$tr["An e-mail has been sent for the account activation"] = "Un courriel de confirmation a été envoyé";
$tr["Please follow the e-mail instructions to activate your account."] = "Merci de suivre les instructions contenues dans le courriel pour activer votre compte.";
$tr["back to home"] = "Retour à l'accueil";
$tr["Old password"] = "Ancien mot de passe";
Modified: trunk/templates/default/locale/it/LC_MESSAGES/template.mo
===================================================================
(Binary files differ)
Modified: trunk/templates/default/locale/it/LC_MESSAGES/template.po
===================================================================
--- trunk/templates/default/locale/it/LC_MESSAGES/template.po 2008-11-17 18:07:46 UTC (rev 150)
+++ trunk/templates/default/locale/it/LC_MESSAGES/template.po 2008-11-17 18:09:06 UTC (rev 151)
@@ -2,8 +2,8 @@
msgstr ""
"Project-Id-Version: OpenUpload default template\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-10-28 18:29+0100\n"
-"PO-Revision-Date: 2008-10-28 18:29+0100\n"
+"POT-Creation-Date: 2008-11-17 19:06+0100\n"
+"PO-Revision-Date: 2008-11-17 19:06+0100\n"
"Last-Translator: Alessandro Briosi <ts...@br...>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -374,7 +374,7 @@
msgstr "Completa caricamento"
#: ../../../default.c:398
-msgid "FILE HAS BEEN SUCCESSGULLY REMOVED"
+msgid "FILE HAS BEEN SUCCESSFULLY REMOVED"
msgstr "IL FILE E' STATO RIMOSSO CON SUCCESSO"
#: ../../../default.c:431
@@ -434,11 +434,11 @@
msgstr "Modifica"
#: ../../../default.c:500
-msgid "Registration succeded"
+msgid "Registration succeeded"
msgstr "Registrazione avvenuta con successo"
#: ../../../default.c:503
-msgid "An e-mail has been sent for the accout activation"
+msgid "An e-mail has been sent for the account activation"
msgstr "Un'email ti è stata inviata per confermare l'attivazione del tuo account"
#: ../../../default.c:506
Modified: trunk/templates/default/locale/it.inc.php
===================================================================
--- trunk/templates/default/locale/it.inc.php 2008-11-17 18:07:46 UTC (rev 150)
+++ trunk/templates/default/locale/it.inc.php 2008-11-17 18:09:06 UTC (rev 151)
@@ -68,7 +68,7 @@
$tr["You can now proceed downloading the file"] = "Puoi ora procedere allo scaricamento del file";
$tr["Download file"] = "Scarica file";
$tr["Complete upload"] = "Completa caricamento";
-$tr["FILE HAS BEEN SUCCESSGULLY REMOVED"] = "IL FILE E' STATO RIMOSSO CON SUCCESSO";
+$tr["FILE HAS BEEN SUCCESSFULLY REMOVED"] = "IL FILE E' STATO RIMOSSO CON SUCCESSO";
$tr["Dear "] = "Egregio";
$tr["This e-mail message is sent to you to confirm your account registration has a valid e-mail address."] = "Questo messaggio ti è stato inviato per confermare che il tuo account abbia un indirizzo e-mail valido";
$tr["Open the following link in a browser to confirm your account."] = "Apri il seguente indirizzo in un browser per confermare il tuo account.";
@@ -82,8 +82,8 @@
$tr["Login here"] = "Accedere qui";
$tr["Language"] = "Lingua";
$tr["Change"] = "Modifica";
-$tr["Registration succeded"] = "Registrazione avvenuta con successo";
-$tr["An e-mail has been sent for the accout activation"] = "Un'email ti è stata inviata per confermare l'attivazione del tuo account";
+$tr["Registration succeeded"] = "Registrazione avvenuta con successo";
+$tr["An e-mail has been sent for the account activation"] = "Un'email ti è stata inviata per confermare l'attivazione del tuo account";
$tr["Please follow the e-mail instructions to activate your account."] = "Segui le istruzioni dell'e-mail per attivare il tuo account.";
$tr["back to home"] = "torna alla pagina principale";
$tr["Old password"] = "Vecchia Password";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-17 18:07:51
|
Revision: 150
http://openupload.svn.sourceforge.net/openupload/?rev=150&view=rev
Author: tsdogs
Date: 2008-11-17 18:07:46 +0000 (Mon, 17 Nov 2008)
Log Message:
-----------
Fix typos
Modified Paths:
--------------
trunk/templates/default/modules/auth/registerConfirm.tpl
trunk/templates/default/modules/files/removeResult.tpl
Modified: trunk/templates/default/modules/auth/registerConfirm.tpl
===================================================================
--- trunk/templates/default/modules/auth/registerConfirm.tpl 2008-11-17 18:07:11 UTC (rev 149)
+++ trunk/templates/default/modules/auth/registerConfirm.tpl 2008-11-17 18:07:46 UTC (rev 150)
@@ -1,7 +1,7 @@
-{tr}Registration succeded{/tr}. <br>
+{tr}Registration succeeded{/tr}. <br>
{if $emailconfirm=='yes'}
-<p>{tr}An e-mail has been sent for the accout activation{/tr}.<br>
+<p>{tr}An e-mail has been sent for the account activation{/tr}.<br>
{tr}Please follow the e-mail instructions to activate your account.{/tr}</p>
{/if}
<br>
Modified: trunk/templates/default/modules/files/removeResult.tpl
===================================================================
--- trunk/templates/default/modules/files/removeResult.tpl 2008-11-17 18:07:11 UTC (rev 149)
+++ trunk/templates/default/modules/files/removeResult.tpl 2008-11-17 18:07:46 UTC (rev 150)
@@ -1,4 +1,4 @@
-{tr}FILE HAS BEEN SUCCESSGULLY REMOVED{/tr}:<br>
+{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>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-17 18:07:14
|
Revision: 149
http://openupload.svn.sourceforge.net/openupload/?rev=149&view=rev
Author: tsdogs
Date: 2008-11-17 18:07:11 +0000 (Mon, 17 Nov 2008)
Log Message:
-----------
Fix typos
Modified Paths:
--------------
trunk/lib/modules/default/files.inc.php
Modified: trunk/lib/modules/default/files.inc.php
===================================================================
--- trunk/lib/modules/default/files.inc.php 2008-11-14 19:16:41 UTC (rev 148)
+++ trunk/lib/modules/default/files.inc.php 2008-11-17 18:07:11 UTC (rev 149)
@@ -74,7 +74,7 @@
case 7: app()->error(tr('Can\'t write to temporary diretory!')); break;
case 8: app()->error(tr('Upload blocked by extension!')); break;
default:
- app()->error(tr('Upload failed for Unknonw error code: %1',$_FILES['upload']['error'])); break;
+ app()->error(tr('Upload failed for Unknown error code: %1',$_FILES['upload']['error'])); break;
}
$this->nextStep(1);
} else if ($_FILES['upload']['size']>app()->user->info('max_upload_size')) {
@@ -229,11 +229,11 @@
} else if (isset($_SESSION['user']['d'][0]['id'])) {
$id = $_SESSION['user']['d'][0]['id'];
}
- /* check if download exsists, and what are the properties */
+ /* check if download exists, and what are the properties */
if ($id != '') {
$finfo = $this->loadFile($id);
if ($finfo[0]['id']!=$id) {
- app()->error(tr('Requested file does not exsist!'));
+ app()->error(tr('Requested file does not exist!'));
$this->prevStep();
} else {
$_SESSION['user']['d']=$finfo;
@@ -323,7 +323,7 @@
} else if (isset($_SESSION['user']['r']['id'])) {
$id = $_SESSION['user']['r']['id'];
}
- /* check if download exsists, and what are the properties */
+ /* check if download exists, and what are the properties */
if ($id != '') {
$finfo = $this->loadFile($id);
if ($finfo['id']!=$id) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-14 19:16:43
|
Revision: 148
http://openupload.svn.sourceforge.net/openupload/?rev=148&view=rev
Author: tsdogs
Date: 2008-11-14 19:16:41 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
update with French translation
Modified Paths:
--------------
trunk/CHANGELOG
trunk/README
Modified: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG 2008-11-14 19:13:14 UTC (rev 147)
+++ trunk/CHANGELOG 2008-11-14 19:16:41 UTC (rev 148)
@@ -1,4 +1,4 @@
-Changelog from release 0.3 to 0.4
+Changelog from release 0.3b to 0.4
* Fixed BUGS
- Registration wasn't working 'cause of a api rename bug
@@ -16,6 +16,8 @@
* Plugins
- Options are now group based and in the database
+* Translations
+ - Add French thanks to BatMat (themat)
Changelog from 0.3a to 0.3b (updated 2008.11.07)
Modified: trunk/README
===================================================================
--- trunk/README 2008-11-14 19:13:14 UTC (rev 147)
+++ trunk/README 2008-11-14 19:16:41 UTC (rev 148)
@@ -2,7 +2,7 @@
OpenUpload - Share your big files over the internet service
-VERSION: 0.3
+VERSION: 0.4
AUTHORS:
@@ -19,6 +19,8 @@
Crystal Project Icons (http://www.everaldo.com) (Used in default template)
Copyright: Copyright (c) 2006-2007 Everaldo Coelho
+BatMat (themat)
+ French translation
DESCRIPTION:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-11-14 19:13:18
|
Revision: 147
http://openupload.svn.sourceforge.net/openupload/?rev=147&view=rev
Author: tsdogs
Date: 2008-11-14 19:13:14 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
remove not needed line
Modified Paths:
--------------
trunk/lib/modules/default/admin.inc.php
Modified: trunk/lib/modules/default/admin.inc.php
===================================================================
--- trunk/lib/modules/default/admin.inc.php 2008-11-14 19:12:18 UTC (rev 146)
+++ trunk/lib/modules/default/admin.inc.php 2008-11-14 19:13:14 UTC (rev 147)
@@ -166,7 +166,6 @@
if (isset($_POST['login'])) {
$pwd = false;
$user = app()->auth->userinfo($_POST['login']);
- //$user = $user[0];
$user['name']=$_POST['editusername'];
$user['group_name']=$_POST['editusergroup'];
$user['email']=$_POST['edituseremail'];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|