openupload-svn-update Mailing List for Open Upload (Page 16)
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-10-15 20:22:07
|
Revision: 9
http://openupload.svn.sourceforge.net/openupload/?rev=9&view=rev
Author: tsdogs
Date: 2008-10-15 13:56:22 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
First svn commit
Added Paths:
-----------
trunk/lib/smarty/configs/
trunk/lib/smarty/internals/
trunk/lib/smarty/plugins/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-15 18:16:04
|
Revision: 21
http://openupload.svn.sourceforge.net/openupload/?rev=21&view=rev
Author: tsdogs
Date: 2008-10-15 18:15:51 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
Added Paths:
-----------
web/img/
web/img/openupload.jpg
web/index.html
Added: web/img/openupload.jpg
===================================================================
(Binary files differ)
Property changes on: web/img/openupload.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: web/index.html
===================================================================
--- web/index.html (rev 0)
+++ web/index.html 2008-10-15 18:15:51 UTC (rev 21)
@@ -0,0 +1,153 @@
+<html>
+<head>
+<TITLE>Welcome to Open Upload Project web site</TITLE>
+<meta name="keywords" content="Open Upload, Rapidshare clone, personal web file server">
+<meta name="description" content="Open Upload is a PHP application to create a private / public file download server">
+<meta name="robots" content="index, follow">
+<meta name="rating" content="general">
+<meta name="revisit-after" content="15 days">
+<STYLE>
+body {
+ font-family: Helvetica, Arial;
+ font-size: 11pt;
+}
+#header {
+ height: 115px;
+ border-bottom: 2px solid #3161cf;
+}
+#logo {
+ float: left;
+}
+#sponsors {
+ float: right;
+}
+#container {
+ clear: both;
+}
+#menu {
+ float: left;
+ width: 200px;
+}
+#menu ul {
+ margin-top: 0px;
+ list-style:none;
+ padding: 0px;
+}
+#menu li {
+ padding-right: 8px;
+ padding-left: 15px;
+ padding-bottom: 20px;
+ margin-top: 0px;
+}
+#content {
+ margin-left: 200px;
+ margin-top: 20px;
+}
+#section {
+ margin-bottom: 30px;
+}
+#title {
+ font-size: 14pt;
+ font-weight: bold;
+ margin-bottom: 2px;
+ border-bottom: 1px solid #000;
+}
+#text {
+ text-align: justify;
+}
+#footer {
+ position: fixed;
+ bottom: 0px;
+ height: 20px;
+ width: 100%;
+ font-weight: bold;
+ font-size: 9pt;
+ border-top: 1px solid #000000;
+ text-align: center;
+}
+#footer a {
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 9pt;
+ text-decoration: none;
+}
+#footer a:visited {
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 9pt;
+ text-decoration: none;
+}
+a {
+ font-size: 11pt;
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 11pt;
+ text-decoration: none;
+}
+a:visited {
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 11pt;
+ text-decoration: none;
+}
+a:hover {
+ color: #4c8dff;
+ font-weight: bold;
+ font-size: 11pt;
+ text-decoration: none;
+}
+</STYLE>
+</head>
+<BODY>
+<div id="header">
+<div id="logo"><img src="./img/openupload.jpg"></div>
+<div id="sponsors">
+<a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=242018&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></a>
+</div>
+</div>
+<div id="container">
+<div id="menu">
+<ul>
+<LI><a href=""><a href="http://sourceforge.net/project/screenshots.php?group_id=242018&ssid=92531" target="_new">Screenshots</a></LI>
+<LI><a href="http://sourceforge.net/project/showfiles.php?group_id=242018" target="_new">Download</a></LI>
+<LI><a href="http://openupload.svn.sourceforge.net/viewvc/openupload/" target="_new">SVN Code</a></LI>
+<LI><a href="http://www.sourceforge.net/projects/openupload">SF.Net Project Page</a></LI>
+</ul>
+</div> <!-- menu -->
+<div id="content">
+<div id="section">
+<div id="title">Welcome to Open Upload Project</div>
+<div id="text">Open Upload is a PHP application to create a private / public file download server.</div>
+</div>
+<div id="section">
+<div id="title">Features</div>
+<div id="text">Open Upload has been designed to be extendable<br>This are the main features:
+<ul>
+<LI>Access control by groups</LI>
+<LI>Template driven</LI>
+<LI>Internationalization</LI>
+<LI>Multiple db backends (MySQL, Postgress, Flat file)</LI>
+<LI>Multiple user authentication backends (database, LDAP, AD)</LI>
+<LI>Plugins to control file upload/download limits / functionality (password protection, captcha, email, banned IP,...)</LI>
+</ul>
+</div> <!-- text -->
+</div> <!-- section -->
+<div id="section">
+<div id="title">Screenshots</div>
+<div id="text">See the screenshots to have an idea on what Open Upload is. <a href="http://sourceforge.net/project/screenshots.php?group_id=242018&ssid=92531" target="_new">Screenshots</a></div>
+</div>
+<div id="section">
+<div id="title">Download</div>
+<div id="text">No release is available for now, check out svn for an overview.</div>
+</div>
+<div id="section">
+<div id="title">SVN</div>
+<div id="text">To checkout svn:<br>
+<pre>svn co https://openupload.svn.sourceforge.net/svnroot/openupload/trunk openupload</pre>
+For further info: <a href="http://sourceforge.net/svn/?group_id=242018">Project Page</a></div>
+</div>
+</div> <!-- content -->
+</div> <!-- container -->
+<div id="footer"><a href="http://openupload.sf.net">Open Upload</a> - Created by Alessandro Briosi © 2008</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-10-15 18:14:26
|
Revision: 20
http://openupload.svn.sourceforge.net/openupload/?rev=20&view=rev
Author: tsdogs
Date: 2008-10-15 18:14:17 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
add administration of users
Modified Paths:
--------------
trunk/lib/modules/db/mysql.inc.php
trunk/lib/modules/default/admin.inc.php
trunk/www/templates/default/main.css
Added Paths:
-----------
trunk/templates/default/modules/admin/adminmenu.tpl
trunk/templates/default/modules/admin/useradd.tpl
trunk/templates/default/modules/admin/useredit.tpl
trunk/templates/default/modules/admin/users.tpl
trunk/www/templates/default/img/admin/active0.png
trunk/www/templates/default/img/admin/active1.png
trunk/www/templates/default/img/admin/delete_user.png
trunk/www/templates/default/img/admin/edit_user.png
trunk/www/templates/default/img/admin/tadd_user.png
trunk/www/templates/default/img/admin/tdelete_user.png
Modified: trunk/lib/modules/db/mysql.inc.php
===================================================================
--- trunk/lib/modules/db/mysql.inc.php 2008-10-15 16:18:27 UTC (rev 19)
+++ trunk/lib/modules/db/mysql.inc.php 2008-10-15 18:14:17 UTC (rev 20)
@@ -27,8 +27,11 @@
}
}
- function queryUser($login) {
- $res = mysql_query('select * from '.$this->prefix.'users where login="'.mysql_real_escape_string($login).'" and active=1');
+ function queryUser($login,$active = true) {
+
+ $sql = 'select * from '.$this->prefix.'users where login="'.mysql_real_escape_string($login).'"';
+ if ($active) $sql .= ' and active=1';
+ $res = mysql_query($sql);
if (mysql_num_rows($res)>0) {
$result = mysql_fetch_assoc($res);
mysql_free_result($res);
@@ -51,13 +54,13 @@
$sql = 'update '.$this->prefix.'users set
password="'.$e($user['password']).'",group_id="'.$e($user['group_id']).'",name="'.$e($user['name']).
'",email="'.$e($user['email']).'",active="'.$e($user['active']).'"'.
- 'where id="'.$user['id'].'"';
+ 'where login="'.$user['login'].'"';
mysql_query($sql);
}
- function deleteUser($user) {
+ function deleteUser($login) {
$e = 'mysql_real_escape_string';
- $sql = 'delete from '.$this->prefix.'users where id="'.$user['id'].'"';
+ $sql = 'delete from '.$this->prefix.'users where login="'.$login.'"';
mysql_query($sql);
}
Modified: trunk/lib/modules/default/admin.inc.php
===================================================================
--- trunk/lib/modules/default/admin.inc.php 2008-10-15 16:18:27 UTC (rev 19)
+++ trunk/lib/modules/default/admin.inc.php 2008-10-15 18:14:17 UTC (rev 20)
@@ -16,6 +16,10 @@
),
"adminusers" => array (
1 => "users",
+ 2 => "useradd",
+ 3 => "useredit",
+ 4 => "userdel",
+ 5 => "useractivate",
),
"admingroups" => array (
1 => "groups",
@@ -45,8 +49,115 @@
}
function users() {
+ /* List the users */
+ $users = app()->db->loadTable('users','login');
+ $this->tpl->assign('users',$users);
}
+ function useradd() {
+ global $_POST;
+
+ $groups = app()->db->loadTable('groups','name');
+ $this->tpl->assign('groups',$groups);
+ if (isset($_POST['adduserlogin'])) {
+ /* add the user */
+ $user['login']=$_POST['adduserlogin'];
+ $user['name']=$_POST['addusername'];
+ $user['group_id']=$_POST['addusergroup'];
+ $user['email']=$_POST['adduseremail'];
+ $user['active']=$_POST['adduseractive'];
+ $error = false;
+ if (strlen($_POST['adduserlogin'])<5) {
+ app()->error('login name must be at least 5 char long!');
+ $error = true;
+ }
+ if (strlen($_POST['adduserpassword'])<5) {
+ app()->error('password must be at least 5 char long!');
+ $error = true;
+ } else if ($_POST['adduserpassword']!=$_POST['adduserrepassword']) {
+ app()->error('Passwords do not correspond!');
+ $error = true;
+ }
+ if (!validEmail($_POST['adduseremail'])) {
+ app()->error('e-mail is not a valid address!');
+ $error = true;
+ }
+ if (!$error) {
+ $user['password']=crypt($_POST['adduserpassword']);
+ app()->db->addUser($user);
+ /* redirect */
+ $this->nextStep(1);
+ }
+ }
+ if (!isset($user)) {
+ $user['active']=1;
+ $user['group_id']=app()->config['register']['default_group'];
+ }
+ $this->tpl->assign('adduser',$user);
+ }
+
+ function userdel() {
+ global $_GET;
+
+ if (isset($_GET['id'])) {
+ app()->db->deleteUser($_GET['id']);
+ }
+ $this->nextStep(1);
+ }
+
+ function useractivate() {
+ global $_GET;
+
+ if (isset($_GET['id'])) {
+ $active=$_GET['active']==1?0:1;
+ $user = app()->db->queryUser($_GET['id'],false);
+ if ($user['login']==$_GET['id']) {
+ $user['active']=$active;
+ app()->db->updateUser($user);
+ }
+ }
+ $this->nextStep(1);
+ }
+
+ function useredit() {
+ global $_GET;
+ global $_POST;
+ /* edit the user */
+ $groups = app()->db->loadTable('groups','name');
+ $this->tpl->assign('groups',$groups);
+ if (isset($_POST['login'])) {
+ $user = app()->db->queryUser($_POST['login'],false);
+ $user['name']=$_POST['editusername'];
+ $user['group_id']=$_POST['editusergroup'];
+ $user['email']=$_POST['edituseremail'];
+ $user['active']=$_POST['edituseractive'];
+ $error = false;
+ if ($_POST['edituserpassword']!='') {
+ if (strlen($_POST['edituserpassword'])<5) {
+ app()->error('password must be at least 5 char long!');
+ $error = true;
+ } else if ($_POST['edituserpassword']!=$_POST['edituserrepassword']) {
+ app()->error('Passwords do not correspond!');
+ $error = true;
+ }
+ if (!$error)
+ $user['password']=crypt($_POST['edituserpassword']);
+ }
+ if (!validEmail($_POST['edituseremail'])) {
+ app()->error('e-mail is not a valid address!');
+ $error = true;
+ }
+ if (!$error) {
+ app()->db->updateUser($user);
+ /* redirect */
+ $this->nextStep(1);
+ }
+ } else {
+ $user = app()->db->queryUser($_GET['id'],false);
+ }
+ $this->tpl->assign('edituser',$user);
+ }
+
function groups() {
}
Added: trunk/templates/default/modules/admin/adminmenu.tpl
===================================================================
--- trunk/templates/default/modules/admin/adminmenu.tpl (rev 0)
+++ trunk/templates/default/modules/admin/adminmenu.tpl 2008-10-15 18:14:17 UTC (rev 20)
@@ -0,0 +1,6 @@
+<div id="menu">
+<ul>
+ <li><a href="{$script}?action=adminusers">{tr}Users{/tr}</a></li>
+</ul>
+</div>
+<hr>
\ No newline at end of file
Added: trunk/templates/default/modules/admin/useradd.tpl
===================================================================
--- trunk/templates/default/modules/admin/useradd.tpl (rev 0)
+++ trunk/templates/default/modules/admin/useradd.tpl 2008-10-15 18:14:17 UTC (rev 20)
@@ -0,0 +1,18 @@
+<form action="{$script}" method="post">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="{$step}">
+<table border="0">
+<tr><td>{tr}Login name{/tr}:</td><td><input type="text" name="adduserlogin" value="{$adduser.login}"></td></tr>
+<tr><td>{tr}Password{/tr}:</td><td><input type="password" name="adduserpassword"></td></tr>
+<tr><td>{tr}Retype Password{/tr}:</td><td><input type="password" name="adduserrepassword"></td></tr>
+<tr><td>{tr}Full Name{/tr}:</td><td><input type="text" name="addusername" value="{$adduser.name}"></td></tr>
+<tr><td>{tr}e-mail{/tr}:</td><td><input type="text" name="adduseremail" value="{$adduser.email}"></td></tr>
+<tr><td>{tr}Group{/tr}:</td><td><select name="addusergroup">
+ {foreach from=$groups item=g}
+ <option value="{$g.name}" {if $g.name==$adduser.group_id} selected{/if}>{$g.description}</option>
+ {/foreach}
+ </select></td></tr>
+<tr><td>{tr}Active{/tr}:</td><td><input type="checkbox" name="adduseractive" value="1" {if $adduser.active==1}checked{/if}></td></tr>
+<tr><td colspan="2" align=right><input type="submit" class="submit" value="{tr}Add{/tr}"></td></tr>
+</table>
+</form>
\ No newline at end of file
Added: trunk/templates/default/modules/admin/useredit.tpl
===================================================================
--- trunk/templates/default/modules/admin/useredit.tpl (rev 0)
+++ trunk/templates/default/modules/admin/useredit.tpl 2008-10-15 18:14:17 UTC (rev 20)
@@ -0,0 +1,19 @@
+<form action="{$script}" method="post">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="{$step}">
+<input type="hidden" name="login" value="{$edituser.login}">
+<table border="0">
+<tr><td>{tr}Login name{/tr}:</td><td>{$edituser.login}</td></tr>
+<tr><td>{tr}Password{/tr}:</td><td><input type="password" name="edituserpassword"></td></tr>
+<tr><td>{tr}Retype Password{/tr}:</td><td><input type="password" name="edituserrepassword"></td></tr>
+<tr><td>{tr}Full Name{/tr}:</td><td><input type="text" name="editusername" value="{$edituser.name}"></td></tr>
+<tr><td>{tr}e-mail{/tr}:</td><td><input type="text" name="edituseremail" value="{$edituser.email}"></td></tr>
+<tr><td>{tr}Group{/tr}:</td><td><select name="editusergroup">
+ {foreach from=$groups item=g}
+ <option value="{$g.name}" {if $g.name==$edituser.group_id} selected{/if}>{$g.description}</option>
+ {/foreach}
+ </select></td></tr>
+<tr><td>{tr}Active{/tr}:</td><td><input type="checkbox" name="edituseractive" value="1" {if $edituser.active==1}checked{/if}></td></tr>
+<tr><td colspan="2" align=right><input type="submit" class="submit" value="{tr}Confirm{/tr}"></td></tr>
+</table>
+</form>
\ No newline at end of file
Added: trunk/templates/default/modules/admin/users.tpl
===================================================================
--- trunk/templates/default/modules/admin/users.tpl (rev 0)
+++ trunk/templates/default/modules/admin/users.tpl 2008-10-15 18:14:17 UTC (rev 20)
@@ -0,0 +1,34 @@
+{include file="default/modules/admin/adminmenu.tpl"}
+<div id="toolbar">
+<a href="{$script}?action={$action}&step=2&id={$u.id}"><img src="{$page.template}/img/admin/tadd_user.png"></a>
+<img src="{$page.template}/img/admin/tdelete_user.png">
+</div>
+<br>
+<table border="0" id="dbtable">
+<tr>
+ <th width="10">S</th>
+ <th width="100">Login</th>
+ <th width="200">Name</th>
+ <th width="100">Group</th>
+ <th width="200">E-mail</th>
+ <th width="20">Active</th>
+ <th width="100">Actions</th>
+</tr>
+{foreach from=$users item=u}
+<tr>
+ <td id="row1"><input type="checkbox" name="user_{$u.login}" value="1"></td>
+ <td id="row1"><a href="{$script}?action=adminusers&step=3&id={$u.login}">{$u.login}</a></td>
+ <td id="row1">{$u.name}</td>
+ <td id="row1">{$u.group_id}</td>
+ <td id="row1">{$u.email}</td>
+ <td id="row1"><a href="{$script}?action={$action}&step=5&id={$u.login}&active={$u.active}">
+ <img src="{$page.template}/img/admin/active{$u.active}.png">
+ </a>
+ </td>
+ <td id="row1">
+ <a href="{$script}?action={$action}&step=3&id={$u.login}"><img src="{$page.template}/img/admin/edit_user.png"></a>
+
+ <a href="{$script}?action={$action}&step=4&id={$u.login}"><img src="{$page.template}/img/admin/delete_user.png"></a></td>
+</tr>
+{/foreach}
+</table>
\ No newline at end of file
Added: trunk/www/templates/default/img/admin/active0.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/admin/active0.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/admin/active1.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/admin/active1.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/admin/delete_user.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/admin/delete_user.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/admin/edit_user.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/admin/edit_user.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/admin/tadd_user.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/admin/tadd_user.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/admin/tdelete_user.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/admin/tdelete_user.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/www/templates/default/main.css
===================================================================
--- trunk/www/templates/default/main.css 2008-10-15 16:18:27 UTC (rev 19)
+++ trunk/www/templates/default/main.css 2008-10-15 18:14:17 UTC (rev 20)
@@ -134,4 +134,24 @@
border-right: 1px solid #2d55b4;
border-bottom: 1px solid #2d55b4;
font-weight: bold;
+}
+img {
+ border: 0px;
+}
+#dbtable {
+ border: 1px solid #000;
+}
+#dbtable th {
+ background-color: #4c8dff;
+ color: #ffffff;
+ font-weight: bold;
+}
+#dbtable #row1 {
+ padding: 2px;
+ background-color: #fafafa;
+ text-align: center;
+}
+#datatable #row2 {
+ background-color: #adadad;
+ text-align: center;
}
\ 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-10-15 16:19:28
|
Revision: 19
http://openupload.svn.sourceforge.net/openupload/?rev=19&view=rev
Author: tsdogs
Date: 2008-10-15 16:18:27 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
fix default language to en
Modified Paths:
--------------
trunk/lib/main.inc.php
Modified: trunk/lib/main.inc.php
===================================================================
--- trunk/lib/main.inc.php 2008-10-15 14:18:21 UTC (rev 18)
+++ trunk/lib/main.inc.php 2008-10-15 16:18:27 UTC (rev 19)
@@ -30,7 +30,7 @@
$this->page['template']= $this->config['WWW_ROOT'].'/templates/'.$this->config['site']['template'];
/* initialize the application components */
if (!isset($_SESSIO['user']['lang'])) {
- $_SESSION['user']['lang']='it';
+ $_SESSION['user']['lang']='en';
}
/* include the class first */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-15 15:33:59
|
Revision: 14
http://openupload.svn.sourceforge.net/openupload/?rev=14&view=rev
Author: tsdogs
Date: 2008-10-15 14:05:56 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
First svn commit
Added Paths:
-----------
trunk/locale/it/LC_MESSAGES/
trunk/locale/it/LC_MESSAGES/openupload.mo
trunk/locale/it/LC_MESSAGES/openupload.po
trunk/locale/tools/trsmarty2c.php
Added: trunk/locale/it/LC_MESSAGES/openupload.mo
===================================================================
(Binary files differ)
Property changes on: trunk/locale/it/LC_MESSAGES/openupload.mo
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/locale/it/LC_MESSAGES/openupload.po
===================================================================
--- trunk/locale/it/LC_MESSAGES/openupload.po (rev 0)
+++ trunk/locale/it/LC_MESSAGES/openupload.po 2008-10-15 14:05:56 UTC (rev 14)
@@ -0,0 +1,138 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenUpload\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-10-14 17:16+0100\n"
+"PO-Revision-Date: 2008-10-14 17:17+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"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-KeywordsList: tr\n"
+"X-Poedit-Basepath: .\n"
+"X-Poedit-Language: Italian\n"
+"X-Poedit-SearchPath-0: ../../../lib\n"
+"X-Poedit-SearchPath-1: ../../../plugins\n"
+
+#: ../../../lib/classes.inc.php:129
+msgid "Login incorrect!"
+msgstr "Login incorretto!"
+
+#: ../../../lib/main.inc.php:153
+msgid "plugin include file not found: %1"
+msgstr "Il plugin non è stato trovato: %1"
+
+#: ../../../lib/modules/db/txt.inc.php:40
+msgid "ERROR: database folder not found!"
+msgstr "ERRORE: Cartella database non trovata!"
+
+#: ../../../lib/modules/db/txt.inc.php:46
+msgid "ERROR: Could not create folder for %1 table!"
+msgstr "ERRORE: Impossibile create cartella per la tabella %1!"
+
+#: ../../../lib/modules/db/mysql.inc.php:13
+msgid "ERROR: connection to database failed!"
+msgstr "ERRORE: Fallita connessione al database!"
+
+#: ../../../lib/modules/default/auth.inc.php:22
+#: ../../../lib/modules/default/auth.inc.php:32
+msgid "Login"
+msgstr "Accedi"
+
+#: ../../../lib/modules/default/auth.inc.php:25
+msgid "User registration"
+msgstr "Registrazione utente"
+
+#: ../../../lib/modules/default/auth.inc.php:34
+msgid "Logout"
+msgstr "Esci"
+
+#: ../../../lib/modules/default/auth.inc.php:113
+msgid "Username already taken, choose a new value"
+msgstr "Nome utente già registrato, prova un'altro nome"
+
+#: ../../../lib/modules/default/auth.inc.php:117
+msgid "Login name must be at least 5 characters long!"
+msgstr "Il nome utente deve essere lungo almeno 5 caratteri!"
+
+#: ../../../lib/modules/default/auth.inc.php:120
+msgid "Please insert Full Name"
+msgstr "Inserire il Nome Completo"
+
+#: ../../../lib/modules/default/auth.inc.php:124
+msgid "Please insert a valid e-mail!"
+msgstr "Inserire un indirizzo e-mail valido!"
+
+#: ../../../lib/modules/default/auth.inc.php:128
+msgid "Password must be at least 5 characters long!"
+msgstr "La password deve essere lunga almento 5 caratteri!"
+
+#: ../../../lib/modules/default/auth.inc.php:132
+msgid "Passwords do not match! please retype."
+msgstr "Le password non corrispondono! Riprova."
+
+#: ../../../lib/modules/default/auth.inc.php:156
+msgid "Registration completed successfully. Have fun!"
+msgstr "Registrazione completata con successo. Buon divertimento!"
+
+#: ../../../lib/modules/default/files.inc.php:31
+msgid "File upload"
+msgstr "Carica file"
+
+#: ../../../lib/modules/default/files.inc.php:34
+msgid "File download"
+msgstr "Scarica file"
+
+#: ../../../lib/modules/default/files.inc.php:37
+msgid "File Removal"
+msgstr "Rimozione file"
+
+#: ../../../lib/modules/default/files.inc.php:41
+msgid "File Upload"
+msgstr "Carica file"
+
+#: ../../../lib/modules/default/files.inc.php:181
+msgid "Requested file does not exsist!"
+msgstr "Il file richiesto non esiste!"
+
+#: ../../../lib/modules/default/files.inc.php:260
+#: ../../../lib/modules/default/files.inc.php:263
+#: ../../../lib/modules/default/files.inc.php:274
+msgid "Wrong file id!"
+msgstr "ID del file errata!"
+
+#: ../../../plugins/mimetypes.inc.php:10
+#: ../../../plugins/mimetypes.inc.php:20
+msgid "WARNING: no mime types defined. Plugin has been disabled!"
+msgstr "ATTENZIONE: nessun tipo di file definito. Il plugin è stato disabilitato!"
+
+#: ../../../plugins/mimetypes.inc.php:22
+msgid "This file type (%1) is not allowed on this site!"
+msgstr "L'upload di questo tipo di file (%1) non è consentito!"
+
+#: ../../../plugins/captcha.inc.php:37
+#: ../../../plugins/captcha.inc.php:55
+msgid "Wrong captcha code! please try again."
+msgstr "Captcha errato! Riprova."
+
+#: ../../../plugins/email.inc.php:27
+msgid "Your e-mail address isn't valid!"
+msgstr "Il tuo indirizzo e-mail non è valido!"
+
+#: ../../../plugins/email.inc.php:37
+msgid "Destination e-mail address isn't valid!"
+msgstr "L'indirizzo e-mail del destinatario non è valido!"
+
+#: ../../../plugins/email.inc.php:52
+msgid "Information about your uploaded file: %1"
+msgstr "Informazioni relative al tuo file: %1"
+
+#: ../../../plugins/email.inc.php:56
+msgid "An upload was delivered to you"
+msgstr "Ti è stato inviato un file"
+
+#: ../../../plugins/password.inc.php:41
+msgid "Wrong password!"
+msgstr "Password errata!"
+
Added: trunk/locale/tools/trsmarty2c.php
===================================================================
--- trunk/locale/tools/trsmarty2c.php (rev 0)
+++ trunk/locale/tools/trsmarty2c.php 2008-10-15 14:05:56 UTC (rev 14)
@@ -0,0 +1,124 @@
+#!/usr/bin/env php
+<?php
+/**
+ * tsmarty2c.php - rips gettext strings from smarty template
+ *
+ * ------------------------------------------------------------------------- *
+ * This library is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU Lesser General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2.1 of the License, or (at your option) any later version. *
+ * *
+ * This library is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this library; if not, write to the Free Software *
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ * ------------------------------------------------------------------------- *
+ *
+ * This command line script rips gettext strings from smarty file,
+ * and prints them to stdout in C format, that can later be used with the
+ * standard gettext tools.
+ *
+ * Usage:
+ * ./tsmarty2c.php <filename or directory> <file2> <..> > smarty.c
+ *
+ * If a parameter is a directory, the template files within will be parsed.
+ *
+ * @package smarty-gettext
+ * @version $Id: tsmarty2c.php,v 1.3 2005/07/27 17:59:39 sagi Exp $
+ * @link http://smarty-gettext.sf.net/
+ * @author Sagi Bashari <sa...@bo...>
+ * @copyright 2004-2005 Sagi Bashari
+ */
+
+// smarty open tag
+$ldq = preg_quote('{');
+
+// smarty close tag
+$rdq = preg_quote('}');
+
+// smarty command
+$cmd = preg_quote('tr');
+
+// extensions of smarty files, used when going through a directory
+$extensions = array('tpl');
+
+// "fix" string - strip slashes, escape and convert new lines to \n
+function fs($str)
+{
+ $str = stripslashes($str);
+ $str = str_replace('"', '\"', $str);
+ $str = str_replace("\n", '\n', $str);
+ return $str;
+}
+
+// rips gettext strings from $file and prints them in C format
+function do_file($file)
+{
+ $content = @file_get_contents($file);
+
+ if (empty($content)) {
+ return;
+ }
+
+ global $ldq, $rdq, $cmd;
+
+ preg_match_all(
+ "/{$ldq}\s*({$cmd})\s*([^{$rdq}]*){$rdq}([^{$ldq}]*){$ldq}\/\\1{$rdq}/",
+ $content,
+ $matches
+ );
+
+ for ($i=0; $i < count($matches[0]); $i++) {
+ // TODO: add line number
+ echo "/* $file */\n"; // credit: Mike van Lammeren 2005-02-14
+
+ if (preg_match('/plural\s*=\s*["\']?\s*(.[^\"\']*)\s*["\']?/', $matches[2][$i], $match)) {
+ echo 'ngettext("'.fs($matches[3][$i]).'","'.fs($match[1]).'",x);'."\n";
+ } else {
+ echo 'gettext("'.fs($matches[3][$i]).'");'."\n";
+ }
+
+ echo "\n";
+ }
+}
+
+// go through a directory
+function do_dir($dir)
+{
+ $d = dir($dir);
+
+ while (false !== ($entry = $d->read())) {
+ if ($entry == '.' || $entry == '..') {
+ continue;
+ }
+
+ $entry = $dir.'/'.$entry;
+
+ if (is_dir($entry)) { // if a directory, go through it
+ do_dir($entry);
+ } else { // if file, parse only if extension is matched
+ $pi = pathinfo($entry);
+
+ if (isset($pi['extension']) && in_array($pi['extension'], $GLOBALS['extensions'])) {
+ do_file($entry);
+ }
+ }
+ }
+
+ $d->close();
+}
+
+for ($ac=1; $ac < $_SERVER['argc']; $ac++) {
+ if (is_dir($_SERVER['argv'][$ac])) { // go through directory
+ do_dir($_SERVER['argv'][$ac]);
+ } else { // do file
+ do_file($_SERVER['argv'][$ac]);
+ }
+}
+
+?>
Property changes on: trunk/locale/tools/trsmarty2c.php
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-15 14:43:50
|
Revision: 3
http://openupload.svn.sourceforge.net/openupload/?rev=3&view=rev
Author: tsdogs
Date: 2008-10-15 13:37:52 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
First svn commit
Added Paths:
-----------
www/config.inc.php.example
www/index.php
www/plugins/
www/plugins/captcha.php
www/templates/
www/templates/default/
www/templates/default/img/
www/templates/default/img/admin/
www/templates/default/img/admin/files.png
www/templates/default/img/admin/groups.png
www/templates/default/img/admin/plugins.png
www/templates/default/img/admin/rights.png
www/templates/default/img/admin/settings.png
www/templates/default/img/admin/users.png
www/templates/default/img/download.png
www/templates/default/img/openupload.jpg
www/templates/default/img/upload.png
www/templates/default/main.css
Added: www/config.inc.php.example
===================================================================
--- www/config.inc.php.example (rev 0)
+++ www/config.inc.php.example 2008-10-15 13:37:52 UTC (rev 3)
@@ -0,0 +1,88 @@
+<?php
+/* This is the general configuration file */
+
+/* Define the installation folder */
+$CONFIG['INSTALL_ROOT']='/usr/local/share/openupload';
+
+/* Define the web root foder (for the application) */
+$CONFIG['WEB_ROOT']='/usr/local/share/openupload/www';
+
+/* define http:// address */
+$CONFIG['WWW_SERVER']='http://yourdomain.com';
+/* define the additional web path */
+$CONFIG['WWW_ROOT']='/';
+
+/* Define where to store the uploaded files */
+$CONFIG['DATA_PATH']=$CONFIG['INSTALL_ROOT'].'/data';
+
+/* Define how long to keep the uploaded files
+ * please check the README for specification on how this works */
+$CONFIG['KEEP_FILES']=0;
+
+/* This specifies the kind of database to use:
+ * supported types are: mysql, pgsql, txt
+ * txt is a special mode where data is stored inside ascii files
+ * it can be used when no database is available
+ */
+$CONFIG['database']['type']='mysql';
+
+/* Depending on the option above... */
+
+/* MYSQL Database */
+$CONFIG['database']['host']='localhost';
+$CONFIG['database']['user']='databaseuser';
+$CONFIG['database']['password']='databasepwd';
+$CONFIG['database']['name']='openupload';
+
+/* TXT Database */
+//$CONFIG['database']['type']='txt';
+//$CONFIG['database']['rootdir']=$CONFIG['INSTALL_ROOT'].'/txtdb';
+
+$CONFIG['database']['prefix']='';
+
+/* PLUGINS: here you enable the plugins
+ * they will need to enable the functionality
+ * on a group basis
+ */
+$CONFIG['plugins'][] = 'banned';
+$CONFIG['plugins'][] = 'mimetypes';
+$CONFIG['plugins'][] = 'email';
+$CONFIG['plugins'][] = 'password';
+$CONFIG['plugins'][] = 'captcha';
+
+/* SITE TITLE */
+$CONFIG['site']['title'] = 'Open Upload';
+
+/* webmaster e-mail */
+$CONFIG['site']['webmaster'] = 'web...@yo...';
+/* email source address */
+$CONFIG['site']['email'] = 'ope...@yo...';
+
+/* REGISTRATION OPTIONS */
+$CONFIG['register']['nologingroup']='unregistered';
+/* registered user by default */
+$CONFIG['register']['default_group']='registered';
+
+
+/* SITE STYLE */
+$CONFIG['site']['template'] = 'default';
+/* ENABLE OR DISABLE SMARTY CACHING
+ * if enabled make sure a cache folder exsists
+ * and that it is writable
+ */
+$CONFIG['site']['caching']=0;
+
+/* NOTE: Depending on the template you might need to change some settings
+ * in the template configuration.
+ * The default template does not have this requirement
+ */
+
+/* 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';
+
+?>
Added: www/index.php
===================================================================
--- www/index.php (rev 0)
+++ www/index.php 2008-10-15 13:37:52 UTC (rev 3)
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Project: OpenUpload
+ * File: www/index.php
+ *
+ * LICENSE:
+ *
+ * Copyright 2008 Alessandro Briosi
+ *
+ * This file is part of OpenUpload.
+ *
+ * OpenUpload is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenUpload is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with OpenUpload; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @link http://openupload.sf.net/
+ * @copyright 2008 Alessandro Briosi
+ * @author Alessandro Briosi <tsdogs at briosix dot org>
+ * @package OpenUpload
+ * @version 0.3
+ */
+
+define ('__VALID_CALLING_SCRIPT', true);
+
+require_once('config.inc.php');
+require_once($CONFIG['INSTALL_ROOT'].'/lib/general.inc.php');
+
+global $application;
+
+/* check authentication */
+if (isset($_GET['action'])) {
+ $action = $_GET['action'];
+} else if (isset($_POST['action'])) {
+ $action = $_POST['action'];
+} else {
+ $action = '';
+}
+if (isset($_GET['step'])) {
+ $step = $_GET['step'];
+} else if (isset($_POST['step'])) {
+ $step = $_POST['step'];
+} else {
+ $step = '';
+}
+
+new Application($CONFIG);
+app()->run($action,$step);
+
+?>
Added: www/plugins/captcha.php
===================================================================
--- www/plugins/captcha.php (rev 0)
+++ www/plugins/captcha.php 2008-10-15 13:37:52 UTC (rev 3)
@@ -0,0 +1,16 @@
+<?php
+
+/* this generates a chiper and sets the session relative chiper protection */
+include ('../config.inc.php');
+
+require_once($CONFIG['INSTALL_ROOT'].'/plugins/securimage/securimage.php');
+
+
+$img = new securimage();
+$img->ttf_file = $CONFIG['INSTALL_ROOT'].'/plugins/securimage/elephant.ttf';
+$img->code_length = 6;
+$img->image_width = 200;
+$img->image_type = SI_IMAGE_JPG;
+$img->show();
+
+?>
\ No newline at end of file
Added: www/templates/default/img/admin/files.png
===================================================================
(Binary files differ)
Property changes on: www/templates/default/img/admin/files.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: www/templates/default/img/admin/groups.png
===================================================================
(Binary files differ)
Property changes on: www/templates/default/img/admin/groups.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: www/templates/default/img/admin/plugins.png
===================================================================
(Binary files differ)
Property changes on: www/templates/default/img/admin/plugins.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: www/templates/default/img/admin/rights.png
===================================================================
(Binary files differ)
Property changes on: www/templates/default/img/admin/rights.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: www/templates/default/img/admin/settings.png
===================================================================
(Binary files differ)
Property changes on: www/templates/default/img/admin/settings.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: www/templates/default/img/admin/users.png
===================================================================
(Binary files differ)
Property changes on: www/templates/default/img/admin/users.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: www/templates/default/img/download.png
===================================================================
(Binary files differ)
Property changes on: www/templates/default/img/download.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: www/templates/default/img/openupload.jpg
===================================================================
(Binary files differ)
Property changes on: www/templates/default/img/openupload.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: www/templates/default/img/upload.png
===================================================================
(Binary files differ)
Property changes on: www/templates/default/img/upload.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: www/templates/default/main.css
===================================================================
--- www/templates/default/main.css (rev 0)
+++ www/templates/default/main.css 2008-10-15 13:37:52 UTC (rev 3)
@@ -0,0 +1,137 @@
+body {
+ font-family: Helvetica, Arial;
+ font-size: 10pt;
+ margin: auto;
+}
+#logo {
+ float:left;
+}
+#userinfo {
+ float: right;
+ height: 20px;
+ vertical-align: bottom;
+ margin-top: 60px;
+ margin-right: 20px;
+}
+#title {
+ background-color: #3161cf;
+ color: #ffffff;
+ font-size: 12pt;
+ font-weight: bold;
+ clear: right;
+ padding-left: 160px;
+ padding-top: 3px;
+ padding-bottom:3px;
+}
+#menu {
+ bottom: 0px;
+ text-align: center;
+ margin-top: 5px;
+}
+#menu ul {
+ list-style:none;
+ margin: 0;
+ padding: 0;
+}
+#menu li {
+ display: inline;
+ padding-right: 8px;
+ padding-left: 8px;
+ border-right: 1px solid #000000;
+}
+#wrapper {
+ clear: both;
+ maring: 0 auto;
+ text-align: center;
+ padding-top: 50px;
+}
+#content {
+ margin: 0 auto;
+ display: inline-block;
+ text-align: left;
+}
+#uploadbutton {
+ text-align: center;
+ margin: 0 auto;
+}
+#downloadbutton {
+ text-align: center;
+ margin: 0 auto;
+}
+
+#footer {
+ clear: both;
+ position: fixed;
+ bottom: 0px;
+ height: 20px;
+ width: 100%;
+ font-weight: bold;
+ font-size: 9pt;
+ border-top: 1px solid #000000;
+ text-align: center;
+}
+#footer a {
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 9pt;
+ text-decoration: none;
+}
+#footer a:visited {
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 9pt;
+ text-decoration: none;
+}
+a {
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 11pt;
+ text-decoration: none;
+}
+a:visited {
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 11pt;
+ text-decoration: none;
+}
+a:hover {
+ color: #4c8dff;
+ font-weight: bold;
+ font-size: 11pt;
+ text-decoration: none;
+}
+input, textarea {
+ color: #132678;
+ background-color: #c7dbff;
+ border: 1px solid #2d55b4;
+ font-size: 10pt;
+}
+.file {
+ font-size: 20pt;
+ color: #132678;
+ background-color: #c7dbff;
+ border: 1px solid #2d55b4;
+ font-size: 10pt;
+}
+fieldset {
+ border: 1px solid #2d55b4;
+ width: 30em
+}
+legend {
+ color: #ffffff;
+ background-color: #4c8dff;
+ border: 1px solid #2d55b4;
+ padding: 2px 6px;
+ font-size: 10pt;
+ font-weight: bold;
+}
+.submit,button {
+ font-size: 10pt;
+ color: #fafafa;
+ background-color: #4c8dff;
+ border-left: 1px solid #e3edff;
+ border-top: 1px solid #e3edff;
+ border-right: 1px solid #2d55b4;
+ border-bottom: 1px solid #2d55b4;
+ font-weight: bold;
+}
\ 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-10-15 14:39:40
|
Revision: 13
http://openupload.svn.sourceforge.net/openupload/?rev=13&view=rev
Author: tsdogs
Date: 2008-10-15 14:03:41 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
First svn commit
Added Paths:
-----------
trunk/lib/modules/db/mysql.inc.php
trunk/lib/modules/db/txt.inc.php
Added: trunk/lib/modules/db/mysql.inc.php
===================================================================
--- trunk/lib/modules/db/mysql.inc.php (rev 0)
+++ trunk/lib/modules/db/mysql.inc.php 2008-10-15 14:03:41 UTC (rev 13)
@@ -0,0 +1,157 @@
+<?php
+class mysqlDB extends dbBase {
+ var $db;
+ var $prefix;
+
+ function mysqlDB($prefix = '') {
+ $this->prefix = $prefix;
+ }
+
+ function init() {
+ /* connect to the database */
+ mysql_connect(app()->config['database']['host'],app()->config['database']['user'],app()->config['database']['password'])
+ or die(tr('ERROR: connection to database failed!'));
+
+ $this->db = mysql_select_db(app()->config['database']['name']);// or die('ERROR: database could not be opened');
+ }
+
+ function getLang($lang) {
+ $sql = 'select * from '.$this->prefix.'langs where id="'.$lang.'"';
+ $res = mysql_query($sql);
+ if (mysql_num_rows($res)>0) {
+ $result = mysql_fetch_assoc($res);
+ mysql_free_result($res);
+ return $result;
+ } else {
+ return array();
+ }
+ }
+
+ function queryUser($login) {
+ $res = mysql_query('select * from '.$this->prefix.'users where login="'.mysql_real_escape_string($login).'" and active=1');
+ if (mysql_num_rows($res)>0) {
+ $result = mysql_fetch_assoc($res);
+ mysql_free_result($res);
+ return $result;
+ } else {
+ return array();
+ }
+ }
+
+ function addUser($user) {
+ $e = 'mysql_real_escape_string';
+ $sql = 'insert into '.$this->prefix.'users (id,login,password,name,group_id,email,active) values
+ (NULL,"'.$e($user['login']).'","'.$e($user['password']).'","'.$e($user['name']).'","'.$e($user['group_id']).'","'
+ .$e($user['email']).'","'.$e($user['active']).'")';
+ mysql_query($sql);
+ }
+
+ function updateUser($user) {
+ $e = 'mysql_real_escape_string';
+ $sql = 'update '.$this->prefix.'users set
+ password="'.$e($user['password']).'",group_id="'.$e($user['group_id']).'",name="'.$e($user['name']).
+ '",email="'.$e($user['email']).'",active="'.$e($user['active']).'"'.
+ 'where id="'.$user['id'].'"';
+ mysql_query($sql);
+ }
+
+ function deleteUser($user) {
+ $e = 'mysql_real_escape_string';
+ $sql = 'delete from '.$this->prefix.'users where id="'.$user['id'].'"';
+ mysql_query($sql);
+ }
+
+ function getFileInfo($id) {
+ $sql = 'select * from '.$this->prefix.'files where id="'.mysql_real_escape_string($id).'"';
+
+ $res = mysql_query($sql);
+ if (mysql_num_rows($res)==1) {
+ $result = mysql_fetch_assoc($res);
+ } else {
+ $result = array();
+ }
+ mysql_free_result($res);
+ /* now add the additional info */
+ $sql = 'select name,value from '.$this->prefix.'file_options where file_id="'.mysql_real_escape_string($id).'"';
+ $res = mysql_query($sql);
+ while ($row = mysql_fetch_assoc($res)) {
+ $result[$row['name']]=$row['value'];
+ }
+ mysql_free_result($res);
+ return $result;
+ }
+
+ function newFileId($field = 'id') {
+ $found = true;
+ while ($found) {
+ $id = randomName(30,30);
+ $sql = 'select '.$field.' from '.$this->prefix.'files where id="'.mysql_real_escape_string($id).'"';
+ $res = mysql_query($sql);
+ $found = mysql_num_rows($res)>0;
+ mysql_free_result($res);
+ }
+ return $id;
+ }
+
+ function addFile(&$finfo) {
+ $e = 'mysql_real_escape_string';
+ $sql = 'insert into '.$this->prefix.'files (id,name,mime,description,size,remove,user_id,upload_date)
+ values ("'.$e($finfo['id']).'","'.$e($finfo['name']).'","'.$e($finfo['mime']).'","'.$e($finfo['description']).
+ '","'.$e($finfo['size']).'","'.$e($finfo['remove']).'","'.$_SESSION['user']['id'].'",now())';
+ /* now ask the plugins for additional options */
+ mysql_query($sql);
+ return $finfo['id'];
+ }
+
+ function addFileOption($finfo,$module,$field) {
+ $sql = 'insert into '.$this->prefix.'file_options (id,file_id,module,name,value)
+ values ("null","'.$finfo['id'].'","'.$module.'","'.$field.'","'.mysql_real_escape_string($finfo[$field]).'")';
+ /* now ask the plugins for additional options */
+ mysql_query($sql);
+ }
+
+ function removeFile($id) {
+ $sql = 'delete '.$this->prefix.'file_options
+ where file_id="'.mysql_real_escape_string($id).'"';
+ mysql_query($sql);
+ $sql = 'delete '.$this->prefix.'files
+ where id="'.mysql_real_escape_string($id).'"';
+ mysql_query($sql);
+ }
+
+ function loadAcl($group) {
+ $sql = 'select * from '.$this->prefix.'acl where (group_id="'.$group.'" or group_id="*") order by group_id,module,action';
+ $res = mysql_query($sql);
+ $acl = array();
+ while ($row = mysql_fetch_assoc($res)) {
+ $acl[$row['group_id']][$row['module']][$row['action']]=$row['access'];
+ }
+ mysql_free_result($res);
+ return $acl;
+ }
+ function loadPluginAcl($group) {
+ $sql = 'select plugin,access from '.$this->prefix.'plugin_acl where group_id="'.$group.'" group by plugin';
+ $res = mysql_query($sql);
+ $plugins = array();
+ while ($row = mysql_fetch_assoc($res)) {
+ $plugins[$row['plugin']] = $row['access'];
+ }
+ mysql_free_result($res);
+ return $plugins;
+ }
+
+ function loadTable($tbl,$sort = '') {
+ $sql = 'select * from '.$this->prefix.$tbl;
+ if ($sort!='') $sql .= ' order by '.$sort;
+
+ $res = mysql_query($sql);
+ $result = array();
+ while ($row = mysql_fetch_assoc($res)) {
+ $result[] = $row;
+ }
+ mysql_free_result($res);
+ return $result;
+ }
+}
+
+?>
\ No newline at end of file
Added: trunk/lib/modules/db/txt.inc.php
===================================================================
--- trunk/lib/modules/db/txt.inc.php (rev 0)
+++ trunk/lib/modules/db/txt.inc.php 2008-10-15 14:03:41 UTC (rev 13)
@@ -0,0 +1,117 @@
+<?php
+
+/* To be fully tested */
+
+/* plain file db */
+class txtDB extends dbBase {
+ var $rootdir;
+ var $prefix;
+
+ function txtDB() {
+ }
+
+ function readTxt ($file) {
+ $x = file_get_contents($file);
+ /* split the lines */
+ $result = array();
+ $lines = split("\n",$x);
+ foreach ($lines as $l) {
+ $r = split("\|",$l,2);
+ if (count($r)==2) {
+ $result[$r[0]]=$r[1];
+ }
+ }
+ return $result;
+ }
+
+ function writeTxt($file,$lines) {
+ $x = '';
+ foreach ($lines as $k => $l) {
+ $x .= $k.'|'.$l."\n";
+ }
+ file_put_contents($file,$x);
+ }
+
+ function init() {
+ /* initialize file names */
+ $this->baseDir=app()->config['database']['rootdir'];
+ $this->prefix=app()->config['database']['prefix'];
+ if (!is_dir($this->baseDir)) {
+ die(tr('ERROR: database folder not found!'));
+ }
+ $dirs = array('users','files','groups');
+ foreach ($dirs as $d) {
+ if (!is_dir($this->baseDir.'/'.$this->prefix.$d)) {
+ if (!mkdir($this->baseDir.'/'.$this->prefix.$d)) {
+ die(tr('ERROR: Could not create folder for %1 table!',$d));
+ }
+ }
+ }
+ }
+
+ function queryUser($login) {
+ $file = $this->baseDir.'/'.$this->prefix.'users/'.$login.'.txt';
+ if (!file_exists($file)) {
+ return array();
+ } else {
+ $result = $this->readTxt($file);
+ if ($result['active']==1)
+ return $result;
+ else
+ return array();
+ }
+ }
+
+ function addUser($user) {
+ /* should compute a real new id */
+ $id = randomName(1,20);
+ $user['id'] = $id;
+ $file = $this->baseDir.'/'.$this->prefix.'users/'.$user['login'].'.txt';
+ $this->writeTxt($file,$user);
+ }
+
+ function updateUser($user) {
+ $file = $this->baseDir.'/'.$this->prefix.'users/'.$user['login'].'.txt';
+ $this->writeTxt($file,$user);
+ }
+
+ function deleteUser($user) {
+ $file = $this->baseDir.'/'.$this->prefix.'users/'.$user['login'].'.txt';
+ unlink($file);
+ /* probably should remove all the files uploaded too */
+ }
+
+ function getFileInfo($id) {
+ $file = $this->baseDir.'/'.$this->prefix.'files/'.$id.'.txt';
+ $finfo = $this->readTxt($file);
+ return $finfo;
+ }
+
+ function newFileId($field = 'id') {
+ $found = true;
+ /* let's hope we never get the duplicate on 2 or more users uploading at the same time */
+ while ($found) {
+ $id = randomName(30,30);
+ $found = file_exists($this->baseDir.'/'.$this->prefix.'files/'.$id.'.txt');
+ }
+ return $id;
+ }
+
+ function addFile(&$finfo) {
+ $finfo['user_id']=$_SESSION['user']['login'];
+ $finfo['upload_date']=date('Y-m-d h:i:s');
+ $file = $this->baseDir.'/'.$this->prefix.'files/'.$finfo['id'].'.txt';
+ $this->writeTxt($file,$finfo);
+ return $finfo['id'];
+ }
+
+ function addFileOption($finfo,$module,$field) {
+ /* this has been saved into the file for now, if needed will split it */
+ }
+
+ function removeFile($id) {
+ unlink($this->baseDir.'/'.$this->prefix.'files/'.$id.'.txt');
+ }
+
+}
+?>
\ 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-10-15 14:30:01
|
Revision: 2
http://openupload.svn.sourceforge.net/openupload/?rev=2&view=rev
Author: tsdogs
Date: 2008-10-15 13:33:25 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
First svn commit
Added Paths:
-----------
www/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-15 14:28:24
|
Revision: 15
http://openupload.svn.sourceforge.net/openupload/?rev=15&view=rev
Author: tsdogs
Date: 2008-10-15 14:09:35 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
First svn commit
Added Paths:
-----------
trunk/templates/default/index.tpl
trunk/templates/default/locale/
trunk/templates/default/locale/it/
trunk/templates/default/locale/it/LC_MESSAGES/
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
trunk/templates/default/modules/
trunk/templates/default/modules/admin/
trunk/templates/default/modules/admin/admin.tpl
trunk/templates/default/modules/auth/
trunk/templates/default/modules/auth/loginForm.tpl
trunk/templates/default/modules/auth/registerConfirm.tpl
trunk/templates/default/modules/auth/registerEnable.tpl
trunk/templates/default/modules/auth/registerForm.tpl
trunk/templates/default/modules/auth/registerlink.tpl
trunk/templates/default/modules/files/
trunk/templates/default/modules/files/downloadConfirm.tpl
trunk/templates/default/modules/files/downloadForm.tpl
trunk/templates/default/modules/files/downloadRequest.tpl
trunk/templates/default/modules/files/removeRequest.tpl
trunk/templates/default/modules/files/removeResult.tpl
trunk/templates/default/modules/files/uploadFileInfo.tpl
trunk/templates/default/modules/files/uploadForm.tpl
trunk/templates/default/modules/files/uploadOptions.tpl
trunk/templates/default/plugins/
trunk/templates/default/plugins/banned/
trunk/templates/default/plugins/banned/banned.tpl
trunk/templates/default/plugins/captcha/
trunk/templates/default/plugins/captcha/downloadRequest.tpl
trunk/templates/default/plugins/captcha/registerForm.tpl
trunk/templates/default/plugins/captcha/uploadOptions.tpl
trunk/templates/default/plugins/email/
trunk/templates/default/plugins/email/notify.tpl
trunk/templates/default/plugins/email/uploadOptions.tpl
trunk/templates/default/plugins/mimetypes/
trunk/templates/default/plugins/mimetypes/uploadForm.tpl
trunk/templates/default/plugins/password/
trunk/templates/default/plugins/password/downloadRequest.tpl
trunk/templates/default/plugins/password/uploadOptions.tpl
Added: trunk/templates/default/index.tpl
===================================================================
--- trunk/templates/default/index.tpl (rev 0)
+++ trunk/templates/default/index.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,38 @@
+<html>
+<head>
+<title>{$site.title} - {tr}{$page.title}{/tr}</title>
+<link rel="stylesheet" type="text/css" href='{$page.template}/main.css'>
+</head>
+<body>
+<!-- header -->
+<div id="header">
+<div id="logo"><img src="{$page.template}/img/openupload.jpg" border="0"></div>
+<div id="userinfo">
+{$user.name}
+</div>
+<div id="title">{tr}{$page.title}{/tr}</div>
+<div id="menu">
+<ul>
+{foreach from=$menu item=m key=k name=c}
+<li {if $smarty.foreach.c.last} style="border: 0px"{/if}><a href="{$script}?action={$k}">{$m}</a></li>
+{/foreach}
+</ul>
+</div> <!-- menu end -->
+</div> <!-- header end -->
+<!-- menu -->
+<!-- content -->
+<div id="wrapper">
+<div id="content">
+{foreach from=$user.messages item=m}
+<div id="message">{$m}</div>
+{/foreach}
+{foreach from=$user.errors item=e}
+<div id="error" style="color: #ff0000; font-weight: bold;">{$e}</div>
+{/foreach}
+{$page.content}
+</div> <!-- content end -->
+</div>
+<!-- footer -->
+<div id="footer">{$site.footer}</div>
+</body>
+</html>
\ No newline at end of file
Added: trunk/templates/default/locale/it/LC_MESSAGES/template.mo
===================================================================
(Binary files differ)
Property changes on: trunk/templates/default/locale/it/LC_MESSAGES/template.mo
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/templates/default/locale/it/LC_MESSAGES/template.po
===================================================================
--- trunk/templates/default/locale/it/LC_MESSAGES/template.po (rev 0)
+++ trunk/templates/default/locale/it/LC_MESSAGES/template.po 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,243 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenUpload default template\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-10-13 20:38+0100\n"
+"PO-Revision-Date: 2008-10-13 20:43+0100\n"
+"Last-Translator: Alessandro Briosi <ts...@br...>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Italian\n"
+"X-Poedit-Basepath: .\n"
+"X-Poedit-SearchPath-0: ../..\n"
+
+#: ../../default.c:2
+msgid "Captcha code"
+msgstr "Codice Captcha"
+
+#: ../../default.c:5
+#: ../../default.c:11
+msgid "Reload Image"
+msgstr "Ricarica immagine"
+
+#: ../../default.c:8
+msgid "Please enter the following captcha to proceed for the download"
+msgstr "Prego inserire il seguente codice captch per procedere al download"
+
+#: ../../default.c:14
+msgid "Use Captcha"
+msgstr "Utilizza Captcha"
+
+#: ../../default.c:17
+msgid "The download is password protected."
+msgstr "Il file \xE8 protetto da una password."
+
+#: ../../default.c:20
+#: ../../default.c:38
+#: ../../default.c:65
+#: ../../default.c:197
+#: ../../default.c:218
+msgid "Password"
+msgstr "Password"
+
+#: ../../default.c:23
+msgid "Password protect"
+msgstr "Password di protezione"
+
+#: ../../default.c:26
+#: ../../default.c:53
+msgid "You are receiving this message because someone uploaded a file on our OpenUpload server for you."
+msgstr "Hai ricevuto questo messaggio perch\xE8 qualcuno ti ha inviato un file attraverso il nostro server OpenUpload."
+
+#: ../../default.c:29
+#: ../../default.c:56
+#: ../../default.c:110
+#: ../../default.c:155
+#: ../../default.c:167
+#: ../../default.c:185
+msgid "File name"
+msgstr "Nome file"
+
+#: ../../default.c:32
+#: ../../default.c:59
+#: ../../default.c:113
+#: ../../default.c:158
+#: ../../default.c:170
+#: ../../default.c:188
+msgid "File size"
+msgstr "Dimensione"
+
+#: ../../default.c:35
+#: ../../default.c:62
+#: ../../default.c:173
+msgid "Description"
+msgstr "Descrizione"
+
+#: ../../default.c:41
+#: ../../default.c:68
+msgid "User message"
+msgstr "Messaggio"
+
+#: ../../default.c:44
+#: ../../default.c:71
+msgid "To download the file open the following link in a browser"
+msgstr "Per scaricare il file apri il seguente link in un browser"
+
+#: ../../default.c:47
+#: ../../default.c:74
+msgid "To remove the file from our server open the following link in a browser"
+msgstr "Per rimuovere il file dai ns. server apri il link seguente in un browser"
+
+#: ../../default.c:50
+#: ../../default.c:77
+msgid "For complains please send an email to"
+msgstr "Per segnalazioni di abuso prego inviare una email a "
+
+#: ../../default.c:80
+#: ../../default.c:86
+msgid "Send me an e-mail"
+msgstr "Inviami una e-mail"
+
+#: ../../default.c:83
+msgid "Your e-mail address"
+msgstr "Il tuo indirizzo e-mail"
+
+#: ../../default.c:89
+msgid "Send e-mail to"
+msgstr "Invia e-mail a"
+
+#: ../../default.c:92
+msgid "Send remove link"
+msgstr "Invia link per la rimozione"
+
+#: ../../default.c:95
+msgid "e-mail Subject"
+msgstr "Oggetto e-mail"
+
+#: ../../default.c:98
+msgid "e-mail Message"
+msgstr "Messaggio e-mail"
+
+#: ../../default.c:101
+msgid "Only the following mime types are allowed"
+msgstr "Solo i seguenti tipi di files possono essere caricati"
+
+#: ../../default.c:104
+msgid "You requested to remove the following file"
+msgstr "Hai richiesto la rimozione del seguente file"
+
+#: ../../default.c:107
+#: ../../default.c:152
+#: ../../default.c:182
+msgid "File description"
+msgstr "Descrizione"
+
+#: ../../default.c:116
+#: ../../default.c:161
+#: ../../default.c:191
+msgid "Uploaded on"
+msgstr "Caricato il"
+
+#: ../../default.c:119
+msgid "Confirm removal"
+msgstr "Conferma rimozione"
+
+#: ../../default.c:122
+msgid "Download link"
+msgstr "Link per lo scaricamento"
+
+#: ../../default.c:125
+msgid "Remove link"
+msgstr "Link per la rimozione"
+
+#: ../../default.c:128
+msgid "Upload a new file"
+msgstr "Carica un nuovo file"
+
+#: ../../default.c:131
+msgid "Please enter the File Information requested"
+msgstr "Prego inserire le informazioni sul File"
+
+#: ../../default.c:134
+msgid "File code"
+msgstr "Codice file"
+
+#: ../../default.c:137
+#: ../../default.c:146
+msgid "Proceed"
+msgstr "Procedi"
+
+#: ../../default.c:140
+msgid "Select the file to be uploaded"
+msgstr "Seleziona il file da caricare"
+
+#: ../../default.c:143
+msgid "Upload"
+msgstr "Carica"
+
+#: ../../default.c:149
+msgid "You can now proceed downloading the file"
+msgstr "Puoi ora procedere allo scaricamento del file"
+
+#: ../../default.c:164
+msgid "Download file"
+msgstr "Scarica file"
+
+#: ../../default.c:176
+msgid "Complete upload"
+msgstr "Completa caricamento"
+
+#: ../../default.c:179
+msgid "FILE HAS BEEN SUCCESSGULLY REMOVED"
+msgstr "IL FILE E' STATO RIMOSSO CON SUCCESSO"
+
+#: ../../default.c:194
+msgid "Login name"
+msgstr "Nome utente"
+
+#: ../../default.c:200
+msgid "Retype Password"
+msgstr "Reinserisci password"
+
+#: ../../default.c:203
+msgid "Full Name"
+msgstr "Nome Completo"
+
+#: ../../default.c:206
+msgid "e-mail"
+msgstr "E-mail"
+
+#: ../../default.c:209
+msgid "Preferred language"
+msgstr "Lingua"
+
+#: ../../default.c:212
+msgid "User login"
+msgstr "Login utente"
+
+#: ../../default.c:215
+msgid "User name"
+msgstr "Nome Utente"
+
+#: ../../default.c:221
+msgid "Login"
+msgstr "Accedi"
+
+#: ../../default.c:224
+msgid "You don't have an account?"
+msgstr "Non possiedi un account?"
+
+#: ../../default.c:227
+msgid "Register here"
+msgstr "Registrati qui"
+
+#: ../../default.c:230
+msgid "or you can"
+msgstr "oppure puoi"
+
+#: ../../default.c:233
+msgid "Login here"
+msgstr "Accedere qui"
+
Added: trunk/templates/default/locale/it.inc.php
===================================================================
--- trunk/templates/default/locale/it.inc.php (rev 0)
+++ trunk/templates/default/locale/it.inc.php 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,49 @@
+<?php
+$tr['User login']='Accesso';
+$tr['User name']='Nome Utente';
+$tr['Password']='Password';
+$tr['Login']='Accedi';
+$tr['You don\'t have an account?']='Non possiedi un account?';
+$tr['Register here']='Registrati qui';
+$tr['or you can']='oppure puoi';
+$tr['Login here']='Accedere qui';
+$tr['Accedi']='Accedi';
+$tr['Only the following mime types are allowed']='Solo i seguenti tipi di file sono accettati';
+$tr['Select the file to be uploaded']='Seleziona il file da caricare';
+$tr['Upload']='Carica';
+$tr['Carica file']='Carica file';
+$tr['Captcha code']='Codice Captcha';
+$tr['Reload Image']='Ricarica immagine';
+$tr['Login name']='Nome utente';
+$tr['Retype Password']='Conferma Password';
+$tr['Full Name']='Nome Completo';
+$tr['e-mail']='e-mail';
+$tr['Preferred language']='Lingua';
+$tr['Registrazione utente']='Registrazione utente';
+$tr['Send me an e-mail']='Inviami una e-amil';
+$tr['Your e-mail address']='Il tuo indirizzo e-mail';
+$tr['Send e-mail to']='Invia una e-mail a';
+$tr['Send remove link']='Invia link di rimozione';
+$tr['e-mail Subject']='e-mail Oggetto';
+$tr['e-mail Message']='e-mail Messaggio';
+$tr['Password protect']='Password di protezione';
+$tr['Use Captcha']='Utilizza Captcha';
+$tr['File name']='Nome file';
+$tr['File size']='Dimensione file';
+$tr['Description']='Descrizione';
+$tr['Complete upload']='Conferma';
+$tr['You are receiving this message because someone uploaded a file on our OpenUpload server for you.']='Hai ricevuto questa e-mail perchè qualcuno ha utilizzato il ns. servizio OpenUpload per inviarti un file.';
+$tr['To download the file open the following link in a browser']='Per scaricare il file apri il link seguante in un browser';
+$tr['To remove the file from our server open the following link in a browser']='Per rimuovere il file dai ns. server apri il link seguente in un browser';
+$tr['Download link']='Link di download';
+$tr['Remove link']='Link di rimozione';
+$tr['Upload a new file']='Carica un nuovo file';
+$tr['The download is password protected.']='Il file è protetto da password.';
+$tr['Please enter the following captcha to proceed for the download']='Inserire il codice captcha per proseguire nello scaricamento';
+$tr['Proceed']='Procedi';
+$tr['Scarica file']='Scarica file';
+$tr['You can now proceed downloading the file']='Puoi ora procedere allo scaricamento del file';
+$tr['File description']='Descrizione';
+$tr['Uploaded on']='Caricato il';
+$tr['Download file']='Scarica file';
+?>
Added: trunk/templates/default/modules/admin/admin.tpl
===================================================================
--- trunk/templates/default/modules/admin/admin.tpl (rev 0)
+++ trunk/templates/default/modules/admin/admin.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,14 @@
+{tr}Here you can administer{/tr}:<hr>
+<table border="0" width="400" height="200">
+<tr>
+ <td align="center"><a href="{$script}?action=adminsettings"><img src="{$page.template}/img/admin/settings.png" border="0" ><br>{tr}Settings{/tr}</a></td>
+ <td align="center"><a href="{$script}?action=adminplugins"><img src="{$page.template}/img/admin/plugins.png" border="0" align="center"><br>{tr}Plugins{/tr}</a></td>
+ <td align="center"><a href="{$script}?action=adminfiles"><img src="{$page.template}/img/admin/files.png" border="0" ><br>{tr}Files{/tr}</a></td>
+</tr>
+<tr>
+ <td align="center"><a href="{$script}?action=adminusers"><img src="{$page.template}/img/admin/users.png" border="0" ><br>{tr}Users{/tr}</a></td>
+ <td align="center"><a href="{$script}?action=admingroups"><img src="{$page.template}/img/admin/groups.png" border="0" ><br>{tr}Groups{/tr}</a></td>
+ <td align="center"><a href="{$script}?action=adminrights"><img src="{$page.template}/img/admin/rights.png" border="0" ><br>{tr}Rights{/tr}</a></td>
+</tr>
+{$plugins}
+</table>
\ No newline at end of file
Added: trunk/templates/default/modules/auth/loginForm.tpl
===================================================================
--- trunk/templates/default/modules/auth/loginForm.tpl (rev 0)
+++ trunk/templates/default/modules/auth/loginForm.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,15 @@
+<div id="login">
+<fieldset>
+<legend>{tr}User login{/tr}</legend>
+<form action="{$script}" method="POST">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="{$nextstep}">
+<table border="0">
+<tr><td>{tr}User name{/tr}:</td><td><input type="text" id="username" name="username" value="{$username}"></td></tr>
+<tr><td>{tr}Password{/tr}:</td><td><input type="password" name="pwd"></td></tr>
+<tr><td colspan="2" align="right"><input class="submit" type="submit" value="{tr}Login{/tr}"></td></tr>
+</table>
+</form>
+</fieldset>
+{include file="default/modules/auth/registerlink.tpl"}
+</div>
\ No newline at end of file
Added: trunk/templates/default/modules/auth/registerConfirm.tpl
===================================================================
--- trunk/templates/default/modules/auth/registerConfirm.tpl (rev 0)
+++ trunk/templates/default/modules/auth/registerConfirm.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1 @@
+Registration succeded. <a href="{$script}">back to home</a>
\ No newline at end of file
Added: trunk/templates/default/modules/auth/registerForm.tpl
===================================================================
--- trunk/templates/default/modules/auth/registerForm.tpl (rev 0)
+++ trunk/templates/default/modules/auth/registerForm.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,14 @@
+<form method="POST" action="{$script}">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="{$nextstep}">
+<table border="0">
+<tr><td>{tr}Login name{/tr}:</td><td><input type="text" name="registerlogin" value="{$register.login}"></td></tr>
+<tr><td>{tr}Password{/tr}:</td><td><input type="password" name="registerpassword"></td></tr>
+<tr><td>{tr}Retype Password{/tr}:</td><td><input type="password" name="registerrepassword"></td></tr>
+<tr><td>{tr}Full Name{/tr}:</td><td><input type="text" name="registername" value="{$register.name}"></td></tr>
+<tr><td>{tr}e-mail{/tr}:</td><td><input type="text" name="registeremail" value="{$register.email}"></td></tr>
+<!--<tr><td>{tr}Preferred language{/tr}: <select name="registerlang"></select></td></tr>-->
+{$plugins}
+<tr><td colspan="2" align="right"><input type="submit" class="submit" value="Register"></td></tr>
+</table>
+</form>
\ No newline at end of file
Added: trunk/templates/default/modules/auth/registerlink.tpl
===================================================================
--- trunk/templates/default/modules/auth/registerlink.tpl (rev 0)
+++ trunk/templates/default/modules/auth/registerlink.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,6 @@
+{if !isset($user.login)}
+ {if $register}
+{tr}You don't have an account?{/tr} <a href="{$script}?action=register">{tr}Register here{/tr}</a>
+ {tr}or you can{/tr} <a href="{$script}?action=login">{tr}Login here{/tr}.</a>
+ {/if}
+{/if}
Added: trunk/templates/default/modules/files/downloadConfirm.tpl
===================================================================
--- trunk/templates/default/modules/files/downloadConfirm.tpl (rev 0)
+++ trunk/templates/default/modules/files/downloadConfirm.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,14 @@
+{tr}You can now proceed downloading the file{/tr}:
+<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|fsize_format}</b></td></tr>
+<tr><td>{tr}Uploaded on{/tr}:</td><td><b>{$finfo.upload_date}</b></td></tr>
+{$plugins}
+</table>
+<div id="downloadbutton"><br><center>
+ <a href="{$script}?action=g">
+ <img src="{$page.template}/img/download.png" border="0"><br>
+ {tr}Download file{/tr}</a></center>
+</div>
+
Added: trunk/templates/default/modules/files/downloadForm.tpl
===================================================================
--- trunk/templates/default/modules/files/downloadForm.tpl (rev 0)
+++ trunk/templates/default/modules/files/downloadForm.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,15 @@
+{tr}Please enter the File Information requested{/tr}:
+<form action="{$script}" method="POST">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="{$nextstep}">
+<table border="0">
+<table border="0">
+<tr><td>{tr}File code{/tr}:</td><td><input id="id" type="text" size="30" name="id"></td></tr>
+{$plugins}
+<tr><td colspan="2" align="right"><input class="submit" type="submit" value="{tr}Proceed{/tr}"></td></tr>
+</table>
+{literal}
+<script>
+document.getElementById('description').focus();
+</script>
+{/literal}
\ No newline at end of file
Added: trunk/templates/default/modules/files/downloadRequest.tpl
===================================================================
--- trunk/templates/default/modules/files/downloadRequest.tpl (rev 0)
+++ trunk/templates/default/modules/files/downloadRequest.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,10 @@
+The file you requested the download needs some input before you can proceed:
+<form action="{$script}" method="POST" name="downloadform">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="{$nextstep}">
+<table border="0">
+{$plugins}
+<tr><td colspan="2" align="right"><input type="submit" class="submit" value="{tr}Proceed{/tr}">
+</table>
+</form>
+
Added: trunk/templates/default/modules/files/removeRequest.tpl
===================================================================
--- trunk/templates/default/modules/files/removeRequest.tpl (rev 0)
+++ trunk/templates/default/modules/files/removeRequest.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,13 @@
+{tr}You requested to remove the following file{/tr}:<br>
+<form method="POST" action={$script}>
+<input type="hidden" name="action" value="{$action}">
+<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>
+<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}">
+</table>
+</form>
\ No newline at end of file
Added: trunk/templates/default/modules/files/removeResult.tpl
===================================================================
--- trunk/templates/default/modules/files/removeResult.tpl (rev 0)
+++ trunk/templates/default/modules/files/removeResult.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,10 @@
+{tr}FILE HAS BEEN SUCCESSGULLY 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>
+<br/>
+<a href="{$script}">Upload a new file</a>
\ No newline at end of file
Added: trunk/templates/default/modules/files/uploadFileInfo.tpl
===================================================================
--- trunk/templates/default/modules/files/uploadFileInfo.tpl (rev 0)
+++ trunk/templates/default/modules/files/uploadFileInfo.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,9 @@
+<table border="0">
+<tr><td>{tr}Download link{/tr}:</td>
+<td><a href="{$finfo.downloadlink}">{$finfo.downloadlink}</a>
+ </td></tr>
+<tr><td>{tr}Remove link{/tr}:</td><td>
+<a href="{$finfo.removelink}">{$finfo.removelink}</a></td></tr>
+</table>
+<br>
+<a href="{$script}">{tr}Upload a new file{/tr}</a>
\ No newline at end of file
Added: trunk/templates/default/modules/files/uploadForm.tpl
===================================================================
--- trunk/templates/default/modules/files/uploadForm.tpl (rev 0)
+++ trunk/templates/default/modules/files/uploadForm.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,23 @@
+{literal}
+<script>
+function unhide() {
+ $obj = document.getElementById('uploadbutton');
+ $obj.style.visibility = 'visible';
+}
+</script>
+{/literal}
+<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}">
+{tr}Select the file to be uploaded{/tr}<br>
+ <input type="file" class="file" size="50" name="upload" onchange="if (this.value!='') unhide();"><br>
+{$plugins}
+<div id="uploadbutton" style="visibility:hidden"><br>
+ <a href="{$script}" onclick="document.uploadform.submit();return false;">
+ <img src="{$page.template}/img/upload.png" border="0"><br>
+ {tr}Upload{/tr}</a>
+</div>
+</form>
+{include file="default/modules/auth/registerlink.tpl"}
+</div>
Added: trunk/templates/default/modules/files/uploadOptions.tpl
===================================================================
--- trunk/templates/default/modules/files/uploadOptions.tpl (rev 0)
+++ trunk/templates/default/modules/files/uploadOptions.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,18 @@
+<div id="uploaddetail">
+<form action="{$script}" method="POST">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="{$nextstep}">
+<table border="0">
+<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><input id="description" type="text" size="30" name="description" value="{$finfo.description}"></td></tr>
+{$plugins}
+<tr><td colspan="2" align="right"><input class="submit" type="submit" value="{tr}Complete upload{/tr}"></td></tr>
+</table>
+</form>
+</div>
+{literal}
+<script>
+document.getElementById('description').focus();
+</script>
+{/literal}
\ No newline at end of file
Added: trunk/templates/default/plugins/banned/banned.tpl
===================================================================
--- trunk/templates/default/plugins/banned/banned.tpl (rev 0)
+++ trunk/templates/default/plugins/banned/banned.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,3 @@
+{tr}Your IP has been blocked!{/tr}<br>
+{tr}You cannot use this site.{/tr}<br>
+{tr}If you think this is a misconfiguration please send an email to the site owner{/tr}
\ No newline at end of file
Added: trunk/templates/default/plugins/captcha/downloadRequest.tpl
===================================================================
--- trunk/templates/default/plugins/captcha/downloadRequest.tpl (rev 0)
+++ trunk/templates/default/plugins/captcha/downloadRequest.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,6 @@
+<tr><td colspan="2">{tr}Please enter the following captcha to proceed for the download{/tr}:</td></tr>
+<tr><td rowspan="2"><img id="captcha" src="{$captcha_img}"></td><td>
+<a href="#" onclick="document.getElementById('captcha').src ='{$captcha_img}?' + Math.random(); return false">
+{tr}Reload Image{/tr}</a></td></tr>
+<tr><td><input type="text" size="20" name="captcha_code"></td></tr>
+
Added: trunk/templates/default/plugins/captcha/registerForm.tpl
===================================================================
--- trunk/templates/default/plugins/captcha/registerForm.tpl (rev 0)
+++ trunk/templates/default/plugins/captcha/registerForm.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,4 @@
+<tr><td rowspan="2" valign="top">{tr}Captcha code{/tr}:<br>
+<a href="#" onclick="document.getElementById('captcha').src ='{$captcha_img}?' + Math.random(); return false">
+{tr}Reload Image{/tr}</a></td><td><img id="captcha" src="{$captcha_img}"></td></tr>
+<tr><td><input type="text" size="20" name="captcha_code"></td></tr>
\ No newline at end of file
Added: trunk/templates/default/plugins/captcha/uploadOptions.tpl
===================================================================
--- trunk/templates/default/plugins/captcha/uploadOptions.tpl (rev 0)
+++ trunk/templates/default/plugins/captcha/uploadOptions.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1 @@
+<tr><td>{tr}Use Captcha{/tr}:</td><td><input type="checkbox" name="captcha" value="1" checked></td></tr>
\ No newline at end of file
Added: trunk/templates/default/plugins/email/notify.tpl
===================================================================
--- trunk/templates/default/plugins/email/notify.tpl (rev 0)
+++ trunk/templates/default/plugins/email/notify.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,118 @@
+This is a multi-part message MIME format.
+
+--{$boudary}
+Content-Type: text/plain; charset="iso-8559-1"
+Content-Transfer-Encoding: 7bit
+
+{tr}You are receiving this message because someone uploaded a file on our OpenUpload server for you.{/tr}
+
+{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}
+{/if}
+{if ($finfo.message!="")}
+{tr}User message{/tr}:
+{$finfo.message}
+{/if}
+
+{tr}To download the file open the following link in a browser{/tr}
+
+{$finfo.downloadlink}
+
+{if isset($remove)}
+{tr}To remove the file from our server open the following link in a browser{/tr}
+
+{$finfo.removelink}
+{/if}
+
+{if isset($adminemail)}
+{tr}For complains please send an email to{/tr}: {$adminemail}
+{/if}
+
+-------------------------------------------------------------------
+OpenUpload c by Alessandro Briosi http://openupload.sourceforge.net
+
+--{$boudary}
+Content-Type: text/html; charset="iso-8559-1"
+Content-Transfer-Encoding: 7bit
+
+<html>
+<header>
+<title>{$subject}</title>
+<style>
+{literal}
+body {
+ font-family: Arial, Helvetica, Tahoma;
+ font-size: 10pt;
+}
+a {
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 11pt;
+ text-decoration: none;
+}
+a:visited {
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 11pt;
+ text-decoration: none;
+}
+a:hover {
+ color: #4c8dff;
+ font-weight: bold;
+ font-size: 11pt;
+ text-decoration: none;
+}
+#footer {
+ clear: both;
+ position: fixed;
+ bottom: 0px;
+ height: 20px;
+ width: 100%;
+ font-weight: bold;
+ font-size: 9pt;
+ border-top: 1px solid #000000;
+ text-align: center;
+}
+td {
+ font-size: 10pt;
+ font-weight: bold;
+}
+</style>
+{/literal}
+</header>
+<body>
+<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 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>
+{/if}
+</table>
+
+{if ($finfo.message!="")}
+<p>{tr}User message{/tr}<br>:
+{$finfo.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>
+
+{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>
+{/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>
+</body>
+</html>
\ No newline at end of file
Added: trunk/templates/default/plugins/email/uploadOptions.tpl
===================================================================
--- trunk/templates/default/plugins/email/uploadOptions.tpl (rev 0)
+++ trunk/templates/default/plugins/email/uploadOptions.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,10 @@
+{if !isset($user.email)}
+<tr><td>{tr}Send me an e-mail{/tr}:</td><td><input type="checkbox" name="emailme" value="yes"></td></tr>
+<tr><td>{tr}Your e-mail address{/tr}:</td><td><input type="text" size="30" value="{$finfo.email}" name="email"></td></tr>
+{else}
+<tr><td>{tr}Send me an e-mail{/tr}:</td><td><input type="checkbox" checked name="emailme" value="yes"></td></tr>
+{/if}
+<tr><td>{tr}Send e-mail to{/tr}:</td><td><input type="text" size="30" value="{$finfo.emailto}" name="emailto"></td></tr>
+<tr><td>{tr}Send remove link{/tr}:</td><td><input type="checkbox" name="removelink" value="yes"></td></tr>
+<tr><td>{tr}e-mail Subject{/tr}:</td><td><input type="text" size="30" value="{$finfo.subject}" name="subject"></td></tr>
+<tr><td valign="top">{tr}e-mail Message{/tr}:</td><td><textarea cols="30" rows="10" name="message">{$finfo.message}</textarea></td></tr>
Added: trunk/templates/default/plugins/mimetypes/uploadForm.tpl
===================================================================
--- trunk/templates/default/plugins/mimetypes/uploadForm.tpl (rev 0)
+++ trunk/templates/default/plugins/mimetypes/uploadForm.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1 @@
+<div id="mime">{tr}Only the following mime types are allowed{/tr} ({foreach from=$mimetypes item=m}{$m}, {/foreach})</div>
\ No newline at end of file
Added: trunk/templates/default/plugins/password/downloadRequest.tpl
===================================================================
--- trunk/templates/default/plugins/password/downloadRequest.tpl (rev 0)
+++ trunk/templates/default/plugins/password/downloadRequest.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1,2 @@
+<tr><td colspan="2">{tr}The download is password protected.{/tr}</td></tr>
+<tr><td>{tr}Password{/tr}:</td><td> <input type="password" name="protect"></td></tr>
Added: trunk/templates/default/plugins/password/uploadOptions.tpl
===================================================================
--- trunk/templates/default/plugins/password/uploadOptions.tpl (rev 0)
+++ trunk/templates/default/plugins/password/uploadOptions.tpl 2008-10-15 14:09:35 UTC (rev 15)
@@ -0,0 +1 @@
+<tr><td>{tr}Password protect{/tr}:</td><td><input type="password" size="30" name="protect"></td></tr>
\ 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-10-15 14:27:24
|
Revision: 12
http://openupload.svn.sourceforge.net/openupload/?rev=12&view=rev
Author: tsdogs
Date: 2008-10-15 14:01:19 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
First svn commit
Added Paths:
-----------
trunk/lib/smarty/plugins/block.textformat.php
trunk/lib/smarty/plugins/block.tr.php
trunk/lib/smarty/plugins/compiler.assign.php
trunk/lib/smarty/plugins/function.assign_debug_info.php
trunk/lib/smarty/plugins/function.config_load.php
trunk/lib/smarty/plugins/function.counter.php
trunk/lib/smarty/plugins/function.cycle.php
trunk/lib/smarty/plugins/function.db_table.php
trunk/lib/smarty/plugins/function.debug.php
trunk/lib/smarty/plugins/function.eval.php
trunk/lib/smarty/plugins/function.fetch.php
trunk/lib/smarty/plugins/function.html_checkboxes.php
trunk/lib/smarty/plugins/function.html_image.php
trunk/lib/smarty/plugins/function.html_options.php
trunk/lib/smarty/plugins/function.html_radios.php
trunk/lib/smarty/plugins/function.html_select_date.php
trunk/lib/smarty/plugins/function.html_select_time.php
trunk/lib/smarty/plugins/function.html_table.php
trunk/lib/smarty/plugins/function.mailto.php
trunk/lib/smarty/plugins/function.math.php
trunk/lib/smarty/plugins/function.popup.php
trunk/lib/smarty/plugins/function.popup_init.php
trunk/lib/smarty/plugins/modifier.capitalize.php
trunk/lib/smarty/plugins/modifier.cat.php
trunk/lib/smarty/plugins/modifier.count_characters.php
trunk/lib/smarty/plugins/modifier.count_paragraphs.php
trunk/lib/smarty/plugins/modifier.count_sentences.php
trunk/lib/smarty/plugins/modifier.count_words.php
trunk/lib/smarty/plugins/modifier.date_format.php
trunk/lib/smarty/plugins/modifier.debug_print_var.php
trunk/lib/smarty/plugins/modifier.default.php
trunk/lib/smarty/plugins/modifier.escape.php
trunk/lib/smarty/plugins/modifier.fsize_format.php
trunk/lib/smarty/plugins/modifier.indent.php
trunk/lib/smarty/plugins/modifier.lower.php
trunk/lib/smarty/plugins/modifier.nl2br.php
trunk/lib/smarty/plugins/modifier.regex_replace.php
trunk/lib/smarty/plugins/modifier.replace.php
trunk/lib/smarty/plugins/modifier.spacify.php
trunk/lib/smarty/plugins/modifier.string_format.php
trunk/lib/smarty/plugins/modifier.strip.php
trunk/lib/smarty/plugins/modifier.strip_tags.php
trunk/lib/smarty/plugins/modifier.truncate.php
trunk/lib/smarty/plugins/modifier.upper.php
trunk/lib/smarty/plugins/modifier.wordwrap.php
trunk/lib/smarty/plugins/outputfilter.trimwhitespace.php
trunk/lib/smarty/plugins/shared.escape_special_chars.php
trunk/lib/smarty/plugins/shared.make_timestamp.php
Added: trunk/lib/smarty/plugins/block.textformat.php
===================================================================
--- trunk/lib/smarty/plugins/block.textformat.php (rev 0)
+++ trunk/lib/smarty/plugins/block.textformat.php 2008-10-15 14:01:19 UTC (rev 12)
@@ -0,0 +1,103 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {textformat}{/textformat} block plugin
+ *
+ * Type: block function<br>
+ * Name: textformat<br>
+ * Purpose: format text a certain way with preset styles
+ * or custom wrap/indent settings<br>
+ * @link http://smarty.php.net/manual/en/language.function.textformat.php {textformat}
+ * (Smarty online manual)
+ * @param array
+ * <pre>
+ * Params: style: string (email)
+ * indent: integer (0)
+ * wrap: integer (80)
+ * wrap_char string ("\n")
+ * indent_char: string (" ")
+ * wrap_boundary: boolean (true)
+ * </pre>
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param string contents of the block
+ * @param Smarty clever simulation of a method
+ * @return string string $content re-formatted
+ */
+function smarty_block_textformat($params, $content, &$smarty)
+{
+ if (is_null($content)) {
+ return;
+ }
+
+ $style = null;
+ $indent = 0;
+ $indent_first = 0;
+ $indent_char = ' ';
+ $wrap = 80;
+ $wrap_char = "\n";
+ $wrap_cut = false;
+ $assign = null;
+
+ foreach ($params as $_key => $_val) {
+ switch ($_key) {
+ case 'style':
+ case 'indent_char':
+ case 'wrap_char':
+ case 'assign':
+ $$_key = (string)$_val;
+ break;
+
+ case 'indent':
+ case 'indent_first':
+ case 'wrap':
+ $$_key = (int)$_val;
+ break;
+
+ case 'wrap_cut':
+ $$_key = (bool)$_val;
+ break;
+
+ default:
+ $smarty->trigger_error("textformat: unknown attribute '$_key'");
+ }
+ }
+
+ if ($style == 'email') {
+ $wrap = 72;
+ }
+
+ // split into paragraphs
+ $_paragraphs = preg_split('![\r\n][\r\n]!',$content);
+ $_output = '';
+
+ for($_x = 0, $_y = count($_paragraphs); $_x < $_y; $_x++) {
+ if ($_paragraphs[$_x] == '') {
+ continue;
+ }
+ // convert mult. spaces & special chars to single space
+ $_paragraphs[$_x] = preg_replace(array('!\s+!','!(^\s+)|(\s+$)!'), array(' ',''), $_paragraphs[$_x]);
+ // indent first line
+ if($indent_first > 0) {
+ $_paragraphs[$_x] = str_repeat($indent_char, $indent_first) . $_paragraphs[$_x];
+ }
+ // wordwrap sentences
+ $_paragraphs[$_x] = wordwrap($_paragraphs[$_x], $wrap - $indent, $wrap_char, $wrap_cut);
+ // indent lines
+ if($indent > 0) {
+ $_paragraphs[$_x] = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraphs[$_x]);
+ }
+ }
+ $_output = implode($wrap_char . $wrap_char, $_paragraphs);
+
+ return $assign ? $smarty->assign($assign, $_output) : $_output;
+
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/plugins/block.textformat.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/plugins/block.tr.php
===================================================================
--- trunk/lib/smarty/plugins/block.tr.php (rev 0)
+++ trunk/lib/smarty/plugins/block.tr.php 2008-10-15 14:01:19 UTC (rev 12)
@@ -0,0 +1,16 @@
+<?php
+
+
+function smarty_block_tr($params, $content = null, &$smarty, &$repeat) {
+
+ if(!$repeat){
+ if (isset($content)) {
+// return htmlentities(translate($content,'template',$params));
+ return translate($content, 'template',$params);
+ } else {
+ return '';
+ }
+ }
+}
+
+?>
\ No newline at end of file
Property changes on: trunk/lib/smarty/plugins/block.tr.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/plugins/compiler.assign.php
===================================================================
--- trunk/lib/smarty/plugins/compiler.assign.php (rev 0)
+++ trunk/lib/smarty/plugins/compiler.assign.php 2008-10-15 14:01:19 UTC (rev 12)
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {assign} compiler function plugin
+ *
+ * Type: compiler function<br>
+ * Name: assign<br>
+ * Purpose: assign a value to a template variable
+ * @link http://smarty.php.net/manual/en/language.custom.functions.php#LANGUAGE.FUNCTION.ASSIGN {assign}
+ * (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com> (initial author)
+ * @author messju mohr <messju at lammfellpuschen dot de> (conversion to compiler function)
+ * @param string containing var-attribute and value-attribute
+ * @param Smarty_Compiler
+ */
+function smarty_compiler_assign($tag_attrs, &$compiler)
+{
+ $_params = $compiler->_parse_attrs($tag_attrs);
+
+ if (!isset($_params['var'])) {
+ $compiler->_syntax_error("assign: missing 'var' parameter", E_USER_WARNING);
+ return;
+ }
+
+ if (!isset($_params['value'])) {
+ $compiler->_syntax_error("assign: missing 'value' parameter", E_USER_WARNING);
+ return;
+ }
+
+ return "\$this->assign({$_params['var']}, {$_params['value']});";
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/plugins/compiler.assign.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/plugins/function.assign_debug_info.php
===================================================================
--- trunk/lib/smarty/plugins/function.assign_debug_info.php (rev 0)
+++ trunk/lib/smarty/plugins/function.assign_debug_info.php 2008-10-15 14:01:19 UTC (rev 12)
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {assign_debug_info} function plugin
+ *
+ * Type: function<br>
+ * Name: assign_debug_info<br>
+ * Purpose: assign debug info to the template<br>
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param array unused in this plugin, this plugin uses {@link Smarty::$_config},
+ * {@link Smarty::$_tpl_vars} and {@link Smarty::$_smarty_debug_info}
+ * @param Smarty
+ */
+function smarty_function_assign_debug_info($params, &$smarty)
+{
+ $assigned_vars = $smarty->_tpl_vars;
+ ksort($assigned_vars);
+ if (@is_array($smarty->_config[0])) {
+ $config_vars = $smarty->_config[0];
+ ksort($config_vars);
+ $smarty->assign("_debug_config_keys", array_keys($config_vars));
+ $smarty->assign("_debug_config_vals", array_values($config_vars));
+ }
+
+ $included_templates = $smarty->_smarty_debug_info;
+
+ $smarty->assign("_debug_keys", array_keys($assigned_vars));
+ $smarty->assign("_debug_vals", array_values($assigned_vars));
+
+ $smarty->assign("_debug_tpls", $included_templates);
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/plugins/function.assign_debug_info.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/plugins/function.config_load.php
===================================================================
--- trunk/lib/smarty/plugins/function.config_load.php (rev 0)
+++ trunk/lib/smarty/plugins/function.config_load.php 2008-10-15 14:01:19 UTC (rev 12)
@@ -0,0 +1,142 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {config_load} function plugin
+ *
+ * Type: function<br>
+ * Name: config_load<br>
+ * Purpose: load config file vars
+ * @link http://smarty.php.net/manual/en/language.function.config.load.php {config_load}
+ * (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author messju mohr <messju at lammfellpuschen dot de> (added use of resources)
+ * @param array Format:
+ * <pre>
+ * array('file' => required config file name,
+ * 'section' => optional config file section to load
+ * 'scope' => local/parent/global
+ * 'global' => overrides scope, setting to parent if true)
+ * </pre>
+ * @param Smarty
+ */
+function smarty_function_config_load($params, &$smarty)
+{
+ if ($smarty->debugging) {
+ $_params = array();
+ require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+ $_debug_start_time = smarty_core_get_microtime($_params, $smarty);
+ }
+
+ $_file = isset($params['file']) ? $smarty->_dequote($params['file']) : null;
+ $_section = isset($params['section']) ? $smarty->_dequote($params['section']) : null;
+ $_scope = isset($params['scope']) ? $smarty->_dequote($params['scope']) : 'global';
+ $_global = isset($params['global']) ? $smarty->_dequote($params['global']) : false;
+
+ if (!isset($_file) || strlen($_file) == 0) {
+ $smarty->trigger_error("missing 'file' attribute in config_load tag", E_USER_ERROR, __FILE__, __LINE__);
+ }
+
+ if (isset($_scope)) {
+ if ($_scope != 'local' &&
+ $_scope != 'parent' &&
+ $_scope != 'global') {
+ $smarty->trigger_error("invalid 'scope' attribute value", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ } else {
+ if ($_global) {
+ $_scope = 'parent';
+ } else {
+ $_scope = 'local';
+ }
+ }
+
+ $_params = array('resource_name' => $_file,
+ 'resource_base_path' => $smarty->config_dir,
+ 'get_source' => false);
+ $smarty->_parse_resource_name($_params);
+ $_file_path = $_params['resource_type'] . ':' . $_params['resource_name'];
+ if (isset($_section))
+ $_compile_file = $smarty->_get_compile_path($_file_path.'|'.$_section);
+ else
+ $_compile_file = $smarty->_get_compile_path($_file_path);
+
+ if($smarty->force_compile || !file_exists($_compile_file)) {
+ $_compile = true;
+ } elseif ($smarty->compile_check) {
+ $_params = array('resource_name' => $_file,
+ 'resource_base_path' => $smarty->config_dir,
+ 'get_source' => false);
+ $_compile = $smarty->_fetch_resource_info($_params) &&
+ $_params['resource_timestamp'] > filemtime($_compile_file);
+ } else {
+ $_compile = false;
+ }
+
+ if($_compile) {
+ // compile config file
+ if(!is_object($smarty->_conf_obj)) {
+ require_once SMARTY_DIR . $smarty->config_class . '.class.php';
+ $smarty->_conf_obj = new $smarty->config_class();
+ $smarty->_conf_obj->overwrite = $smarty->config_overwrite;
+ $smarty->_conf_obj->booleanize = $smarty->config_booleanize;
+ $smarty->_conf_obj->read_hidden = $smarty->config_read_hidden;
+ $smarty->_conf_obj->fix_newlines = $smarty->config_fix_newlines;
+ }
+
+ $_params = array('resource_name' => $_file,
+ 'resource_base_path' => $smarty->config_dir,
+ $_params['get_source'] = true);
+ if (!$smarty->_fetch_resource_info($_params)) {
+ return;
+ }
+ $smarty->_conf_obj->set_file_contents($_file, $_params['source_content']);
+ $_config_vars = array_merge($smarty->_conf_obj->get($_file),
+ $smarty->_conf_obj->get($_file, $_section));
+ if(function_exists('var_export')) {
+ $_output = '<?php $_config_vars = ' . var_export($_config_vars, true) . '; ?>';
+ } else {
+ $_output = '<?php $_config_vars = unserialize(\'' . strtr(serialize($_config_vars),array('\''=>'\\\'', '\\'=>'\\\\')) . '\'); ?>';
+ }
+ $_params = (array('compile_path' => $_compile_file, 'compiled_content' => $_output, 'resource_timestamp' => $_params['resource_timestamp']));
+ require_once(SMARTY_CORE_DIR . 'core.write_compiled_resource.php');
+ smarty_core_write_compiled_resource($_params, $smarty);
+ } else {
+ include($_compile_file);
+ }
+
+ if ($smarty->caching) {
+ $smarty->_cache_info['config'][$_file] = true;
+ }
+
+ $smarty->_config[0]['vars'] = @array_merge($smarty->_config[0]['vars'], $_config_vars);
+ $smarty->_config[0]['files'][$_file] = true;
+
+ if ($_scope == 'parent') {
+ $smarty->_config[1]['vars'] = @array_merge($smarty->_config[1]['vars'], $_config_vars);
+ $smarty->_config[1]['files'][$_file] = true;
+ } else if ($_scope == 'global') {
+ for ($i = 1, $for_max = count($smarty->_config); $i < $for_max; $i++) {
+ $smarty->_config[$i]['vars'] = @array_merge($smarty->_config[$i]['vars'], $_config_vars);
+ $smarty->_config[$i]['files'][$_file] = true;
+ }
+ }
+
+ if ($smarty->debugging) {
+ $_params = array();
+ require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+ $smarty->_smarty_debug_info[] = array('type' => 'config',
+ 'filename' => $_file.' ['.$_section.'] '.$_scope,
+ 'depth' => $smarty->_inclusion_depth,
+ 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time);
+ }
+
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/plugins/function.config_load.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/plugins/function.counter.php
===================================================================
--- trunk/lib/smarty/plugins/function.counter.php (rev 0)
+++ trunk/lib/smarty/plugins/function.counter.php 2008-10-15 14:01:19 UTC (rev 12)
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {counter} function plugin
+ *
+ * Type: function<br>
+ * Name: counter<br>
+ * Purpose: print out a counter value
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @link http://smarty.php.net/manual/en/language.function.counter.php {counter}
+ * (Smarty online manual)
+ * @param array parameters
+ * @param Smarty
+ * @return string|null
+ */
+function smarty_function_counter($params, &$smarty)
+{
+ static $counters = array();
+
+ $name = (isset($params['name'])) ? $params['name'] : 'default';
+ if (!isset($counters[$name])) {
+ $counters[$name] = array(
+ 'start'=>1,
+ 'skip'=>1,
+ 'direction'=>'up',
+ 'count'=>1
+ );
+ }
+ $counter =& $counters[$name];
+
+ if (isset($params['start'])) {
+ $counter['start'] = $counter['count'] = (int)$params['start'];
+ }
+
+ if (!empty($params['assign'])) {
+ $counter['assign'] = $params['assign'];
+ }
+
+ if (isset($counter['assign'])) {
+ $smarty->assign($counter['assign'], $counter['count']);
+ }
+
+ if (isset($params['print'])) {
+ $print = (bool)$params['print'];
+ } else {
+ $print = empty($counter['assign']);
+ }
+
+ if ($print) {
+ $retval = $counter['count'];
+ } else {
+ $retval = null;
+ }
+
+ if (isset($params['skip'])) {
+ $counter['skip'] = $params['skip'];
+ }
+
+ if (isset($params['direction'])) {
+ $counter['direction'] = $params['direction'];
+ }
+
+ if ($counter['direction'] == "down")
+ $counter['count'] -= $counter['skip'];
+ else
+ $counter['count'] += $counter['skip'];
+
+ return $retval;
+
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/plugins/function.counter.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/plugins/function.cycle.php
===================================================================
--- trunk/lib/smarty/plugins/function.cycle.php (rev 0)
+++ trunk/lib/smarty/plugins/function.cycle.php 2008-10-15 14:01:19 UTC (rev 12)
@@ -0,0 +1,102 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {cycle} function plugin
+ *
+ * Type: function<br>
+ * Name: cycle<br>
+ * Date: May 3, 2002<br>
+ * Purpose: cycle through given values<br>
+ * Input:
+ * - name = name of cycle (optional)
+ * - values = comma separated list of values to cycle,
+ * or an array of values to cycle
+ * (this can be left out for subsequent calls)
+ * - reset = boolean - resets given var to true
+ * - print = boolean - print var or not. default is true
+ * - advance = boolean - whether or not to advance the cycle
+ * - delimiter = the value delimiter, default is ","
+ * - assign = boolean, assigns to template var instead of
+ * printed.
+ *
+ * Examples:<br>
+ * <pre>
+ * {cycle values="#eeeeee,#d0d0d0d"}
+ * {cycle name=row values="one,two,three" reset=true}
+ * {cycle name=row}
+ * </pre>
+ * @link http://smarty.php.net/manual/en/language.function.cycle.php {cycle}
+ * (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author credit to Mark Priatel <mpr...@ro...>
+ * @author credit to Gerard <ge...@in...>
+ * @author credit to Jason Sweat <jsw...@ya...>
+ * @version 1.3
+ * @param array
+ * @param Smarty
+ * @return string|null
+ */
+function smarty_function_cycle($params, &$smarty)
+{
+ static $cycle_vars;
+
+ $name = (empty($params['name'])) ? 'default' : $params['name'];
+ $print = (isset($params['print'])) ? (bool)$params['print'] : true;
+ $advance = (isset($params['advance'])) ? (bool)$params['advance'] : true;
+ $reset = (isset($params['reset'])) ? (bool)$params['reset'] : false;
+
+ if (!in_array('values', array_keys($params))) {
+ if(!isset($cycle_vars[$name]['values'])) {
+ $smarty->trigger_error("cycle: missing 'values' parameter");
+ return;
+ }
+ } else {
+ if(isset($cycle_vars[$name]['values'])
+ && $cycle_vars[$name]['values'] != $params['values'] ) {
+ $cycle_vars[$name]['index'] = 0;
+ }
+ $cycle_vars[$name]['values'] = $params['values'];
+ }
+
+ $cycle_vars[$name]['delimiter'] = (isset($params['delimiter'])) ? $params['delimiter'] : ',';
+
+ if(is_array($cycle_vars[$name]['values'])) {
+ $cycle_array = $cycle_vars[$name]['values'];
+ } else {
+ $cycle_array = explode($cycle_vars[$name]['delimiter'],$cycle_vars[$name]['values']);
+ }
+
+ if(!isset($cycle_vars[$name]['index']) || $reset ) {
+ $cycle_vars[$name]['index'] = 0;
+ }
+
+ if (isset($params['assign'])) {
+ $print = false;
+ $smarty->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]);
+ }
+
+ if($print) {
+ $retval = $cycle_array[$cycle_vars[$name]['index']];
+ } else {
+ $retval = null;
+ }
+
+ if($advance) {
+ if ( $cycle_vars[$name]['index'] >= count($cycle_array) -1 ) {
+ $cycle_vars[$name]['index'] = 0;
+ } else {
+ $cycle_vars[$name]['index']++;
+ }
+ }
+
+ return $retval;
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/plugins/function.cycle.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/plugins/function.db_table.php
===================================================================
--- trunk/lib/smarty/plugins/function.db_table.php (rev 0)
+++ trunk/lib/smarty/plugins/function.db_table.php 2008-10-15 14:01:19 UTC (rev 12)
@@ -0,0 +1,40 @@
+<?php
+
+
+
+function smarty_function_db_table($params, &$smarty){
+
+ $data = $params['data'];
+ isset($params['header'])?$headers = $params['header']:$headers=array();
+ isset($params['fields'])?$fields = $params['fields']:$fields=array();
+
+ $fields_set = count($fields)>0;
+
+ $result = '<table '.$params['tbloptions'].'>';
+ $result .= "<tbody>\n";
+ if (count($headers)>0){
+ $result .= '<tr>';
+ foreach ($headers as $val){
+ $result .= '<th>'.$val.'</th>';
+ }
+ $result .= '</tr>';
+ }
+
+ foreach ($data as $row){
+ $result .= '<tr>';
+ if ($fields_set) {
+ foreach ($fields as $val){
+ $result .= '<td>'.htmlentities($row[$val]).'</td>';
+ }
+ } else {
+ foreach ($row as $val){
+ $result .= '<td>'.htmlentities($val).'</td>';
+ }
+ }
+ $result .= '</tr>'."\n";
+ }
+
+ $result .= "</tbody>\n";
+ $result .= "</table>\n";
+ return $result;
+}
\ No newline at end of file
Property changes on: trunk/lib/smarty/plugins/function.db_table.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/plugins/function.debug.php
===================================================================
--- trunk/lib/smarty/plugins/function.debug.php (rev 0)
+++ trunk/lib/smarty/plugins/function.debug.php 2008-10-15 14:01:19 UTC (rev 12)
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {debug} function plugin
+ *
+ * Type: function<br>
+ * Name: debug<br>
+ * Date: July 1, 2002<br>
+ * Purpose: popup debug window
+ * @link http://smarty.php.net/manual/en/language.function.debug.php {debug}
+ * (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @version 1.0
+ * @param array
+ * @param Smarty
+ * @return string output from {@link Smarty::_generate_debug_output()}
+ */
+function smarty_function_debug($params, &$smarty)
+{
+ if (isset($params['output'])) {
+ $smarty->assign('_smarty_debug_output', $params['output']);
+ }
+ require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
+ return smarty_core_display_debug_console(null, $smarty);
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/plugins/function.debug.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/plugins/function.eval.php
===================================================================
--- trunk/lib/smarty/plugins/function.eval.php (rev 0)
+++ trunk/lib/smarty/plugins/function.eval.php 2008-10-15 14:01:19 UTC (rev 12)
@@ -0,0 +1,49 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {eval} function plugin
+ *
+ * Type: function<br>
+ * Name: eval<br>
+ * Purpose: evaluate a template variable as a template<br>
+ * @link http://smarty.php.net/manual/en/language.function.eval.php {eval}
+ * (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ */
+function smarty_function_eval($params, &$smarty)
+{
+
+ if (!isset($params['var'])) {
+ $smarty->trigger_error("eval: missing 'var' parameter");
+ return;
+ }
+
+ if($params['var'] == '') {
+ return;
+ }
+
+ $smarty->_compile_source('evaluated template', $params['var'], $_var_compiled);
+
+ ob_start();
+ $smarty->_eval('?>' . $_var_compiled);
+ $_contents = ob_get_contents();
+ ob_end_clean();
+
+ if (!empty($params['assign'])) {
+ $smarty->assign($params['assign'], $_contents);
+ } else {
+ return $_contents;
+ }
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/plugins/function.eval.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/plugins/function.fetch.php
===================================================================
--- trunk/lib/smarty/plugins/function.fetch.php (rev 0)
+++ trunk/lib/smarty/plugins/function.fetch.php 2008-10-15 14:01:19 UTC (rev 12)
@@ -0,0 +1,221 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {fetch} plugin
+ *
+ * Type: function<br>
+ * Name: fetch<br>
+ * Purpose: fetch file, web or ftp data and display results
+ * @link http://smarty.php.net/manual/en/language.function.fetch.php {fetch}
+ * (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ * @return string|null if the assign parameter is passed, Smarty assigns the
+ * result to a template variable
+ */
+function smarty_function_fetch($params, &$smarty)
+{
+ if (empty($params['file'])) {
+ $smarty->_trigger_fatal_error("[plugin] parameter 'file' cannot be empty");
+ return;
+ }
+
+ $content = '';
+ if ($smarty->security && !preg_match('!^(http|ftp)://!i', $params['file'])) {
+ $_params = array('resource_type' => 'file', 'resource_name' => $params['file']);
+ require_once(SMARTY_CORE_DIR . 'core.is_secure.php');
+ if(!smarty_core_is_secure($_params, $smarty)) {
+ $smarty->_trigger_fatal_error('[plugin] (secure mode) fetch \'' . $params['file'] . '\' is not allowed');
+ return;
+ }
+
+ // fetch the file
+ if($fp = @fopen($params['file'],'r')) {
+ while(!feof($fp)) {
+ $content .= fgets ($fp,4096);
+ }
+ fclose($fp);
+ } else {
+ $smarty->_trigger_fatal_error('[plugin] fetch cannot read file \'' . $params['file'] . '\'');
+ return;
+ }
+ } else {
+ // not a local file
+ if(preg_match('!^http://!i',$params['file'])) {
+ // http fetch
+ if($uri_parts = parse_url($params['file'])) {
+ // set defaults
+ $host = $server_name = $uri_parts['host'];
+ $timeout = 30;
+ $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*";
+ $agent = "Smarty Template Engine ".$smarty->_version;
+ $referer = "";
+ $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/';
+ $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : '';
+ $_is_proxy = false;
+ if(empty($uri_parts['port'])) {
+ $port = 80;
+ } else {
+ $port = $uri_parts['port'];
+ }
+ if(!empty($uri_parts['user'])) {
+ $user = $uri_parts['user'];
+ }
+ if(!empty($uri_parts['pass'])) {
+ $pass = $uri_parts['pass'];
+ }
+ // loop through parameters, setup headers
+ foreach($params as $param_key => $param_value) {
+ switch($param_key) {
+ case "file":
+ case "assign":
+ case "assign_headers":
+ break;
+ case "user":
+ if(!empty($param_value)) {
+ $user = $param_value;
+ }
+ break;
+ case "pass":
+ if(!empty($param_value)) {
+ $pass = $param_value;
+ }
+ break;
+ case "accept":
+ if(!empty($param_value)) {
+ $accept = $param_value;
+ }
+ break;
+ case "header":
+ if(!empty($param_value)) {
+ if(!preg_match('![\w\d-]+: .+!',$param_value)) {
+ $smarty->_trigger_fatal_error("[plugin] invalid header format '".$param_value."'");
+ return;
+ } else {
+ $extra_headers[] = $param_value;
+ }
+ }
+ break;
+ case "proxy_host":
+ if(!empty($param_value)) {
+ $proxy_host = $param_value;
+ }
+ break;
+ case "proxy_port":
+ if(!preg_match('!\D!', $param_value)) {
+ $proxy_port = (int) $param_value;
+ } else {
+ $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'");
+ return;
+ }
+ break;
+ case "agent":
+ if(!empty($param_value)) {
+ $agent = $param_value;
+ }
+ break;
+ case "referer":
+ if(!empty($param_value)) {
+ $referer = $param_value;
+ }
+ break;
+ case "timeout":
+ if(!preg_match('!\D!', $param_value)) {
+ $timeout = (int) $param_value;
+ } else {
+ $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'");
+ return;
+ }
+ break;
+ default:
+ $smarty->_trigger_fatal_error("[plugin] unrecognized attribute '".$param_key."'");
+ return;
+ }
+ }
+ if(!empty($proxy_host) && !empty($proxy_port)) {
+ $_is_proxy = true;
+ $fp = fsockopen($proxy_host,$proxy_port,$errno,$errstr,$timeout);
+ } else {
+ $fp = fsockopen($server_name,$port,$errno,$errstr,$timeout);
+ }
+
+ if(!$fp) {
+ $smarty->_trigger_fatal_error("[plugin] unable to fetch: $errstr ($errno)");
+ return;
+ } else {
+ if($_is_proxy) {
+ fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n");
+ } else {
+ fputs($fp, "GET $uri HTTP/1.0\r\n");
+ }
+ if(!empty($host)) {
+ fputs($fp, "Host: $host\r\n");
+ }
+ if(!empty($accept)) {
+ fputs($fp, "Accept: $accept\r\n");
+ }
+ if(!empty($agent)) {
+ fputs($fp, "User-Agent: $agent\r\n");
+ }
+ if(!empty($referer)) {
+ fputs($fp, "Referer: $referer\r\n");
+ }
+ if(isset($extra_headers) && is_array($extra_headers)) {
+ foreach($extra_headers as $curr_header) {
+ fputs($fp, $curr_header."\r\n");
+ }
+ }
+ if(!empty($user) && !empty($pass)) {
+ fputs($fp, "Authorization: BASIC ".base64_encode("$user:$pass")."\r\n");
+ }
+
+ fputs($fp, "\r\n");
+ while(!feof($fp)) {
+ $content .= fgets($fp,4096);
+ }
+ fclose($fp);
+ $csplit = split("\r\n\r\n",$content,2);
+
+ $content = $csplit[1];
+
+ if(!empty($params['assign_headers'])) {
+ $smarty->assign($params['assign_headers'],split("\r\n",$csplit[0]));
+ }
+ }
+ } else {
+ $smarty->_trigger_fatal_error("[plugin] unable to parse URL, check syntax");
+ return;
+ }
+ } else {
+ // ftp fetch
+ if($fp = @fopen($params['file'],'r')) {
+ while(!feof($fp)) {
+ $content .= fgets ($fp,4096);
+ }
+ fclose($fp);
+ } else {
+ $smarty->_trigger_fatal_error('[plugin] fetch cannot read file \'' . $params['file'] .'\'');
+ return;
+ }
+ }
+
+ }
+
+
+ if (!empty($params['assign'])) {
+ $smarty->assign($params['assign'],$content);
+ } else {
+ return $content;
+ }
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/plugins/function.fetch.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/plugins/function.html_checkboxes.php
===================================================================
--- trunk/lib/smarty/plugins/function.html_checkboxes.php (rev 0)
+++ trunk/lib/smarty/plugins/function.html_checkboxes.php 2008-10-15 14:01:19 UTC (rev 12)
@@ -0,0 +1,143 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_checkboxes} function plugin
+ *
+ * File: function.html_checkboxes.php<br>
+ * Type: function<br>
+ * Name: html_checkboxes<br>
+ * Date: 24.Feb.2003<br>
+ * Purpose: Prints out a list of checkbox input types<br>
+ * Input:<br>
+ * - name (optional) - string default "checkbox"
+ * - values (required) - array
+ * - options (optional) - associative array
+ * - checked (optional) - array default not set
+ * - separator (optional) - ie <br> or
+ * - output (optional) - the output next to each checkbox
+ * - assign (optional) - assign the output as an array to this variable
+ * Examples:
+ * <pre>
+ * {html_checkboxes values=$ids output=$names}
+ * {html_checkboxes values=$ids name='box' separator='<br>' output=$names}
+ * {html_checkboxes values=$ids checked=$checked separator='<br>' output=$names}
+ * </pre>
+ * @link http://smarty.php.net/manual/en/language.function.html.checkboxes.php {html_checkboxes}
+ * (Smarty online manual)
+ * @author Christopher Kvarme <chr...@fl...>
+ * @author credits to Monte Ohrt <monte at ohrt dot com>
+ * @version 1.0
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_checkboxes($params, &$smarty)
+{
+ require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+
+ $name = 'checkbox';
+ $values = null;
+ $options = null;
+ $selected = null;
+ $separator = '';
+ $labels = true;
+ $output = null;
+
+ $extra = '';
+
+ foreach($params as $_key => $_val) {
+ switch($_key) {
+ case 'name':
+ case 'separator':
+ $$_key = $_val;
+ break;
+
+ case 'labels':
+ $$_key = (bool)$_val;
+ break;
+
+ case 'options':
+ $$_key = (array)$_val;
+ break;
+
+ case 'values':
+ case 'output':
+ $$_key = array_values((array)$_val);
+ break;
+
+ case 'checked':
+ case 'selected':
+ $selected = array_map('strval', array_values((array)$_val));
+ break;
+
+ case 'checkboxes':
+ $smarty->trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING);
+ $options = (array)$_val;
+ break;
+
+ case 'assign':
+ break;
+
+ default:
+ if(!is_array($_val)) {
+ $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+ } else {
+ $smarty->trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+ }
+ break;
+ }
+ }
+
+ if (!isset($options) && !isset($values))
+ return ''; /* raise error here? */
+
+ settype($selected, 'array');
+ $_html_result = array();
+
+ if (isset($options)) {
+
+ foreach ($options as $_key=>$_val)
+ $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
+
+
+ } else {
+ foreach ($values as $_i=>$_key) {
+ $_val = isset($output[$_i]) ? $output[$_i] : '';
+ $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
+ }
+
+ }
+
+ if(!empty($params['assign'])) {
+ $smarty->assign($params['assign'], $_html_result);
+ } else {
+ return implode("\n",$_html_result);
+ }
+
+}
+
+function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels) {
+ $_output = '';
+ if ($labels) $_output .= '<label>';
+ $_output .= '<input type="checkbox" name="'
+ . smarty_function_escape_special_chars($name) . '[]" value="'
+ . smarty_function_escape_special_chars($value) . '"';
+
+ if (in_array((string)$value, $selected)) {
+ $_output .= ' checked="checked"';
+ }
+ $_output .= $extra . ' />' . $output;
+ if ($labels) $_output .= '</label>';
+ $_output .= $separator;
+
+ return $_output;
+}
+
+?>
Property changes on: trunk/lib/smarty/plugins/function.html_checkboxes.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/plugins/function.html_image.php
===================================================================
--- trunk/lib/smarty/plugins/function.html_image.php (rev 0)
+++ trunk/lib/smarty/plugins/function.html_image.php 2008-10-15 14:01:19 UTC (rev 12)
@@ -0,0 +1,142 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_image} function plugin
+ *
+ * Type: function<br>
+ * Name: html_image<br>
+ * Date: Feb 24, 2003<br>
+ * Purpose: format HTML tags for the image<br>
+ * Input:<br>
+ * - file = file (and path) of image (required)
+ * - height = image height (optional, default actual height)
+ * - width = image width (optional, default actual width)
+ * - basedir = base directory for absolute paths, default
+ * is environment variable DOCUMENT_ROOT
+ * - path_prefix = prefix for path output (optional, default empty)
+ *
+ * Examples: {html_image file="/images/masthead.gif"}
+ * Output: <img src="/images/masthead.gif" width=400 height=23>
+ * @link http://smarty.php.net/manual/en/language.function.html.image.php {html_image}
+ * (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author credits to Duda <du...@bi...> - wrote first image function
+ * in repository, helped with lots of functionality
+ * @version 1.0
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_image($params, &$smarty)
+{
+ require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+
+ $alt = '';
+ $file = '';
+ $height = '';
+ $width = '';
+ $extra = '';
+ $prefix = '';
+ $suffix = '';
+ $path_prefix = '';
+ $server_vars = ($smarty->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
+ $basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : '';
+ foreach($params as $_key => $_val) {
+ switch($_key) {
+ case 'file':
+ case 'height':
+ case 'width':
+ case 'dpi':
+ case 'path_prefix':
+ case 'basedir':
+ $$_key = $_val;
+ break;
+
+ case 'alt':
+ if(!is_array($_val)) {
+ $$_key = smarty_function_escape_special_chars($_val);
+ } else {
+ $smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+ }
+ break;
+
+ case 'link':
+ case 'href':
+ $prefix = '<a href="' . $_val . '">';
+ $suffix = '</a>';
+ break;
+
+ default:
+ if(!is_array($_val)) {
+ $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+ } else {
+ $smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+ }
+ break;
+ }
+ }
+
+ if (empty($file)) {
+ $smarty->trigger_error("html_image: missing 'file' parameter", E_USER_NOTICE);
+ return;
+ }
+
+ if (substr($file,0,1) == '/') {
+ $_image_path = $basedir . $file;
+ } else {
+ $_image_path = $file;
+ }
+
+ if(!isset($params['width']) || !isset($params['height'])) {
+ if(!$_image_data = @getimagesize($_image_path)) {
+ if(!file_exists($_image_path)) {
+ $smarty->trigger_error("html_image: unable to find '$_image_path'", E_USER_NOTICE);
+ return;
+ } else if(!is_readable($_image_path)) {
+ $smarty->trigger_error("html_image: unable to read '$_image_path'", E_USER_NOTICE);
+ return;
+ } else {
+ $smarty->trigger_error("html_image: '$_image_path' is not a valid image file", E_USER_NOTICE);
+ return;
+ }
+ }
+ if ($smarty->security &&
+ ($_params = array('resource_type' => 'file', 'resource_name' => $_image_path)) &&
+ (require_once(SMARTY_CORE_DIR . 'core.is_secure.php')) &&
+ (!smarty_core_is_secure($_params, $smarty)) ) {
+ $smarty->trigger_error("html_image: (secure) '$_image_path' not in secure directory", E_USER_NOTICE);
+ }
+
+ if(!isset($params['width'])) {
+ $width = $_image_data[0];
+ }
+ if(!isset($params['height'])) {
+ $height = $_image_data[1];
+ }
+
+ }
+
+ if(isset($params['dpi'])) {
+ if(strstr($server_vars['HTTP_USER_AGENT'], 'Mac')) {
+ $dpi_default = 72;
+ } else {
+ $dpi_default = 96;
+ }
+ $_resize = $dpi_default/$params['dpi'];
+ $width = round($width * $_resize);
+ $height = round($height * $_resize);
+ }
+
+ return $prefix . '<img src="'.$path_prefix.$file.'" alt="'.$alt.'" width="'.$width.'" height="'.$height.'"'.$extra.' />' . $suffix;
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/plugins/function.html_image.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/plugins/function.html_options.php
===================================================================
--- trunk/lib/smarty/plugins/function.html_options.php (rev 0)
+++ trunk/lib/smarty/plugins/function.html_options.php 2008-10-15 14:01:19 UTC (rev 12)
@@ -0,0 +1,122 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_options} function plugin
+ *
+ * Type: function<br>
+ * Name: html_options<br>
+ * Input:<br>
+ * - name (optional) - string default "select"
+ * - values (required if no options supplied) - array
+ * - options (required if no values supplied) - associative array
+ * - selected (optional) - string default not set
+ * - output (required if not options supplied) - array
+ * Purpose: Prints the list of <option> tags generated from
+ * the passed parameters
+ * @link http://smarty.php.net/manual/en/language.function.html.options.php {html_image}
+ * (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_options($params, &$smarty)
+{
+ require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+
+ $name = null;
+ $values = null;
+ $options = null;
+ $selected = array();
+ $output = null;
+
+ $extra = '';
+
+ foreach($params as $_key => $_val) {
+ switch($_key) {
+ case 'name':
+ $$_key = (string)$_val;
+ break;
+
+ case 'options':
+ $$_key = (array)$_val;
+ break;
+
+ case 'values':
+ case 'output':
+ $$_key = array_values((array)$_val);
+ break;
+
+ case 'selected':
+ $$_key = array_map('strval', array_values((array)$_val));
+ break;
+
+ default:
+ if(!is_array($_val)) {
+ $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+ } else {
+ $smarty->trigger_error("html_options: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+ }
+ break;
+ }
+ }
+
+ if (!isset($options) && !isset($values))
+ return ''; /* raise error here? */
+
+ $_html_result = '';
+
+ if (isset($options)) {
+
+ foreach ($options as $_key=>$_val)
+ $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
+
+ } else {
+
+ foreach ($values as $_i=>$_key) {
+ $_val = isset($output[$_i]) ? $output[$_i] : '';
+ $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
+ }
+
+ }
+
+ if(!empty($name)) {
+ $_html_result = '<select name="' . $name . '"' . $extra . '>' . "\n" . $_html_result . '</select>' . "\n";
+ }
+
+ return $_html_result;
+
+}
+
+function smarty_function_html_options_optoutput($key, $value, $selected) {
+ if(!is_array($value)) {
+ $_html_result = '<option label="' . smarty_function_escape_special_chars($value) . '" value="' .
+ smarty_function_escape_special_chars($key) . '"';
+ if (in_array((string)$key, $selected))
+ $_html_result .= ' selected="selected"';
+ $_html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n";
+ } else {
+ $_html_result = smarty_function_html_options_optgroup($key, $value, $selected);
+ }
+ return $_html_result;
+}
+
+function smarty_function_html_options_optgroup($key, $values, $selected) {
+ $optgroup_html = '<optgroup label="' . smarty_function_escape_special_chars($key) . '">' . "\n";
+ foreach ($values as $key => $value) {
+ $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected);
+ }
+ $optgroup_html .= "</optgroup>\n";
+ return $optgroup_html;
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/plugins/function.html_options.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/plugins/function.html_radios.php
===================================================================
--- trunk/lib/smarty/plugins/function.html_radios.php (rev 0)
+++ trunk/lib/smarty/plugins/function.html_radios.php 2008-10-15 14:01:19 UTC (rev 12)
@@ -0,0 +1,156 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_radios} function plugin
+ *
+ * File: function.html_radios.php<br>
+ * Type: function<br>
+ * Name: html_radios<br>
+ * Date: 24.Feb.2003<br>
+ * Purpose: Prints out a list of radio input types<br>
+ * Input:<br>
+ * - name (optional) - string default "radio"
+ * - values (required) - array
+ * - options (optional) - associative array
+ * - checked (optional) - array default not set
+ * - separator (optional) - ie <br> or
+ * - output (optional) - the output next to each radio button
+ * - assign (optional) - assign the output as an array to this variable
+ * Examples:
+ * <pre>
+ * {html_radios values=$ids output=$names}
+ * {html_radios values=$ids name='box' separator='<br>' output=$names}
+ * {html_radios values=$ids checked=$checked separator='<br>' output=$names}
+ * </pre>
+ * @link http://smarty.php.net/manual/en/language.function.html.radios.php {html_radios}
+ * (Smarty online manual)
+ * @author Christopher Kvarme <chr...@fl...>
+ * @author credits to Monte Ohrt <monte at ohrt dot com>
+ * @version 1.0
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_radios($params, &$smarty)
+{
+ require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+
+ $name = 'radio';
+ $values = null;
+ $options = null;
+ $selected = null;
+ $separator = '';
+ $labels = true;
+ $label_ids = false;
+ $output = null;
+ $extra = '';
+
+ foreach($params as $_key => $_val) {
+ switch($_key) {
+ case 'name':
+ case 'separator':
+ $$_key = (string)$_val;
+ break;
+
+ case 'checked':
+ case 'selected':
+ if(is_array($_val)) {
+ $smarty->trigger_error('html_radios: the "' . $_key . '" attribute cannot be an array', E_USER_WARNING);
+ } else {
+ $selected = (string)$_val;
+ }
+ break;
+
+ case 'labels':
+ case 'label_ids':
+ $$_key = (bool)$_val;
+ break;
+
+ case 'options':
+ $$_key = (array)$_val;
+ break;
+
+ case 'values':
+ case 'output':
+ $$_key = array_values((array)$_val);
+ break;
+
+ case 'radios':
+ $smarty->trigger_error('html_radios: the use of the "radios" attribute is deprecated, use "options" instead', E_USER_WARNING);
+ $options = (array)$_val;
+ break;
+
+ case 'assign':
+ break;
+
+ default:
+ if(!is_array($_val)) {
+ $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+ } else {
+ $smarty->trigger_error("html_radios: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+ }
+ break;
+ }
+ }
+
+ if (!isset($options) && !isset($values))
+ return ''; /* raise error here? */
+
+ $_html_result = array();
+
+ if (isset($options)) {
+
+ foreach ($options as $_key=>$_val)
+ $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids);
+
+ } else {
+
+ foreach ($values as $_i=>$_key) {
+ $_val = isset($output[$_i]) ? $output[$_i] : '';
+ $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids);
+ }
+
+ }
+
+ if(!empty($params['assign'])) {
+ $smarty->assign($params['assign'], $_html_result);
+ } else {
+ return implode("\n",$_html_result);
+ }
+
+}
+
+function smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids) {
+ $_output = '';
+ if ($labels) {
+ if($label_ids) {
+ $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!', '_', $name . '_' . $value));
+ $_output .= '<label for="' . $_id . '">';
+ } else {
+ $_output .= '<label>';
+ }
+ }
+ $_output .= '<input type="radio" name="'
+ . smarty_function_escape_special_chars($name) . '" value="'
+ . smarty_function_escape_special_chars($value) . '"';
+
+ if ($labels && $label_ids) $_output .= ' id="' . $_id . '"';
+
+ if ((string)$value==$selected) {
+ $_output .= ' checked="checked"';
+ }
+ $_output .= $extra . ' />' . $output;
+ if ($labels) $_output .= '</label>';
+ $_output .= $separator;
+
+ return $_output;
+}
+
+?>
Property changes on: trunk/lib/smarty/plugins/function.html_radios.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/plugins/function.html_select_date.php
===================================================================
--- trunk/lib/smarty/plugins/function.html_select_date.php (rev 0)
+++ trunk/lib/smarty/plugins/function.html_select_date.php 2008-10-15 14:01:19 UTC (rev 12)
@@ -0,0 +1,331 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {html_select_date} plugin
+ *
+ * Type: function<br>
+ * Name: html_select_date<br>
+ * Purpose: Prints the dropdowns for date selection.
+ *
+ * ChangeLog:<br>
+ * - 1.0 initial release
+ * - 1.1 added support for +/- N syntax for begin
+ * and end year values. (Monte)
+ * - 1.2 added support for yyyy-mm-dd syntax for
+ * time value. (Jan Rosier)
+ * - 1.3 added support for choosing format for
+ * month values (Gary Loescher)
+ * - 1.3.1 added support for choosing format for
+ * day values (Marcus Bointon)
+ * - 1.3.2 support negative timestamps, force year
+ * dropdown to include given date unless explicitly set (Monte)
+ * - 1.3.4 fix behaviour of 0000-00-00 00:00:00 dates to match that
+ * of 0000-00-00 dates (cybot, boots)
+ * @link http://smarty.php.net/manual/en/language.function.html.select.date.php {html_select_date}
+ * (Smarty online manual)
+ * @version 1.3.4
+ * @author Andrei Zmievski
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ * @return string
+ */
+function smarty_function_html_select_date($params, &$smarty)
+{
+ require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+ require_once $smarty->_get_plugin_filepath('shared','make_timestamp');
+ require_once $smarty->_get_plugin_filepath('function','html_options');
+ /* Default values. */
+ $prefix = "Date_";
+ $start_year = strftime("%Y");
+ $end_year = $start_year;
+ $display_days = true;
+ $display_months = true;
+ $display_years = true;
+ $month_format = "%B";
+ /* Write months as numbers by default GL */
+ $month_value_format = "%m";
+ $day_format = "%02d";
+ /* Write day values using this format MB */
+ $day_value_format = "%d";
+ $year_as_text = false;
+ /* Display years in reverse order? Ie. 2000,1999,.... */
+ $reverse_years = false;
+ /* Should the select boxes be part of an array when returned from PHP?
+ e.g. setting it to "birthday", would create "birthday[Day]",
+ "birthday[Month]" & "birthday[Year]". Can be combined with prefix */
+ $field_array = null;
+ /* <select size>'s of the different <select> tags.
+ If not set, uses default dropdown. */
+ $day_size = null;
+ $month_size = null;
+ $year_size = null;
+ /* Unparsed attributes common to *ALL* the <select>/<input> tags.
+ An example might be in the template: all_extra ='class ="foo"'. */
+ $all_extra = null;
+ /* Separate attributes for the tags. */
+ $day_extra = null;
+ $month_extra = null;
+ $year_extra = null;
+ /* Order in which to display the fields.
+ "D" -> day, "M" -> month, "Y" -> year. */
+ $field_order = 'MDY';
+ /* String printed between the different fields. */
+ $field_separator = "\n";
+ $time = time();
+ $all_empty = null;
+ ...
[truncated message content] |
|
From: <ts...@us...> - 2008-10-15 14:27:21
|
Revision: 4
http://openupload.svn.sourceforge.net/openupload/?rev=4&view=rev
Author: tsdogs
Date: 2008-10-15 13:38:37 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
Reorganization
Added Paths:
-----------
trunk/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-15 14:21:03
|
Revision: 18
http://openupload.svn.sourceforge.net/openupload/?rev=18&view=rev
Author: tsdogs
Date: 2008-10-15 14:18:21 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
Branches and Web place
Added Paths:
-----------
branches/
web/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-15 14:13:06
|
Revision: 17
http://openupload.svn.sourceforge.net/openupload/?rev=17&view=rev
Author: tsdogs
Date: 2008-10-15 14:12:06 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
First svn commit
Added Paths:
-----------
trunk/plugins/securimage/LICENSE.txt
trunk/plugins/securimage/README.txt
trunk/plugins/securimage/elephant.ttf
trunk/plugins/securimage/example_form.php
trunk/plugins/securimage/gdfonts/
trunk/plugins/securimage/gdfonts/automatic.gdf
trunk/plugins/securimage/gdfonts/bubblebath.gdf
trunk/plugins/securimage/gdfonts/caveman.gdf
trunk/plugins/securimage/gdfonts/crass.gdf
trunk/plugins/securimage/images/
trunk/plugins/securimage/images/audio_icon.gif
trunk/plugins/securimage/images/refresh.gif
trunk/plugins/securimage/securimage.php
trunk/plugins/securimage/securimage_example.php
trunk/plugins/securimage/securimage_play.php
trunk/plugins/securimage/securimage_show.php
Added: trunk/plugins/securimage/LICENSE.txt
===================================================================
--- trunk/plugins/securimage/LICENSE.txt (rev 0)
+++ trunk/plugins/securimage/LICENSE.txt 2008-10-15 14:12:06 UTC (rev 17)
@@ -0,0 +1,458 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
Added: trunk/plugins/securimage/README.txt
===================================================================
--- trunk/plugins/securimage/README.txt (rev 0)
+++ trunk/plugins/securimage/README.txt 2008-10-15 14:12:06 UTC (rev 17)
@@ -0,0 +1,57 @@
+NAME:
+
+ Securimage - A PHP class for creating and managing form CAPTCHA images
+
+VERSION: 1.0.2
+
+AUTHOR:
+
+ Drew Phillips <dr...@dr...>
+
+DOWNLOAD:
+
+ The latest version can always be
+ found at http://www.phpcaptcha.org
+
+DOCUMENTATION:
+
+ Online documentation of the class, methods, and variables can
+ be found at http://www.phpcaptcha.org/Securimage_Docs/
+
+REQUIREMENTS:
+ PHP 4.3.0
+ GD 2.0
+ FreeType (optional, required for TTF support)
+
+SYNOPSIS:
+
+ require_once 'securimage.php';
+
+ $image = new Securimage();
+
+ $image->show();
+
+ // Code Validation
+
+ $image = new Securimage();
+ if ($image->check($_POST['code']) == true) {
+ echo "Correct!";
+ } else {
+ echo "Sorry, wrong code.";
+ }
+
+DESCRIPTION:
+
+ What is Securimage?
+
+ Securimage is a PHP class that is used to generate and validate CAPTCHA images.
+ The classes uses an existing PHP session or creates its own if none is found to store the
+ CAPTCHA code. Variables within the class are used to control the style and display of the image.
+ The class supports TTF fonts and effects for strengthening the security of the image.
+ If TTF support is not available, GD fonts can be used as well, but certain options such as
+ transparent text and angled letters cannot be used.
+
+
+COPYRIGHT:
+ Copyright (c) 2007 Drew Phillips. All rights reserved.
+ This software is released under the GNU Lesser General Public License.
Added: trunk/plugins/securimage/elephant.ttf
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/securimage/elephant.ttf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/securimage/example_form.php
===================================================================
--- trunk/plugins/securimage/example_form.php (rev 0)
+++ trunk/plugins/securimage/example_form.php 2008-10-15 14:12:06 UTC (rev 17)
@@ -0,0 +1,78 @@
+<?php
+
+/**
+ * Project: Securimage: A PHP class for creating and managing form CAPTCHA images<br />
+ * File: form.php<br /><br />
+ *
+ * This is a very simple form sending a username and password.<br />
+ * It demonstrates how you can integrate the image script into your code.<br />
+ * By creating a new instance of the class and passing the user entered code as the only parameter, you can then immediately call $obj->checkCode() which will return true if the code is correct, or false otherwise.<br />
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or any later version.<br /><br />
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.<br /><br />
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA<br /><br />
+ *
+ * Any modifications to the library should be indicated clearly in the source code
+ * to inform users that the changes are not a part of the original software.<br /><br />
+ *
+ * If you found this script useful, please take a quick moment to rate it.<br />
+ * http://www.hotscripts.com/rate/49400.html Thanks.
+ *
+ * @link http://www.phpcaptcha.org Securimage PHP CAPTCHA
+ * @link http://www.phpcaptcha.org/latest.zip Download Latest Version
+ * @link http://www.phpcaptcha.org/Securimage_Docs/ Online Documentation
+ * @copyright 2007 Drew Phillips
+ * @author drew010 <dr...@dr...>
+ * @version 1.0.3.1 (March 23, 2008)
+ * @package Securimage
+ *
+ */ ?>
+<html>
+<head>
+ <title>Securimage Test Form</title>
+</head>
+
+<body>
+
+<?php
+if (empty($_POST)) { ?>
+<form method="POST">
+Username:<br />
+<input type="text" name="username" /><br />
+Password:<br />
+<input type="text" name="password" /><br />
+
+<!-- pass a session id to the query string of the script to prevent ie caching -->
+<img src="securimage_show.php?sid=<?php echo md5(uniqid(time())); ?>"><br />
+<input type="text" name="code" /><br />
+
+<input type="submit" value="Submit Form" />
+</form>
+
+<?php
+} else { //form is posted
+ include("securimage.php");
+ $img = new Securimage();
+ $valid = $img->check($_POST['code']);
+
+ if($valid == true) {
+ echo "<center>Thanks, you entered the correct code.</center>";
+ } else {
+ echo "<center>Sorry, the code you entered was invalid. <a href=\"javascript:history.go(-1)\">Go back</a> to try again.</center>";
+ }
+}
+
+?>
+
+</body>
+</html>
Added: trunk/plugins/securimage/gdfonts/automatic.gdf
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/securimage/gdfonts/automatic.gdf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/securimage/gdfonts/bubblebath.gdf
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/securimage/gdfonts/bubblebath.gdf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/securimage/gdfonts/caveman.gdf
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/securimage/gdfonts/caveman.gdf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/securimage/gdfonts/crass.gdf
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/securimage/gdfonts/crass.gdf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/securimage/images/audio_icon.gif
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/securimage/images/audio_icon.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/securimage/images/refresh.gif
===================================================================
(Binary files differ)
Property changes on: trunk/plugins/securimage/images/refresh.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/plugins/securimage/securimage.php
===================================================================
--- trunk/plugins/securimage/securimage.php (rev 0)
+++ trunk/plugins/securimage/securimage.php 2008-10-15 14:12:06 UTC (rev 17)
@@ -0,0 +1,932 @@
+<?php
+
+/**
+ * Project: Securimage: A PHP class for creating and managing form CAPTCHA images<br />
+ * File: securimage.php<br />
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or any later version.<br /><br />
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.<br /><br />
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA<br /><br />
+ *
+ * Any modifications to the library should be indicated clearly in the source code
+ * to inform users that the changes are not a part of the original software.<br /><br />
+ *
+ * If you found this script useful, please take a quick moment to rate it.<br />
+ * http://www.hotscripts.com/rate/49400.html Thanks.
+ *
+ * @link http://www.phpcaptcha.org Securimage PHP CAPTCHA
+ * @link http://www.phpcaptcha.org/latest.zip Download Latest Version
+ * @link http://www.phpcaptcha.org/Securimage_Docs/ Online Documentation
+ * @copyright 2007 Drew Phillips
+ * @author drew010 <dr...@dr...>
+ * @version 1.0.3.1 (March 24, 2008)
+ * @package Securimage
+ *
+ */
+
+/**
+ ChangeLog
+
+ 1.0.3.1
+ - Error reading from wordlist in some cases caused words to be cut off 1 letter short
+
+ 1.0.3
+ - Removed shadow_text from code which could cause an undefined property error due to removal from previous version
+
+ 1.0.2
+ - Audible CAPTCHA Code wav files
+ - Create codes from a word list instead of random strings
+
+ 1.0
+ - Added the ability to use a selected character set, rather than a-z0-9 only.
+ - Added the multi-color text option to use different colors for each letter.
+ - Switched to automatic session handling instead of using files for code storage
+ - Added GD Font support if ttf support is not available. Can use internal GD fonts or load new ones.
+ - Added the ability to set line thickness
+ - Added option for drawing arced lines over letters
+ - Added ability to choose image type for output
+
+*/
+
+/**
+ * Output images in JPEG format
+ */
+define('SI_IMAGE_JPEG', 1);
+/**
+ * Output images in PNG format
+ */
+define('SI_IMAGE_PNG', 2);
+/**
+ * Output images in GIF format
+ * Must have GD >= 2.0.28!
+ */
+define('SI_IMAGE_GIF', 3);
+
+/**
+ * Securimage CAPTCHA Class.
+ *
+ * @package Securimage
+ * @subpackage classes
+ *
+ */
+class Securimage {
+
+ /**
+ * The desired width of the CAPTCHA image.
+ *
+ * @var int
+ */
+ var $image_width = 175;
+
+ /**
+ * The desired width of the CAPTCHA image.
+ *
+ * @var int
+ */
+ var $image_height = 45;
+
+ /**
+ * The image format for output.<br />
+ * Valid options: SI_IMAGE_PNG, SI_IMAGE_JPG, SI_IMAGE_GIF
+ *
+ * @var int
+ */
+ var $image_type = SI_IMAGE_PNG;
+
+ /**
+ * The length of the code to generate.
+ *
+ * @var int
+ */
+ var $code_length = 4;
+
+ /**
+ * The character set for individual characters in the image.<br />
+ * Letters are converted to uppercase.<br />
+ * The font must support the letters or there may be problematic substitutions.
+ *
+ * @var string
+ */
+ var $charset = 'ABCDEFGHKLMNPRSTUVWYZ23456789';
+ //var $charset = '0123456789';
+
+ /**
+ * Create codes using this word list
+ *
+ * @var string The path to the word list to use for creating CAPTCHA codes
+ */
+ var $wordlist_file = '../words/words.txt';
+
+ /**
+ * True to use a word list file instead of a random code
+ *
+ * @var bool
+ */
+ var $use_wordlist = true;
+
+ /**
+ * Whether to use a GD font instead of a TTF font.<br />
+ * TTF offers more support and options, but use this if your PHP doesn't support TTF.<br />
+ *
+ * @var boolean
+ */
+ var $use_gd_font = false;
+
+ /**
+ * The GD font to use.<br />
+ * Internal gd fonts can be loaded by their number.<br />
+ * Alternatively, a file path can be given and the font will be loaded from file.
+ *
+ * @var mixed
+ */
+ var $gd_font_file = 'gdfonts/bubblebath.gdf';
+
+ /**
+ * The approximate size of the font in pixels.<br />
+ * This does not control the size of the font because that is determined by the GD font itself.<br />
+ * This is used to aid the calculations of positioning used by this class.<br />
+ *
+ * @var int
+ */
+ var $gd_font_size = 20;
+
+ // Note: These font options below do not apply if you set $use_gd_font to true with the exception of $text_color
+
+ /**
+ * The path to the TTF font file to load.
+ *
+ * @var string
+ */
+ var $ttf_file = "./elephant.ttf";
+
+ /**
+ * The font size.<br />
+ * Depending on your version of GD, this should be specified as the pixel size (GD1) or point size (GD2)<br />
+ *
+ * @var int
+ */
+ var $font_size = 24;
+
+ /**
+ * The minimum angle in degrees, with 0 degrees being left-to-right reading text.<br />
+ * Higher values represent a counter-clockwise rotation.<br />
+ * For example, a value of 90 would result in bottom-to-top reading text.
+ *
+ * @var int
+ */
+ var $text_angle_minimum = -20;
+
+ /**
+ * The minimum angle in degrees, with 0 degrees being left-to-right reading text.<br />
+ * Higher values represent a counter-clockwise rotation.<br />
+ * For example, a value of 90 would result in bottom-to-top reading text.
+ *
+ * @var int
+ */
+ var $text_angle_maximum = 20;
+
+ /**
+ * The X-Position on the image where letter drawing will begin.<br />
+ * This value is in pixels from the left side of the image.
+ *
+ * @var int
+ */
+ var $text_x_start = 8;
+
+ /**
+ * Letters can be spaced apart at random distances.<br />
+ * This is the minimum distance between two letters.<br />
+ * This should be <i>at least</i> as wide as a font character.<br />
+ * Small values can cause letters to be drawn over eachother.<br />
+ *
+ * @var int
+ */
+ var $text_minimum_distance = 30;
+
+ /**
+ * Letters can be spaced apart at random distances.<br />
+ * This is the maximum distance between two letters.<br />
+ * This should be <i>at least</i> as wide as a font character.<br />
+ * Small values can cause letters to be drawn over eachother.<br />
+ *
+ * @var int
+ */
+ var $text_maximum_distance = 33;
+
+ /**
+ * The background color for the image.<br />
+ * This should be specified in HTML hex format.<br />
+ * Make sure to include the preceding # sign!
+ *
+ * @var string
+ */
+ var $image_bg_color = "#e3daed";
+
+ /**
+ * The text color to use for drawing characters.<br />
+ * This value is ignored if $use_multi_text is set to true.<br />
+ * Make sure this contrasts well with the background color.<br />
+ * Specify the color in HTML hex format with preceding # sign
+ *
+ * @see Securimage::$use_multi_text
+ * @var string
+ */
+ var $text_color = "#ff0000";
+
+ /**
+ * Set to true to use multiple colors for each character.
+ *
+ * @see Securimage::$multi_text_color
+ * @var boolean
+ */
+ var $use_multi_text = true;
+
+ /**
+ * String of HTML hex colors to use.<br />
+ * Separate each possible color with commas.<br />
+ * Be sure to precede each value with the # sign.
+ *
+ * @var string
+ */
+ var $multi_text_color = "#0a68dd,#f65c47,#8d32fd";
+
+ /**
+ * Set to true to make the characters appear transparent.
+ *
+ * @see Securimage::$text_transparency_percentage
+ * @var boolean
+ */
+ var $use_transparent_text = true;
+
+ /**
+ * The percentage of transparency, 0 to 100.<br />
+ * A value of 0 is completely opaque, 100 is completely transparent (invisble)
+ *
+ * @see Securimage::$use_transparent_text
+ * @var int
+ */
+ var $text_transparency_percentage = 15;
+
+
+ // Line options
+ /**
+ * Draw vertical and horizontal lines on the image.
+ *
+ * @see Securimage::$line_color
+ * @see Securimage::$line_distance
+ * @see Securimage::$line_thickness
+ * @see Securimage::$draw_lines_over_text
+ * @var boolean
+ */
+ var $draw_lines = true;
+
+ /**
+ * The color of the lines drawn on the image.<br />
+ * Use HTML hex format with preceding # sign.
+ *
+ * @see Securimage::$draw_lines
+ * @var string
+ */
+ var $line_color = "#80BFFF";
+
+ /**
+ * How far apart to space the lines from eachother in pixels.
+ *
+ * @see Securimage::$draw_lines
+ * @var int
+ */
+ var $line_distance = 5;
+
+ /**
+ * How thick to draw the lines in pixels.<br />
+ * 1-3 is ideal depending on distance
+ *
+ * @see Securimage::$draw_lines
+ * @see Securimage::$line_distance
+ * @var int
+ */
+ var $line_thickness = 1;
+
+ /**
+ * Set to true to draw angled lines on the image in addition to the horizontal and vertical lines.
+ *
+ * @see Securimage::$draw_lines
+ * @var boolean
+ */
+ var $draw_angled_lines = false;
+
+ /**
+ * Draw the lines over the text.<br />
+ * If fales lines will be drawn before putting the text on the image.<br />
+ * This can make the image hard for humans to read depending on the line thickness and distance.
+ *
+ * @var boolean
+ */
+ var $draw_lines_over_text = false;
+
+ /**
+ * For added security, it is a good idea to draw arced lines over the letters to make it harder for bots to segment the letters.<br />
+ * Two arced lines will be drawn over the text on each side of the image.<br />
+ * This is currently expirimental and may be off in certain configurations.
+ *
+ * @var boolean
+ */
+ var $arc_linethrough = true;
+
+ /**
+ * The colors or color of the arced lines.<br />
+ * Use HTML hex notation with preceding # sign, and separate each value with a comma.<br />
+ * This should be similar to your font color for single color images.
+ *
+ * @var string
+ */
+ var $arc_line_colors = "#8080ff";
+
+ /**
+ * Full path to the WAV files to use to make the audio files, include trailing /.<br />
+ * Name Files [A-Z0-9].wav
+ *
+ * @since 1.0.1
+ * @var string
+ */
+ var $audio_path = './audio/';
+
+
+ //END USER CONFIGURATION
+ //There should be no need to edit below unless you really know what you are doing.
+
+ /**
+ * The gd image resource.
+ *
+ * @access private
+ * @var resource
+ */
+ var $im;
+
+ /**
+ * The background image resource
+ *
+ * @access private
+ * @var resource
+ */
+ var $bgimg;
+
+ /**
+ * The code generated by the script
+ *
+ * @access private
+ * @var string
+ */
+ var $code;
+
+ /**
+ * The code that was entered by the user
+ *
+ * @access private
+ * @var string
+ */
+ var $code_entered;
+
+ /**
+ * Whether or not the correct code was entered
+ *
+ * @access private
+ * @var boolean
+ */
+ var $correct_code;
+
+ /**
+ * Class constructor.<br />
+ * Because the class uses sessions, this will attempt to start a session if there is no previous one.<br />
+ * If you do not start a session before calling the class, the constructor must be called before any
+ * output is sent to the browser.
+ *
+ * <code>
+ * $securimage = new Securimage();
+ * </code>
+ *
+ */
+ function Securimage()
+ {
+ if ( session_id() == '' ) { // no session has been started yet, which is needed for validation
+ session_start();
+ }
+ }
+
+ /**
+ * Generate a code and output the image to the browser.
+ *
+ * <code>
+ * <?php
+ * include 'securimage.php';
+ * $securimage = new Securimage();
+ * $securimage->show('bg.jpg');
+ * ?>
+ * </code>
+ *
+ * @param string $background_image The path to an image to use as the background for the CAPTCHA
+ */
+ function show($background_image = "")
+ {
+ if($background_image != "" && is_readable($background_image)) {
+ $this->bgimg = $background_image;
+ }
+
+ $this->doImage();
+ }
+
+ /**
+ * Validate the code entered by the user.
+ *
+ * <code>
+ * $code = $_POST['code'];
+ * if ($securimage->check($code) == false) {
+ * die("Sorry, the code entered did not match.");
+ * } else {
+ * $valid = true;
+ * }
+ * </code>
+ * @param string $code The code the user entered
+ * @return boolean true if the code was correct, false if not
+ */
+ function check($code)
+ {
+ $this->code_entered = $code;
+ $this->validate();
+ return $this->correct_code;
+ }
+
+ /**
+ * Generate and output the image
+ *
+ * @access private
+ *
+ */
+ function doImage()
+ {
+ if($this->use_transparent_text == true || $this->bgimg != "") {
+ $this->im = imagecreatetruecolor($this->image_width, $this->image_height);
+ $bgcolor = imagecolorallocate($this->im, hexdec(substr($this->image_bg_color, 1, 2)), hexdec(substr($this->image_bg_color, 3, 2)), hexdec(substr($this->image_bg_color, 5, 2)));
+ imagefilledrectangle($this->im, 0, 0, imagesx($this->im), imagesy($this->im), $bgcolor);
+ } else { //no transparency
+ $this->im = imagecreate($this->image_width, $this->image_height);
+ $bgcolor = imagecolorallocate($this->im, hexdec(substr($this->image_bg_color, 1, 2)), hexdec(substr($this->image_bg_color, 3, 2)), hexdec(substr($this->image_bg_color, 5, 2)));
+ }
+
+ if($this->bgimg != "") { $this->setBackground(); }
+
+ $this->createCode();
+
+ if (!$this->draw_lines_over_text && $this->draw_lines) $this->drawLines();
+
+ $this->drawWord();
+
+ if ($this->arc_linethrough == true) $this->arcLines();
+
+ if ($this->draw_lines_over_text && $this->draw_lines) $this->drawLines();
+
+ $this->output();
+
+ }
+
+ /**
+ * Set the background of the CAPTCHA image
+ *
+ * @access private
+ *
+ */
+ function setBackground()
+ {
+ $dat = @getimagesize($this->bgimg);
+ if($dat == false) { return; }
+
+ switch($dat[2]) {
+ case 1: $newim = @imagecreatefromgif($this->bgimg); break;
+ case 2: $newim = @imagecreatefromjpeg($this->bgimg); break;
+ case 3: $newim = @imagecreatefrompng($this->bgimg); break;
+ case 15: $newim = @imagecreatefromwbmp($this->bgimg); break;
+ case 16: $newim = @imagecreatefromxbm($this->bgimg); break;
+ default: return;
+ }
+
+ if(!$newim) return;
+
+ imagecopy($this->im, $newim, 0, 0, 0, 0, $this->image_width, $this->image_height);
+ }
+
+ /**
+ * Draw arced lines over the text
+ *
+ * @access private
+ *
+ */
+ function arcLines()
+ {
+ $colors = explode(',', $this->arc_line_colors);
+ imagesetthickness($this->im, 3);
+
+ $color = $colors[rand(0, sizeof($colors) - 1)];
+ $linecolor = imagecolorallocate($this->im, hexdec(substr($color, 1, 2)), hexdec(substr($color, 3, 2)), hexdec(substr($color, 5, 2)));
+
+ $xpos = $this->text_x_start + ($this->font_size * 2) + rand(-5, 5);
+ $width = $this->image_width / 2.66 + rand(3, 10);
+ $height = $this->font_size * 2.14 - rand(3, 10);
+
+ if ( rand(0,100) % 2 == 0 ) {
+ $start = rand(0,66);
+ $ypos = $this->image_height / 2 - rand(5, 15);
+ $xpos += rand(5, 15);
+ } else {
+ $start = rand(180, 246);
+ $ypos = $this->image_height / 2 + rand(5, 15);
+ }
+
+ $end = $start + rand(75, 110);
+
+ imagearc($this->im, $xpos, $ypos, $width, $height, $start, $end, $linecolor);
+
+ $color = $colors[rand(0, sizeof($colors) - 1)];
+ $linecolor = imagecolorallocate($this->im, hexdec(substr($color, 1, 2)), hexdec(substr($color, 3, 2)), hexdec(substr($color, 5, 2)));
+
+ if ( rand(1,75) % 2 == 0 ) {
+ $start = rand(45, 111);
+ $ypos = $this->image_height / 2 - rand(5, 15);
+ $xpos += rand(5, 15);
+ } else {
+ $start = rand(200, 250);
+ $ypos = $this->image_height / 2 + rand(5, 15);
+ }
+
+ $end = $start + rand(75, 100);
+
+ imagearc($this->im, $this->image_width * .75, $ypos, $width, $height, $start, $end, $linecolor);
+ }
+
+ /**
+ * Draw lines on the image
+ *
+ * @access private
+ *
+ */
+ function drawLines()
+ {
+ $linecolor = imagecolorallocate($this->im, hexdec(substr($this->line_color, 1, 2)), hexdec(substr($this->line_color, 3, 2)), hexdec(substr($this->line_color, 5, 2)));
+ imagesetthickness($this->im, $this->line_thickness);
+
+ //vertical lines
+ for($x = 1; $x < $this->image_width; $x += $this->line_distance) {
+ imageline($this->im, $x, 0, $x, $this->image_height, $linecolor);
+ }
+
+ //horizontal lines
+ for($y = 11; $y < $this->image_height; $y += $this->line_distance) {
+ imageline($this->im, 0, $y, $this->image_width, $y, $linecolor);
+ }
+
+ if ($this->draw_angled_lines == true) {
+ for ($x = -($this->image_height); $x < $this->image_width; $x += $this->line_distance) {
+ imageline($this->im, $x, 0, $x + $this->image_height, $this->image_height, $linecolor);
+ }
+
+ for ($x = $this->image_width + $this->image_height; $x > 0; $x -= $this->line_distance) {
+ imageline($this->im, $x, 0, $x - $this->image_height, $this->image_height, $linecolor);
+ }
+ }
+ }
+
+ /**
+ * Draw the CAPTCHA code over the image
+ *
+ * @access private
+ *
+ */
+ function drawWord()
+ {
+ if ($this->use_gd_font == true) {
+ if (!is_int($this->gd_font_file)) { //is a file name
+ $font = @imageloadfont($this->gd_font_file);
+ if ($font == false) {
+ trigger_error("Failed to load GD Font file {$this->gd_font_file} ", E_USER_WARNING);
+ return;
+ }
+ } else { //gd font identifier
+ $font = $this->gd_font_file;
+ }
+
+ $color = imagecolorallocate($this->im, hexdec(substr($this->text_color, 1, 2)), hexdec(substr($this->text_color, 3, 2)), hexdec(substr($this->text_color, 5, 2)));
+ imagestring($this->im, $font, $this->text_x_start, ($this->image_height / 2) - ($this->gd_font_size / 2), $this->code, $color);
+
+ } else { //ttf font
+ if($this->use_transparent_text == true) {
+ $alpha = intval($this->text_transparency_percentage / 100 * 127);
+ $font_color = imagecolorallocatealpha($this->im, hexdec(substr($this->text_color, 1, 2)), hexdec(substr($this->text_color, 3, 2)), hexdec(substr($this->text_color, 5, 2)), $alpha);
+ } else { //no transparency
+ $font_color = imagecolorallocate($this->im, hexdec(substr($this->text_color, 1, 2)), hexdec(substr($this->text_color, 3, 2)), hexdec(substr($this->text_color, 5, 2)));
+ }
+
+ $x = $this->text_x_start;
+ $strlen = strlen($this->code);
+ $y_min = ($this->image_height / 2) + ($this->font_size / 2) - 2;
+ $y_max = ($this->image_height / 2) + ($this->font_size / 2) + 2;
+ $colors = explode(',', $this->multi_text_color);
+
+ for($i = 0; $i < $strlen; ++$i) {
+ $angle = rand($this->text_angle_minimum, $this->text_angle_maximum);
+ $y = rand($y_min, $y_max);
+ if ($this->use_multi_text == true) {
+ $idx = rand(0, sizeof($colors) - 1);
+ $r = substr($colors[$idx], 1, 2);
+ $g = substr($colors[$idx], 3, 2);
+ $b = substr($colors[$idx], 5, 2);
+ if($this->use_transparent_text == true) {
+ $font_color = imagecolorallocatealpha($this->im, "0x$r", "0x$g", "0x$b", $alpha);
+ } else {
+ $font_color = imagecolorallocate($this->im, "0x$r", "0x$g", "0x$b");
+ }
+ }
+ imagettftext($this->im, $this->font_size, $angle, $x, $y, $font_color, $this->ttf_file, $this->code{$i});
+
+ $x += rand($this->text_minimum_distance, $this->text_maximum_distance);
+ } //for loop
+ } //else ttf font
+ } //function
+
+ /**
+ * Create a code and save to the session
+ *
+ * @since 1.0.1
+ *
+ */
+ function createCode()
+ {
+ $this->code = false;
+
+ if ($this->use_wordlist && is_readable($this->wordlist_file)) {
+ $this->code = $this->readCodeFromFile();
+ }
+
+ if ($this->code == false) {
+ $this->code = $this->generateCode($this->code_length);
+ }
+
+ $this->saveData();
+ }
+
+ /**
+ * Generate a code
+ *
+ * @access private
+ * @param int $len The code length
+ * @return string
+ */
+ function generateCode($len)
+ {
+ $code = '';
+
+ for($i = 1, $cslen = strlen($this->charset); $i <= $len; ++$i) {
+ $code .= strtoupper( $this->charset{rand(0, $cslen - 1)} );
+ }
+ return $code;
+ }
+
+ /**
+ * Reads a word list file to get a code
+ *
+ * @access private
+ * @since 1.0.2
+ * @return mixed false on failure, a word on success
+ */
+ function readCodeFromFile()
+ {
+ $fp = @fopen($this->wordlist_file, 'rb');
+ if (!$fp) return false;
+
+ $fsize = filesize($this->wordlist_file);
+ if ($fsize < 32) return false; // too small of a list to be effective
+
+ if ($fsize < 128) {
+ $max = $fsize; // still pretty small but changes the range of seeking
+ } else {
+ $max = 128;
+ }
+
+ fseek($fp, rand(0, $fsize - $max), SEEK_SET);
+ $data = fread($fp, 128); // read a random 128 bytes from file
+ fclose($fp);
+ $data = preg_replace("/\r?\n/", "\n", $data);
+
+ $start = strpos($data, "\n", rand(0, 100)) + 1; // random start position
+ $end = strpos($data, "\n", $start); // find end of word
+
+ return strtolower(substr($data, $start, $end - $start)); // return substring in 128 bytes
+ }
+
+ /**
+ * Output image to the browser
+ *
+ * @access private
+ *
+ */
+ function output()
+ {
+ header("Expires: Sun, 1 Jan 2000 12:00:00 GMT");
+ header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
+ header("Cache-Control: no-store, no-cache, must-revalidate");
+ header("Cache-Control: post-check=0, pre-check=0", false);
+ header("Pragma: no-cache");
+
+ switch($this->image_type)
+ {
+ case SI_IMAGE_JPEG:
+ header("Content-Type: image/jpeg");
+ imagejpeg($this->im, null, 90);
+ break;
+
+ case SI_IMAGE_GIF:
+ header("Content-Type: image/gif");
+ imagegif($this->im);
+ break;
+
+ default:
+ header("Content-Type: image/png");
+ imagepng($this->im);
+ break;
+ }
+
+ imagedestroy($this->im);
+ }
+
+ /**
+ * Get WAV file data of the spoken code.<br />
+ * This is appropriate for output to the browser as audio/x-wav
+ *
+ * @since 1.0.1
+ * @return string WAV data
+ *
+ */
+ function getAudibleCode()
+ {
+ $letters = array();
+ $code = $this->getCode();
+
+ if ($code == '') {
+ $this->createCode();
+ $code = $this->getCode();
+ }
+
+ for($i = 0; $i < strlen($code); ++$i) {
+ $letters[] = $code{$i};
+ }
+
+ return $this->generateWAV($letters);
+ }
+
+ /**
+ * Save the code in the session
+ *
+ * @access private
+ *
+ */
+ function saveData()
+ {
+ $_SESSION['securimage_code_value'] = strtolower($this->code);
+ }
+
+ /**
+ * Validate the code to the user code
+ *
+ * @access private
+ *
+ */
+ function validate()
+ {
+ if ( isset($_SESSION['securimage_code_value']) && !empty($_SESSION['securimage_code_value']) ) {
+ if ( $_SESSION['securimage_code_value'] == strtolower(trim($this->code_entered)) ) {
+ $this->correct_code = true;
+ $_SESSION['securimage_code_value'] = '';
+ } else {
+ $this->correct_code = false;
+ }
+ } else {
+ $this->correct_code = false;
+ }
+ }
+
+ /**
+ * Get the captcha code
+ *
+ * @since 1.0.1
+ * @return string
+ */
+ function getCode()
+ {
+ if (isset($_SESSION['securimage_code_value']) && !empty($_SESSION['securimage_code_value'])) {
+ return $_SESSION['securimage_code_value'];
+ } else {
+ return '';
+ }
+ }
+
+ /**
+ * Check if the user entered code was correct
+ *
+ * @access private
+ * @return boolean
+ */
+ function checkCode()
+ {
+ return $this->correct_code;
+ }
+
+ /**
+ * Generate a wav file by concatenating individual files
+ * @since 1.0.1
+ * @access private
+ * @param array $letters Array of letters to build a file from
+ * @return string WAV file data
+ */
+ function generateWAV($letters)
+ {
+ $first = true; // use first file to write the header...
+ $data_len = 0;
+ $files = array();
+ $out_data = '';
+
+ foreach ($letters as $letter) {
+ $filename = $this->audio_path . strtoupper($letter) . '.wav';
+
+ $fp = fopen($filename, 'rb');
+
+ $file = array();
+
+ $data = fread($fp, filesize($filename)); // read file in
+
+ $header = substr($data, 0, 36);
+ $body = substr($data, 44);
+
+
+ $data = unpack('NChunkID/VChunkSize/NFormat/NSubChunk1ID/VSubChunk1Size/vAudioFormat/vNumChannels/VSampleRate/VByteRate/vBlockAlign/vBitsPerSample', $header);
+
+ $file['sub_chunk1_id'] = $data['SubChunk1ID'];
+ $file['bits_per_sample'] = $data['BitsPerSample'];
+ $file['channels'] = $data['NumChannels'];
+ $file['format'] = $data['AudioFormat'];
+ $file['sample_rate'] = $data['SampleRate'];
+ $file['size'] = $data['ChunkSize'] + 8;
+ $file['data'] = $body;
+
+ if ( ($p = strpos($file['data'], 'LIST')) !== false) {
+ // If the LIST data is not at the end of the file, this will probably break your sound file
+ $info = substr($file['data'], $p + 4, 8);
+ $data = unpack('Vlength/Vjunk', $info);
+ $file['data'] = substr($file['data'], 0, $p);
+ $file['size'] = $file['size'] - (strlen($file['data']) - $p);
+ }
+
+ $files[] = $file;
+ $data = null;
+ $header = null;
+ $body = null;
+
+ $data_len += strlen($file['data']);
+
+ fclose($fp);
+ }
+
+ $out_data = '';
+ for($i = 0; $i < sizeof($files); ++$i) {
+ if ($i == 0) { // output header
+ $out_data .= pack('C4VC8', ord('R'), ord('I'), ord('F'), ord('F'), $data_len + 36, ord('W'), ord('A'), ord('V'), ord('E'), ord('f'), ord('m'), ord('t'), ord(' '));
+
+ $out_data .= pack('VvvVVvv',
+ 16,
+ $files[$i]['format'],
+ $files[$i]['channels'],
+ $files[$i]['sample_rate'],
+ $files[$i]['sample_rate'] * (($files[$i]['bits_per_sample'] * $files[$i]['channels']) / 8),
+ ($files[$i]['bits_per_sample'] * $files[$i]['channels']) / 8,
+ $files[$i]['bits_per_sample'] );
+
+ $out_data .= pack('C4', ord('d'), ord('a'), ord('t'), ord('a'));
+
+ $ou...
[truncated message content] |
|
From: <ts...@us...> - 2008-10-15 14:11:22
|
Revision: 16
http://openupload.svn.sourceforge.net/openupload/?rev=16&view=rev
Author: tsdogs
Date: 2008-10-15 14:10:22 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
First svn commit
Added Paths:
-----------
trunk/sql/mysql/openupload.sql
Added: trunk/sql/mysql/openupload.sql
===================================================================
--- trunk/sql/mysql/openupload.sql (rev 0)
+++ trunk/sql/mysql/openupload.sql 2008-10-15 14:10:22 UTC (rev 16)
@@ -0,0 +1,267 @@
+-- MySQL dump 10.11
+--
+-- Host: localhost Database: openupload_empty
+-- ------------------------------------------------------
+-- Server version 5.0.51a-3ubuntu5.3
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+--
+-- Table structure for table `acl`
+--
+
+DROP TABLE IF EXISTS `acl`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `acl` (
+ `module` varchar(100) NOT NULL,
+ `action` varchar(100) NOT NULL,
+ `group_id` varchar(50) NOT NULL,
+ `access` varchar(10) NOT NULL,
+ PRIMARY KEY (`module`,`action`,`group_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Dumping data for table `acl`
+--
+
+LOCK TABLES `acl` WRITE;
+/*!40000 ALTER TABLE `acl` DISABLE KEYS */;
+INSERT INTO `acl` VALUES ('*','*','admins','allow'),('admin','*','unregisterd','deny'),('admin','*','registered','deny'),('files','*','unregistered','allow'),('files','*','registered','allow'),('auth','*','registered','allow'),('auth','*','unregistered','allow'),('auth','register','*','deny'),('auth','register','unregistered','deny'),('auth','login','*','deny'),('auth','login','unregistered','allow'),('auth','logout','unregistered','deny'),('auth','logout','*','allow');
+/*!40000 ALTER TABLE `acl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `banned`
+--
+
+DROP TABLE IF EXISTS `banned`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `banned` (
+ `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 AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Dumping data for table `banned`
+--
+
+LOCK TABLES `banned` WRITE;
+/*!40000 ALTER TABLE `banned` DISABLE KEYS */;
+INSERT INTO `banned` VALUES (2,'0.0.0.0/0','allow',9999999),(1,'127.0.0.1','allow',1);
+/*!40000 ALTER TABLE `banned` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `file_options`
+--
+
+DROP TABLE IF EXISTS `file_options`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `file_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 AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Dumping data for table `file_options`
+--
+
+LOCK TABLES `file_options` WRITE;
+/*!40000 ALTER TABLE `file_options` DISABLE KEYS */;
+/*!40000 ALTER TABLE `file_options` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `files`
+--
+
+DROP TABLE IF EXISTS `files`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `files` (
+ `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_id` int(11) NOT NULL,
+ `upload_date` datetime NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Dumping data for table `files`
+--
+
+LOCK TABLES `files` WRITE;
+/*!40000 ALTER TABLE `files` DISABLE KEYS */;
+/*!40000 ALTER TABLE `files` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `groups`
+--
+
+DROP TABLE IF EXISTS `groups`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `groups` (
+ `name` varchar(50) NOT NULL,
+ `description` varchar(250) default NULL,
+ PRIMARY KEY (`name`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Dumping data for table `groups`
+--
+
+LOCK TABLES `groups` WRITE;
+/*!40000 ALTER TABLE `groups` DISABLE KEYS */;
+INSERT INTO `groups` VALUES ('admins','Administrators group'),('registered','Registered Users'),('unregistered','Unregistered users');
+/*!40000 ALTER TABLE `groups` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `langs`
+--
+
+DROP TABLE IF EXISTS `langs`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `langs` (
+ `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;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Dumping data for table `langs`
+--
+
+LOCK TABLES `langs` WRITE;
+/*!40000 ALTER TABLE `langs` DISABLE KEYS */;
+INSERT INTO `langs` VALUES ('en','English','en_EN','[en];[en_EN]','iso-8559-1',1),('it','Italiano','it_IT.utf8','[it];[it_IT]','iso-8559-1',1);
+/*!40000 ALTER TABLE `langs` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `plugin_acl`
+--
+
+DROP TABLE IF EXISTS `plugin_acl`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `plugin_acl` (
+ `group_id` varchar(50) NOT NULL,
+ `plugin` varchar(100) NOT NULL,
+ `access` varchar(10) NOT NULL,
+ PRIMARY KEY (`group_id`,`plugin`,`access`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Dumping data for table `plugin_acl`
+--
+
+LOCK TABLES `plugin_acl` WRITE;
+/*!40000 ALTER TABLE `plugin_acl` DISABLE KEYS */;
+INSERT INTO `plugin_acl` VALUES ('admins','captcha','enable'),('admins','email','enable'),('admins','password','enable'),('registered','captcha','enable'),('registered','email','enable'),('registered','password','enable'),('unregistered','captcha','enable'),('unregistered','mimetypes','enable'),('unregistered','password','disable');
+/*!40000 ALTER TABLE `plugin_acl` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `plugin_oprions`
+--
+
+DROP TABLE IF EXISTS `plugin_oprions`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `plugin_oprions` (
+ `plugin` varchar(100) NOT NULL,
+ `group_id` varchar(100) NOT NULL,
+ `option` varchar(100) NOT NULL,
+ `value` varchar(100) NOT NULL,
+ PRIMARY KEY (`plugin`,`group_id`,`option`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+SET character_set_client = @saved_cs_client;
+
+--
+-- Dumping data for table `plugin_oprions`
+--
+
+LOCK TABLES `plugin_oprions` WRITE;
+/*!40000 ALTER TABLE `plugin_oprions` DISABLE KEYS */;
+/*!40000 ALTER TABLE `plugin_oprions` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `users`
+--
+
+DROP TABLE IF EXISTS `users`;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
+CREATE TABLE `users` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `login` varchar(100) NOT NULL,
+ `password` varchar(100) NOT NULL,
+ `name` varchar(200) NOT NULL,
+ `group_id` varchar(50) NOT NULL default 'unregistered',
+ `email` varchar(250) NOT NULL,
+ `active` tinyint(3) unsigned NOT NULL default '1',
+ PRIMARY KEY (`id`),
+ KEY `login` (`login`)
+) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COMMENT='MyShare Users';
+SET character_set_client = @saved_cs_client;
+
+--
+-- Dumping data for table `users`
+--
+
+LOCK TABLES `users` WRITE;
+/*!40000 ALTER TABLE `users` DISABLE KEYS */;
+INSERT INTO `users` VALUES (1,'admin','$1$IGgMd3Qo$f06LS1O.VmX57A18CkSuD1','Administrator','admins','ad...@yo...',1);
+/*!40000 ALTER TABLE `users` ENABLE KEYS */;
+UNLOCK TABLES;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+-- Dump completed on 2008-10-15 13:13:57
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-15 14:03:30
|
Revision: 11
http://openupload.svn.sourceforge.net/openupload/?rev=11&view=rev
Author: tsdogs
Date: 2008-10-15 13:59:09 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
First svn commit
Added Paths:
-----------
trunk/lib/smarty/internals/core.assemble_plugin_filepath.php
trunk/lib/smarty/internals/core.assign_smarty_interface.php
trunk/lib/smarty/internals/core.create_dir_structure.php
trunk/lib/smarty/internals/core.display_debug_console.php
trunk/lib/smarty/internals/core.get_include_path.php
trunk/lib/smarty/internals/core.get_microtime.php
trunk/lib/smarty/internals/core.get_php_resource.php
trunk/lib/smarty/internals/core.is_secure.php
trunk/lib/smarty/internals/core.is_trusted.php
trunk/lib/smarty/internals/core.load_plugins.php
trunk/lib/smarty/internals/core.load_resource_plugin.php
trunk/lib/smarty/internals/core.process_cached_inserts.php
trunk/lib/smarty/internals/core.process_compiled_include.php
trunk/lib/smarty/internals/core.read_cache_file.php
trunk/lib/smarty/internals/core.rm_auto.php
trunk/lib/smarty/internals/core.rmdir.php
trunk/lib/smarty/internals/core.run_insert_handler.php
trunk/lib/smarty/internals/core.smarty_include_php.php
trunk/lib/smarty/internals/core.write_cache_file.php
trunk/lib/smarty/internals/core.write_compiled_include.php
trunk/lib/smarty/internals/core.write_compiled_resource.php
trunk/lib/smarty/internals/core.write_file.php
Added: trunk/lib/smarty/internals/core.assemble_plugin_filepath.php
===================================================================
--- trunk/lib/smarty/internals/core.assemble_plugin_filepath.php (rev 0)
+++ trunk/lib/smarty/internals/core.assemble_plugin_filepath.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,67 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * assemble filepath of requested plugin
+ *
+ * @param string $type
+ * @param string $name
+ * @return string|false
+ */
+function smarty_core_assemble_plugin_filepath($params, &$smarty)
+{
+ static $_filepaths_cache = array();
+
+ $_plugin_filename = $params['type'] . '.' . $params['name'] . '.php';
+ if (isset($_filepaths_cache[$_plugin_filename])) {
+ return $_filepaths_cache[$_plugin_filename];
+ }
+ $_return = false;
+
+ foreach ((array)$smarty->plugins_dir as $_plugin_dir) {
+
+ $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename;
+
+ // see if path is relative
+ if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) {
+ $_relative_paths[] = $_plugin_dir;
+ // relative path, see if it is in the SMARTY_DIR
+ if (@is_readable(SMARTY_DIR . $_plugin_filepath)) {
+ $_return = SMARTY_DIR . $_plugin_filepath;
+ break;
+ }
+ }
+ // try relative to cwd (or absolute)
+ if (@is_readable($_plugin_filepath)) {
+ $_return = $_plugin_filepath;
+ break;
+ }
+ }
+
+ if($_return === false) {
+ // still not found, try PHP include_path
+ if(isset($_relative_paths)) {
+ foreach ((array)$_relative_paths as $_plugin_dir) {
+
+ $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename;
+
+ $_params = array('file_path' => $_plugin_filepath);
+ require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
+ if(smarty_core_get_include_path($_params, $smarty)) {
+ $_return = $_params['new_file_path'];
+ break;
+ }
+ }
+ }
+ }
+ $_filepaths_cache[$_plugin_filename] = $_return;
+ return $_return;
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.assemble_plugin_filepath.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.assign_smarty_interface.php
===================================================================
--- trunk/lib/smarty/internals/core.assign_smarty_interface.php (rev 0)
+++ trunk/lib/smarty/internals/core.assign_smarty_interface.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty assign_smarty_interface core plugin
+ *
+ * Type: core<br>
+ * Name: assign_smarty_interface<br>
+ * Purpose: assign the $smarty interface variable
+ * @param array Format: null
+ * @param Smarty
+ */
+function smarty_core_assign_smarty_interface($params, &$smarty)
+{
+ if (isset($smarty->_smarty_vars) && isset($smarty->_smarty_vars['request'])) {
+ return;
+ }
+
+ $_globals_map = array('g' => 'HTTP_GET_VARS',
+ 'p' => 'HTTP_POST_VARS',
+ 'c' => 'HTTP_COOKIE_VARS',
+ 's' => 'HTTP_SERVER_VARS',
+ 'e' => 'HTTP_ENV_VARS');
+
+ $_smarty_vars_request = array();
+
+ foreach (preg_split('!!', strtolower($smarty->request_vars_order)) as $_c) {
+ if (isset($_globals_map[$_c])) {
+ $_smarty_vars_request = array_merge($_smarty_vars_request, $GLOBALS[$_globals_map[$_c]]);
+ }
+ }
+ $_smarty_vars_request = @array_merge($_smarty_vars_request, $GLOBALS['HTTP_SESSION_VARS']);
+
+ $smarty->_smarty_vars['request'] = $_smarty_vars_request;
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.assign_smarty_interface.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.create_dir_structure.php
===================================================================
--- trunk/lib/smarty/internals/core.create_dir_structure.php (rev 0)
+++ trunk/lib/smarty/internals/core.create_dir_structure.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * create full directory structure
+ *
+ * @param string $dir
+ */
+
+// $dir
+
+function smarty_core_create_dir_structure($params, &$smarty)
+{
+ if (!file_exists($params['dir'])) {
+ $_open_basedir_ini = ini_get('open_basedir');
+
+ if (DIRECTORY_SEPARATOR=='/') {
+ /* unix-style paths */
+ $_dir = $params['dir'];
+ $_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);
+ $_new_dir = (substr($_dir, 0, 1)=='/') ? '/' : getcwd().'/';
+ if($_use_open_basedir = !empty($_open_basedir_ini)) {
+ $_open_basedirs = explode(':', $_open_basedir_ini);
+ }
+
+ } else {
+ /* other-style paths */
+ $_dir = str_replace('\\','/', $params['dir']);
+ $_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);
+ if (preg_match('!^((//)|([a-zA-Z]:/))!', $_dir, $_root_dir)) {
+ /* leading "//" for network volume, or "[letter]:/" for full path */
+ $_new_dir = $_root_dir[1];
+ /* remove drive-letter from _dir_parts */
+ if (isset($_root_dir[3])) array_shift($_dir_parts);
+
+ } else {
+ $_new_dir = str_replace('\\', '/', getcwd()).'/';
+
+ }
+
+ if($_use_open_basedir = !empty($_open_basedir_ini)) {
+ $_open_basedirs = explode(';', str_replace('\\', '/', $_open_basedir_ini));
+ }
+
+ }
+
+ /* all paths use "/" only from here */
+ foreach ($_dir_parts as $_dir_part) {
+ $_new_dir .= $_dir_part;
+
+ if ($_use_open_basedir) {
+ // do not attempt to test or make directories outside of open_basedir
+ $_make_new_dir = false;
+ foreach ($_open_basedirs as $_open_basedir) {
+ if (substr($_new_dir, 0, strlen($_open_basedir)) == $_open_basedir) {
+ $_make_new_dir = true;
+ break;
+ }
+ }
+ } else {
+ $_make_new_dir = true;
+ }
+
+ if ($_make_new_dir && !file_exists($_new_dir) && !@mkdir($_new_dir, $smarty->_dir_perms) && !is_dir($_new_dir)) {
+ $smarty->trigger_error("problem creating directory '" . $_new_dir . "'");
+ return false;
+ }
+ $_new_dir .= '/';
+ }
+ }
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.create_dir_structure.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.display_debug_console.php
===================================================================
--- trunk/lib/smarty/internals/core.display_debug_console.php (rev 0)
+++ trunk/lib/smarty/internals/core.display_debug_console.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,61 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty debug_console function plugin
+ *
+ * Type: core<br>
+ * Name: display_debug_console<br>
+ * Purpose: display the javascript debug console window
+ * @param array Format: null
+ * @param Smarty
+ */
+function smarty_core_display_debug_console($params, &$smarty)
+{
+ // we must force compile the debug template in case the environment
+ // changed between separate applications.
+
+ if(empty($smarty->debug_tpl)) {
+ // set path to debug template from SMARTY_DIR
+ $smarty->debug_tpl = SMARTY_DIR . 'debug.tpl';
+ if($smarty->security && is_file($smarty->debug_tpl)) {
+ $smarty->secure_dir[] = realpath($smarty->debug_tpl);
+ }
+ $smarty->debug_tpl = 'file:' . SMARTY_DIR . 'debug.tpl';
+ }
+
+ $_ldelim_orig = $smarty->left_delimiter;
+ $_rdelim_orig = $smarty->right_delimiter;
+
+ $smarty->left_delimiter = '{';
+ $smarty->right_delimiter = '}';
+
+ $_compile_id_orig = $smarty->_compile_id;
+ $smarty->_compile_id = null;
+
+ $_compile_path = $smarty->_get_compile_path($smarty->debug_tpl);
+ if ($smarty->_compile_resource($smarty->debug_tpl, $_compile_path))
+ {
+ ob_start();
+ $smarty->_include($_compile_path);
+ $_results = ob_get_contents();
+ ob_end_clean();
+ } else {
+ $_results = '';
+ }
+
+ $smarty->_compile_id = $_compile_id_orig;
+
+ $smarty->left_delimiter = $_ldelim_orig;
+ $smarty->right_delimiter = $_rdelim_orig;
+
+ return $_results;
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.display_debug_console.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.get_include_path.php
===================================================================
--- trunk/lib/smarty/internals/core.get_include_path.php (rev 0)
+++ trunk/lib/smarty/internals/core.get_include_path.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Get path to file from include_path
+ *
+ * @param string $file_path
+ * @param string $new_file_path
+ * @return boolean
+ * @staticvar array|null
+ */
+
+// $file_path, &$new_file_path
+
+function smarty_core_get_include_path(&$params, &$smarty)
+{
+ static $_path_array = null;
+
+ if(!isset($_path_array)) {
+ $_ini_include_path = ini_get('include_path');
+
+ if(strstr($_ini_include_path,';')) {
+ // windows pathnames
+ $_path_array = explode(';',$_ini_include_path);
+ } else {
+ $_path_array = explode(':',$_ini_include_path);
+ }
+ }
+ foreach ($_path_array as $_include_path) {
+ if (@is_readable($_include_path . DIRECTORY_SEPARATOR . $params['file_path'])) {
+ $params['new_file_path'] = $_include_path . DIRECTORY_SEPARATOR . $params['file_path'];
+ return true;
+ }
+ }
+ return false;
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.get_include_path.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.get_microtime.php
===================================================================
--- trunk/lib/smarty/internals/core.get_microtime.php (rev 0)
+++ trunk/lib/smarty/internals/core.get_microtime.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Get seconds and microseconds
+ * @return double
+ */
+function smarty_core_get_microtime($params, &$smarty)
+{
+ $mtime = microtime();
+ $mtime = explode(" ", $mtime);
+ $mtime = (double)($mtime[1]) + (double)($mtime[0]);
+ return ($mtime);
+}
+
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.get_microtime.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.get_php_resource.php
===================================================================
--- trunk/lib/smarty/internals/core.get_php_resource.php (rev 0)
+++ trunk/lib/smarty/internals/core.get_php_resource.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Retrieves PHP script resource
+ *
+ * sets $php_resource to the returned resource
+ * @param string $resource
+ * @param string $resource_type
+ * @param $php_resource
+ * @return boolean
+ */
+
+function smarty_core_get_php_resource(&$params, &$smarty)
+{
+
+ $params['resource_base_path'] = $smarty->trusted_dir;
+ $smarty->_parse_resource_name($params, $smarty);
+
+ /*
+ * Find out if the resource exists.
+ */
+
+ if ($params['resource_type'] == 'file') {
+ $_readable = false;
+ if(file_exists($params['resource_name']) && is_readable($params['resource_name'])) {
+ $_readable = true;
+ } else {
+ // test for file in include_path
+ $_params = array('file_path' => $params['resource_name']);
+ require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
+ if(smarty_core_get_include_path($_params, $smarty)) {
+ $_include_path = $_params['new_file_path'];
+ $_readable = true;
+ }
+ }
+ } else if ($params['resource_type'] != 'file') {
+ $_template_source = null;
+ $_readable = is_callable($smarty->_plugins['resource'][$params['resource_type']][0][0])
+ && call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][0],
+ array($params['resource_name'], &$_template_source, &$smarty));
+ }
+
+ /*
+ * Set the error function, depending on which class calls us.
+ */
+ if (method_exists($smarty, '_syntax_error')) {
+ $_error_funcc = '_syntax_error';
+ } else {
+ $_error_funcc = 'trigger_error';
+ }
+
+ if ($_readable) {
+ if ($smarty->security) {
+ require_once(SMARTY_CORE_DIR . 'core.is_trusted.php');
+ if (!smarty_core_is_trusted($params, $smarty)) {
+ $smarty->$_error_funcc('(secure mode) ' . $params['resource_type'] . ':' . $params['resource_name'] . ' is not trusted');
+ return false;
+ }
+ }
+ } else {
+ $smarty->$_error_funcc($params['resource_type'] . ':' . $params['resource_name'] . ' is not readable');
+ return false;
+ }
+
+ if ($params['resource_type'] == 'file') {
+ $params['php_resource'] = $params['resource_name'];
+ } else {
+ $params['php_resource'] = $_template_source;
+ }
+ return true;
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.get_php_resource.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.is_secure.php
===================================================================
--- trunk/lib/smarty/internals/core.is_secure.php (rev 0)
+++ trunk/lib/smarty/internals/core.is_secure.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * determines if a resource is secure or not.
+ *
+ * @param string $resource_type
+ * @param string $resource_name
+ * @return boolean
+ */
+
+// $resource_type, $resource_name
+
+function smarty_core_is_secure($params, &$smarty)
+{
+ if (!$smarty->security || $smarty->security_settings['INCLUDE_ANY']) {
+ return true;
+ }
+
+ if ($params['resource_type'] == 'file') {
+ $_rp = realpath($params['resource_name']);
+ if (isset($params['resource_base_path'])) {
+ foreach ((array)$params['resource_base_path'] as $curr_dir) {
+ if ( ($_cd = realpath($curr_dir)) !== false &&
+ strncmp($_rp, $_cd, strlen($_cd)) == 0 &&
+ substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) {
+ return true;
+ }
+ }
+ }
+ if (!empty($smarty->secure_dir)) {
+ foreach ((array)$smarty->secure_dir as $curr_dir) {
+ if ( ($_cd = realpath($curr_dir)) !== false) {
+ if($_cd == $_rp) {
+ return true;
+ } elseif (strncmp($_rp, $_cd, strlen($_cd)) == 0 &&
+ substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR) {
+ return true;
+ }
+ }
+ }
+ }
+ } else {
+ // resource is not on local file system
+ return call_user_func_array(
+ $smarty->_plugins['resource'][$params['resource_type']][0][2],
+ array($params['resource_name'], &$smarty));
+ }
+
+ return false;
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.is_secure.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.is_trusted.php
===================================================================
--- trunk/lib/smarty/internals/core.is_trusted.php (rev 0)
+++ trunk/lib/smarty/internals/core.is_trusted.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * determines if a resource is trusted or not
+ *
+ * @param string $resource_type
+ * @param string $resource_name
+ * @return boolean
+ */
+
+ // $resource_type, $resource_name
+
+function smarty_core_is_trusted($params, &$smarty)
+{
+ $_smarty_trusted = false;
+ if ($params['resource_type'] == 'file') {
+ if (!empty($smarty->trusted_dir)) {
+ $_rp = realpath($params['resource_name']);
+ foreach ((array)$smarty->trusted_dir as $curr_dir) {
+ if (!empty($curr_dir) && is_readable ($curr_dir)) {
+ $_cd = realpath($curr_dir);
+ if (strncmp($_rp, $_cd, strlen($_cd)) == 0
+ && substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) {
+ $_smarty_trusted = true;
+ break;
+ }
+ }
+ }
+ }
+
+ } else {
+ // resource is not on local file system
+ $_smarty_trusted = call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][3],
+ array($params['resource_name'], $smarty));
+ }
+
+ return $_smarty_trusted;
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.is_trusted.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.load_plugins.php
===================================================================
--- trunk/lib/smarty/internals/core.load_plugins.php (rev 0)
+++ trunk/lib/smarty/internals/core.load_plugins.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,125 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Load requested plugins
+ *
+ * @param array $plugins
+ */
+
+// $plugins
+
+function smarty_core_load_plugins($params, &$smarty)
+{
+
+ foreach ($params['plugins'] as $_plugin_info) {
+ list($_type, $_name, $_tpl_file, $_tpl_line, $_delayed_loading) = $_plugin_info;
+ $_plugin = &$smarty->_plugins[$_type][$_name];
+
+ /*
+ * We do not load plugin more than once for each instance of Smarty.
+ * The following code checks for that. The plugin can also be
+ * registered dynamically at runtime, in which case template file
+ * and line number will be unknown, so we fill them in.
+ *
+ * The final element of the info array is a flag that indicates
+ * whether the dynamically registered plugin function has been
+ * checked for existence yet or not.
+ */
+ if (isset($_plugin)) {
+ if (empty($_plugin[3])) {
+ if (!is_callable($_plugin[0])) {
+ $smarty->_trigger_fatal_error("[plugin] $_type '$_name' is not implemented", $_tpl_file, $_tpl_line, __FILE__, __LINE__);
+ } else {
+ $_plugin[1] = $_tpl_file;
+ $_plugin[2] = $_tpl_line;
+ $_plugin[3] = true;
+ if (!isset($_plugin[4])) $_plugin[4] = true; /* cacheable */
+ }
+ }
+ continue;
+ } else if ($_type == 'insert') {
+ /*
+ * For backwards compatibility, we check for insert functions in
+ * the symbol table before trying to load them as a plugin.
+ */
+ $_plugin_func = 'insert_' . $_name;
+ if (function_exists($_plugin_func)) {
+ $_plugin = array($_plugin_func, $_tpl_file, $_tpl_line, true, false);
+ continue;
+ }
+ }
+
+ $_plugin_file = $smarty->_get_plugin_filepath($_type, $_name);
+
+ if (! $_found = ($_plugin_file != false)) {
+ $_message = "could not load plugin file '$_type.$_name.php'\n";
+ }
+
+ /*
+ * If plugin file is found, it -must- provide the properly named
+ * plugin function. In case it doesn't, simply output the error and
+ * do not fall back on any other method.
+ */
+ if ($_found) {
+ include_once $_plugin_file;
+
+ $_plugin_func = 'smarty_' . $_type . '_' . $_name;
+ if (!function_exists($_plugin_func)) {
+ $smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", $_tpl_file, $_tpl_line, __FILE__, __LINE__);
+ continue;
+ }
+ }
+ /*
+ * In case of insert plugins, their code may be loaded later via
+ * 'script' attribute.
+ */
+ else if ($_type == 'insert' && $_delayed_loading) {
+ $_plugin_func = 'smarty_' . $_type . '_' . $_name;
+ $_found = true;
+ }
+
+ /*
+ * Plugin specific processing and error checking.
+ */
+ if (!$_found) {
+ if ($_type == 'modifier') {
+ /*
+ * In case modifier falls back on using PHP functions
+ * directly, we only allow those specified in the security
+ * context.
+ */
+ if ($smarty->security && !in_array($_name, $smarty->security_settings['MODIFIER_FUNCS'])) {
+ $_message = "(secure mode) modifier '$_name' is not allowed";
+ } else {
+ if (!function_exists($_name)) {
+ $_message = "modifier '$_name' is not implemented";
+ } else {
+ $_plugin_func = $_name;
+ $_found = true;
+ }
+ }
+ } else if ($_type == 'function') {
+ /*
+ * This is a catch-all situation.
+ */
+ $_message = "unknown tag - '$_name'";
+ }
+ }
+
+ if ($_found) {
+ $smarty->_plugins[$_type][$_name] = array($_plugin_func, $_tpl_file, $_tpl_line, true, true);
+ } else {
+ // output error
+ $smarty->_trigger_fatal_error('[plugin] ' . $_message, $_tpl_file, $_tpl_line, __FILE__, __LINE__);
+ }
+ }
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.load_plugins.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.load_resource_plugin.php
===================================================================
--- trunk/lib/smarty/internals/core.load_resource_plugin.php (rev 0)
+++ trunk/lib/smarty/internals/core.load_resource_plugin.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,74 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * load a resource plugin
+ *
+ * @param string $type
+ */
+
+// $type
+
+function smarty_core_load_resource_plugin($params, &$smarty)
+{
+ /*
+ * Resource plugins are not quite like the other ones, so they are
+ * handled differently. The first element of plugin info is the array of
+ * functions provided by the plugin, the second one indicates whether
+ * all of them exist or not.
+ */
+
+ $_plugin = &$smarty->_plugins['resource'][$params['type']];
+ if (isset($_plugin)) {
+ if (!$_plugin[1] && count($_plugin[0])) {
+ $_plugin[1] = true;
+ foreach ($_plugin[0] as $_plugin_func) {
+ if (!is_callable($_plugin_func)) {
+ $_plugin[1] = false;
+ break;
+ }
+ }
+ }
+
+ if (!$_plugin[1]) {
+ $smarty->_trigger_fatal_error("[plugin] resource '" . $params['type'] . "' is not implemented", null, null, __FILE__, __LINE__);
+ }
+
+ return;
+ }
+
+ $_plugin_file = $smarty->_get_plugin_filepath('resource', $params['type']);
+ $_found = ($_plugin_file != false);
+
+ if ($_found) { /*
+ * If the plugin file is found, it -must- provide the properly named
+ * plugin functions.
+ */
+ include_once($_plugin_file);
+
+ /*
+ * Locate functions that we require the plugin to provide.
+ */
+ $_resource_ops = array('source', 'timestamp', 'secure', 'trusted');
+ $_resource_funcs = array();
+ foreach ($_resource_ops as $_op) {
+ $_plugin_func = 'smarty_resource_' . $params['type'] . '_' . $_op;
+ if (!function_exists($_plugin_func)) {
+ $smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", null, null, __FILE__, __LINE__);
+ return;
+ } else {
+ $_resource_funcs[] = $_plugin_func;
+ }
+ }
+
+ $smarty->_plugins['resource'][$params['type']] = array($_resource_funcs, true);
+ }
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.load_resource_plugin.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.process_cached_inserts.php
===================================================================
--- trunk/lib/smarty/internals/core.process_cached_inserts.php (rev 0)
+++ trunk/lib/smarty/internals/core.process_cached_inserts.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Replace cached inserts with the actual results
+ *
+ * @param string $results
+ * @return string
+ */
+function smarty_core_process_cached_inserts($params, &$smarty)
+{
+ preg_match_all('!'.$smarty->_smarty_md5.'{insert_cache (.*)}'.$smarty->_smarty_md5.'!Uis',
+ $params['results'], $match);
+ list($cached_inserts, $insert_args) = $match;
+
+ for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; $i++) {
+ if ($smarty->debugging) {
+ $_params = array();
+ require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+ $debug_start_time = smarty_core_get_microtime($_params, $smarty);
+ }
+
+ $args = unserialize($insert_args[$i]);
+ $name = $args['name'];
+
+ if (isset($args['script'])) {
+ $_params = array('resource_name' => $smarty->_dequote($args['script']));
+ require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
+ if(!smarty_core_get_php_resource($_params, $smarty)) {
+ return false;
+ }
+ $resource_type = $_params['resource_type'];
+ $php_resource = $_params['php_resource'];
+
+
+ if ($resource_type == 'file') {
+ $smarty->_include($php_resource, true);
+ } else {
+ $smarty->_eval($php_resource);
+ }
+ }
+
+ $function_name = $smarty->_plugins['insert'][$name][0];
+ if (empty($args['assign'])) {
+ $replace = $function_name($args, $smarty);
+ } else {
+ $smarty->assign($args['assign'], $function_name($args, $smarty));
+ $replace = '';
+ }
+
+ $params['results'] = substr_replace($params['results'], $replace, strpos($params['results'], $cached_inserts[$i]), strlen($cached_inserts[$i]));
+ if ($smarty->debugging) {
+ $_params = array();
+ require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+ $smarty->_smarty_debug_info[] = array('type' => 'insert',
+ 'filename' => 'insert_'.$name,
+ 'depth' => $smarty->_inclusion_depth,
+ 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $debug_start_time);
+ }
+ }
+
+ return $params['results'];
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.process_cached_inserts.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.process_compiled_include.php
===================================================================
--- trunk/lib/smarty/internals/core.process_compiled_include.php (rev 0)
+++ trunk/lib/smarty/internals/core.process_compiled_include.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Replace nocache-tags by results of the corresponding non-cacheable
+ * functions and return it
+ *
+ * @param string $compiled_tpl
+ * @param string $cached_source
+ * @return string
+ */
+
+function smarty_core_process_compiled_include($params, &$smarty)
+{
+ $_cache_including = $smarty->_cache_including;
+ $smarty->_cache_including = true;
+
+ $_return = $params['results'];
+
+ foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) {
+ $smarty->_include($_include_file_path, true);
+ }
+
+ foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) {
+ $_return = preg_replace_callback('!(\{nocache\:('.$_cache_serial.')#(\d+)\})!s',
+ array(&$smarty, '_process_compiled_include_callback'),
+ $_return);
+ }
+ $smarty->_cache_including = $_cache_including;
+ return $_return;
+}
+
+?>
Property changes on: trunk/lib/smarty/internals/core.process_compiled_include.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.read_cache_file.php
===================================================================
--- trunk/lib/smarty/internals/core.read_cache_file.php (rev 0)
+++ trunk/lib/smarty/internals/core.read_cache_file.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,101 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * read a cache file, determine if it needs to be
+ * regenerated or not
+ *
+ * @param string $tpl_file
+ * @param string $cache_id
+ * @param string $compile_id
+ * @param string $results
+ * @return boolean
+ */
+
+// $tpl_file, $cache_id, $compile_id, &$results
+
+function smarty_core_read_cache_file(&$params, &$smarty)
+{
+ static $content_cache = array();
+
+ if ($smarty->force_compile) {
+ // force compile enabled, always regenerate
+ return false;
+ }
+
+ if (isset($content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']])) {
+ list($params['results'], $smarty->_cache_info) = $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']];
+ return true;
+ }
+
+ if (!empty($smarty->cache_handler_func)) {
+ // use cache_handler function
+ call_user_func_array($smarty->cache_handler_func,
+ array('read', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], null));
+ } else {
+ // use local cache file
+ $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']);
+ $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id);
+ $params['results'] = $smarty->_read_file($_cache_file);
+ }
+
+ if (empty($params['results'])) {
+ // nothing to parse (error?), regenerate cache
+ return false;
+ }
+
+ $_contents = $params['results'];
+ $_info_start = strpos($_contents, "\n") + 1;
+ $_info_len = (int)substr($_contents, 0, $_info_start - 1);
+ $_cache_info = unserialize(substr($_contents, $_info_start, $_info_len));
+ $params['results'] = substr($_contents, $_info_start + $_info_len);
+
+ if ($smarty->caching == 2 && isset ($_cache_info['expires'])){
+ // caching by expiration time
+ if ($_cache_info['expires'] > -1 && (time() > $_cache_info['expires'])) {
+ // cache expired, regenerate
+ return false;
+ }
+ } else {
+ // caching by lifetime
+ if ($smarty->cache_lifetime > -1 && (time() - $_cache_info['timestamp'] > $smarty->cache_lifetime)) {
+ // cache expired, regenerate
+ return false;
+ }
+ }
+
+ if ($smarty->compile_check) {
+ $_params = array('get_source' => false, 'quiet'=>true);
+ foreach (array_keys($_cache_info['template']) as $_template_dep) {
+ $_params['resource_name'] = $_template_dep;
+ if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) {
+ // template file has changed, regenerate cache
+ return false;
+ }
+ }
+
+ if (isset($_cache_info['config'])) {
+ $_params = array('resource_base_path' => $smarty->config_dir, 'get_source' => false, 'quiet'=>true);
+ foreach (array_keys($_cache_info['config']) as $_config_dep) {
+ $_params['resource_name'] = $_config_dep;
+ if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) {
+ // config file has changed, regenerate cache
+ return false;
+ }
+ }
+ }
+ }
+
+ $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']] = array($params['results'], $_cache_info);
+
+ $smarty->_cache_info = $_cache_info;
+ return true;
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.read_cache_file.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.rm_auto.php
===================================================================
--- trunk/lib/smarty/internals/core.rm_auto.php (rev 0)
+++ trunk/lib/smarty/internals/core.rm_auto.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * delete an automagically created file by name and id
+ *
+ * @param string $auto_base
+ * @param string $auto_source
+ * @param string $auto_id
+ * @param integer $exp_time
+ * @return boolean
+ */
+
+// $auto_base, $auto_source = null, $auto_id = null, $exp_time = null
+
+function smarty_core_rm_auto($params, &$smarty)
+{
+ if (!@is_dir($params['auto_base']))
+ return false;
+
+ if(!isset($params['auto_id']) && !isset($params['auto_source'])) {
+ $_params = array(
+ 'dirname' => $params['auto_base'],
+ 'level' => 0,
+ 'exp_time' => $params['exp_time']
+ );
+ require_once(SMARTY_CORE_DIR . 'core.rmdir.php');
+ $_res = smarty_core_rmdir($_params, $smarty);
+ } else {
+ $_tname = $smarty->_get_auto_filename($params['auto_base'], $params['auto_source'], $params['auto_id']);
+
+ if(isset($params['auto_source'])) {
+ if (isset($params['extensions'])) {
+ $_res = false;
+ foreach ((array)$params['extensions'] as $_extension)
+ $_res |= $smarty->_unlink($_tname.$_extension, $params['exp_time']);
+ } else {
+ $_res = $smarty->_unlink($_tname, $params['exp_time']);
+ }
+ } elseif ($smarty->use_sub_dirs) {
+ $_params = array(
+ 'dirname' => $_tname,
+ 'level' => 1,
+ 'exp_time' => $params['exp_time']
+ );
+ require_once(SMARTY_CORE_DIR . 'core.rmdir.php');
+ $_res = smarty_core_rmdir($_params, $smarty);
+ } else {
+ // remove matching file names
+ $_handle = opendir($params['auto_base']);
+ $_res = true;
+ while (false !== ($_filename = readdir($_handle))) {
+ if($_filename == '.' || $_filename == '..') {
+ continue;
+ } elseif (substr($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, 0, strlen($_tname)) == $_tname) {
+ $_res &= (bool)$smarty->_unlink($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, $params['exp_time']);
+ }
+ }
+ }
+ }
+
+ return $_res;
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.rm_auto.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.rmdir.php
===================================================================
--- trunk/lib/smarty/internals/core.rmdir.php (rev 0)
+++ trunk/lib/smarty/internals/core.rmdir.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * delete a dir recursively (level=0 -> keep root)
+ * WARNING: no tests, it will try to remove what you tell it!
+ *
+ * @param string $dirname
+ * @param integer $level
+ * @param integer $exp_time
+ * @return boolean
+ */
+
+// $dirname, $level = 1, $exp_time = null
+
+function smarty_core_rmdir($params, &$smarty)
+{
+ if(!isset($params['level'])) { $params['level'] = 1; }
+ if(!isset($params['exp_time'])) { $params['exp_time'] = null; }
+
+ if($_handle = @opendir($params['dirname'])) {
+
+ while (false !== ($_entry = readdir($_handle))) {
+ if ($_entry != '.' && $_entry != '..') {
+ if (@is_dir($params['dirname'] . DIRECTORY_SEPARATOR . $_entry)) {
+ $_params = array(
+ 'dirname' => $params['dirname'] . DIRECTORY_SEPARATOR . $_entry,
+ 'level' => $params['level'] + 1,
+ 'exp_time' => $params['exp_time']
+ );
+ smarty_core_rmdir($_params, $smarty);
+ }
+ else {
+ $smarty->_unlink($params['dirname'] . DIRECTORY_SEPARATOR . $_entry, $params['exp_time']);
+ }
+ }
+ }
+ closedir($_handle);
+ }
+
+ if ($params['level']) {
+ return @rmdir($params['dirname']);
+ }
+ return (bool)$_handle;
+
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.rmdir.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.run_insert_handler.php
===================================================================
--- trunk/lib/smarty/internals/core.run_insert_handler.php (rev 0)
+++ trunk/lib/smarty/internals/core.run_insert_handler.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Handle insert tags
+ *
+ * @param array $args
+ * @return string
+ */
+function smarty_core_run_insert_handler($params, &$smarty)
+{
+
+ require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+ if ($smarty->debugging) {
+ $_params = array();
+ $_debug_start_time = smarty_core_get_microtime($_params, $smarty);
+ }
+
+ if ($smarty->caching) {
+ $_arg_string = serialize($params['args']);
+ $_name = $params['args']['name'];
+ if (!isset($smarty->_cache_info['insert_tags'][$_name])) {
+ $smarty->_cache_info['insert_tags'][$_name] = array('insert',
+ $_name,
+ $smarty->_plugins['insert'][$_name][1],
+ $smarty->_plugins['insert'][$_name][2],
+ !empty($params['args']['script']) ? true : false);
+ }
+ return $smarty->_smarty_md5."{insert_cache $_arg_string}".$smarty->_smarty_md5;
+ } else {
+ if (isset($params['args']['script'])) {
+ $_params = array('resource_name' => $smarty->_dequote($params['args']['script']));
+ require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
+ if(!smarty_core_get_php_resource($_params, $smarty)) {
+ return false;
+ }
+
+ if ($_params['resource_type'] == 'file') {
+ $smarty->_include($_params['php_resource'], true);
+ } else {
+ $smarty->_eval($_params['php_resource']);
+ }
+ unset($params['args']['script']);
+ }
+
+ $_funcname = $smarty->_plugins['insert'][$params['args']['name']][0];
+ $_content = $_funcname($params['args'], $smarty);
+ if ($smarty->debugging) {
+ $_params = array();
+ require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+ $smarty->_smarty_debug_info[] = array('type' => 'insert',
+ 'filename' => 'insert_'.$params['args']['name'],
+ 'depth' => $smarty->_inclusion_depth,
+ 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time);
+ }
+
+ if (!empty($params['args']["assign"])) {
+ $smarty->assign($params['args']["assign"], $_content);
+ } else {
+ return $_content;
+ }
+ }
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.run_insert_handler.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.smarty_include_php.php
===================================================================
--- trunk/lib/smarty/internals/core.smarty_include_php.php (rev 0)
+++ trunk/lib/smarty/internals/core.smarty_include_php.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * called for included php files within templates
+ *
+ * @param string $smarty_file
+ * @param string $smarty_assign variable to assign the included template's
+ * output into
+ * @param boolean $smarty_once uses include_once if this is true
+ * @param array $smarty_include_vars associative array of vars from
+ * {include file="blah" var=$var}
+ */
+
+// $file, $assign, $once, $_smarty_include_vars
+
+function smarty_core_smarty_include_php($params, &$smarty)
+{
+ $_params = array('resource_name' => $params['smarty_file']);
+ require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
+ smarty_core_get_php_resource($_params, $smarty);
+ $_smarty_resource_type = $_params['resource_type'];
+ $_smarty_php_resource = $_params['php_resource'];
+
+ if (!empty($params['smarty_assign'])) {
+ ob_start();
+ if ($_smarty_resource_type == 'file') {
+ $smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']);
+ } else {
+ $smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']);
+ }
+ $smarty->assign($params['smarty_assign'], ob_get_contents());
+ ob_end_clean();
+ } else {
+ if ($_smarty_resource_type == 'file') {
+ $smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']);
+ } else {
+ $smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']);
+ }
+ }
+}
+
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.smarty_include_php.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.write_cache_file.php
===================================================================
--- trunk/lib/smarty/internals/core.write_cache_file.php (rev 0)
+++ trunk/lib/smarty/internals/core.write_cache_file.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,96 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Prepend the cache information to the cache file
+ * and write it
+ *
+ * @param string $tpl_file
+ * @param string $cache_id
+ * @param string $compile_id
+ * @param string $results
+ * @return true|null
+ */
+
+ // $tpl_file, $cache_id, $compile_id, $results
+
+function smarty_core_write_cache_file($params, &$smarty)
+{
+
+ // put timestamp in cache header
+ $smarty->_cache_info['timestamp'] = time();
+ if ($smarty->cache_lifetime > -1){
+ // expiration set
+ $smarty->_cache_info['expires'] = $smarty->_cache_info['timestamp'] + $smarty->cache_lifetime;
+ } else {
+ // cache will never expire
+ $smarty->_cache_info['expires'] = -1;
+ }
+
+ // collapse nocache.../nocache-tags
+ if (preg_match_all('!\{(/?)nocache\:[0-9a-f]{32}#\d+\}!', $params['results'], $match, PREG_PATTERN_ORDER)) {
+ // remove everything between every pair of outermost noache.../nocache-tags
+ // and replace it by a single nocache-tag
+ // this new nocache-tag will be replaced by dynamic contents in
+ // smarty_core_process_compiled_includes() on a cache-read
+
+ $match_count = count($match[0]);
+ $results = preg_split('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!', $params['results'], -1, PREG_SPLIT_DELIM_CAPTURE);
+
+ $level = 0;
+ $j = 0;
+ for ($i=0, $results_count = count($results); $i < $results_count && $j < $match_count; $i++) {
+ if ($results[$i] == $match[0][$j]) {
+ // nocache tag
+ if ($match[1][$j]) { // closing tag
+ $level--;
+ unset($results[$i]);
+ } else { // opening tag
+ if ($level++ > 0) unset($results[$i]);
+ }
+ $j++;
+ } elseif ($level > 0) {
+ unset($results[$i]);
+ }
+ }
+ $params['results'] = implode('', $results);
+ }
+ $smarty->_cache_info['cache_serials'] = $smarty->_cache_serials;
+
+ // prepend the cache header info into cache file
+ $_cache_info = serialize($smarty->_cache_info);
+ $params['results'] = strlen($_cache_info) . "\n" . $_cache_info . $params['results'];
+
+ if (!empty($smarty->cache_handler_func)) {
+ // use cache_handler function
+ call_user_func_array($smarty->cache_handler_func,
+ array('write', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], null));
+ } else {
+ // use local cache file
+
+ if(!@is_writable($smarty->cache_dir)) {
+ // cache_dir not writable, see if it exists
+ if(!@is_dir($smarty->cache_dir)) {
+ $smarty->trigger_error('the $cache_dir \'' . $smarty->cache_dir . '\' does not exist, or is not a directory.', E_USER_ERROR);
+ return false;
+ }
+ $smarty->trigger_error('unable to write to $cache_dir \'' . realpath($smarty->cache_dir) . '\'. Be sure $cache_dir is writable by the web server user.', E_USER_ERROR);
+ return false;
+ }
+
+ $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']);
+ $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id);
+ $_params = array('filename' => $_cache_file, 'contents' => $params['results'], 'create_dirs' => true);
+ require_once(SMARTY_CORE_DIR . 'core.write_file.php');
+ smarty_core_write_file($_params, $smarty);
+ return true;
+ }
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.write_cache_file.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.write_compiled_include.php
===================================================================
--- trunk/lib/smarty/internals/core.write_compiled_include.php (rev 0)
+++ trunk/lib/smarty/internals/core.write_compiled_include.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,91 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Extract non-cacheable parts out of compiled template and write it
+ *
+ * @param string $compile_path
+ * @param string $template_compiled
+ * @return boolean
+ */
+
+function smarty_core_write_compiled_include($params, &$smarty)
+{
+ $_tag_start = 'if \(\$this->caching && \!\$this->_cache_including\)\: echo \'\{nocache\:('.$params['cache_serial'].')#(\d+)\}\'; endif;';
+ $_tag_end = 'if \(\$this->caching && \!\$this->_cache_including\)\: echo \'\{/nocache\:(\\2)#(\\3)\}\'; endif;';
+
+ preg_match_all('!('.$_tag_start.'(.*)'.$_tag_end.')!Us',
+ $params['compiled_content'], $_match_source, PREG_SET_ORDER);
+
+ // no nocache-parts found: done
+ if (count($_match_source)==0) return;
+
+ // convert the matched php-code to functions
+ $_include_compiled = "<?php /* Smarty version ".$smarty->_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n";
+ $_include_compiled .= " compiled from " . strtr(urlencode($params['resource_name']), array('%2F'=>'/', '%3A'=>':')) . " */\n\n";
+
+ $_compile_path = $params['include_file_path'];
+
+ $smarty->_cache_serials[$_compile_path] = $params['cache_serial'];
+ $_include_compiled .= "\$this->_cache_serials['".$_compile_path."'] = '".$params['cache_serial']."';\n\n?>";
+
+ $_include_compiled .= $params['plugins_code'];
+ $_include_compiled .= "<?php";
+
+ $this_varname = ((double)phpversion() >= 5.0) ? '_smarty' : 'this';
+ for ($_i = 0, $_for_max = count($_match_source); $_i < $_for_max; $_i++) {
+ $_match =& $_match_source[$_i];
+ $source = $_match[4];
+ if ($this_varname == '_smarty') {
+ /* rename $this to $_smarty in the sourcecode */
+ $tokens = token_get_all('<?php ' . $_match[4]);
+
+ /* remove trailing <?php */
+ $open_tag = '';
+ while ($tokens) {
+ $token = array_shift($tokens);
+ if (is_array($token)) {
+ $open_tag .= $token[1];
+ } else {
+ $open_tag .= $token;
+ }
+ if ($open_tag == '<?php ') break;
+ }
+
+ for ($i=0, $count = count($tokens); $i < $count; $i++) {
+ if (is_array($tokens[$i])) {
+ if ($tokens[$i][0] == T_VARIABLE && $tokens[$i][1] == '$this') {
+ $tokens[$i] = '$' . $this_varname;
+ } else {
+ $tokens[$i] = $tokens[$i][1];
+ }
+ }
+ }
+ $source = implode('', $tokens);
+ }
+
+ /* add function to compiled include */
+ $_include_compiled .= "
+function _smarty_tplfunc_$_match[2]_$_match[3](&\$$this_varname)
+{
+$source
+}
+
+";
+ }
+ $_include_compiled .= "\n\n?>\n";
+
+ $_params = array('filename' => $_compile_path,
+ 'contents' => $_include_compiled, 'create_dirs' => true);
+
+ require_once(SMARTY_CORE_DIR . 'core.write_file.php');
+ smarty_core_write_file($_params, $smarty);
+ return true;
+}
+
+
+?>
Property changes on: trunk/lib/smarty/internals/core.write_compiled_include.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.write_compiled_resource.php
===================================================================
--- trunk/lib/smarty/internals/core.write_compiled_resource.php (rev 0)
+++ trunk/lib/smarty/internals/core.write_compiled_resource.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * write the compiled resource
+ *
+ * @param string $compile_path
+ * @param string $compiled_content
+ * @return true
+ */
+function smarty_core_write_compiled_resource($params, &$smarty)
+{
+ if(!@is_writable($smarty->compile_dir)) {
+ // compile_dir not writable, see if it exists
+ if(!@is_dir($smarty->compile_dir)) {
+ $smarty->trigger_error('the $compile_dir \'' . $smarty->compile_dir . '\' does not exist, or is not a directory.', E_USER_ERROR);
+ return false;
+ }
+ $smarty->trigger_error('unable to write to $compile_dir \'' . realpath($smarty->compile_dir) . '\'. Be sure $compile_dir is writable by the web server user.', E_USER_ERROR);
+ return false;
+ }
+
+ $_params = array('filename' => $params['compile_path'], 'contents' => $params['compiled_content'], 'create_dirs' => true);
+ require_once(SMARTY_CORE_DIR . 'core.write_file.php');
+ smarty_core_write_file($_params, $smarty);
+ return true;
+}
+
+/* vim: set expandtab: */
+
+?>
Property changes on: trunk/lib/smarty/internals/core.write_compiled_resource.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/internals/core.write_file.php
===================================================================
--- trunk/lib/smarty/internals/core.write_file.php (rev 0)
+++ trunk/lib/smarty/internals/core.write_file.php 2008-10-15 13:59:09 UTC (rev 11)
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * write out a file to disk
+ *
+ * @param string $filename
+ * @param string $contents
+ * @param boolean $create_dirs
+ * @return boolean
+ */
+function smarty_core_write_file($params, &$smarty)
+{
+ $_dirname = dirname($params['filename']);
+
+ if ($params['create_dirs']) {
+ $_params = array('dir' => $_dirname);
+ require_once(SMARTY_CORE_DIR . 'core.create_dir_structure.php');
+ smarty_core_create_dir_structure($_params, $smarty);
+ }
+
+ // write to tmp file, then rename it to avoid file locking race condition
+ $_tmp_file = tempnam($_dirname, 'wrt');
+
+ if (!($fd = @fopen($_tmp_file, 'wb'))) {
+ $_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid('wrt');
+ if (!($fd = @fopen($_tmp_file, 'wb'))) {
+ $smarty->trigger_error("problem writing temporary file '$_tmp_file'");
+ return false;
+ }
+ }
+
+ fwrite($fd, $params['contents']);
+ fclose($fd);
+
+ if (DIRECTORY_SEPARATOR == '\\' || !@rename($_tmp_file, $params['filename'])) {
+ // On platforms and filesystems that cannot overwrite with rename()
+ // delete the file before renaming it -- because windows always suffers
+ // this, it is short-circuited to avoid the initial rename() attempt
+ @unlink($params['filename']);
+ @rename($_tmp_file, $params['filename']);
+ }
+ @chmod($params['filename'], $smarty->_file_perms);
+
+ return true;
+}
+
+/* vim: set expandtab: */
+
+?>
\ No newline at end of file
Property changes on: trunk/lib/smarty/internals/core.write_file.php
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-15 14:02:22
|
Revision: 10
http://openupload.svn.sourceforge.net/openupload/?rev=10&view=rev
Author: tsdogs
Date: 2008-10-15 13:58:01 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
First svn commit
Added Paths:
-----------
trunk/lib/modules/auth/
trunk/lib/modules/auth/default.inc.php
trunk/lib/modules/db/
trunk/lib/modules/default/
trunk/lib/modules/default/admin.inc.php
trunk/lib/modules/default/auth.inc.php
trunk/lib/modules/default/files.inc.php
trunk/lib/modules/tr/
trunk/lib/modules/tr/array.inc.php
trunk/lib/modules/tr/gettext.inc.php
trunk/lib/smarty/Config_File.class.php
trunk/lib/smarty/Smarty.class.php
trunk/lib/smarty/Smarty_Compiler.class.php
trunk/lib/smarty/debug.tpl
Added: trunk/lib/modules/auth/default.inc.php
===================================================================
--- trunk/lib/modules/auth/default.inc.php (rev 0)
+++ trunk/lib/modules/auth/default.inc.php 2008-10-15 13:58:01 UTC (rev 10)
@@ -0,0 +1,31 @@
+<?php
+/* use the db to Authenticate users */
+class defaultAuth extends authBase {
+
+ function defaultAuth() {
+ }
+
+ function init() {
+ $this->db = app()->db;
+ }
+
+ function authenticate($login,$password) {
+ $res = $this->db->queryUser($login);
+ //echo crypt($password); exit;
+ if ($res['login']==$login and crypt($password,$res['password'])==$res['password']) {
+ return true;
+ }
+ return false;
+ }
+
+ function userInfo($login) {
+ $result = $this->db->queryUser($login);
+ return $result;
+ }
+
+ function addUser($user) {
+ $user['password']=crypt($user['password']);
+ $this->db->addUser($user);
+ }
+}
+?>
\ No newline at end of file
Added: trunk/lib/modules/default/admin.inc.php
===================================================================
--- trunk/lib/modules/default/admin.inc.php (rev 0)
+++ trunk/lib/modules/default/admin.inc.php 2008-10-15 13:58:01 UTC (rev 10)
@@ -0,0 +1,66 @@
+<?php
+
+class AdminModule extends OpenUploadModule {
+var $actions = array (
+ "admin" => array (
+ 1 => "admin",
+ ),
+ "adminsettings" => array (
+ 1 => "settings",
+ ),
+ "adminplugins" => array (
+ 1 => "plugins",
+ ),
+ "adminfiles" => array (
+ 1 => "files",
+ ),
+ "adminusers" => array (
+ 1 => "users",
+ ),
+ "admingroups" => array (
+ 1 => "groups",
+ ),
+ "adminrights" => array (
+ 1 => "rights",
+ ),
+ );
+
+var $page;
+
+ function AdminModule() {
+ $this->menu = array (
+ "admin" => tr("Administration"),
+ );
+ foreach ($this->actions as $a => $v) {
+ $this->page[$a] = array ("title" => tr("Administration"));
+ }
+ }
+
+ function init() {
+ /* only if the user has admin privileges let it see the module */
+
+ }
+
+ function admin() {
+ }
+
+ function users() {
+ }
+
+ function groups() {
+ }
+
+ function rights() {
+ }
+
+ function files() {
+ }
+
+ function plugins() {
+ }
+
+ function settings() {
+ }
+
+}
+?>
\ No newline at end of file
Added: trunk/lib/modules/default/auth.inc.php
===================================================================
--- trunk/lib/modules/default/auth.inc.php (rev 0)
+++ trunk/lib/modules/default/auth.inc.php 2008-10-15 13:58:01 UTC (rev 10)
@@ -0,0 +1,149 @@
+<?php
+
+class AuthModule extends OpenUploadModule {
+var $actions = array (
+ "login" => array (
+ 1 => "loginForm",
+ 2 => "authenticate",
+ ),
+ "logout" => array (
+ 1 => "logout",
+ ),
+ "register" => array (
+ 1 => "registerForm",
+ 2 => "registerConfirm",
+ ),
+ );
+var $page;
+
+ function AuthModule() {
+ $this->page = array (
+ "login" => array (
+ "title" => tr("Login"),
+ ),
+ "register" => array (
+ "title" => tr("User registration"),
+ ),
+ );
+ }
+
+ function init() {
+ if (!app()->user->loggedin()) {
+ $this->menu['login']=tr('Login');
+ } else {
+ $this->menu['logout']=tr('Logout');
+ }
+ $this->tpl->assign('register',app()->checkACL(app()->user->userGroup(),'auth','register')=='allow');
+ }
+
+
+ function loginForm() {
+
+ /* disable login option link */
+ $this->tpl->assign('login',false);
+ $this->page['title']='Login';
+
+ $finfo = array();
+ app()->pluginAction('loginForm',$finfo,false);
+ //app()->mainPage = 'login';
+ }
+
+ function authenticate() {
+ if (!app()->user->authenticate()) {
+ app()->user->logout();
+ return false; /* never reached */
+ }
+ $finfo = array();
+ $result = app()->pluginAction('authenticate',$finfo,true);
+ if (!$result) { /* plugins forced a logout */
+ app()->user->logout();
+ return false; /* never reached */
+ }
+ /* authentication was successfull */
+ redirect();
+ }
+
+ function logout() {
+ app()->user->logout();
+ }
+
+ function registerForm() {
+ global $_SESSION;
+ global $_POST;
+
+ /* ask the plugins if require more options */
+ $result = app()->pluginAction('registerForm',$user);
+ if (!$result) {
+ /* some plugin disabled the registration */
+ redirect();
+ }
+ $this->tpl->assign('register',$_SESSION['register']);
+ }
+
+ function registerConfirm() {
+ global $_SESSION;
+ global $_POST;
+
+ if (isset($_POST['registerlogin'])) {
+ /* check for the unique login */
+ $u = app()->auth->userInfo($_POST['registerlogin']);
+ if ($u['login']!='') {
+ app()->error(tr('Username already taken, choose a new value'));
+ $failed = true;
+ }
+ if (strlen($_POST['registerlogin'])<5) {
+ app()->error(tr('Login name must be at least 5 characters long!'));
+ }
+ if ($_POST['registername']=='') {
+ app()->error(tr('Please insert Full Name'));
+ $failed = true;
+ }
+ if ($_POST['registeremail']=='' or !validEmail($_POST['registeremail'])) {
+ app()->error(tr('Please insert a valid e-mail!'));
+ $failed = true;
+ }
+ if (strlen(trim($_POST['registerpassword']))<5) {
+ app()->error(tr('Password must be at least 5 characters long!'));
+ $failed = true;
+ }
+ if ($_POST['registerpassword']!=$_POST['registerrepassword']) {
+ app()->error(tr('Passwords do not match! please retype.'));
+ $failed = true;
+ }
+ $user['login'] = $_POST['registerlogin'];
+ $user['name'] = $_POST['registername'];
+ $user['password'] = $_POST['registerpassword'];
+ $user['email'] = $_POST['registeremail'];
+ $user['group_id'] = app()->config['register']['default_group'];
+ $user['active'] = 1;
+ $result = app()->pluginAction('registerConfirm',$user);
+ $_SESSION['register']=$user;
+ unset($_SESSION['register']['password']);
+ if (!$result) {
+ $fauled = true;
+ }
+ if ($failed)
+ $this->prevStep(1); /* back to registration form */
+ app()->auth->addUser($user);
+ } else {
+ $this->prevStep(1); /* back to registration form */
+ }
+ unset($_SESSION['register']);
+ /* ask the plugins if require more options */
+ if ($user['active']=='1') {
+ app()->message(tr('Registration completed successfully. Have fun!'));
+ $_POST['username'] = $user['login'];
+ $_POST['pwd'] = $user['password'];
+ /* simulate the user login and proceed */
+ unset($_SESSION['user']);
+ $this->authenticate();
+ }
+ }
+
+ function registerEnable() {
+ /* if everything is ok register the user */
+
+ }
+
+}
+?>
\ No newline at end of file
Added: trunk/lib/modules/default/files.inc.php
===================================================================
--- trunk/lib/modules/default/files.inc.php (rev 0)
+++ trunk/lib/modules/default/files.inc.php 2008-10-15 13:58:01 UTC (rev 10)
@@ -0,0 +1,291 @@
+<?php
+
+class FilesModule extends OpenUploadModule {
+var $actions = array (
+ "u" => array (
+ 1 => "uploadForm",
+ 2 => "uploadOptions",
+ 3 => "uploadConfirm",
+ 4 => "uploadFileInfo",
+ ),
+ "d" => array (
+ 1 => "downloadForm",
+ 2 => "downloadRequest",
+ 3 => "downloadConfirm",
+ ),
+ "g" => array (
+ 1 => "serveFile",
+ ),
+ "r" => array (
+ 1 => "removeRequest",
+ 2 => "removeConfirm",
+ 3 => "removeResult",
+ ),
+ );
+var $page;
+var $menu;
+
+ function FilesModule() {
+ $this->page = array (
+ "u" => array (
+ "title" => tr("File upload"),
+ ),
+ "d" => array (
+ "title" => tr("File download"),
+ ),
+ "r" => array (
+ "title" => tr("File Removal"),
+ ),
+ );
+ $this->menu = array (
+ "u" => tr("File Upload"),
+ //"d" => tr("File Download"),
+ //"r" => tr("File Removal"),
+ );
+
+ }
+
+ function init() {
+ /* initialize */
+ }
+
+ /* real implementation */
+
+ function uploadForm() {
+ global $_SESSION;
+
+ unset($_SESSION['user']['u']);
+ $result = app()->pluginAction('uploadForm',$finfo);
+ }
+
+ function uploadOptions() {
+ global $_SESSION;
+ global $_FILES;
+
+ if (isset($_FILES['upload'])) {
+ /* prepare the file */
+ $tmpname = app()->config['DATA_PATH'].'/tmp/'.randomName();
+ move_uploaded_file($_FILES['upload']['tmp_name'],$tmpname);
+ $_SESSION['user']['u']['tmp']=$tmpname;
+ $_SESSION['user']['u']['mime']=$_FILES['upload']['type'];
+ $_SESSION['user']['u']['name']=$_FILES['upload']['name'];
+ $_SESSION['user']['u']['size']=$_FILES['upload']['size'];
+ $this->nextStep(app()->step);
+ } else if (!isset($_SESSION['user']['u'])) {
+ redirect();
+ }
+ $result = app()->pluginAction('uploadOptions',$_SESSION['user']['u']);
+ if (!$result) { /* some plugin blocked the upload */
+ /* remove the file */
+ redirect();
+ }
+ $this->tpl->assign('finfo',$_SESSION['user']['u']);
+ /* ask for information on the file */
+ }
+
+ function uploadConfirm() {
+ global $_POST;
+ global $_SESSION;
+
+ /* save the file */
+ /* send an e-mail if requested */
+ /* display the information on the upload */
+ if (isset($_POST['description'])) {
+ /* move the file to the actual location */
+ $finfo = $_SESSION['user']['u'];
+ $finfo['description'] = $_POST['description'];
+ /* now check plugins and if ok add file otherwise redirect */
+ $result = app()->pluginAction('uploadConfirm',$finfo);
+ if (!$result)
+ $this->prevStep();
+ /* everything ok then add the file */
+ $finfo['id']= app()->db->newFileId();
+ $finfo['remove']= app()->db->newFileId('remove');
+ app()->db->addFile($finfo);
+ foreach (app()->plugins as $plugin) {
+ if (count($plugin->fields)>0) {
+ foreach ($plugin->fields as $f) {
+ app()->db->addFileOption($finfo,$plugin->name,$f);
+ }
+ }
+ }
+ rename($_SESSION['user']['u']['tmp'],app()->config['DATA_PATH'].'/'.$finfo['id']);
+ $_SESSION['user']['u']=$finfo;
+ $this->nextStep();
+ }
+ }
+
+ function uploadFileInfo() {
+ if (isset($_SESSION['user']['u']['id'])) {
+ $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'];
+ $result = app()->pluginAction('uploadFileInfo',$finfo,false);
+ $this->tpl->assign('finfo',$finfo);
+ $this->tpl->assign('webbase',app()->config['WWW_SERVER'].app()->config['WWW_ROOT']);
+ } else {
+ redirect();
+ }
+ }
+
+ function downloadForm() {
+ global $_SESSION;
+ global $_GET;
+
+ unset($_SESSION['user']['d']);
+ if (isset($_GET['id'])) {
+ $_SESSION['user']['d']['id'] = $_GET['id'];
+ $this->nextStep();
+ }
+ $finfo = array();
+ app()->pluginAction('downloadForm',$finfo,false);
+ }
+
+ function downloadRequest() {
+ global $_GET;
+ global $_SESSION;
+
+ $id = '';
+ if (isset($_POST['id'])) {
+ $id = $_POST['id'];
+ } else if (isset($_SESSION['user']['d']['id'])) {
+ $id = $_SESSION['user']['d']['id'];
+ }
+ /* check if download exsists, and what are the properties */
+ if ($id != '') {
+ $finfo = app()->db->getFileInfo($id);
+ if ($finfo['id']!=$id) {
+ app()->error(tr('Requested file does not exsist!'));
+ $this->prevStep();
+ } else {
+ $_SESSION['user']['d']=$finfo;
+ $this->tpl->assign('finfo',$finfo);
+ $result = app()->pluginAction('downloadRequest',$finfo,false);
+ if ($result) {
+ $this->nextStep();
+ }
+ }
+ }
+ }
+
+ function downloadConfirm() {
+
+ /* here we do the actual download of the file */
+ if (!isset($_SESSION['user']['d'])) {
+ redirect();
+ } else if ($_SESSION['user']['d']['candownload']=='ok') {
+ $finfo = $_SESSION['user']['d'];
+ $this->tpl->assign('finfo',$finfo);
+ /* download is allowed */
+ } else {
+ $finfo = $_SESSION['user']['d'];
+ /* check wether the plugins are ok */
+ $result = app()->pluginAction('downloadConfirm',$finfo);
+ if (!$result)
+ $this->prevStep();
+ $_SESSION['user']['d']=$finfo;
+ $_SESSION['user']['d']['candownload']='ok';
+ /* now the user can download it */
+ $this->nextStep(app()->step);
+ }
+ }
+
+ function serveFile() {
+ global $_SESSION;
+ global $_POST;
+
+ /* here we do the actual download of the file */
+ if (!isset($_SESSION['user']['d'])) {
+ redirect();
+ } else if ($_SESSION['user']['d']['candownload']!='ok') {
+ $this->nextStep(2,'d');
+ } else {
+ $finfo = $_SESSION['user']['d'];
+ /* check wether the plugins are ok */
+ $result = app()->pluginAction('serveFile',$finfo);
+ if (!$result)
+ $this->nextStep(3,'d');
+ $_SESSION['user']['d']['candownload']='ok';
+ /* if we got this far the download should begin serving */
+ $file = app()->config['DATA_PATH'].'/'.$finfo['id'];
+ $filesize = filesize($file);
+ ob_clean();
+ header('Content-Type: '.$finfo['mime']);
+ header('Content-Length: '.$filesize);
+ header('Content-Disposition: attachment; filename="'.$finfo['name'].'"');
+ readfile($file);
+ /* file should have been sent now let's reset the download info */
+ $_SESSION['user']['d']['candownload']='ko';
+ exit(0);
+ }
+ }
+
+ function removeRequest() {
+ global $_GET;
+ global $_SESSION;
+
+ $id = '';
+ if (isset($_GET['id'])) {
+ $id = $_GET['id'];
+ } else if (isset($_SESSION['user']['r']['id'])) {
+ $id = $_SESSION['user']['r']['id'];
+ }
+ /* check if download exsists, and what are the properties */
+ if ($id != '') {
+ $finfo = app()->db->getFileInfo($id);
+ if ($finfo['id']!=$id) {
+ app()->error(tr('Wrong file id!'));
+ redirect();
+ } else if ($_GET['removeid']!=$finfo['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);
+ if (!$result) {
+ redirect();
+ }
+ }
+ } else {
+ app()->error(tr('Wrong file id!'));
+ redirect();
+ }
+ }
+
+ function removeConfirm() {
+ $finfo = $_SESSION['user']['r'];
+
+ /* here we do the actual download of the file */
+ if (!isset($_SESSION['user']['r'])) {
+ redirect();
+ } else {
+ $finfo = $_SESSION['user']['r'];
+ /* check wether the plugins are ok */
+ $result = app()->pluginAction('removeConfirm',$finfo);
+ if (!$result)
+ $this->prevStep();
+ /* now we can remove the file */
+ app()->db->removeFile($finfo['id']);
+ $file = app()->config['DATA_PATH'].'/'.$finfo['id'];
+ unlink($file);
+ /* display removal confirmation */
+ $this->nextStep();
+ }
+ }
+
+ function removeResult() {
+ if (!isset($_SESSION['user']['r'])) {
+ redirect();
+ } else {
+ $finfo = $_SESSION['user']['r'];
+ $result = app()->pluginAction('removeResult',$finfo,false);
+ $this->tpl->assign('finfo',$finfo);
+ unset($_SESSION['user']['r']); /* remove any file reference */
+ }
+ }
+
+}
+
+?>
\ No newline at end of file
Added: trunk/lib/modules/tr/array.inc.php
===================================================================
--- trunk/lib/modules/tr/array.inc.php (rev 0)
+++ trunk/lib/modules/tr/array.inc.php 2008-10-15 13:58:01 UTC (rev 10)
@@ -0,0 +1,56 @@
+<?php
+
+/* simple array translation */
+
+class ArrayTranslator extends translatorBase {
+var $update = false;
+var $TR;
+
+ function ArrayTranslator() {
+ }
+
+ function init() {
+ $locale = app()->user->userInfo('lang');
+ $lang = app()->db->getLang($locale);
+ $tr = array();
+ $this->files['openupload']=app()->config['INSTALL_ROOT'].'/locale/'.$lang['id'].'.inc.php';
+ if (file_exists($this->files['openupload'])) {
+ require_once($this->files['openupload']);
+ $this->TR['openupload']=$tr;
+ }
+ $tr = array();
+ $this->files['template']=app()->config['INSTALL_ROOT'].'/templates/'.app()->config['site']['template'].'/locale/'.$lang['id'].'.inc.php';
+ if (file_exists($this->files['template'])) {
+ require_once($this->files['template']);
+ $this->TR['template']=$tr;
+ }
+ /* setup page encoding */
+ if (isset($lang['charset']))
+ header('Content-Type: text/html; charset='.$lang['charset']);
+ }
+
+
+ function translate($txt,$domain = 'openupload') {
+
+ if (isset($this->TR[$domain][$txt])) {
+ return $this->TR[$domain][$txt];
+ } else {
+ if ($this->update) {
+ /* add the translation to the file */
+ $f = @fopen($this->files[$domain],'w+');
+ if ($f) {
+ fwrite($f,'<?php'."\n");
+ foreach ($this->TR[$domain] as $k => $v) {
+ fwrite($f,'$tr[\''.str_replace("'","\'",$k).'\']=\''.str_replace("'","\'",$v).'\';'."\n");
+ }
+ fwrite($f,'$tr[\''.str_replace("'","\'",$txt).'\']=\''.str_replace("'","\'",$txt).'\';'."\n");
+ fwrite($f,'?>');
+ fclose($f);
+ $this->TR[$domain][$txt]=$txt;
+ }
+ }
+ return $txt;
+ }
+ }
+}
+?>
\ No newline at end of file
Added: trunk/lib/modules/tr/gettext.inc.php
===================================================================
--- trunk/lib/modules/tr/gettext.inc.php (rev 0)
+++ trunk/lib/modules/tr/gettext.inc.php 2008-10-15 13:58:01 UTC (rev 10)
@@ -0,0 +1,28 @@
+<?php
+
+/* gettext translation module */
+
+class GettextTranslator extends translatorBase {
+
+ function GetTextTranslator() {
+ }
+
+ function init() {
+ $locale = app()->user->userInfo('lang');
+ $lang = app()->db->getLang($locale);
+ putenv("LANG=".$lang['locale']);
+ bindtextdomain('openupload',app()->config['INSTALL_ROOT'].'/locale');
+ bindtextdomain('template',app()->config['INSTALL_ROOT'].'/templates/'.app()->config['site']['template'].'/locale');
+ setlocale(LC_ALL,$lang['locale']);
+ /* setup page encoding */
+ if (isset($lang['charset']))
+ header('Content-Type: text/html; charset='.$lang['charset']);
+ }
+
+
+ function translate($txt,$domain = 'openupload') {
+ textdomain($domain);
+ return gettext($txt);
+ }
+}
+?>
\ No newline at end of file
Added: trunk/lib/smarty/Config_File.class.php
===================================================================
--- trunk/lib/smarty/Config_File.class.php (rev 0)
+++ trunk/lib/smarty/Config_File.class.php 2008-10-15 13:58:01 UTC (rev 10)
@@ -0,0 +1,389 @@
+<?php
+
+/**
+ * Config_File class.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @link http://smarty.php.net/
+ * @version 2.6.20
+ * @copyright Copyright: 2001-2005 New Digital Group, Inc.
+ * @author Andrei Zmievski <an...@ph...>
+ * @access public
+ * @package Smarty
+ */
+
+/* $Id: Config_File.class.php 2702 2007-03-08 19:11:22Z mohrt $ */
+
+/**
+ * Config file reading class
+ * @package Smarty
+ */
+class Config_File {
+ /**#@+
+ * Options
+ * @var boolean
+ */
+ /**
+ * Controls whether variables with the same name overwrite each other.
+ */
+ var $overwrite = true;
+
+ /**
+ * Controls whether config values of on/true/yes and off/false/no get
+ * converted to boolean values automatically.
+ */
+ var $booleanize = true;
+
+ /**
+ * Controls whether hidden config sections/vars are read from the file.
+ */
+ var $read_hidden = true;
+
+ /**
+ * Controls whether or not to fix mac or dos formatted newlines.
+ * If set to true, \r or \r\n will be changed to \n.
+ */
+ var $fix_newlines = true;
+ /**#@-*/
+
+ /** @access private */
+ var $_config_path = "";
+ var $_config_data = array();
+ /**#@-*/
+
+ /**
+ * Constructs a new config file class.
+ *
+ * @param string $config_path (optional) path to the config files
+ */
+ function Config_File($config_path = NULL)
+ {
+ if (isset($config_path))
+ $this->set_path($config_path);
+ }
+
+
+ /**
+ * Set the path where configuration files can be found.
+ *
+ * @param string $config_path path to the config files
+ */
+ function set_path($config_path)
+ {
+ if (!empty($config_path)) {
+ if (!is_string($config_path) || !file_exists($config_path) || !is_dir($config_path)) {
+ $this->_trigger_error_msg("Bad config file path '$config_path'");
+ return;
+ }
+ if(substr($config_path, -1) != DIRECTORY_SEPARATOR) {
+ $config_path .= DIRECTORY_SEPARATOR;
+ }
+
+ $this->_config_path = $config_path;
+ }
+ }
+
+
+ /**
+ * Retrieves config info based on the file, section, and variable name.
+ *
+ * @param string $file_name config file to get info for
+ * @param string $section_name (optional) section to get info for
+ * @param string $var_name (optional) variable to get info for
+ * @return string|array a value or array of values
+ */
+ function get($file_name, $section_name = NULL, $var_name = NULL)
+ {
+ if (empty($file_name)) {
+ $this->_trigger_error_msg('Empty config file name');
+ return;
+ } else {
+ $file_name = $this->_config_path . $file_name;
+ if (!isset($this->_config_data[$file_name]))
+ $this->load_file($file_name, false);
+ }
+
+ if (!empty($var_name)) {
+ if (empty($section_name)) {
+ return $this->_config_data[$file_name]["vars"][$var_name];
+ } else {
+ if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name]))
+ return $this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name];
+ else
+ return array();
+ }
+ } else {
+ if (empty($section_name)) {
+ return (array)$this->_config_data[$file_name]["vars"];
+ } else {
+ if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"]))
+ return (array)$this->_config_data[$file_name]["sections"][$section_name]["vars"];
+ else
+ return array();
+ }
+ }
+ }
+
+
+ /**
+ * Retrieves config info based on the key.
+ *
+ * @param $file_name string config key (filename/section/var)
+ * @return string|array same as get()
+ * @uses get() retrieves information from config file and returns it
+ */
+ function &get_key($config_key)
+ {
+ list($file_name, $section_name, $var_name) = explode('/', $config_key, 3);
+ $result = &$this->get($file_name, $section_name, $var_name);
+ return $result;
+ }
+
+ /**
+ * Get all loaded config file names.
+ *
+ * @return array an array of loaded config file names
+ */
+ function get_file_names()
+ {
+ return array_keys($this->_config_data);
+ }
+
+
+ /**
+ * Get all section names from a loaded file.
+ *
+ * @param string $file_name config file to get section names from
+ * @return array an array of section names from the specified file
+ */
+ function get_section_names($file_name)
+ {
+ $file_name = $this->_config_path . $file_name;
+ if (!isset($this->_config_data[$file_name])) {
+ $this->_trigger_error_msg("Unknown config file '$file_name'");
+ return;
+ }
+
+ return array_keys($this->_config_data[$file_name]["sections"]);
+ }
+
+
+ /**
+ * Get all global or section variable names.
+ *
+ * @param string $file_name config file to get info for
+ * @param string $section_name (optional) section to get info for
+ * @return array an array of variables names from the specified file/section
+ */
+ function get_var_names($file_name, $section = NULL)
+ {
+ if (empty($file_name)) {
+ $this->_trigger_error_msg('Empty config file name');
+ return;
+ } else if (!isset($this->_config_data[$file_name])) {
+ $this->_trigger_error_msg("Unknown config file '$file_name'");
+ return;
+ }
+
+ if (empty($section))
+ return array_keys($this->_config_data[$file_name]["vars"]);
+ else
+ return array_keys($this->_config_data[$file_name]["sections"][$section]["vars"]);
+ }
+
+
+ /**
+ * Clear loaded config data for a certain file or all files.
+ *
+ * @param string $file_name file to clear config data for
+ */
+ function clear($file_name = NULL)
+ {
+ if ($file_name === NULL)
+ $this->_config_data = array();
+ else if (isset($this->_config_data[$file_name]))
+ $this->_config_data[$file_name] = array();
+ }
+
+
+ /**
+ * Load a configuration file manually.
+ *
+ * @param string $file_name file name to load
+ * @param boolean $prepend_path whether current config path should be
+ * prepended to the filename
+ */
+ function load_file($file_name, $prepend_path = true)
+ {
+ if ($prepend_path && $this->_config_path != "")
+ $config_file = $this->_config_path . $file_name;
+ else
+ $config_file = $file_name;
+
+ ini_set('track_errors', true);
+ $fp = @fopen($config_file, "r");
+ if (!is_resource($fp)) {
+ $this->_trigger_error_msg("Could not open config file '$config_file'");
+ return false;
+ }
+
+ $contents = ($size = filesize($config_file)) ? fread($fp, $size) : '';
+ fclose($fp);
+
+ $this->_config_data[$config_file] = $this->parse_contents($contents);
+ return true;
+ }
+
+ /**
+ * Store the contents of a file manually.
+ *
+ * @param string $config_file file name of the related contents
+ * @param string $contents the file-contents to parse
+ */
+ function set_file_contents($config_file, $contents)
+ {
+ $this->_config_data[$config_file] = $this->parse_contents($contents);
+ return true;
+ }
+
+ /**
+ * parse the source of a configuration file manually.
+ *
+ * @param string $contents the file-contents to parse
+ */
+ function parse_contents($contents)
+ {
+ if($this->fix_newlines) {
+ // fix mac/dos formatted newlines
+ $contents = preg_replace('!\r\n?!', "\n", $contents);
+ }
+
+ $config_data = array();
+ $config_data['sections'] = array();
+ $config_data['vars'] = array();
+
+ /* reference to fill with data */
+ $vars =& $config_data['vars'];
+
+ /* parse file line by line */
+ preg_match_all('!^.*\r?\n?!m', $contents, $match);
+ $lines = $match[0];
+ for ($i=0, $count=count($lines); $i<$count; $i++) {
+ $line = $lines[$i];
+ if (empty($line)) continue;
+
+ if ( substr($line, 0, 1) == '[' && preg_match('!^\[(.*?)\]!', $line, $match) ) {
+ /* section found */
+ if (substr($match[1], 0, 1) == '.') {
+ /* hidden section */
+ if ($this->read_hidden) {
+ $section_name = substr($match[1], 1);
+ } else {
+ /* break reference to $vars to ignore hidden section */
+ unset($vars);
+ $vars = array();
+ continue;
+ }
+ } else {
+ $section_name = $match[1];
+ }
+ if (!isset($config_data['sections'][$section_name]))
+ $config_data['sections'][$section_name] = array('vars' => array());
+ $vars =& $config_data['sections'][$section_name]['vars'];
+ continue;
+ }
+
+ if (preg_match('/^\s*(\.?\w+)\s*=\s*(.*)/s', $line, $match)) {
+ /* variable found */
+ $var_name = rtrim($match[1]);
+ if (strpos($match[2], '"""') === 0) {
+ /* handle multiline-value */
+ $lines[$i] = substr($match[2], 3);
+ $var_value = '';
+ while ($i<$count) {
+ if (($pos = strpos($lines[$i], '"""')) === false) {
+ $var_value .= $lines[$i++];
+ } else {
+ /* end of multiline-value */
+ $var_value .= substr($lines[$i], 0, $pos);
+ break;
+ }
+ }
+ $booleanize = false;
+
+ } else {
+ /* handle simple value */
+ $var_value = preg_replace('/^([\'"])(.*)\1$/', '\2', rtrim($match[2]));
+ $booleanize = $this->booleanize;
+
+ }
+ $this->_set_config_var($vars, $var_name, $var_value, $booleanize);
+ }
+ /* else unparsable line / means it is a comment / means ignore it */
+ }
+ return $config_data;
+ }
+
+ /**#@+ @access private */
+ /**
+ * @param array &$container
+ * @param string $var_name
+ * @param mixed $var_value
+ * @param boolean $booleanize determines whether $var_value is converted to
+ * to true/false
+ */
+ function _set_config_var(&$container, $var_name, $var_value, $booleanize)
+ {
+ if (substr($var_name, 0, 1) == '.') {
+ if (!$this->read_hidden)
+ return;
+ else
+ $var_name = substr($var_name, 1);
+ }
+
+ if (!preg_match("/^[a-zA-Z_]\w*$/", $var_name)) {
+ $this->_trigger_error_msg("Bad variable name '$var_name'");
+ return;
+ }
+
+ if ($booleanize) {
+ if (preg_match("/^(on|true|yes)$/i", $var_value))
+ $var_value = true;
+ else if (preg_match("/^(off|false|no)$/i", $var_value))
+ $var_value = false;
+ }
+
+ if (!isset($container[$var_name]) || $this->overwrite)
+ $container[$var_name] = $var_value;
+ else {
+ settype($container[$var_name], 'array');
+ $container[$var_name][] = $var_value;
+ }
+ }
+
+ /**
+ * @uses trigger_error() creates a PHP warning/error
+ * @param string $error_msg
+ * @param integer $error_type one of
+ */
+ function _trigger_error_msg($error_msg, $error_type = E_USER_WARNING)
+ {
+ trigger_error("Config_File error: $error_msg", $error_type);
+ }
+ /**#@-*/
+}
+
+?>
Property changes on: trunk/lib/smarty/Config_File.class.php
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/lib/smarty/Smarty.class.php
===================================================================
--- trunk/lib/smarty/Smarty.class.php (rev 0)
+++ trunk/lib/smarty/Smarty.class.php 2008-10-15 13:58:01 UTC (rev 10)
@@ -0,0 +1,1960 @@
+<?php
+
+/**
+ * Project: Smarty: the PHP compiling template engine
+ * File: Smarty.class.php
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For questions, help, comments, discussion, etc., please join the
+ * Smarty mailing list. Send a blank e-mail to
+ * sma...@li...
+ *
+ * @link http://smarty.php.net/
+ * @copyright 2001-2005 New Digital Group, Inc.
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author Andrei Zmievski <an...@ph...>
+ * @package Smarty
+ * @version 2.6.20
+ */
+
+/* $Id: Smarty.class.php 2722 2007-06-18 14:29:00Z danilo $ */
+
+/**
+ * DIR_SEP isn't used anymore, but third party apps might
+ */
+if(!defined('DIR_SEP')) {
+ define('DIR_SEP', DIRECTORY_SEPARATOR);
+}
+
+/**
+ * set SMARTY_DIR to absolute path to Smarty library files.
+ * if not defined, include_path will be used. Sets SMARTY_DIR only if user
+ * application has not already defined it.
+ */
+
+if (!defined('SMARTY_DIR')) {
+ define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+}
+
+if (!defined('SMARTY_CORE_DIR')) {
+ define('SMARTY_CORE_DIR', SMARTY_DIR . 'internals' . DIRECTORY_SEPARATOR);
+}
+
+define('SMARTY_PHP_PASSTHRU', 0);
+define('SMARTY_PHP_QUOTE', 1);
+define('SMARTY_PHP_REMOVE', 2);
+define('SMARTY_PHP_ALLOW', 3);
+
+/**
+ * @package Smarty
+ */
+class Smarty
+{
+ /**#@+
+ * Smarty Configuration Section
+ */
+
+ /**
+ * The name of the directory where templates are located.
+ *
+ * @var string
+ */
+ var $template_dir = 'templates';
+
+ /**
+ * The directory where compiled templates are located.
+ *
+ * @var string
+ */
+ var $compile_dir = 'templates_c';
+
+ /**
+ * The directory where config files are located.
+ *
+ * @var string
+ */
+ var $config_dir = 'configs';
+
+ /**
+ * An array of directories searched for plugins.
+ *
+ * @var array
+ */
+ var $plugins_dir = array('plugins');
+
+ /**
+ * If debugging is enabled, a debug console window will display
+ * when the page loads (make sure your browser allows unrequested
+ * popup windows)
+ *
+ * @var boolean
+ */
+ var $debugging = false;
+
+ /**
+ * When set, smarty does uses this value as error_reporting-level.
+ *
+ * @var boolean
+ */
+ var $error_reporting = null;
+
+ /**
+ * This is the path to the debug console template. If not set,
+ * the default one will be used.
+ *
+ * @var string
+ */
+ var $debug_tpl = '';
+
+ /**
+ * This determines if debugging is enable-able from the browser.
+ * <ul>
+ * <li>NONE => no debugging control allowed</li>
+ * <li>URL => enable debugging when SMARTY_DEBUG is found in the URL.</li>
+ * </ul>
+ * @link http://www.foo.dom/index.php?SMARTY_DEBUG
+ * @var string
+ */
+ var $debugging_ctrl = 'NONE';
+
+ /**
+ * This tells Smarty whether to check for recompiling or not. Recompiling
+ * does not need to happen unless a template or config file is changed.
+ * Typically you enable this during development, and disable for
+ * production.
+ *
+ * @var boolean
+ */
+ var $compile_check = true;
+
+ /**
+ * This forces templates to compile every time. Useful for development
+ * or debugging.
+ *
+ * @var boolean
+ */
+ var $force_compile = false;
+
+ /**
+ * This enables template caching.
+ * <ul>
+ * <li>0 = no caching</li>
+ * <li>1 = use class cache_lifetime value</li>
+ * <li>2 = use cache_lifetime in cache file</li>
+ * </ul>
+ * @var integer
+ */
+ var $caching = 0;
+
+ /**
+ * The name of the directory for cache files.
+ *
+ * @var string
+ */
+ var $cache_dir = 'cache';
+
+ /**
+ * This is the number of seconds cached content will persist.
+ * <ul>
+ * <li>0 = always regenerate cache</li>
+ * <li>-1 = never expires</li>
+ * </ul>
+ *
+ * @var integer
+ */
+ var $cache_lifetime = 3600;
+
+ /**
+ * Only used when $caching is enabled. If true, then If-Modified-Since headers
+ * are respected with cached content, and appropriate HTTP headers are sent.
+ * This way repeated hits to a cached page do not send the entire page to the
+ * client every time.
+ *
+ * @var boolean
+ */
+ var $cache_modified_check = false;
+
+ /**
+ * This determines how Smarty handles "<?php ... ?>" tags in templates.
+ * possible values:
+ * <ul>
+ * <li>SMARTY_PHP_PASSTHRU -> print tags as plain text</li>
+ * <li>SMARTY_PHP_QUOTE -> escape tags as entities</li>
+ * <li>SMARTY_PHP_REMOVE -> remove php tags</li>
+ * <li>SMARTY_PHP_ALLOW -> execute php tags</li>
+ * </ul>
+ *
+ * @var integer
+ */
+ var $php_handling = SMARTY_PHP_PASSTHRU;
+
+ /**
+ * This enables template security. When enabled, many things are restricted
+ * in the templates that normally would go unchecked. This is useful when
+ * untrusted parties are editing templates and you want a reasonable level
+ * of security. (no direct execution of PHP in templates for example)
+ *
+ * @var boolean
+ */
+ var $security = false;
+
+ /**
+ * This is the list of template directories that are considered secure. This
+ * is used only if {@link $security} is enabled. One directory per array
+ * element. {@link $template_dir} is in this list implicitly.
+ *
+ * @var array
+ */
+ var $secure_dir = array();
+
+ /**
+ * These are the security settings for Smarty. They are used only when
+ * {@link $security} is enabled.
+ *
+ * @var array
+ */
+ var $security_settings = array(
+ 'PHP_HANDLING' => false,
+ 'IF_FUNCS' => array('array', 'list',
+ 'isset', 'empty',
+ 'count', 'sizeof',
+ 'in_array', 'is_array',
+ 'true', 'false', 'null'),
+ 'INCLUDE_ANY' => false,
+ 'PHP_TAGS' => false,
+ 'MODIFIER_FUNCS' => array('count'),
+ 'ALLOW_CONSTANTS' => false
+ );
+
+ /**
+ * This is an array of directories where trusted php scripts reside.
+ * {@link $security} is disabled during their inclusion/execution.
+ *
+ * @var array
+ */
+ var $trusted_dir = array();
+
+ /**
+ * The left delimiter used for the template tags.
+ *
+ * @var string
+ */
+ var $left_delimiter = '{';
+
+ /**
+ * The right delimiter used for the template tags.
+ *
+ * @var string
+ */
+ var $right_delimiter = '}';
+
+ /**
+ * The order in which request variables are registered, similar to
+ * variables_order in php.ini E = Environment, G = GET, P = POST,
+ * C = Cookies, S = Server
+ *
+ * @var string
+ */
+ var $request_vars_order = 'EGPCS';
+
+ /**
+ * Indicates wether $HTTP_*_VARS[] (request_use_auto_globals=false)
+ * are uses as request-vars or $_*[]-vars. note: if
+ * request_use_auto_globals is true, then $request_vars_order has
+ * no effect, but the php-ini-value "gpc_order"
+ *
+ * @var boolean
+ */
+ var $request_use_auto_globals = true;
+
+ /**
+ * Set this if you want different sets of compiled files for the same
+ * templates. This is useful for things like different languages.
+ * Instead of creating separate sets of templates per language, you
+ * set different compile_ids like 'en' and 'de'.
+ *
+ * @var string
+ */
+ var $compile_id = null;
+
+ /**
+ * This tells Smarty whether or not to use sub dirs in the cache/ and
+ * templates_c/ directories. sub directories better organized, but
+ * may not work well with PHP safe mode enabled.
+ *
+ * @var boolean
+ *
+ */
+ var $use_sub_dirs = false;
+
+ /**
+ * This is a list of the modifiers to apply to all template variables.
+ * Put each modifier in a separate array element in the order you want
+ * them applied. example: <code>array('escape:"htmlall"');</code>
+ *
+ * @var array
+ */
+ var $default_modifiers = array();
+
+ /**
+ * This is the resource type to be used when not specified
+ * at the beginning of the resource path. examples:
+ * $smarty->display('file:index.tpl');
+ * $smarty->display('db:index.tpl');
+ * $smarty->display('index.tpl'); // will use default resource type
+ * {include file="file:index.tpl"}
+ * {include file="db:index.tpl"}
+ * {include file="index.tpl"} {* will use default resource type *}
+ *
+ * @var array
+ */
+ var $default_resource_type = 'file';
+
+ /**
+ * The function used for cache file handling. If not set, built-in caching is used.
+ *
+ * @var null|string function name
+ */
+ var $cache_handler_func = null;
+
+ /**
+ * This indicates which filters are automatically loaded into Smarty.
+ *
+ * @var array array of filter names
+ */
+ var $autoload_filters = array();
+
+ /**#@+
+ * @var boolean
+ */
+ /**
+ * This tells if config file vars of the same name overwrite each other or not.
+ * if disabled, same name variables are accumulated in an array.
+ */
+ var $config_overwrite = true;
+
+ /**
+ * This tells whether or not to automatically booleanize config file variables.
+ * If enabled, then the strings "on", "true", and "yes" are treated as boolean
+ * true, and "off", "false" and "no" are treated as boolean false.
+ */
+ var $config_booleanize = true;
+
+ /**
+ * This tells whether hidden sections [.foobar] are readable from the
+ * tempalates or not. Normally you would never allow this since that is
+ * the point behind hidden sections: the application can access them, but
+ * the templates cannot.
+ */
+ var $config_read_hidden = false;
+
+ /**
+ * This tells whether or not automatically fix newlines in config files.
+ * It basically converts \r (mac) or \r\n (dos) to \n
+ */
+ var $config_fix_newlines = true;
+ /**#@-*/
+
+ /**
+ * If a template cannot be found, this PHP function will be executed.
+ * Useful for creating templates on-the-fly or other special action.
+ *
+ * @var string function name
+ */
+ var $default_template_handler_func = '';
+
+ /**
+ * The file that contains the compiler class. This can a full
+ * pathname, or relative to the php_include path.
+ *
+ * @var string
+ */
+ var $compiler_file = 'Smarty_Compiler.class.php';
+
+ /**
+ * The class used for compiling templates.
+ *
+ * @var string
+ */
+ var $compiler_class = 'Smarty_Compiler';
+
+ /**
+ * The class used to load config vars.
+ *
+ * @var string
+ */
+ var $config_class = 'Config_File';
+
+/**#@+
+ * END Smarty Configuration Section
+ * There should be no need to touch anything below this line.
+ * @access private
+ */
+ /**
+ * where assigned template vars are kept
+ *
+ * @var array
+ */
+ var $_tpl_vars = array();
+
+ /**
+ * stores run-time $smarty.* vars
+ *
+ * @var null|array
+ */
+ var $_smarty_vars = null;
+
+ /**
+ * keeps track of sections
+ *
+ * @var array
+ */
+ var $_sections = array();
+
+ /**
+ * keeps track of foreach blocks
+ *
+ * @var array
+ */
+ var $_foreach = array();
+
+ /**
+ * keeps track of tag hierarchy
+ *
+ * @var array
+ */
+ var $_tag_stack = array();
+
+ /**
+ * configuration object
+ *
+ * @var Config_file
+ */
+ var $_conf_obj = null;
+
+ /**
+ * loaded configuration settings
+ *
+ * @var array
+ */
+ var $_config = array(array('vars' => array(), 'files' => array()));
+
+ /**
+ * md5 checksum of the string 'Smarty'
+ *
+ * @var string
+ */
+ var $_smarty_md5 = 'f8d698aea36fcbead2b9d5359ffca76f';
+
+ /**
+ * Smarty version number
+ *
+ * @var string
+ */
+ var $_version = '2.6.20';
+
+ /**
+ * current template inclusion depth
+ *
+ * @var integer
+ */
+ var $_inclusion_depth = 0;
+
+ /**
+ * for different compiled templates
+ *
+ * @var string
+ */
+ var $_compile_id = null;
+
+ /**
+ * text in URL to enable debug mode
+ *
+ * @var string
+ */
+ var $_smarty_debug_id = 'SMARTY_DEBUG';
+
+ /**
+ * debugging information for debug console
+ *
+ * @var array
+ */
+ var $_smarty_debug_info = array();
+
+ /**
+ * info that makes up a cache file
+ *
+ * @var array
+ */
+ var $_cache_info = array();
+
+ /**
+ * default file permissions
+ *
+ * @var integer
+ */
+ var $_file_perms = 0644;
+
+ /**
+ * default dir permissions
+ *
+ * @var integer
+ */
+ var $_dir_perms = 0771;
+
+ /**
+ * registered objects
+ *
+ * @var array
+ */
+ var $_reg_objects = array();
+
+ /**
+ * table keeping track of plugins
+ *
+ * @var array
+ */
+ var $_plugins = array(
+ 'modifier' => array(),
+ 'function' => array(),
+ 'block' => array(),
+ 'compiler' => array(),
+ 'prefilter' => array(),
+ 'postfilter' => array(),
+ 'outputfilter' => array(),
+ 'resource' => array(),
+ 'insert' => array());
+
+
+ /**
+ * cache serials
+ *
+ * @var array
+ */
+ var $_cache_serials = array();
+
+ /**
+ * name of optional cache include file
+ *
+ * @var string
+ */
+ var $_cache_include = null;
+
+ /**
+ * indicate if the current code is used in a compiled
+ * include
+ *
+ * @var string
+ */
+ var $_cache_including = false;
+
+ /**#@-*/
+ /**
+ * The class constructor.
+ */
+ function Smarty()
+ {
+ $this->assign('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME']
+ : @$GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']);
+ }
+
+ /**
+ * assigns values to template variables
+ *
+ * @param array|string $tpl_var the template variable name(s)
+ * @param mixed $value the value to assign
+ */
+ function assign($tpl_var, $value = null)
+ {
+ if (is_array($tpl_var)){
+ foreach ($tpl_var as $key => $val) {
+ if ($key != '') {
+ $this->_tpl_vars[$key] = $val;
+ }
+ }
+ } else {
+ if ($tpl_var != '')
+ $this->_tpl_vars[$tpl_var] = $value;
+ }
+ }
+
+ /**
+ * assigns values to template variables by reference
+ *
+ * @param string $tpl_var the template variable name
+ * @param mixed $value the referenced value to assign
+ */
+ function assign_by_ref($tpl_var, &$value)
+ {
+ if ($tpl_var != '')
+ $this->_tpl_vars[$tpl_var] = &$value;
+ }
+
+ /**
+ * appends values to template variables
+ *
+ * @param array|string $tpl_var the template variable name(s)
+ * @param mixed $value the value to append
+ */
+ function append($tpl_var, $value=null, $merge=false)
+ {
+ if (is_array($tpl_var)) {
+ // $tpl_var is an array, ignore $value
+ foreach ($tpl_var as $_key => $_val) {
+ if ($_key != '') {
+ if(!@is_array($this->_tpl_vars[$_key])) {
+ settype($this->_tpl_vars[$_key],'array');
+ }
+ if($merge && is_array($_val)) {
+ foreach($_val as $_mkey => $_mval) {
+ $this->_tpl_vars[$_key][$_mkey] = $_mval;
+ }
+ } else {
+ $this->_tpl_vars[$_key][] = $_val;
+ }
+ }
+ }
+ } else {
+ if ($tpl_var != '' && isset($value)) {
+ if(!@is_array($this->_tpl_vars[$tpl_var])) {
+ settype($this->_tpl_vars[$tpl_var],'array');
+ }
+ if($merge && is_array($value)) {
+ foreach($value as $_mkey => $_mval) {
+ $this->_tpl_vars[$tpl_var][$_mkey] = $_mval;
+ }
+ } else {
+ $this->_tpl_vars[$tpl_var][] = $value;
+ }
+ }
+ }
+ }
+
+ /**
+ * appends values to template variables by reference
+ *
+ * @param string $tpl_var the template variable name
+ * @param mixed $value the referenced value to append
+ */
+ function append_by_ref($tpl_var, &$value, $merge=false)
+ {
+ if ($tpl_var != '' && isset($value)) {
+ if(!@is_array($this->_tpl_vars[$tpl_var])) {
+ settype($this->_tpl_vars[$tpl_var],'array');
+ }
+ if ($merge && is_array($value)) {
+ foreach($value as $_key => $_val) {
+ $this->_tpl_vars[$tpl_var][$_key] = &$value[$_key];
+ }
+ } else {
+ $this->_tpl_vars[$tpl_var][] = &$value;
+ }
+ }
+ }
+
+
+ /**
+ * clear the given assigned template variable.
+ *
+ * @param string $tpl_var the template variable to clear
+ */
+ function clear_assign($tpl_var)
+ {
+ if (is_array($tpl_var))
+ foreach ($tpl_var as $curr_var)
+ unset($this->_tpl_vars[$curr_var]);
+ else
+ unset($this->_tpl_vars[$tpl_var]);
+ }
+
+
+ /**
+ * Registers custom function to be used in templates
+ *
+ * @param string $function the name of the template function
+ * @param string $function_impl the name of the PHP function to register
+ */
+ function register_function($function, $function_impl, $cacheable=true, $cache_attrs=null)
+ {
+ $this->_plugins['function'][$function] =
+ array($function_impl, null, null, false, $cacheable, $cache_attrs);
+
+ }
+
+ /**
+ * Unregisters custom function
+ *
+ * @param string $function name of template function
+ */
+ function unregister_function($function)
+ {
+ unset($this->_plugins['function'][$function]);
+ }
+
+ /**
+ * Registers object to be used in templates
+ *
+ * @param string $object name of template object
+ * @param object &$object_impl the referenced PHP object to register
+ * @param null|array $allowed list of allowed methods (empty = all)
+ * @param boolean $smarty_args smarty argument format, else traditional
+ * @param null|array $block_functs list of methods that are block format
+ */
+ function register_object($object, &$object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
+ {
+ settype($allowed, 'array');
+ settype($smarty_args, 'boolean');
+ $this->_reg_objects[$object] =
+ array(&$object_impl, $allowed, $smarty_args, $block_methods);
+ }
+
+ /**
+ * Unregisters object
+ *
+ * @param string $object name of template object
+ */
+ function unregister_object($object)
+ {
+ unset($this->_reg_objects[$object]);
+ }
+
+
+ /**
+ * Registers block function to be used in templates
+ *
+ * @param string $block name of template block
+ * @param string $block_impl PHP function to register
+ */
+ function register_block($block, $block_impl, $cacheable=true, $cache_attrs=null)
+ {
+ $this->_plugins['block'][$block] =
+ array($block_impl, null, null, false, $cacheable, $cache_attrs);
+ }
+
+ /**
+ * Unregisters block function
+ *
+ * @param string $block name of template function
+ */
+ function unregister_block($block)
+ {
+ unset($this->_plugins['block'][$block]);
+ }
+
+ /**
+ * Registers compiler function
+ *
+ * @param string $function name of template function
+ * @param string $function_impl name of PHP function to register
+ */
+ function register_compiler_function($function, $function_impl, $cacheable=true)
+ {
+ $this->_plugins['compiler'][$function] =
+ array($function_impl, null, null, false, $cacheable);
+ }
+
+ /**
+ * Unregisters compiler function
+ *
+ * @param string $function name of template function
+ */
+ function unregister_compiler_function($function)
+ {
+ unset($this->_plugins['compiler'][$function]);
+ }
+
+ /**
+ * Registers modifier to be used in templates
+ *
+ * @param string $modifier name of template modifier
+ * @param string $modifier_impl name of PHP function to register
+ */
+ function register_modifier($modifier, $modifier_impl)
+ {
+ $this->_plugins['modifier'][$modifier] =
+ array($modifier_impl, null, null, false);
+ }
+
+ /**
+ * Unregisters modifier
+ *
+ * @param string $modifier name of template modifier
+ */
+ function unregister_modifier($modifier)
+ {
+ unset($this->_plugins['modifier'][$modifier]);
+ }
+
+ /**
+ * Registers a resource to fetch a template
+ *
+ * @param string $type name of resource
+ * @param array $functions array of functions to handle resource
+ */
+ function register_resource($type, $functions)
+ {
+ if (count($functions)==4) {
+ $this->_plugins['resource'][$type] =
+ array($functions, false);
+
+ } elseif (count($functions)==5) {
+ $this->_plugins['resource'][$type] =
+ array(array(array(&$functions[0], $functions[1])
+ ,array(&$functions[0], $functions[2])
+ ,array(&$functions[0], $functions[3])
+ ,array(&$functions[0], $functions[4]))
+ ,false);
+
+ } else {
+ $this->trigger_error("malformed function-list for '$type' in register_resource");
+
+ }
+ }
+
+ /**
+ * Unregisters a resource
+ *
+ * @param string $type name of resource
+ */
+ function unregister_resource($type)
+ {
+ unset($this->_plugins['resource'][$type]);
+ }
+
+ /**
+ * Registers a prefilter function to apply
+ * to a template before compiling
+ *
+ * @param callback $function
+ */
+ function register_prefilter($function)
+ {
+ $this->_plugins['prefilter'][$this->_get_filter_name($function)]
+ = array($function, null, null, false);
+ }
+
+ /**
+ * Unregisters a prefilter function
+ *
+ * @param callback $function
+ */
+ function unregister_prefilter($function)
+ {
+ unset($this->_plugins['prefilter'][$this->_get_filter_name($function)]);
+ }
+
+ /**
+ * Registers a postfilter function to apply
+ * to a compiled template after compilation
+ *
+ * @param callback $function
+ */
+ function register_postfilter($function)
+ {
+ $this->_plugins['postfilter'][$this->_get_filter_name($function)]
+ = array($function, null, null, false);
+ }
+
+ /**
+ * Unregisters a postfilter function
+ *
+ * @param callback $function
+ */
+ function unregister_postfilter($function)
+ {
+ unset($this->_plugins['postfilter'][$this->_get_filter_name($function)]);
+ }
+
+ /**
+ * Registers an output filter function to apply
+ * to a template output
+ *
+ * @param callback $function
+ */
+ function register_outputfilter($function)
+ {
+ $this->_plugins['outputfilter'][$this->_get_filter_name($function)]
+ = array($function, null, null, false);
+ }
+
+ /**
+ * Unregisters an outputfilter function
+ *
+ * @param callback $function
+ */
+ function unregister_outputfilter($function)
+ {
+ unset($this->_plugins['outputfilter'][$this->_get_filter_name($function)]);
+ }
+
+ /**
+ * load a filter of specified type and name
+ *
+ * @param string $type filter type
+ * @param string $name filter name
+ */
+ function load_filter($type, $name)
+ {
+ switch ($type) {
+ case 'output':
+ $_params = array('plugins' => array(array($type . 'filter', $name, null, null, false)));
+ require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
+ smarty_core_load_plugins($_params, $this);
+ break;
+
+ case 'pre':
+ case 'post':
+ if (!isset($this->_plugins[$type . 'filter'][$name]))
+ $this->_plugins[$type . 'filter'][$name] ...
[truncated message content] |
|
From: <ts...@us...> - 2008-10-15 13:56:51
|
Revision: 7
http://openupload.svn.sourceforge.net/openupload/?rev=7&view=rev
Author: tsdogs
Date: 2008-10-15 13:52:31 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
First svn commit
Added Paths:
-----------
trunk/www/config.inc.php.example
trunk/www/index.php
trunk/www/plugins/
trunk/www/plugins/captcha.php
trunk/www/templates/
trunk/www/templates/default/
trunk/www/templates/default/img/
trunk/www/templates/default/img/admin/
Added: trunk/www/config.inc.php.example
===================================================================
--- trunk/www/config.inc.php.example (rev 0)
+++ trunk/www/config.inc.php.example 2008-10-15 13:52:31 UTC (rev 7)
@@ -0,0 +1,88 @@
+<?php
+/* This is the general configuration file */
+
+/* Define the installation folder */
+$CONFIG['INSTALL_ROOT']='/usr/local/share/openupload';
+
+/* Define the web root foder (for the application) */
+$CONFIG['WEB_ROOT']='/usr/local/share/openupload/www';
+
+/* define http:// address */
+$CONFIG['WWW_SERVER']='http://yourdomain.com';
+/* define the additional web path */
+$CONFIG['WWW_ROOT']='/';
+
+/* Define where to store the uploaded files */
+$CONFIG['DATA_PATH']=$CONFIG['INSTALL_ROOT'].'/data';
+
+/* Define how long to keep the uploaded files
+ * please check the README for specification on how this works */
+$CONFIG['KEEP_FILES']=0;
+
+/* This specifies the kind of database to use:
+ * supported types are: mysql, pgsql, txt
+ * txt is a special mode where data is stored inside ascii files
+ * it can be used when no database is available
+ */
+$CONFIG['database']['type']='mysql';
+
+/* Depending on the option above... */
+
+/* MYSQL Database */
+$CONFIG['database']['host']='localhost';
+$CONFIG['database']['user']='databaseuser';
+$CONFIG['database']['password']='databasepwd';
+$CONFIG['database']['name']='openupload';
+
+/* TXT Database */
+//$CONFIG['database']['type']='txt';
+//$CONFIG['database']['rootdir']=$CONFIG['INSTALL_ROOT'].'/txtdb';
+
+$CONFIG['database']['prefix']='';
+
+/* PLUGINS: here you enable the plugins
+ * they will need to enable the functionality
+ * on a group basis
+ */
+$CONFIG['plugins'][] = 'banned';
+$CONFIG['plugins'][] = 'mimetypes';
+$CONFIG['plugins'][] = 'email';
+$CONFIG['plugins'][] = 'password';
+$CONFIG['plugins'][] = 'captcha';
+
+/* SITE TITLE */
+$CONFIG['site']['title'] = 'Open Upload';
+
+/* webmaster e-mail */
+$CONFIG['site']['webmaster'] = 'web...@yo...';
+/* email source address */
+$CONFIG['site']['email'] = 'ope...@yo...';
+
+/* REGISTRATION OPTIONS */
+$CONFIG['register']['nologingroup']='unregistered';
+/* registered user by default */
+$CONFIG['register']['default_group']='registered';
+
+
+/* SITE STYLE */
+$CONFIG['site']['template'] = 'default';
+/* ENABLE OR DISABLE SMARTY CACHING
+ * if enabled make sure a cache folder exsists
+ * and that it is writable
+ */
+$CONFIG['site']['caching']=0;
+
+/* NOTE: Depending on the template you might need to change some settings
+ * in the template configuration.
+ * The default template does not have this requirement
+ */
+
+/* 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';
+
+?>
Added: trunk/www/index.php
===================================================================
--- trunk/www/index.php (rev 0)
+++ trunk/www/index.php 2008-10-15 13:52:31 UTC (rev 7)
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Project: OpenUpload
+ * File: www/index.php
+ *
+ * LICENSE:
+ *
+ * Copyright 2008 Alessandro Briosi
+ *
+ * This file is part of OpenUpload.
+ *
+ * OpenUpload is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenUpload is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with OpenUpload; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @link http://openupload.sf.net/
+ * @copyright 2008 Alessandro Briosi
+ * @author Alessandro Briosi <tsdogs at briosix dot org>
+ * @package OpenUpload
+ * @version 0.3
+ */
+
+define ('__VALID_CALLING_SCRIPT', true);
+
+require_once('config.inc.php');
+require_once($CONFIG['INSTALL_ROOT'].'/lib/general.inc.php');
+
+global $application;
+
+/* check authentication */
+if (isset($_GET['action'])) {
+ $action = $_GET['action'];
+} else if (isset($_POST['action'])) {
+ $action = $_POST['action'];
+} else {
+ $action = '';
+}
+if (isset($_GET['step'])) {
+ $step = $_GET['step'];
+} else if (isset($_POST['step'])) {
+ $step = $_POST['step'];
+} else {
+ $step = '';
+}
+
+new Application($CONFIG);
+app()->run($action,$step);
+
+?>
Added: trunk/www/plugins/captcha.php
===================================================================
--- trunk/www/plugins/captcha.php (rev 0)
+++ trunk/www/plugins/captcha.php 2008-10-15 13:52:31 UTC (rev 7)
@@ -0,0 +1,16 @@
+<?php
+
+/* this generates a chiper and sets the session relative chiper protection */
+include ('../config.inc.php');
+
+require_once($CONFIG['INSTALL_ROOT'].'/plugins/securimage/securimage.php');
+
+
+$img = new securimage();
+$img->ttf_file = $CONFIG['INSTALL_ROOT'].'/plugins/securimage/elephant.ttf';
+$img->code_length = 6;
+$img->image_width = 200;
+$img->image_type = SI_IMAGE_JPG;
+$img->show();
+
+?>
\ 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-10-15 13:54:56
|
Revision: 8
http://openupload.svn.sourceforge.net/openupload/?rev=8&view=rev
Author: tsdogs
Date: 2008-10-15 13:53:52 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
First svn commit
Added Paths:
-----------
trunk/data/
trunk/lib/
trunk/lib/classes.inc.php
trunk/lib/general.inc.php
trunk/lib/main.inc.php
trunk/lib/modules/
trunk/lib/smarty/
trunk/locale/
trunk/locale/en.inc.php
trunk/locale/it/
trunk/locale/it.inc.php
trunk/locale/tools/
trunk/plugins/
trunk/plugins/banned.inc.php
trunk/plugins/captcha.inc.php
trunk/plugins/email.inc.php
trunk/plugins/mimetypes.inc.php
trunk/plugins/password.inc.php
trunk/plugins/securimage/
trunk/sql/
trunk/sql/mysql/
trunk/templates/
trunk/templates/default/
trunk/templates_c/
trunk/txtdb/
trunk/www/templates/default/img/admin/files.png
trunk/www/templates/default/img/admin/groups.png
trunk/www/templates/default/img/admin/plugins.png
trunk/www/templates/default/img/admin/rights.png
trunk/www/templates/default/img/admin/settings.png
trunk/www/templates/default/img/admin/users.png
trunk/www/templates/default/img/download.png
trunk/www/templates/default/img/openupload.jpg
trunk/www/templates/default/img/upload.png
trunk/www/templates/default/main.css
Added: trunk/lib/classes.inc.php
===================================================================
--- trunk/lib/classes.inc.php (rev 0)
+++ trunk/lib/classes.inc.php 2008-10-15 13:53:52 UTC (rev 8)
@@ -0,0 +1,203 @@
+<?php
+
+class translatorBase {
+ function translatorBase() {}
+
+ function init() {}
+
+ function translate($txt) {
+ return $txt;
+ }
+}
+
+class authBase {
+
+ function authBase() {
+ }
+
+
+}
+
+class dbBase {
+
+ function dbBase() {
+
+ }
+
+ function init() {
+
+ }
+
+ function addFile($info = array()) {
+ }
+
+ function addFileOption($info = array(),$module,$field) {
+ }
+
+ function removeFile($id) {
+ }
+
+ function getFileInfo($id = 0) {
+ return array();
+ }
+
+ function userInfo($login) {
+ return array();
+ }
+
+ function addUser($info) {
+ }
+
+ function deleteUser($login) {
+ }
+
+}
+
+class User {
+ function User() {
+ }
+
+ function init() {
+ $this->auth = app()->auth;
+ /* setup the user if not yet done */
+ }
+
+ function logout() {
+ global $_SESSION;
+
+ $messages = $_SESSION['user']['messages'];
+ $errors = $_SESSION['user']['errors'];
+ unset($_SESSION['user']);
+ $_SESSION['user']['messages'] = $messages;
+ $_SESSION['user']['errors'] = $errors;
+ redirect('?action=login');
+ }
+
+ function loggedin() {
+ global $_SESSION;
+ if (isset($_SESSION['user']['login']) and $_SESSION['user']['login']!='') {
+ return true;
+ }
+ return false;
+ }
+
+ function userInfo($field = '') {
+ if ($field != '') {
+ return $_SESSION['user'][$field];
+ } else {
+ return $_SESSION['user'];
+ }
+ }
+
+ function userGroup() {
+ if ($this->userInfo('group_id')!='')
+ $group = $this->userInfo('group_id');
+ else
+ $group = app()->config['register']['nologingroup'];
+ return $group;
+ }
+
+ function setUserInfo($user) {
+ $_SESSION['user']=$user;
+ }
+
+ function authenticate() {
+ global $_SESSION;
+ global $_GET;
+ global $_POST;
+
+ /* logout if requested */
+ if (isset($_GET['logout'])) {
+ $this->logout();
+ }
+
+ /* if already authenticated return */
+ if ($this->loggedin())
+ return true;
+
+ // if it's logging in save user and pwd
+ if (isset($_POST['username'])) {
+ $username = $_POST['username'];
+ $password = $_POST['pwd'];
+ }
+
+
+ if ($username != '') {
+ // use the default authentication method
+ $res = $this->auth->authenticate($username,$password);
+ if ($res) {
+ $_SESSION['user']['login']=$username;
+ /* retrieve user info */
+ $info = $this->auth->userinfo($username);
+ unset($info['password']);
+ $_SESSION['user'] = $info;
+ /* make the post not be resent on refresh */
+ redirect();
+ } else {
+ // set the error message for the login
+ app()->error(tr('Login incorrect!'));
+ }
+ }
+ return false;
+ }
+}
+
+class OpenUploadModule {
+var $actions = array();
+var $access = array();
+var $page = array();
+var $tpl;
+
+ function OpenUploadMoule() {
+ }
+
+ function nextStep($step = 0, $action = '') {
+ $step = $step==0?app()->step+1:$step;
+ $action = $action==''?app()->action:$action;
+ redirect('?action='.$action.'&step='.$step);
+ }
+
+ function prevStep() {
+ $step = app()->step>1?app()->step-1:1;
+ $action = app()->action;
+ redirect('?action='.$action.'&step='.$step);
+ }
+
+ function init() {
+ }
+
+}
+
+class OpenUploadPlugin {
+ var $pluginHTML = '';
+ var $messageHTML;
+ var $name;
+ var $fields = array();
+
+ function MySharePlugin() {
+ }
+
+ function assign($name, $value) {
+ app()->tpl->assign($name,$value);
+ }
+
+ function display($tpl) {
+ $this->pluginHTML .= app()->fetch('plugins/'.$this->name.'/'.$tpl);
+ }
+
+ function init() {
+ }
+
+/* functions that can be called
+ * all functions receive an array with the parameters
+ * some of them are called with an empty array = no params
+ * auth module = loginForm, authenticate, logout,
+ * registerForm, registerConfirm, registerEnable
+ * files module = uploadRequest, uploadOptions, uploadConfirm, UploadFileInfo,
+ * downloadForm, downloadRequest, downloadConfirm, serveFile,
+ * removeRequest, removeResult
+ */
+
+}
+
+?>
\ No newline at end of file
Added: trunk/lib/general.inc.php
===================================================================
--- trunk/lib/general.inc.php (rev 0)
+++ trunk/lib/general.inc.php 2008-10-15 13:53:52 UTC (rev 8)
@@ -0,0 +1,196 @@
+<?php
+/* Main library containing the general code for the application */
+
+ob_start();
+session_start();
+
+define('SMARTY_DIR', $CONFIG['INSTALL_ROOT'].'/lib/smarty/');
+require(SMARTY_DIR . 'Smarty.class.php');
+require_once($CONFIG['INSTALL_ROOT'].'/lib/classes.inc.php');
+require_once($CONFIG['INSTALL_ROOT'].'/lib/main.inc.php');
+
+/* check if the selected template needs personalizations code of some sort */
+if (file_exists($CONFIG['INSTALL_ROOT'].'/templates/'.$CONFIG['site']['template'].'/init.inc.php')) {
+ include ($CONFIG['INSTALL_ROOT'].'/templates/'.$CONFIG['site']['template'].'/init.inc.php');
+}
+
+/*************************************************************************************
+ * GLOBAL FUNCTIONS *
+ *************************************************************************************/
+
+function app() {
+ global $application;
+
+ return $application;
+}
+
+function redirect($url = '') {
+ global $_SERVER;
+ ob_clean();
+//echo 'redirect '.$url; exit;
+ /* there might be problems with urls containing other urls but this is not my case
+ anyway! */
+ if (strpos('http://',$url)===FALSE and strpos('https://',$url)===FALSE) {
+ header('location: '.$_SERVER['PHP_SELF'].$url);
+ } else {
+ header('location: '.$url);
+ }
+ exit(0);
+}
+
+function randomName($min = 10, $max = 20) {
+ $result = '';
+ for ($i = 1; $i<rand($min,$max); $i++) {
+ $result.= rand(0,9);
+ }
+ return $result;
+}
+
+
+function translate($txt,$domain,$args) {
+ /* now we retrieve the translated message */
+ $txt = app()->tr->translate($txt,$domain);
+ /* if there are arguments replace them */
+ if (count($args)>0) {
+ $trargs = array();
+ $i = 1;
+ foreach ($args as $a) {
+ $trargs['%'.$i]=$a;
+ $i++;
+ }
+ $txt = strtr($txt,$trargs);
+ }
+ /* return the trasnalted text */
+ return $txt;
+}
+/**
+ * @name tr
+ * @param $txt
+ * @param ...
+ * @description translates a string either from template or from code.
+ *
+ */
+function tr($txt) {
+ /* now we retrieve the translated message */
+ $args = array();
+ if (func_num_args()>1) {
+ $args = func_get_args();
+ array_shift($args);
+ }
+ $txt = translate($txt,'openupload',$args);
+ return $txt;
+}
+
+/**
+Validate an email address.
+Provide email address (raw input)
+Returns true if the email address has the email
+address format and the domain exists.
+Note: taken from here: http://www.linuxjournal.com/article/9585
+*/
+function validEmail($email)
+{
+ $isValid = true;
+ $atIndex = strrpos($email, "@");
+ if (is_bool($atIndex) && !$atIndex)
+ {
+ $isValid = false;
+ }
+ else
+ {
+ $domain = substr($email, $atIndex+1);
+ $local = substr($email, 0, $atIndex);
+ $localLen = strlen($local);
+ $domainLen = strlen($domain);
+ if ($localLen < 1 || $localLen > 64)
+ {
+ // local part length exceeded
+ $isValid = false;
+ }
+ else if ($domainLen < 1 || $domainLen > 255)
+ {
+ // domain part length exceeded
+ $isValid = false;
+ }
+ else if ($local[0] == '.' || $local[$localLen-1] == '.')
+ {
+ // local part starts or ends with '.'
+ $isValid = false;
+ }
+ else if (preg_match('/\\.\\./', $local))
+ {
+ // local part has two consecutive dots
+ $isValid = false;
+ }
+ else if (!preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain))
+ {
+ // character not valid in domain part
+ $isValid = false;
+ }
+ else if (preg_match('/\\.\\./', $domain))
+ {
+ // domain part has two consecutive dots
+ $isValid = false;
+ }
+ else if (!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/',
+ str_replace("\\\\","",$local)))
+ {
+ // character not valid in local part unless
+ // local part is quoted
+ if (!preg_match('/^"(\\\\"|[^"])+"$/',
+ str_replace("\\\\","",$local)))
+ {
+ $isValid = false;
+ }
+ }
+ if ($isValid && !(checkdnsrr($domain,"MX") || checkdnsrr($domain,"A")))
+ {
+ // domain not found in DNS
+ $isValid = false;
+ }
+ }
+ return $isValid;
+}
+
+/* this function generates a mail from a template */
+function sendmail($from,$reply,$to,$subject,$template, $attach = array()) {
+ $tpl = &app()->tpl;
+ $tpl->assign('subject',$subject);
+ $tpl->assign('from',$from);
+ $tpl->assign('to',$to);
+ /* generate a boundary */
+ $bound1 = "==Multipart_Bounday_x".md5(time())."x";
+ /* generate a second boundary for the alternativa */
+ $header = "From: ".$from."\nReply-To: ".$reply."\n";
+ $header .= "Mime-Version: 1.0\n";
+ if (count($attach)>0) {
+ $bound2 = "==Multipart_Bounday_z".md5(time())."z";
+ $header .= "Content-Type: multipart/mixed;\n boundary=\"".$bound1."\"";
+ } else {
+ $bound2 = $bound1;
+ $header .= "Content-Type: multipart/alternative;\n boundary=\"".$bound1."\"";
+ }
+ $tpl->assign('boudary',$bound2);
+ $msg = app()->fetch($template);
+
+ /* now add the attachements */
+ if (count($attach)>0) {
+ foreach ($attach as $a) {
+ $msg .="--".$bound1."\n";
+ $msg .="Content-Type: ".$a['mime'].";\n name=\"".$a['name']."\"\n";
+ $msg .="Content-Disposition: attachment; filename=\"".$a['name']."\"\n";
+ $msg .="Content-Transfer-Encoding: base64\n\n";
+ $msg .=chunk_split(base64_encode(file_get_contents($a['file'])));
+ }
+ $msg .="\n--".$bound1."--\n";
+ $msg .="\n--".$bound2."--\n";
+ } else {
+ $msg .="\n--".$bound1."--\n";
+ }
+ return mail($to,$subject,$msg,$header,'-f "'.$from.'"');
+}
+
+
+
+
+?>
Added: trunk/lib/main.inc.php
===================================================================
--- trunk/lib/main.inc.php (rev 0)
+++ trunk/lib/main.inc.php 2008-10-15 13:53:52 UTC (rev 8)
@@ -0,0 +1,274 @@
+<?php
+
+class Application {
+ var $db; /* database */
+ var $auth; /* authentication */
+ var $tr; /* trasnlation */
+ var $config; /* condifuration */
+ var $user; /* user */
+ var $modules; /* modules */
+ var $actions; /* actions related to modules */
+ var $plugins; /* plugins for modules */
+ var $page; /* page global config */
+ var $acl; /* module acl */
+ var $pluginAcl; /* plugin acl */
+
+ function Application($CONFIG) {
+ global $application;
+
+ $application = $this;
+ $this->config = $CONFIG;
+
+ /* initialize template engine */
+ $this->tpl = new Smarty();
+ $this->tpl->template_dir = $this->config['INSTALL_ROOT'].'/templates';
+ $this->tpl->compile_dir = $this->config['INSTALL_ROOT'].'/templates_c/';
+ $this->tpl->config_dir = SMARTY_DIR.'/config';
+ $this->tpl->cache_dir = $this->config['INSTALL_ROOT'].'/cache';
+ $this->tpl->caching = $this->config['site']['caching'];
+
+ $this->page['template']= $this->config['WWW_ROOT'].'/templates/'.$this->config['site']['template'];
+ /* initialize the application components */
+ if (!isset($_SESSIO['user']['lang'])) {
+ $_SESSION['user']['lang']='it';
+ }
+
+ /* include the class first */
+ $dbtype = $this->config['database']['type'];
+ require_once($this->config['INSTALL_ROOT'].'/lib/modules/db/'.$dbtype.'.inc.php');
+ $dbmname = $dbtype.'DB';
+ $this->db = new $dbmname();
+ $this->db->init($this->config['database']['prefix']);
+
+ /* authentication module */
+ if (isset($this->config['auth'])) {
+ $authmname = $this->config['auth'];
+ } else {
+ $authmname = 'default';
+ }
+ require_once($this->config['INSTALL_ROOT'].'/lib/modules/auth/'.$authmname.'.inc.php');
+ $auth = $authmname.'Auth';
+ $this->auth = new $auth();
+ $this->auth->init();
+
+ $this->user = new User();
+ $this->user->init();
+
+ /* translation module */
+ if (isset($this->config['translator'])) {
+ $trname = $this->config['translator'];
+ } else {
+ $trname = 'gettext';
+ }
+ require_once($this->config['INSTALL_ROOT'].'/lib/modules/tr/'.$trname.'.inc.php');
+ $tr = $trname.'Translator';
+ $this->tr = new $tr();
+ $this->tr->init();
+
+ $this->config['modules'][]='files';
+ $this->config['modules'][]='auth';
+ $this->config['modules'][]='admin';
+
+ $this->loadACL();
+ $this->initModules();
+ }
+
+ function fetch($tname) {
+ if (file_exists($this->tpl->template_dir.'/'.$this->config['site']['template'].'/'.$tname.'.tpl')) {
+ return $this->tpl->fetch($this->config['site']['template'].'/'.$tname.'.tpl');
+ } else {
+ return $this->tpl->fetch('default/'.$tname.'.tpl');
+ }
+ }
+
+ function display($tname) {
+ if (file_exists($this->tpl->template_dir.'/'.$this->config['site']['template'].'/'.$tname.'.tpl')) {
+ $this->tpl->display($this->config['site']['template'].'/'.$tname.'.tpl');
+ } else {
+ $this->tpl->display('default/'.$tname.'.tpl');
+ }
+ }
+
+ function message($msg) {
+ global $_SESSION;
+ $_SESSION['user']['messages'][] = $msg;
+ }
+
+ function error($msg) {
+ global $_SESSION;
+ $_SESSION['user']['errors'][] = $msg;
+ }
+
+ function initModules() {
+ /* initialize configured modules */
+ foreach ($this->config['modules'] as $module) {
+ /* create and initialize the module */
+ require_once($this->config['INSTALL_ROOT'].'/lib/modules/default/'.$module.'.inc.php');
+ $m = $module.'Module';
+ $m = new $m();
+ $m->name = $module;
+ $m->tpl = &$this->tpl;
+ foreach ($m->actions as $k => $l) {
+ $this->actions[$k] = $m->name;
+ $this->modules[$module] = $m;
+ }
+ }
+ foreach ($this->modules as $m) {
+ $m->init();
+ }
+ }
+
+ function initMenu($auth = false) {
+
+ $this->menu = array();
+ foreach ($this->modules as $m) {
+ foreach ($m->actions as $k => $a) {
+ if (isset($m->menu[$k])) {
+ $group = app()->user->userGroup();
+ if ($this->checkACL($group,$m->name,$k) == 'allow') {
+ $this->menu[$k]=$m->menu[$k];
+ }
+ }
+ }
+ }
+ $this->tpl->assign('menu',$this->menu);
+ }
+
+ function initPlugins() {
+ /* initialize plugin system */
+
+ $this->plugins = array();
+ /* load the plugins */
+ foreach ($this->config['plugins'] as $plugin) {
+ /* include the file */
+ if (file_exists($this->config['INSTALL_ROOT'].'/plugins/'.$plugin.'.inc.php')) {
+ require_once($this->config['INSTALL_ROOT'].'/plugins/'.$plugin.'.inc.php');
+ $pname = $plugin."Plugin";
+ $newp = new $pname();
+ $newp->name = $plugin;
+ $this->plugins[] = $newp;
+ } else {
+ $this->error(tr('plugin include file not found: %1',$plugin));
+ }
+ }
+ foreach ($this->plugins as $plugin) {
+ $plugin->init();
+ }
+ }
+
+ function pluginAction($action,&$finfo,$stop = true) {
+ $this->pluginHTML = '';
+ $result = true;
+
+ if (!is_array($this->plugins))
+ return true;
+ foreach ($this->plugins as $plugin) {
+ if (method_exists($plugin,$action)) {
+ /* check plugin acl */
+ $acl = 'disable'; /* disabled by default */
+ if (isset($this->pluginAcl[$plugin->name])) {
+ $acl = $this->pluginAcl[$plugin->name];
+ }
+ if (!$plugin->$action($finfo,$acl)) {
+ if ($stop) return false;
+ $result = false;
+ }
+ $this->pluginHTML .= $plugin->pluginHTML;
+ }
+ }
+ return $result;
+ }
+
+ function loadACL() {
+ /* loads the acl from the db */
+ $group = $this->user->userGroup();
+ $this->acl = $this->db->loadACL($group);
+ $this->pluginAcl = $this->db->loadPluginAcl($group);
+ }
+
+ function checkACL($group,$module,$action) {
+ $result = 'deny'; /* not defined are denyed by default */
+ if (isset($this->acl[$group][$module][$action])) {
+ $result = $this->acl[$group][$module][$action];
+ } else if (isset($this->acl[$group][$module]['*'])) {
+ $result = $this->acl[$group][$module]['*'];
+ } else if (isset($this->acl[$group]['*']['*'])) {
+ $result = $this->acl[$group]['*']['*'];
+ } else if (isset($this->acl['*'][$module][$action])) {
+ $result = $this->acl['*'][$module][$action];
+ } else if (isset($this->acl['*'][$module]['*'])) {
+ $result = $this->acl['*'][$module]['*'];
+ } else if (isset($this->acl['*']['*']['*'])) {
+ $result = $this->acl['*']['*']['*']; /* this should be avoided imho */
+ }
+
+ if ($this->config['debug_acl'] and $result == 'deny') {
+ echo 'group: '.$group.'<br>'; print_r($this->acl); exit;
+ }
+
+ return $result;
+ }
+
+ function run($action = '',$step = 0) {
+ global $_SERVER;
+ global $_SESSION;
+
+ $this->mainPage = 'index';
+
+ /* setup the template variable */
+ if (!isset($this->config['defaultaction'])) $this->config['defaultaction']='u';
+
+ $this->action= $action=='' ? $this->config['defaultaction']:$action;
+ $this->step= $step==0 ?1:$step;
+
+ $this->tpl->assign('action',$this->action);
+ $this->tpl->assign('step',$this->step);
+ $this->tpl->assign('nextstep',$this->step+1);
+ $this->tpl->assign('site',$this->config['site']);
+ $this->tpl->assign('script',$_SERVER['PHP_SELF']);
+ $this->tpl->assign('page',$this->page);
+
+
+ /* depending on the acl some actions need authentication others don't */
+ if (!isset($this->actions[$this->action])) {
+ /* no module can handle this action */
+ redirect();
+ }
+ /* get the handling module */
+ $mname = $this->actions[$this->action];
+ $m = &$this->modules[$mname];
+ $group = $this->user->userGroup();
+
+ if ($this->checkACL($group,$mname,$this->action)!='allow') {
+ redirect();
+ }
+ $this->initPlugins();
+
+ $this->initMenu($this->user->loggedin());
+
+ /* now run the module */
+ if (isset($m->actions[$this->action][$this->step])) {
+ $fun = $m->actions[$this->action][$this->step];
+ } else {
+ $fun = $m->actions[$this->action][1];
+ }
+ if (isset($m->page[$this->action])) {
+ foreach ($m->page[$this->action] as $k => $v) {
+ $this->page[$k] = $v;
+ }
+ }
+ $this->tpl->assign('user',$_SESSION['user']);
+ $m->$fun();
+
+ /* now display the final page */
+ $this->tpl->assign('user',$_SESSION['user']);
+ unset($_SESSION['user']['messages']);
+ unset($_SESSION['user']['errors']);
+ $this->tpl->assign('plugins',$this->pluginHTML);
+ $this->page['content']=$this->fetch('modules/'.$m->name.'/'.$fun);
+ $this->tpl->assign('page',$this->page);
+ $this->display($this->mainPage);
+ }
+}
+
+?>
Added: trunk/locale/en.inc.php
===================================================================
--- trunk/locale/en.inc.php (rev 0)
+++ trunk/locale/en.inc.php 2008-10-15 13:53:52 UTC (rev 8)
@@ -0,0 +1,3 @@
+<?php
+// english is default, don't translate
+?>
\ No newline at end of file
Added: trunk/locale/it.inc.php
===================================================================
--- trunk/locale/it.inc.php (rev 0)
+++ trunk/locale/it.inc.php 2008-10-15 13:53:52 UTC (rev 8)
@@ -0,0 +1,20 @@
+<?php
+$tr['Login']='Accedi';
+$tr['File upload']='Carica file';
+$tr['File download']='Scarica file';
+$tr['File Removal']='Rimuovi file';
+$tr['File Upload']='Carica file';
+$tr['User registration']='Registrazione utente';
+$tr['Carica file']='Carica file';
+$tr['Accedi']='Accedi';
+$tr['Login name must be at least 5 characters long!']='Il Nome utente deve essere lungo almeno 5 caratteri!';
+$tr['Please insert Full Name']='Inserire il nome completo';
+$tr['Please insert a valid e-mail!']='Inserire un indirizzo e-mail valido!';
+$tr['Password must be at least 5 characters long!']='La password deve essere lunga almeno 5 caratteri!';
+$tr['Wrong captcha code! please try again.']='Codice captcha errato! Prego riprovare.';
+$tr['Login incorrect!']='Login non valido!';
+$tr['Logout']='Esci';
+$tr['Your e-mail address isn\'t valid!']='L\'indirizzo e-mail non è valido!';
+$tr['Information about your uploaded file: %1']='Informazioni relative al file caricato: %1';
+$tr['Wrong password!']='Password errata!';
+?>
Added: trunk/plugins/banned.inc.php
===================================================================
--- trunk/plugins/banned.inc.php (rev 0)
+++ trunk/plugins/banned.inc.php 2008-10-15 13:53:52 UTC (rev 8)
@@ -0,0 +1,91 @@
+<?php
+
+
+class BannedPlugin extends OpenUploadPlugin {
+
+ function BannedPlugin() {
+ }
+
+ function init() {
+ global $_SERVER;
+
+ $this->banned = app()->db->loadTable('banned','priority');
+ /* now check if the ip has been banned display the banned template */
+ foreach ($this->banned as $row) {
+ if ($this->matchIP($_SERVER['REMOTE_ADDR'],$row['ip'])) {
+ if ($row['access']!='allow') {
+ $this->banned();
+ } else {
+ return;
+ }
+ }
+ }
+ /* no match has been found */
+ $this->banned();
+ }
+
+ function banned() {
+
+ $this->display('banned');
+ app()->page['content'] = $this->pluginHTML;
+ app()->page['title']= tr('IP Banned');
+ app()->tpl->assign('page',app()->page);
+ app()->display(app()->mainPage);
+ exit;
+ }
+
+ function convertSubnet($val) {
+ $sub = array();
+ if ($val<0) $val = 0;
+ if ($val>32) $val = 32;
+ for ($i=0; $i<4; $i++) {
+ $x = 0; /* could be done with a for... */
+ if ($val>0) $x += 128;
+ if ($val>1) $x += 64;
+ if ($val>2) $x += 32;
+ if ($val>3) $x += 16;
+ if ($val>4) $x += 8;
+ if ($val>5) $x += 4;
+ if ($val>6) $x += 2;
+ if ($val>7) $x += 1;
+ $sub[$i] = $x;
+ $val = $val - 8;
+ }
+ return $sub;
+ }
+
+ function matchIP($sip,$exp) {
+ if (strpos($exp,'/')!==FALSE) {
+ $x = explode('/',$exp);
+ $net = $x[0];
+ $sub = $x[1];
+ if (strpos($sub,'.')===FALSE) {
+ /* it's a single number convert to subnet mask*/
+ $sub = $this->convertSubnet($sub);
+ } else {
+ $sub = explode('.',$sub);
+ }
+ } else { /* single ip */
+ $net = $exp;
+ $sub = array(255,255,255,255);
+ }
+ $ip = explode('.',$sip);
+ $net = explode('.',$net);
+
+ /* now do the match */
+ $mip[0] = $ip[0] & $sub[0];
+ $mip[1] = $ip[1] & $sub[1];
+ $mip[2] = $ip[2] & $sub[2];
+ $mip[3] = $ip[3] & $sub[3];
+ $dip[0] = $net[0] & $sub[0];
+ $dip[1] = $net[1] & $sub[1];
+ $dip[2] = $net[2] & $sub[2];
+ $dip[3] = $net[3] & $sub[3];
+ if (($mip[0] == $dip[0]) and ($mip[1] == $dip[1]) and
+ ($mip[2] == $dip[2]) and ($mip[3] == $dip[3]))
+ return true;
+ else
+ return false;
+ }
+}
+?>
\ No newline at end of file
Added: trunk/plugins/captcha.inc.php
===================================================================
--- trunk/plugins/captcha.inc.php (rev 0)
+++ trunk/plugins/captcha.inc.php 2008-10-15 13:53:52 UTC (rev 8)
@@ -0,0 +1,63 @@
+<?php
+
+class CaptchaPlugin extends OpenUploadPlugin {
+
+ function CaptchaPlugin() {
+ $this->fields = array('captcha');
+ $this->description = tr('Add captcha protection to file download and user registration');
+ }
+
+ function uploadOptions(&$finfo,$acl) {
+ if ($acl!='enable') return true;
+ $this->display('uploadOptions');
+ return true;
+ }
+
+ function uploadConfirm(&$finfo,$acl) {
+ global $_POST;
+
+ if ($acl!='enable') return true;
+ $finfo['captcha'] = $_POST['captcha'];
+ return true;
+ }
+
+ function downloadRequest($finfo,$acl) {
+ if ($finfo['captcha']==1) {
+ $this->assign('captcha_img',app()->config['WWW_ROOT'].'/plugins/captcha.php');
+ $this->display('downloadRequest');
+ return false;
+ }
+ return true;
+ }
+
+ function downloadConfirm($finfo,$acl) {
+ global $_POST;
+
+ if ($finfo['captcha']==1) {
+ require_once(app()->config['INSTALL_ROOT'].'/plugins/securimage/securimage.php');
+ $securimage = new Securimage();
+ $result = $securimage->check($_POST['captcha_code']);
+ if (!$result) app()->error(tr('Wrong captcha code! please try again.'));
+ return $result;
+ } else
+ return true;
+ }
+
+ function registerForm($uinfo,$acl) {
+ $this->assign('captcha_img',app()->config['WWW_ROOT'].'/plugins/captcha.php');
+ $this->display('registerForm');
+ return true;
+ }
+
+ function registerConfirm(&$uinfo,$acl) {
+ global $_POST;
+
+ require_once(app()->config['INSTALL_ROOT'].'/plugins/securimage/securimage.php');
+ $securimage = new Securimage();
+ $result = $securimage->check($_POST['captcha_code']);
+ if (!$result) app()->error(tr('Wrong captcha code! please try again.'));
+ return $result;
+ }
+}
+
+?>
\ No newline at end of file
Added: trunk/plugins/email.inc.php
===================================================================
--- trunk/plugins/email.inc.php (rev 0)
+++ trunk/plugins/email.inc.php 2008-10-15 13:53:52 UTC (rev 8)
@@ -0,0 +1,71 @@
+<?php
+
+class emailPlugin extends OpenUploadPlugin {
+
+ function emailPlugin() {
+ $this->description = 'Add option to send e-mail to the uploader or to another e-mail address';
+ }
+
+ function uploadOptions(&$finfo,$acl) {
+ if ($acl!='enable') return true;
+ $this->display('uploadOptions');
+ return true;
+ }
+
+ function uploadConfirm(&$finfo,$acl) {
+ global $_POST;
+ 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") {
+ 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'];
+ } else {
+ $finfo['emailfrom']=$_SESSION['user']['name'].' <'.$_SESSION['user']['email'].'>';
+ }
+ }
+ if ($finfo['emailto']!='') {
+ if (!validEmail($_POST['emailto'])) {
+ app()->error(tr('Destination e-mail address isn\'t valid!'));
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ function uploadFileInfo(&$finfo,$acl) {
+ global $_SESSION;
+
+ if ($acl!='enable') return true;
+ /* send the e-mails */
+ app()->tpl->assign('finfo',$finfo);
+ if ($finfo['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');
+ }
+ if ($finfo['emailto']!='') {
+ $subject = $finfo['subject']!=''?$finfo['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');
+ }
+ /* don't send it twice */
+ $finfo['emailme']=='';
+ $finfo['emailto']=='';
+//exit();
+ return true;
+ }
+}
\ No newline at end of file
Added: trunk/plugins/mimetypes.inc.php
===================================================================
--- trunk/plugins/mimetypes.inc.php (rev 0)
+++ trunk/plugins/mimetypes.inc.php 2008-10-15 13:53:52 UTC (rev 8)
@@ -0,0 +1,31 @@
+<?php
+
+class MimeTypesPlugin extends OpenUploadPlugin {
+
+ function MimeTypes() {
+ $this->description = tr('Limit the mimetypes a user can upload');
+ }
+
+ function uploadForm(&$finfo,$acl) {
+ if ($acl!='enable') return true;
+ if (count(app()->config['mimetypes'])==0) {
+ app()->error(tr('WARNING: no mime types defined. Plugin has been disabled!'));
+ } else {
+ $this->assign('mimetypes',app()->config['mimetypes']);
+ $this->display('uploadForm');
+ }
+ return true;
+ }
+
+ function uploadOptions(&$finfo,$acl) {
+ if ($acl!='enable') return true;
+ if (count(app()->config['mimetypes'])==0) {
+ app()->error(tr('WARNING: no mime types defined. Plugin has been disabled!'));
+ } else if (array_search($finfo['mime'],app()->config['mimetypes'])===FALSE) {
+ app()->error(tr('This file type (%1) is not allowed on this site!',$finfo['mime']));
+ return false;
+ }
+ return true;
+ }
+}
+?>
\ No newline at end of file
Added: trunk/plugins/password.inc.php
===================================================================
--- trunk/plugins/password.inc.php (rev 0)
+++ trunk/plugins/password.inc.php 2008-10-15 13:53:52 UTC (rev 8)
@@ -0,0 +1,50 @@
+<?php
+
+class PasswordPlugin extends OpenUploadPlugin {
+
+ function PasswordPlugin() {
+ $this->fields = array('password');
+ $this->description = tr('Option to add password protection for file download');
+ }
+
+ function uploadOptions(&$finfo,$acl) {
+ if ($acl!='enable') return true;
+ $this->display('uploadOptions');
+ return true;
+ }
+
+ function uploadConfirm(&$finfo,$acl) {
+ global $_POST;
+
+ if (isset($_POST['protect']) and $acl=='enable') {
+ $finfo['plainpassword'] = $_POST['protect'];
+ $finfo['password'] = crypt($_POST['protect']);
+ } else {
+ $finfo['password'] = crypt("");
+ $finfo['plainpassword'] = "";
+ }
+ return true;
+ }
+
+ function downloadRequest($finfo,$acl) {
+ if ($finfo['password']!=crypt("",$finfo['password'])) {
+ $this->display('downloadRequest');
+ return false;
+ }
+ return true;
+ }
+
+ function downloadConfirm($finfo,$acl) {
+ global $_POST;
+
+ if ($finfo['password']!=crypt("",$finfo['password'])) {
+ $result = $finfo['password']==crypt($_POST['protect'],$finfo['password']);
+ if (!$result) app()->error(tr('Wrong password!'));
+ return $result;
+ } else {
+ return true;
+ }
+ }
+}
+
+?>
\ No newline at end of file
Added: trunk/www/templates/default/img/admin/files.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/admin/files.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/admin/groups.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/admin/groups.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/admin/plugins.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/admin/plugins.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/admin/rights.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/admin/rights.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/admin/settings.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/admin/settings.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/admin/users.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/admin/users.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/download.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/download.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/openupload.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/openupload.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/upload.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/upload.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/main.css
===================================================================
--- trunk/www/templates/default/main.css (rev 0)
+++ trunk/www/templates/default/main.css 2008-10-15 13:53:52 UTC (rev 8)
@@ -0,0 +1,137 @@
+body {
+ font-family: Helvetica, Arial;
+ font-size: 10pt;
+ margin: auto;
+}
+#logo {
+ float:left;
+}
+#userinfo {
+ float: right;
+ height: 20px;
+ vertical-align: bottom;
+ margin-top: 60px;
+ margin-right: 20px;
+}
+#title {
+ background-color: #3161cf;
+ color: #ffffff;
+ font-size: 12pt;
+ font-weight: bold;
+ clear: right;
+ padding-left: 160px;
+ padding-top: 3px;
+ padding-bottom:3px;
+}
+#menu {
+ bottom: 0px;
+ text-align: center;
+ margin-top: 5px;
+}
+#menu ul {
+ list-style:none;
+ margin: 0;
+ padding: 0;
+}
+#menu li {
+ display: inline;
+ padding-right: 8px;
+ padding-left: 8px;
+ border-right: 1px solid #000000;
+}
+#wrapper {
+ clear: both;
+ maring: 0 auto;
+ text-align: center;
+ padding-top: 50px;
+}
+#content {
+ margin: 0 auto;
+ display: inline-block;
+ text-align: left;
+}
+#uploadbutton {
+ text-align: center;
+ margin: 0 auto;
+}
+#downloadbutton {
+ text-align: center;
+ margin: 0 auto;
+}
+
+#footer {
+ clear: both;
+ position: fixed;
+ bottom: 0px;
+ height: 20px;
+ width: 100%;
+ font-weight: bold;
+ font-size: 9pt;
+ border-top: 1px solid #000000;
+ text-align: center;
+}
+#footer a {
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 9pt;
+ text-decoration: none;
+}
+#footer a:visited {
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 9pt;
+ text-decoration: none;
+}
+a {
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 11pt;
+ text-decoration: none;
+}
+a:visited {
+ color: #3161cf;
+ font-weight: bold;
+ font-size: 11pt;
+ text-decoration: none;
+}
+a:hover {
+ color: #4c8dff;
+ font-weight: bold;
+ font-size: 11pt;
+ text-decoration: none;
+}
+input, textarea {
+ color: #132678;
+ background-color: #c7dbff;
+ border: 1px solid #2d55b4;
+ font-size: 10pt;
+}
+.file {
+ font-size: 20pt;
+ color: #132678;
+ background-color: #c7dbff;
+ border: 1px solid #2d55b4;
+ font-size: 10pt;
+}
+fieldset {
+ border: 1px solid #2d55b4;
+ width: 30em
+}
+legend {
+ color: #ffffff;
+ background-color: #4c8dff;
+ border: 1px solid #2d55b4;
+ padding: 2px 6px;
+ font-size: 10pt;
+ font-weight: bold;
+}
+.submit,button {
+ font-size: 10pt;
+ color: #fafafa;
+ background-color: #4c8dff;
+ border-left: 1px solid #e3edff;
+ border-top: 1px solid #e3edff;
+ border-right: 1px solid #2d55b4;
+ border-bottom: 1px solid #2d55b4;
+ font-weight: bold;
+}
\ 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-10-15 13:51:00
|
Revision: 6
http://openupload.svn.sourceforge.net/openupload/?rev=6&view=rev
Author: tsdogs
Date: 2008-10-15 13:48:18 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
Reorganization
Removed Paths:
-------------
INSTALL
LICENSE
README
TODO
index.php
www/
Deleted: INSTALL
===================================================================
--- INSTALL 2008-10-15 13:39:24 UTC (rev 5)
+++ INSTALL 2008-10-15 13:48:18 UTC (rev 6)
@@ -1,30 +0,0 @@
-This is a preliminary version of the notes
-
-Installation notes
-
-Multisite installation
-1. Download the source from http:/www.sf.net/projects/openupload
-2. Untar the file
- tar xzf <release>.tar.gz
-3. Copy all files to somewhere which is not accessible from the web (i.e. /usr/local/share/openupload)
-4. Copy the www/ files into the web server folder (i.e. /var/www/html) or create a web server alias to point to the www/ folder
-5. copy the www/config.inc.php.example and edit it to suit your installation
-6. Make sure the web server is able to write to the data directory
-7. Create the database
- mysql:
- - create the db and the user
- create database <database>;
- grant all privileges on <database>.* to '<user>'@'localhost' deintified by '<password>';
- - import the database schema and default config options
- mysql <database> -u <user> -p < sql/mysql/openupload.sql
-
-8. Point your browser to http://localhost/<wherever>
-
-BIG FAT NOTE:
-The program will work even if you copy the whole folder into the web server root or a subdiretory.
-But:
-- You should make sure the files are not directly accessible via WEB
- More specifically:
- "data" directory where files are stored
- "txtdb" if a flat txt database is used
-
Deleted: LICENSE
===================================================================
--- LICENSE 2008-10-15 13:39:24 UTC (rev 5)
+++ LICENSE 2008-10-15 13:48:18 UTC (rev 6)
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
Deleted: README
===================================================================
--- README 2008-10-15 13:39:24 UTC (rev 5)
+++ README 2008-10-15 13:48:18 UTC (rev 6)
@@ -1,34 +0,0 @@
-NAME:
-
- OpenUpload - Share your big files over the internet service
-
-VERSION: 0.3
-
-AUTHORS:
-OpenUpload (http://openupload.sf.net/)
- Copyright: 2008 Alessandro Briosi <ts...@br...>
-
-ADDITIONAL AUTHORS:
-Smarty (http://www.smarty.net/):
- Copyright: 2001-2005 New Digital Group, Inc. (LGPL 2.1+)
-
-Securimage (http://www.phpcaptcha.org) (Used by captcha plugin):
- Copyright: 2007 Drew Phillips (LGPL 2.1+)
-
-Crystal Project Icons (http://www.everaldo.com) (Used in default template)
- Copyright: Copyright (c) 2006-2007 Everaldo Coelho
-
-
-DESCRIPTION:
-
- What is OpenUpload?
-
- It is a php web application to handle a files upload/download service.
- It aims to be customizable/extendible.
- It can be used inside enterprises for sharing files fast with customers.
-
-
-COPYRIGHT:
- Copyright (c) 2008 Alessandro Briosi. All rights reserved.
- This software is released under the GNU General Public License.
- Please read the disclaimer at the top of the index.php file.
Deleted: TODO
===================================================================
--- TODO 2008-10-15 13:39:24 UTC (rev 5)
+++ TODO 2008-10-15 13:48:18 UTC (rev 6)
@@ -1,68 +0,0 @@
-TODO list not priority ordered.
-
-UPLOAD
-Display upload progress
-
-REGISTRATION
-Registration with e-mail activation
-Check for a valid login value
-Moderation of registrations by admin
-
-USER
-Manage profile (password/Name/E-Mail change)
-Manage personal files (if allowed)
-
-DATABASE
-Implement pgsql module
-Additional tables for txt module, needs a review.
-
-AUTHENTICATION
-LDAP authentication (with OpenLdap and AD) mainly
-
-ADMIN
-User administration
-Group administration
-File administration and maintainence
-Config administration
-Plugin administration
-First setup script
-
-ACL
-User/Group acl for modules and plugins: partially done 2008.10
-
-DOWNLOAD
-Fix double click on no blockings for download
-
-PLUGINS
-Plugin configuration options
-
-(Followings are some ideas)
-Upload different filesize limiting depending on group
-Download bandwith limiting depending on group (of upload user probably better)
-Download wait time (is this really needed?)
-User additional fields fot registration request.
-Antivirus on upload
-Deletion timeout (should it be a plugin? Maybe only for user interaction on it)
-
-TRANSLATIONS (gettext/array)
-Complete implementation: done 2008.10
-Translate to italian: done 2008.10
-Add a database translator?
-
-MAINTEINENCE
-Create a script to clean up the files/tmpfiles.
-Manage file deletion timeout probably better to be handled here.
-
-TEMPLATE
-Create a sample template.
-
-LOG
-Activity logging
-
-TERMS OF USE
-
-WEB SITE with Screen Shots
-
-SVN setup
-
-RELEASE
Deleted: index.php
===================================================================
--- index.php 2008-10-15 13:39:24 UTC (rev 5)
+++ index.php 2008-10-15 13:48:18 UTC (rev 6)
@@ -1,34 +0,0 @@
-<?php
-/**
- * Project: OpenUpload
- * File: index.php
- *
- * LICENSE:
- *
- * Copyright 2008 Alessandro Briosi
- *
- * This file is part of OpenUpload.
- *
- * OpenUpload is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * OpenUpload is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with OpenUpload; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * @link http://openupload.sf.net/
- * @copyright 2008 Alessandro Briosi
- * @author Alessandro Briosi <tsdogs at briosix dot org>
- * @package OpenUpload
- * @version 0.3
- */
-
- require_once('www/index.php');
-?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-15 13:39:28
|
Revision: 5
http://openupload.svn.sourceforge.net/openupload/?rev=5&view=rev
Author: tsdogs
Date: 2008-10-15 13:39:24 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
Reorganization
Added Paths:
-----------
trunk/INSTALL
trunk/LICENSE
trunk/README
trunk/TODO
trunk/index.php
trunk/www/
Copied: trunk/INSTALL (from rev 1, INSTALL)
===================================================================
--- trunk/INSTALL (rev 0)
+++ trunk/INSTALL 2008-10-15 13:39:24 UTC (rev 5)
@@ -0,0 +1,30 @@
+This is a preliminary version of the notes
+
+Installation notes
+
+Multisite installation
+1. Download the source from http:/www.sf.net/projects/openupload
+2. Untar the file
+ tar xzf <release>.tar.gz
+3. Copy all files to somewhere which is not accessible from the web (i.e. /usr/local/share/openupload)
+4. Copy the www/ files into the web server folder (i.e. /var/www/html) or create a web server alias to point to the www/ folder
+5. copy the www/config.inc.php.example and edit it to suit your installation
+6. Make sure the web server is able to write to the data directory
+7. Create the database
+ mysql:
+ - create the db and the user
+ create database <database>;
+ grant all privileges on <database>.* to '<user>'@'localhost' deintified by '<password>';
+ - import the database schema and default config options
+ mysql <database> -u <user> -p < sql/mysql/openupload.sql
+
+8. Point your browser to http://localhost/<wherever>
+
+BIG FAT NOTE:
+The program will work even if you copy the whole folder into the web server root or a subdiretory.
+But:
+- You should make sure the files are not directly accessible via WEB
+ More specifically:
+ "data" directory where files are stored
+ "txtdb" if a flat txt database is used
+
Copied: trunk/LICENSE (from rev 1, LICENSE)
===================================================================
--- trunk/LICENSE (rev 0)
+++ trunk/LICENSE 2008-10-15 13:39:24 UTC (rev 5)
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
Copied: trunk/README (from rev 1, README)
===================================================================
--- trunk/README (rev 0)
+++ trunk/README 2008-10-15 13:39:24 UTC (rev 5)
@@ -0,0 +1,34 @@
+NAME:
+
+ OpenUpload - Share your big files over the internet service
+
+VERSION: 0.3
+
+AUTHORS:
+OpenUpload (http://openupload.sf.net/)
+ Copyright: 2008 Alessandro Briosi <ts...@br...>
+
+ADDITIONAL AUTHORS:
+Smarty (http://www.smarty.net/):
+ Copyright: 2001-2005 New Digital Group, Inc. (LGPL 2.1+)
+
+Securimage (http://www.phpcaptcha.org) (Used by captcha plugin):
+ Copyright: 2007 Drew Phillips (LGPL 2.1+)
+
+Crystal Project Icons (http://www.everaldo.com) (Used in default template)
+ Copyright: Copyright (c) 2006-2007 Everaldo Coelho
+
+
+DESCRIPTION:
+
+ What is OpenUpload?
+
+ It is a php web application to handle a files upload/download service.
+ It aims to be customizable/extendible.
+ It can be used inside enterprises for sharing files fast with customers.
+
+
+COPYRIGHT:
+ Copyright (c) 2008 Alessandro Briosi. All rights reserved.
+ This software is released under the GNU General Public License.
+ Please read the disclaimer at the top of the index.php file.
Copied: trunk/TODO (from rev 1, TODO)
===================================================================
--- trunk/TODO (rev 0)
+++ trunk/TODO 2008-10-15 13:39:24 UTC (rev 5)
@@ -0,0 +1,68 @@
+TODO list not priority ordered.
+
+UPLOAD
+Display upload progress
+
+REGISTRATION
+Registration with e-mail activation
+Check for a valid login value
+Moderation of registrations by admin
+
+USER
+Manage profile (password/Name/E-Mail change)
+Manage personal files (if allowed)
+
+DATABASE
+Implement pgsql module
+Additional tables for txt module, needs a review.
+
+AUTHENTICATION
+LDAP authentication (with OpenLdap and AD) mainly
+
+ADMIN
+User administration
+Group administration
+File administration and maintainence
+Config administration
+Plugin administration
+First setup script
+
+ACL
+User/Group acl for modules and plugins: partially done 2008.10
+
+DOWNLOAD
+Fix double click on no blockings for download
+
+PLUGINS
+Plugin configuration options
+
+(Followings are some ideas)
+Upload different filesize limiting depending on group
+Download bandwith limiting depending on group (of upload user probably better)
+Download wait time (is this really needed?)
+User additional fields fot registration request.
+Antivirus on upload
+Deletion timeout (should it be a plugin? Maybe only for user interaction on it)
+
+TRANSLATIONS (gettext/array)
+Complete implementation: done 2008.10
+Translate to italian: done 2008.10
+Add a database translator?
+
+MAINTEINENCE
+Create a script to clean up the files/tmpfiles.
+Manage file deletion timeout probably better to be handled here.
+
+TEMPLATE
+Create a sample template.
+
+LOG
+Activity logging
+
+TERMS OF USE
+
+WEB SITE with Screen Shots
+
+SVN setup
+
+RELEASE
Copied: trunk/index.php (from rev 1, index.php)
===================================================================
--- trunk/index.php (rev 0)
+++ trunk/index.php 2008-10-15 13:39:24 UTC (rev 5)
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Project: OpenUpload
+ * File: index.php
+ *
+ * LICENSE:
+ *
+ * Copyright 2008 Alessandro Briosi
+ *
+ * This file is part of OpenUpload.
+ *
+ * OpenUpload is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenUpload is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with OpenUpload; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @link http://openupload.sf.net/
+ * @copyright 2008 Alessandro Briosi
+ * @author Alessandro Briosi <tsdogs at briosix dot org>
+ * @package OpenUpload
+ * @version 0.3
+ */
+
+ require_once('www/index.php');
+?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-15 13:32:53
|
Revision: 1
http://openupload.svn.sourceforge.net/openupload/?rev=1&view=rev
Author: tsdogs
Date: 2008-10-15 13:32:30 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
First svn commit
Added Paths:
-----------
INSTALL
LICENSE
README
TODO
index.php
Added: INSTALL
===================================================================
--- INSTALL (rev 0)
+++ INSTALL 2008-10-15 13:32:30 UTC (rev 1)
@@ -0,0 +1,30 @@
+This is a preliminary version of the notes
+
+Installation notes
+
+Multisite installation
+1. Download the source from http:/www.sf.net/projects/openupload
+2. Untar the file
+ tar xzf <release>.tar.gz
+3. Copy all files to somewhere which is not accessible from the web (i.e. /usr/local/share/openupload)
+4. Copy the www/ files into the web server folder (i.e. /var/www/html) or create a web server alias to point to the www/ folder
+5. copy the www/config.inc.php.example and edit it to suit your installation
+6. Make sure the web server is able to write to the data directory
+7. Create the database
+ mysql:
+ - create the db and the user
+ create database <database>;
+ grant all privileges on <database>.* to '<user>'@'localhost' deintified by '<password>';
+ - import the database schema and default config options
+ mysql <database> -u <user> -p < sql/mysql/openupload.sql
+
+8. Point your browser to http://localhost/<wherever>
+
+BIG FAT NOTE:
+The program will work even if you copy the whole folder into the web server root or a subdiretory.
+But:
+- You should make sure the files are not directly accessible via WEB
+ More specifically:
+ "data" directory where files are stored
+ "txtdb" if a flat txt database is used
+
Added: LICENSE
===================================================================
--- LICENSE (rev 0)
+++ LICENSE 2008-10-15 13:32:30 UTC (rev 1)
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
Added: README
===================================================================
--- README (rev 0)
+++ README 2008-10-15 13:32:30 UTC (rev 1)
@@ -0,0 +1,34 @@
+NAME:
+
+ OpenUpload - Share your big files over the internet service
+
+VERSION: 0.3
+
+AUTHORS:
+OpenUpload (http://openupload.sf.net/)
+ Copyright: 2008 Alessandro Briosi <ts...@br...>
+
+ADDITIONAL AUTHORS:
+Smarty (http://www.smarty.net/):
+ Copyright: 2001-2005 New Digital Group, Inc. (LGPL 2.1+)
+
+Securimage (http://www.phpcaptcha.org) (Used by captcha plugin):
+ Copyright: 2007 Drew Phillips (LGPL 2.1+)
+
+Crystal Project Icons (http://www.everaldo.com) (Used in default template)
+ Copyright: Copyright (c) 2006-2007 Everaldo Coelho
+
+
+DESCRIPTION:
+
+ What is OpenUpload?
+
+ It is a php web application to handle a files upload/download service.
+ It aims to be customizable/extendible.
+ It can be used inside enterprises for sharing files fast with customers.
+
+
+COPYRIGHT:
+ Copyright (c) 2008 Alessandro Briosi. All rights reserved.
+ This software is released under the GNU General Public License.
+ Please read the disclaimer at the top of the index.php file.
Added: TODO
===================================================================
--- TODO (rev 0)
+++ TODO 2008-10-15 13:32:30 UTC (rev 1)
@@ -0,0 +1,68 @@
+TODO list not priority ordered.
+
+UPLOAD
+Display upload progress
+
+REGISTRATION
+Registration with e-mail activation
+Check for a valid login value
+Moderation of registrations by admin
+
+USER
+Manage profile (password/Name/E-Mail change)
+Manage personal files (if allowed)
+
+DATABASE
+Implement pgsql module
+Additional tables for txt module, needs a review.
+
+AUTHENTICATION
+LDAP authentication (with OpenLdap and AD) mainly
+
+ADMIN
+User administration
+Group administration
+File administration and maintainence
+Config administration
+Plugin administration
+First setup script
+
+ACL
+User/Group acl for modules and plugins: partially done 2008.10
+
+DOWNLOAD
+Fix double click on no blockings for download
+
+PLUGINS
+Plugin configuration options
+
+(Followings are some ideas)
+Upload different filesize limiting depending on group
+Download bandwith limiting depending on group (of upload user probably better)
+Download wait time (is this really needed?)
+User additional fields fot registration request.
+Antivirus on upload
+Deletion timeout (should it be a plugin? Maybe only for user interaction on it)
+
+TRANSLATIONS (gettext/array)
+Complete implementation: done 2008.10
+Translate to italian: done 2008.10
+Add a database translator?
+
+MAINTEINENCE
+Create a script to clean up the files/tmpfiles.
+Manage file deletion timeout probably better to be handled here.
+
+TEMPLATE
+Create a sample template.
+
+LOG
+Activity logging
+
+TERMS OF USE
+
+WEB SITE with Screen Shots
+
+SVN setup
+
+RELEASE
Added: index.php
===================================================================
--- index.php (rev 0)
+++ index.php 2008-10-15 13:32:30 UTC (rev 1)
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Project: OpenUpload
+ * File: index.php
+ *
+ * LICENSE:
+ *
+ * Copyright 2008 Alessandro Briosi
+ *
+ * This file is part of OpenUpload.
+ *
+ * OpenUpload is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenUpload is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with OpenUpload; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @link http://openupload.sf.net/
+ * @copyright 2008 Alessandro Briosi
+ * @author Alessandro Briosi <tsdogs at briosix dot org>
+ * @package OpenUpload
+ * @version 0.3
+ */
+
+ require_once('www/index.php');
+?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Alessandro B. <ts...@br...> - 2008-10-13 09:10:51
|
|
From: Alessandro B. <ts...@br...> - 2008-10-13 08:14:17
|
Testing |