openupload-svn-update Mailing List for Open Upload (Page 14)
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-24 08:40:35
|
Revision: 71
http://openupload.svn.sourceforge.net/openupload/?rev=71&view=rev
Author: tsdogs
Date: 2008-10-24 08:37:53 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
fix user_id to user_login
Modified Paths:
--------------
trunk/sql/mysql/1_structure.sql
Modified: trunk/sql/mysql/1_structure.sql
===================================================================
--- trunk/sql/mysql/1_structure.sql 2008-10-24 08:35:12 UTC (rev 70)
+++ trunk/sql/mysql/1_structure.sql 2008-10-24 08:37:53 UTC (rev 71)
@@ -55,7 +55,7 @@
`description` tinytext NOT NULL,
`size` int(12) NOT NULL,
`remove` varchar(100) NOT NULL,
- `user_id` int(11) NOT NULL,
+ `user_login` varchar(100) NOT NULL,
`ip` varchar(40) NOT NULL,
`upload_date` datetime NOT NULL,
PRIMARY KEY (`id`)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-24 08:37:53
|
Revision: 70
http://openupload.svn.sourceforge.net/openupload/?rev=70&view=rev
Author: tsdogs
Date: 2008-10-24 08:35:12 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
Update to new structure
Modified Paths:
--------------
trunk/sql/mysql/1_structure.sql
trunk/sql/mysql/2_base.sql
trunk/sql/mysql/3_mode_private.sql
trunk/sql/mysql/3_mode_public.sql
trunk/sql/mysql/3_mode_restricted.sql
trunk/sql/mysql/3_mode_service.sql
Modified: trunk/sql/mysql/1_structure.sql
===================================================================
--- trunk/sql/mysql/1_structure.sql 2008-10-23 18:16:35 UTC (rev 69)
+++ trunk/sql/mysql/1_structure.sql 2008-10-24 08:35:12 UTC (rev 70)
@@ -23,7 +23,7 @@
`id` int(11) NOT NULL auto_increment,
`module` varchar(100) NOT NULL,
`action` varchar(100) NOT NULL,
- `group_id` varchar(50) NOT NULL,
+ `group_name` varchar(50) NOT NULL,
`access` varchar(10) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
@@ -113,11 +113,11 @@
CREATE TABLE IF NOT EXISTS `plugin_acl` (
`id` int(11) NOT NULL auto_increment,
- `group_id` varchar(50) NOT NULL,
+ `group_name` varchar(50) NOT NULL,
`plugin` varchar(100) NOT NULL,
`access` varchar(10) NOT NULL,
PRIMARY KEY (`id`),
- UNIQUE KEY `group_id` (`group_id`,`plugin`)
+ UNIQUE KEY `group_name` (`group_name`,`plugin`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
-- --------------------------------------------------------
@@ -129,7 +129,7 @@
CREATE TABLE IF NOT EXISTS `plugin_options` (
`id` int(11) NOT NULL auto_increment,
`plugin` varchar(100) NOT NULL,
- `group_id` varchar(100) NOT NULL,
+ `group_name` varchar(100) NOT NULL,
`name` varchar(100) NOT NULL,
`value` text,
PRIMARY KEY (`id`)
@@ -146,7 +146,7 @@
`login` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
`name` varchar(200) NOT NULL,
- `group_id` varchar(50) NOT NULL default 'unregistered',
+ `group_name` varchar(50) NOT NULL default 'registered',
`email` varchar(250) NOT NULL,
`lang` varchar(10) NOT NULL default 'en',
`reg_date` datetime NOT NULL,
Modified: trunk/sql/mysql/2_base.sql
===================================================================
--- trunk/sql/mysql/2_base.sql 2008-10-23 18:16:35 UTC (rev 69)
+++ trunk/sql/mysql/2_base.sql 2008-10-24 08:35:12 UTC (rev 70)
@@ -39,21 +39,21 @@
-- Dump dei dati per la tabella `users`
--
-INSERT INTO `users` (`id`, `login`, `password`, `name`, `group_id`, `email`, `lang`, `active`) VALUES(1, 'admin', '$1$sLCQ3aFR$rCIb4Owhgi3mIHgYnbA351', 'Administrator', 'admins', 'ope...@yo...', 'en', now(), '', 1);
+INSERT INTO `users` (`id`, `login`, `password`, `name`, `group_name`, `email`, `lang`, `reg_date`, `regid`, `active`) VALUES(1, 'admin', '$1$sLCQ3aFR$rCIb4Owhgi3mIHgYnbA351', 'Administrator', 'admins', 'ope...@yo...', 'en', now(), '', 1);
--
-- Dump dei dati per la tabella `acl`
--
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(1, '*', '*', 'admins', 'allow');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(2, 'admin', '*', 'admins', 'allow');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(3, 'admin', '*', '*', 'deny');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(4, 'auth', 'login', 'unregistered', 'allow');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(1, '*', '*', 'admins', 'allow');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(2, 'admin', '*', 'admins', 'allow');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(3, 'admin', '*', '*', 'deny');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(4, 'auth', 'login', 'unregistered', 'allow');
--
-- Dump dei dati per la tabella `plugin_acl`
--
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(1, 'admins', 'password', 'enable');
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(2, 'admins', 'captcha', 'enable');
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(3, 'admins', 'email', 'enable');
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(1, 'admins', 'password', 'enable');
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(2, 'admins', 'captcha', 'enable');
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(3, 'admins', 'email', 'enable');
Modified: trunk/sql/mysql/3_mode_private.sql
===================================================================
--- trunk/sql/mysql/3_mode_private.sql 2008-10-23 18:16:35 UTC (rev 69)
+++ trunk/sql/mysql/3_mode_private.sql 2008-10-24 08:35:12 UTC (rev 70)
@@ -1,16 +1,16 @@
--
-- Dump dei dati per la tabella `acl`
--
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(5, 'auth', 'register', '*', 'deny');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(6, 'auth', '*', 'unregistered', 'deny');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(7, 'auth', '*', '*', 'allow');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(8, 'files', '*', 'unregistered', 'deny');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(9, 'files', '*', '*', 'allow');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(5, 'auth', 'register', '*', 'deny');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(6, 'auth', '*', 'unregistered', 'deny');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(7, 'auth', '*', '*', 'allow');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(8, 'files', '*', 'unregistered', 'deny');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(9, 'files', '*', '*', 'allow');
--
-- Dump dei dati per la tabella `plugin_acl`
--
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(4, 'registered', 'password', 'enable');
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(5, 'registered', 'captcha', 'enable');
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(6, 'registered', 'email', 'enable');
\ No newline at end of file
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(4, 'registered', 'password', 'enable');
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(5, 'registered', 'captcha', 'enable');
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(6, 'registered', 'email', 'enable');
\ No newline at end of file
Modified: trunk/sql/mysql/3_mode_public.sql
===================================================================
--- trunk/sql/mysql/3_mode_public.sql 2008-10-23 18:16:35 UTC (rev 69)
+++ trunk/sql/mysql/3_mode_public.sql 2008-10-24 08:35:12 UTC (rev 70)
@@ -2,13 +2,13 @@
-- Dump dei dati per la tabella `acl`
--
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(5, 'auth', '*', '*', 'deny');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(6, 'files', '*', '*', 'allow');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(5, 'auth', '*', '*', 'deny');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(6, 'files', '*', '*', 'allow');
--
-- Dump dei dati per la tabella `plugin_acl`
--
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(4, 'unregistered', 'password', 'enable');
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(5, 'unregistered', 'captcha', 'enable');
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(6, 'unregistered', 'email', 'enable');
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(4, 'unregistered', 'password', 'enable');
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(5, 'unregistered', 'captcha', 'enable');
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(6, 'unregistered', 'email', 'enable');
Modified: trunk/sql/mysql/3_mode_restricted.sql
===================================================================
--- trunk/sql/mysql/3_mode_restricted.sql 2008-10-23 18:16:35 UTC (rev 69)
+++ trunk/sql/mysql/3_mode_restricted.sql 2008-10-24 08:35:12 UTC (rev 70)
@@ -1,18 +1,18 @@
--
-- Dump dei dati per la tabella `acl`
--
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(5, 'auth', 'register', '*', 'deny');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(6, 'auth', '*', 'unregistered', 'deny');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(7, 'auth', '*', '*', 'allow');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(8, 'files', 'd', 'unregistered', 'allow');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(9, 'files', 'g', 'unregistered', 'allow');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(10, 'files', '*', 'unregistered', 'deny');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(11, 'files', '*', '*', 'allow');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(5, 'auth', 'register', '*', 'deny');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(6, 'auth', '*', 'unregistered', 'deny');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(7, 'auth', '*', '*', 'allow');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(8, 'files', 'd', 'unregistered', 'allow');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(9, 'files', 'g', 'unregistered', 'allow');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(10, 'files', '*', 'unregistered', 'deny');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(11, 'files', '*', '*', 'allow');
--
-- Dump dei dati per la tabella `plugin_acl`
--
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(4, 'registered', 'password', 'enable');
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(5, 'registered', 'captcha', 'enable');
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(6, 'registered', 'email', 'enable');
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(4, 'registered', 'password', 'enable');
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(5, 'registered', 'captcha', 'enable');
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(6, 'registered', 'email', 'enable');
Modified: trunk/sql/mysql/3_mode_service.sql
===================================================================
--- trunk/sql/mysql/3_mode_service.sql 2008-10-23 18:16:35 UTC (rev 69)
+++ trunk/sql/mysql/3_mode_service.sql 2008-10-24 08:35:12 UTC (rev 70)
@@ -1,19 +1,19 @@
--
-- Dump dei dati per la tabella `acl`
--
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(5, 'auth', 'register', 'unregistered', 'allow');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(6, 'auth', '*', 'unregistered', 'deny');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(7, 'auth', 'register', '*', 'deny');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(8, 'auth', '*', '*', 'allow');
-INSERT INTO `acl` (`id`, `module`, `action`, `group_id`, `access`) VALUES(9, 'files', '*', '*', 'allow');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(5, 'auth', 'register', 'unregistered', 'allow');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(6, 'auth', '*', 'unregistered', 'deny');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(7, 'auth', 'register', '*', 'deny');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(8, 'auth', '*', '*', 'allow');
+INSERT INTO `acl` (`id`, `module`, `action`, `group_name`, `access`) VALUES(9, 'files', '*', '*', 'allow');
--
-- Dump dei dati per la tabella `plugin_acl`
--
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(4, 'registered', 'password', 'enable');
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(5, 'registered', 'captcha', 'enable');
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(6, 'registered', 'email', 'enable');
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(7, 'unregistered', 'mimetypes', 'enable');
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(8, 'unregistered', 'captcha', 'enable');
-INSERT INTO `plugin_acl` (`id`, `group_id`, `plugin`, `access`) VALUES(9, 'unregistered', 'password', 'enable');
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(4, 'registered', 'password', 'enable');
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(5, 'registered', 'captcha', 'enable');
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(6, 'registered', 'email', 'enable');
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(7, 'unregistered', 'mimetypes', 'enable');
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(8, 'unregistered', 'captcha', 'enable');
+INSERT INTO `plugin_acl` (`id`, `group_name`, `plugin`, `access`) VALUES(9, 'unregistered', 'password', 'enable');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-23 18:16:37
|
Revision: 69
http://openupload.svn.sourceforge.net/openupload/?rev=69&view=rev
Author: tsdogs
Date: 2008-10-23 18:16:35 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
update for first buggy version with ldap authentication
Modified Paths:
--------------
trunk/templates/default/modules/admin/pluginadd.tpl
trunk/templates/default/modules/admin/pluginedit.tpl
trunk/templates/default/modules/admin/pluginsacl.tpl
trunk/templates/default/modules/admin/rightadd.tpl
trunk/templates/default/modules/admin/rightedit.tpl
trunk/templates/default/modules/admin/rights.tpl
trunk/templates/default/modules/admin/useradd.tpl
trunk/templates/default/modules/admin/useredit.tpl
trunk/templates/default/modules/admin/users.tpl
Modified: trunk/templates/default/modules/admin/pluginadd.tpl
===================================================================
--- trunk/templates/default/modules/admin/pluginadd.tpl 2008-10-23 18:15:55 UTC (rev 68)
+++ trunk/templates/default/modules/admin/pluginadd.tpl 2008-10-23 18:16:35 UTC (rev 69)
@@ -13,7 +13,7 @@
<tr><td>{tr}Group{/tr}:</td><td>
<select name="addplugingroup">
{foreach from=$groups item=g}
-<option value="{$g.name}" {if $g.name==$plugin.group_id}selected{/if}>{$g.name}</option>
+<option value="{$g.name}" {if $g.name==$plugin.group_name}selected{/if}>{$g.name}</option>
{/foreach}
</select></td></tr>
<tr><td>{tr}Access{/tr}:</td><td>
Modified: trunk/templates/default/modules/admin/pluginedit.tpl
===================================================================
--- trunk/templates/default/modules/admin/pluginedit.tpl 2008-10-23 18:15:55 UTC (rev 68)
+++ trunk/templates/default/modules/admin/pluginedit.tpl 2008-10-23 18:16:35 UTC (rev 69)
@@ -14,7 +14,7 @@
<tr><td>{tr}Group{/tr}:</td><td>
<select name="editplugingroup">
{foreach from=$groups item=g}
-<option value="{$g.name}" {if $g.name==$plugin.group_id}selected{/if}>{$g.name}</option>
+<option value="{$g.name}" {if $g.name==$plugin.group_name}selected{/if}>{$g.name}</option>
{/foreach}
</select></td></tr>
<tr><td>{tr}Access{/tr}:</td><td>
Modified: trunk/templates/default/modules/admin/pluginsacl.tpl
===================================================================
--- trunk/templates/default/modules/admin/pluginsacl.tpl 2008-10-23 18:15:55 UTC (rev 68)
+++ trunk/templates/default/modules/admin/pluginsacl.tpl 2008-10-23 18:16:35 UTC (rev 69)
@@ -19,7 +19,7 @@
<td id="{$rid}"><input type="checkbox" name="p_{$p.id}" value="1"></td>
<td id="{$rid}" style="text-align:left"><a href="{$script}?action={$action}&step=3&id={$p.id}">{$p.id}</a></td>
<td id="{$rid}">{$p.plugin}</td>
- <td id="{$rid}">{$p.group_id}</td>
+ <td id="{$rid}">{$p.group_name}</td>
<td id="{$rid}">{$p.access}</td>
<td id="{$rid}">
<a href="{$script}?action={$action}&step=3&id={$p.id}"><img src="{$page.template}/img/admin/edit_plugin.png"></a>
Modified: trunk/templates/default/modules/admin/rightadd.tpl
===================================================================
--- trunk/templates/default/modules/admin/rightadd.tpl 2008-10-23 18:15:55 UTC (rev 68)
+++ trunk/templates/default/modules/admin/rightadd.tpl 2008-10-23 18:16:35 UTC (rev 69)
@@ -7,7 +7,7 @@
<tr><td>{tr}Group{/tr}:</td><td>
<select name="addrightgroup">
{foreach from=$groups item=g}
-<option value="{$g.name}" {if $g.name==$right.group_id}selected{/if}>{$g.name}</option>
+<option value="{$g.name}" {if $g.name==$right.group_name}selected{/if}>{$g.name}</option>
{/foreach}
</select></td></tr>
<tr><td>{tr}Module{/tr}:</td><td>
Modified: trunk/templates/default/modules/admin/rightedit.tpl
===================================================================
--- trunk/templates/default/modules/admin/rightedit.tpl 2008-10-23 18:15:55 UTC (rev 68)
+++ trunk/templates/default/modules/admin/rightedit.tpl 2008-10-23 18:16:35 UTC (rev 69)
@@ -8,7 +8,7 @@
<tr><td>{tr}Group{/tr}:</td><td>
<select name="editrightgroup">
{foreach from=$groups item=g}
-<option value="{$g.name}" {if $g.name==$right.group_id}selected{/if}>{$g.name}</option>
+<option value="{$g.name}" {if $g.name==$right.group_name}selected{/if}>{$g.name}</option>
{/foreach}
</select></td></tr>
<tr><td>{tr}Module{/tr}:</td><td>
Modified: trunk/templates/default/modules/admin/rights.tpl
===================================================================
--- trunk/templates/default/modules/admin/rights.tpl 2008-10-23 18:15:55 UTC (rev 68)
+++ trunk/templates/default/modules/admin/rights.tpl 2008-10-23 18:16:35 UTC (rev 69)
@@ -19,7 +19,7 @@
<tr>
<td id="{$rid}"><input type="checkbox" name="right_{$r.id}" value="1"></td>
<td id="{$rid}"><a href="{$script}?action={$action}&step=3&id={$r.id}">{$r.id}</a></td>
- <td id="{$rid}">{$r.group_id}</td>
+ <td id="{$rid}">{$r.group_name}</td>
<td id="{$rid}">{$r.module}</td>
<td id="{$rid}">{$r.action}</td>
<td id="{$rid}">{$r.access}</td>
Modified: trunk/templates/default/modules/admin/useradd.tpl
===================================================================
--- trunk/templates/default/modules/admin/useradd.tpl 2008-10-23 18:15:55 UTC (rev 68)
+++ trunk/templates/default/modules/admin/useradd.tpl 2008-10-23 18:16:35 UTC (rev 69)
@@ -11,7 +11,7 @@
<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>
+ <option value="{$g.name}" {if $g.name==$adduser.group_name} selected{/if}>{$g.description}</option>
{/foreach}
</select></td></tr>
<tr><td>{tr}Preferred language{/tr}:</td><td> <select name="adduserlang">
Modified: trunk/templates/default/modules/admin/useredit.tpl
===================================================================
--- trunk/templates/default/modules/admin/useredit.tpl 2008-10-23 18:15:55 UTC (rev 68)
+++ trunk/templates/default/modules/admin/useredit.tpl 2008-10-23 18:16:35 UTC (rev 69)
@@ -11,7 +11,7 @@
<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>
+ <option value="{$g.name}" {if $g.name==$edituser.group_name} selected{/if}>{$g.description}</option>
{/foreach}
</select></td></tr>
<tr><td>{tr}Preferred language{/tr}:</td><td> <select name="edituserlang">
Modified: trunk/templates/default/modules/admin/users.tpl
===================================================================
--- trunk/templates/default/modules/admin/users.tpl 2008-10-23 18:15:55 UTC (rev 68)
+++ trunk/templates/default/modules/admin/users.tpl 2008-10-23 18:16:35 UTC (rev 69)
@@ -20,7 +20,7 @@
<td id="{$rid}"><input type="checkbox" name="user_{$u.login}" value="1"></td>
<td id="{$rid}"><a href="{$script}?action={$action}&step=3&id={$u.login}">{$u.login}</a></td>
<td id="{$rid}">{$u.name}</td>
- <td id="{$rid}">{$u.group_id}</td>
+ <td id="{$rid}">{$u.group_name}</td>
<td id="{$rid}">{$u.email}</td>
<td id="{$rid}"><a href="{$script}?action={$action}&step=5&id={$u.login}&active={$u.active}">
<img src="{$page.template}/img/admin/active{$u.active}.png">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-23 18:15:57
|
Revision: 68
http://openupload.svn.sourceforge.net/openupload/?rev=68&view=rev
Author: tsdogs
Date: 2008-10-23 18:15:55 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
First buggy version with ldap authentication
Modified Paths:
--------------
trunk/lib/classes.inc.php
trunk/lib/main.inc.php
trunk/lib/modules/auth/default.inc.php
trunk/lib/modules/db/txt.inc.php
trunk/lib/modules/default/admin.inc.php
trunk/lib/modules/default/auth.inc.php
trunk/lib/modules/default/files.inc.php
trunk/lib/user.inc.php
Added Paths:
-----------
trunk/lib/modules/auth/ldap.inc.php
Modified: trunk/lib/classes.inc.php
===================================================================
--- trunk/lib/classes.inc.php 2008-10-23 11:02:34 UTC (rev 67)
+++ trunk/lib/classes.inc.php 2008-10-23 18:15:55 UTC (rev 68)
@@ -11,11 +11,25 @@
}
class authBase {
-var $features = array();
+var $features = array('adminuser' => 'no', 'admingroup' => 'no');
function authBase() {
}
+ function init() {}
+
+ function authenticate($user,$pwd) { return false; }
+
+ function userinfo($login) { return array(); }
+ function groupinfo($group = '') { return array(); }
+
+ function users() { return array(); }
+ function useradd($user) {}
+ function useredit($user) {}
+ function userdel($id) {}
+ function groupadd($group) {}
+ function groupedit($group) {}
+ function groupdel($id) {}
}
Modified: trunk/lib/main.inc.php
===================================================================
--- trunk/lib/main.inc.php 2008-10-23 11:02:34 UTC (rev 67)
+++ trunk/lib/main.inc.php 2008-10-23 18:15:55 UTC (rev 68)
@@ -75,10 +75,10 @@
$this->user->setInfo('lang',$lang);
}
+//unset($_SESSION['user']);
$this->tr->init();
$this->auth->init();
$this->user->init();
-//unset($_SESSION['user']);
if ($this->user->info('max_upload_size')==0)
$this->user->setInfo('max_upload_size',$this->config['max_upload_size']*1024*1024);
ini_set('max_upload_size',$this->user->info('max_upload_size'));
@@ -227,14 +227,22 @@
function loadACL() {
/* loads the acl from the db */
$group = $this->user->group();
- $this->acl = array_merge($this->db->read('acl',array('group_id' => $group),array('module','action'),'',
- array('group_id','module','action')),
- $this->db->read('acl',array('group_id' => '*'),array('module','action'),'',
- array('group_id','module','action')));
- $this->pluginAcl = $this->db->read('plugin_acl',array('group_id' => $group),array('plugin'),'',array('plugin'));
+ if (is_array($group)) {
+ $this->acl = $this->db->read('acl',array(),array('group_name','module','action'),'',
+ array('group_name','module','action'));
+ $this->pluginAcl = $this->db->read('plugin_acl',array(),array('plugin'),'',array('plugin'));
+ } else {
+ $this->acl = array_merge($this->db->read('acl',array('group_name' => $group),array('module','action'),'',
+ array('group_name','module','action')),
+ $this->db->read('acl',array('group_name' => '*'),array('module','action'),'',
+ array('group_name','module','action')));
+ $this->pluginAcl = $this->db->read('plugin_acl',array('group_name' => $group),array('plugin'),'',array('plugin'));
+ }
}
- function checkACL($group,$module,$action) {
+
+ function checkSingleACL($group,$module,$action) {
+
$result = 'deny'; /* not defined are denyed by default */
if (isset($this->acl[$group][$module][$action])) {
$result = $this->acl[$group][$module][$action]['access'];
@@ -249,7 +257,21 @@
} else if (isset($this->acl['*']['*']['*'])) {
$result = $this->acl['*']['*']['*']['access']; /* this should be avoided imho */
}
+ return $result;
+ }
+ function checkACL($group,$module,$action) {
+ if (is_array($group)) {
+ foreach ($group as $g) {
+ $result = $this->checkSingleACL($g,$module,$action);
+ if ($result == 'allow') {
+ return $result;
+ }
+ }
+ } else {
+ $result = $this->checkSingleACL($group,$module,$action);
+ }
+
if ($this->config['debug_acl'] and $result == 'deny') {
echo '<pre>ACL: '.$result.' - group: '.$group.', module: '.$module.', action: '.$action."\n";
print_r($this->acl);
Modified: trunk/lib/modules/auth/default.inc.php
===================================================================
--- trunk/lib/modules/auth/default.inc.php 2008-10-23 11:02:34 UTC (rev 67)
+++ trunk/lib/modules/auth/default.inc.php 2008-10-23 18:15:55 UTC (rev 68)
@@ -5,8 +5,8 @@
var $userfields;
function defaultAuth() {
- $this->userfields = array('id','login','password','name','group_id','email','lang','reg_date','regid','active');
- $this->features = array('info','add', 'update', 'delete');
+ $this->userfields = array('id','login','password','name','group_name','email','lang','reg_date','regid','active');
+ $this->features = array('useradmin' => 'yes', 'groupadmin' => 'yes');
}
function init() {
@@ -22,26 +22,53 @@
return false;
}
- function info($login) {
+ function userinfo($login) {
$result = $this->db->read('users',array('login' => $login));
+ $result['group']=$result['group_name'];
return $result[0];
}
+
+ function groupinfo($group = '') {
+ if ($group != '') {
+ $result = $this->db->read('groups',array('name' => $group));
+ return $result[0]['name'];
+ } else {
+ $result = $this->db->read('groups');
+ return $result;
+ }
+ }
- function add($user) {
+ function users() {
+ return app()->db->read('users',array(),array('login'));
+ }
+
+ function useradd($user) {
$user['password']=crypt($user['password']);
$this->db->insert('users',$user,$this->userfields);
}
- function update($user,$pwd = false) {
+ function useredit($user,$pwd = false) {
if ($pwd) {
$user['password']=crypt($user['password']);
}
$this->db->update('users',$user,array('id' => $user['id']),$this->userfields);
}
- function delete($id) {
+ function userdel($id) {
$this->db->delete('users',array('login' => $id));
}
+
+ function groupadd($group) {
+ $this->db->insert('groups',$group);
+ }
+
+ function groupedit($group) {
+ app()->db->update('groups',$group,array('name' => $group['name']));
+ }
+
+ function groupdel($group_id) {
+ app()->db->delete('groups',array('name' => $group_id));
+ }
}
?>
\ No newline at end of file
Added: trunk/lib/modules/auth/ldap.inc.php
===================================================================
--- trunk/lib/modules/auth/ldap.inc.php (rev 0)
+++ trunk/lib/modules/auth/ldap.inc.php 2008-10-23 18:15:55 UTC (rev 68)
@@ -0,0 +1,104 @@
+<?php
+
+class ldapAuth extends authBase {
+var $config;
+
+ function ldapAuth() {
+ }
+
+ function init() {
+ $this->config = app()->config['ldap'];
+ $this->ufield = isset($this->config['uid'])?$this->config['uid']:'uid';
+ $this->gfield = isset($this->config['gid'])?$this->config['gid']:'gid';
+ /* cannot add or edit users for now */
+ $this->features = array('useradmin' => 'no', 'groupadmin' => 'no');
+ }
+
+ function authenticate($login,$password) {
+ $ds=ldap_connect($this->config['host']);
+ if ($ds) {
+ $uid = $this->ufield.'='.$login.','.$this->config['userdn'];
+ if (ldap_bind($ds, $uid, $password) ) {
+ /* authentication was successfull, save username and password for additional info */
+ $this->uid = $uid;
+ $this->password = $password;
+ return true;
+ }
+ ldap_close($ds);
+ }
+ return false;
+ }
+
+ function userinfo($login) {
+ $ds=@ldap_connect($this->config['host']);
+ $result = array();
+ if (ldap_bind($ds, $this->config['user'],$this->config['password']) ) {
+ $r = @ldap_search($ds, $this->config['userdn'],
+ '(&('.$this->ufield.'='.$login.')(objectclass='.$this->config['userclass'].'))');
+ if ($r) {
+ $res = @ldap_get_entries($ds, $r);
+ /* associate user fields */
+ $res = $res[0];
+ foreach ($this->config['userfields'] as $n => $f) {
+ $result[$f] = $res[$n][0];
+ }
+ }
+ /* now retrieve the main group */
+ $r = @ldap_search($ds, $this->config['groupdn'],
+ '(&('.$this->gfield.'='.$result['group_id'].')(objectclass='.$this->config['groupclass'].'))');
+ if ($r) {
+ $res = @ldap_get_entries($ds, $r);
+ /* associate user fields */
+ $res = $res[0];
+ foreach ($this->config['groupfields'] as $n => $f) {
+ if ($f == 'name') {
+ $result['group'] = $res[$n][0];
+ }
+ }
+ }
+ if (isset($this->config['sgid'])) {
+ $result['group'] = array($result['group']);
+ $r = @ldap_search($ds, $this->config['groupdn'],
+ '(&('.$this->config['sgid'].'='.$result['login'].')(objectclass='.$this->config['groupclass'].'))');
+ if ($r) {
+ $res = @ldap_get_entries($ds, $r);
+ for ($i = 0; $i<$res['count']; $i++) {
+ foreach ($this->config['sgroupfields'] as $n => $f) {
+ if ($f == 'name') {
+ $result['group'][] = $res[$i][$n][0];
+ }
+ }
+ }
+ }
+ }
+ }
+ ldap_close($ds);
+ return $result;
+ }
+
+ function groupinfo($group = '') {
+ $ds=@ldap_connect($this->config['host']);
+ $result = array();
+ @ldap_bind($ds, $this->config['user'], $this->config['password']);
+ if (group != '') {
+ $r = @ldap_search($ds, $this->config['groupdn'],'(objectclass='.$this->config['groupclass'].')');
+ } else {
+ $r = @ldap_search($ds, $this->config['groupdn'],
+ '(&('.$this->gfield.'='.$group.')(objectclass='.$this->config['groupclass'].'))');
+ }
+ if ($r) {
+ $res = @ldap_get_entries($ds, $r);
+ /* associate user fields */
+ for ($i = 0; $i<$res['count']; $i++) {
+ foreach ($this->config['sgroupfields'] as $n => $f) {
+ $result[$i][$f] = $res[$i][$n][0];
+ }
+ }
+ }
+ ldap_close($ds);
+ return $result;
+ }
+
+}
+
+?>
\ No newline at end of file
Modified: trunk/lib/modules/db/txt.inc.php
===================================================================
--- trunk/lib/modules/db/txt.inc.php 2008-10-23 11:02:34 UTC (rev 67)
+++ trunk/lib/modules/db/txt.inc.php 2008-10-23 18:15:55 UTC (rev 68)
@@ -18,7 +18,7 @@
"users" => array (
"type" => "file",
"fields" => array (
- "id", "login", "password", "name", "group_id", "email", "lang", "reg_date", "regid", "active",
+ "id", "login", "password", "name", "group_name", "email", "lang", "reg_date", "regid", "active",
),
"auto_increment" => "id",
),
@@ -38,7 +38,7 @@
"acl" => array (
"type" => "file",
"fields" => array (
- "id", "module", "action", "group_id", "access",
+ "id", "module", "action", "group_name", "access",
),
"auto_increment" => "id",
),
@@ -51,14 +51,14 @@
"plugin_acl" => array (
"type" => "file",
"fields" => array (
- "id", "group_id", "plugin", "access",
+ "id", "group_name", "plugin", "access",
),
"auto_increment" => "id",
),
"plugin_options" => array (
"type" => "file",
"fields" => array (
- "id", "plugin", "group_id", "name", "value",
+ "id", "plugin", "group_name", "name", "value",
),
"auto_increment" => "id",
),
Modified: trunk/lib/modules/default/admin.inc.php
===================================================================
--- trunk/lib/modules/default/admin.inc.php 2008-10-23 11:02:34 UTC (rev 67)
+++ trunk/lib/modules/default/admin.inc.php 2008-10-23 18:15:55 UTC (rev 68)
@@ -73,20 +73,25 @@
function users() {
/* List the users */
- $users = app()->db->read('users',array(),array('login'));
- $this->tpl->assign('users',$users);
+ if (app()->auth->features['useradmin'] == 'yes') {
+ $users = app()->auth->users();
+ $this->tpl->assign('users',$users);
+ } else {
+ app()->error(tr('User administration not supported by Auth Module'));
+ }
}
function useradd() {
global $_POST;
- $groups = app()->db->read('groups',array(),array('name'));
+ $groups = app()->auth->groupinfo();
+ /* do the assoc */
$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['group_name']=$_POST['addusergroup'];
$user['email']=$_POST['adduseremail'];
$user['active']=$_POST['adduseractive'];
$user['lang']=$_POST['adduserlang'];
@@ -108,14 +113,14 @@
}
if (!$error) {
$user['password']=$_POST['adduserpassword'];
- app()->auth->add($user);
+ app()->auth->useradd($user);
/* redirect */
$this->nextStep(1);
}
}
if (!isset($user)) {
$user['active']=1;
- $user['group_id']=app()->config['register']['default_group'];
+ $user['group_name']=app()->config['register']['default_group'];
}
$this->tpl->assign('adduser',$user);
}
@@ -124,7 +129,7 @@
global $_GET;
if (isset($_GET['id'])) {
- app()->auth->delete($_GET['id']);
+ app()->auth->userdel($_GET['id']);
}
$this->nextStep(1);
}
@@ -134,11 +139,11 @@
if (isset($_GET['id'])) {
$active=$_GET['active']==1?0:1;
- $user = app()->db->read('users',array('login' => $_GET['id']));
+ $user = app()->auth->userinfo($_GET['id']);
$user = $user[0];
if ($user['login']==$_GET['id']) {
$user['active']=$active;
- app()->auth->update($user,false);
+ app()->auth->useredit($user,false);
}
}
$this->nextStep(1);
@@ -148,13 +153,13 @@
global $_GET;
global $_POST;
/* edit the user */
- $groups = app()->db->read('groups',array(),array('name'));
+ $groups = app()->auth->groupinfo();
$this->tpl->assign('groups',$groups);
if (isset($_POST['login'])) {
- $user = app()->db->read('users',array('login' => $_POST['login']));
+ $user = app()->auth->userinfo($_POST['login']);
$user = $user[0];
$user['name']=$_POST['editusername'];
- $user['group_id']=$_POST['editusergroup'];
+ $user['group_name']=$_POST['editusergroup'];
$user['email']=$_POST['edituseremail'];
$user['lang']=$_POST['edituserlang'];
$user['active']=$_POST['edituseractive'];
@@ -175,20 +180,24 @@
$error = true;
}
if (!$error) {
- app()->auth->update($user);
+ app()->auth->useredit($user);
/* redirect */
$this->nextStep(1);
}
} else {
- $user = app()->db->read('users',array('login' => $_GET['id']));
+ $user = app()->auth->info($_GET['id']);
$user = $user[0];
}
$this->tpl->assign('edituser',$user);
}
function groups() {
- $groups = app()->db->read('groups',array(),array('name'));
- $this->tpl->assign('groups',$groups);
+ if (app()->auth->features['groupadmin']=='yes') {
+ $groups = app()->auth->groupinfo();
+ $this->tpl->assign('groups',$groups);
+ } else {
+ app()->error(tr('Group administration not supported by Auth Module'));
+ }
}
function groupadd() {
@@ -198,7 +207,7 @@
$group['name']=$_POST['addgroupname'];
$group['description']=$_POST['addgroupdescription'];
if ($group['name']!='') {
- app()->db->insert('groups',$group);
+ app()->auth->groupadd($group);
$this->nextStep(1);
} else {
app()->error(tr('Please provide a valid group name!'));
@@ -211,13 +220,12 @@
global $_POST;
global $_GET;
- $group = app()->db->read('groups',array('name' => $_GET['id']));
+ $group = app()->auth->groupinfo();
$group = $group[0];
if (isset($_POST['editgroupname'])) {
$group['name']=$_POST['editgroupname'];
$group['description']=$_POST['editgroupdescription'];
- app()->db->update('groups',$group,array('name' => $group['name']));
- $this->nextStep(1);
+ $this->nextStep(1);
}
app()->tpl->assign('group',$group);
}
@@ -226,17 +234,18 @@
global $_GET;
/* should check if sub users exsist */
if (isset($_GET['id'])) {
- app()->db->delete('groups',array('name' => $_GET['id']));
+ app()->auth->groupdel($_GET['id']);
/* delete all the rights of the group */
- app()->db->delete('acl',array('group_id' => $_GET['id']));
+ app()->db->delete('acl',array('group_name' => $_GET['id']));
+ app()->db->delete('pluins_acl',array('group_name' => $_GET['id']));
}
$this->nextStep(1);
}
function rights() {
- $groups = app()->db->read('groups',array(),array('name'));
+ $groups = app()->auth->groupinfo();
$this->tpl->assign('groups',$groups);
- $rights = app()->db->read('acl',array(),array('group_id','module'));
+ $rights = app()->db->read('acl',array(),array('group_name','module'));
$this->tpl->assign('rights',$rights);
}
@@ -246,19 +255,19 @@
$modules = app()->config['modules'];
$modules['*']='*';
$this->tpl->assign('modules',$modules);
- $groups = app()->db->read('groups',array(),array('name'));
+ $groups = app()->auth->groupinfo();
$groups[]='*';
$this->tpl->assign('groups',$groups);
$access['allow']=tr('Allow');
$access['deny']=tr('Deny');
$this->tpl->assign('access',$access);
$right['module']='*';
- $right['group_id']='*';
+ $right['group_name']='*';
$right['action']='*';
$right['access']='deny';
if (isset($_POST['addrightgroup'])) {
$right['id']='';
- $right['group_id']=$_POST['addrightgroup'];
+ $right['group_name']=$_POST['addrightgroup'];
$right['module']=$_POST['addrightmodule'];
$right['action']=$_POST['addrightaction'];
$right['access']=$_POST['addrightaccess'];
@@ -277,7 +286,7 @@
$modules = app()->config['modules'];
$modules['*']='*';
$this->tpl->assign('modules',$modules);
- $groups = app()->db->read('groups',array(),array('name'));
+ $groups = app()->auth->groupinfo();
$groups[]='*';
$this->tpl->assign('groups',$groups);
$access['allow']=tr('Allow');
@@ -286,7 +295,7 @@
if (isset($_POST['editaclid'])) {
$right = app()->db->read('acl',array('id' => $_POST['editaclid']));
$right = $right[0];
- $right['group_id']=$_POST['editrightgroup'];
+ $right['group_name']=$_POST['editrightgroup'];
$right['module']=$_POST['editrightmodule'];
$right['action']=$_POST['editrightaction'];
$right['access']=$_POST['editrightaccess'];
@@ -316,8 +325,6 @@
$count = app()->db->count('files');
$this->tpl->assign('pages',ceil($count / $NUM)+1);
$this->tpl->assign('pagen',$page);
- $users = app()->db->read('users',array(),array('login'),'',array('id'));
- $this->tpl->assign('users',$users);
$files = app()->db->read('files',array(),array('upload_date desc'),$limit);
$this->tpl->assign('files',$files);
}
@@ -354,7 +361,7 @@
$plugins = app()->config['plugins'];
$this->tpl->assign('pluginslist',$plugins);
- $groups = app()->db->read('groups',array(),array('name'));
+ $groups = app()->auth->groupinfo();
$this->tpl->assign('groups',$groups);
$access['enable']=tr('Enable');
$access['disable']=tr('Disable');
@@ -362,7 +369,7 @@
$plugin['access']='disable';
if (isset($_POST['addplugingroup'])) {
$plugin['id']='';
- $plugin['group_id']=$_POST['addplugingroup'];
+ $plugin['group_name']=$_POST['addplugingroup'];
$plugin['plugin']=$_POST['addpluginplugin'];
$plugin['access']=$_POST['addpluginaccess'];
app()->db->insert('plugin_acl',$plugin);
@@ -379,7 +386,7 @@
$plugin = $plugin[0];
$plugins = app()->config['plugins'];
$this->tpl->assign('pluginslist',$plugins);
- $groups = app()->db->read('groups',array(),array('name'));
+ $groups = app()->auth->groupinfo();
$this->tpl->assign('groups',$groups);
$access['enable']=tr('Enable');
$access['disable']=tr('Disable');
@@ -387,7 +394,7 @@
if (isset($_POST['editpluginid'])) {
$plugin = app()->db->read('plugin_acl',array('id' => $_POST['editpluginid']));
$plugin = $plugin[0];
- $plugin['group_id']=$_POST['editplugingroup'];
+ $plugin['group_name']=$_POST['editplugingroup'];
$plugin['plugin']=$_POST['editpluginplugin'];
$plugin['access']=$_POST['editpluginaccess'];
app()->db->update('plugin_acl',$plugin,array('id' => $_POST['editpluginid']));
Modified: trunk/lib/modules/default/auth.inc.php
===================================================================
--- trunk/lib/modules/default/auth.inc.php 2008-10-23 11:02:34 UTC (rev 67)
+++ trunk/lib/modules/default/auth.inc.php 2008-10-23 18:15:55 UTC (rev 68)
@@ -39,7 +39,8 @@
if (!app()->user->loggedin()) {
$this->menu['login']=tr('Login');
} else {
- $this->menu['profile']=tr('Preferences');
+ if (app()->auth->features['adminusers']=='yes')
+ $this->menu['profile']=tr('Preferences');
$this->menu['logout']=tr('Logout');
}
$this->tpl->assign('register',app()->checkACL(app()->user->group(),'auth','register')=='allow');
@@ -140,7 +141,7 @@
$user['password'] = $_POST['registerpassword'];
$user['email'] = $_POST['registeremail'];
$user['lang'] = $_POST['registerlang'];
- $user['group_id'] = app()->config['register']['default_group'];
+ $user['group_name'] = app()->config['register']['default_group'];
$user['reg_date']=date('Y-m-d H:i:s');
$result = app()->pluginAction('registerConfirm',$user);
$_SESSION['register']=$user;
@@ -233,7 +234,7 @@
}
}
if (!$error) {
- app()->auth->update($user);
+ app()->auth->useredit($user);
app()->user->set($user);
$this->nextStep(1);
}
Modified: trunk/lib/modules/default/files.inc.php
===================================================================
--- trunk/lib/modules/default/files.inc.php 2008-10-23 11:02:34 UTC (rev 67)
+++ trunk/lib/modules/default/files.inc.php 2008-10-23 18:15:55 UTC (rev 68)
@@ -88,7 +88,7 @@
$_SESSION['user']['u']['name']=$_FILES['upload']['name'];
$_SESSION['user']['u']['size']=$_FILES['upload']['size'];
$_SESSION['user']['u']['ip']=$_SERVER['REMOTE_ADDR'];
- $_SESSION['user']['u']['user_id']=app()->user->info('id');
+ $_SESSION['user']['u']['user_login']=app()->user->info('login');
$this->nextStep(app()->step);
}
} else if (!isset($_SESSION['user']['u'])) {
@@ -122,7 +122,7 @@
$finfo['id']= app()->db->newRandomId('files','id');
$finfo['remove']= app()->db->newRandomId('files','remove');
$finfo['upload_date'] = date('Y-m-d H:i:s');
- app()->db->insert('files',$finfo,array('id','name','mime','description','size','remove','user_id','ip','upload_date'));
+ app()->db->insert('files',$finfo,array('id','name','mime','description','size','remove','user_login','ip','upload_date'));
foreach (app()->plugins as $plugin) {
if (count($plugin->fields)>0) {
foreach ($plugin->fields as $f) {
Modified: trunk/lib/user.inc.php
===================================================================
--- trunk/lib/user.inc.php 2008-10-23 11:02:34 UTC (rev 67)
+++ trunk/lib/user.inc.php 2008-10-23 18:15:55 UTC (rev 68)
@@ -38,8 +38,8 @@
}
function group() {
- if ($this->info('group_id')!='')
- $group = $this->info('group_id');
+ if ($this->info('group')!='')
+ $group = $this->info('group');
else
$group = app()->config['register']['nologingroup'];
return $group;
@@ -79,7 +79,7 @@
if ($res) {
$_SESSION['user']['login']=$username;
/* retrieve user info */
- $_SESSION['user'] = $this->auth->info($username);;
+ $_SESSION['user'] = $this->auth->userinfo($username);
/* make the post not be resent on refresh */
return true;
} else {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-23 12:57:20
|
Revision: 59
http://openupload.svn.sourceforge.net/openupload/?rev=59&view=rev
Author: tsdogs
Date: 2008-10-23 10:24:45 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
fix sorting issue.
Modified Paths:
--------------
trunk/lib/modules/db/mysql.inc.php
Modified: trunk/lib/modules/db/mysql.inc.php
===================================================================
--- trunk/lib/modules/db/mysql.inc.php 2008-10-22 18:41:38 UTC (rev 58)
+++ trunk/lib/modules/db/mysql.inc.php 2008-10-23 10:24:45 UTC (rev 59)
@@ -76,7 +76,7 @@
$sorting = '';
foreach ($sort as $s) {
if ($sorting!='') $sorting.=',';
- $sorting .= '`'.$s.'`';
+ $sorting .= $s;
}
$sql .= ' ORDER BY '.$sorting;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-23 12:55:34
|
Revision: 60
http://openupload.svn.sourceforge.net/openupload/?rev=60&view=rev
Author: tsdogs
Date: 2008-10-23 10:25:26 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
move banned ip to main class
Modified Paths:
--------------
trunk/lib/main.inc.php
Modified: trunk/lib/main.inc.php
===================================================================
--- trunk/lib/main.inc.php 2008-10-23 10:24:45 UTC (rev 59)
+++ trunk/lib/main.inc.php 2008-10-23 10:25:26 UTC (rev 60)
@@ -260,6 +260,74 @@
return $result;
}
+ 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;
+ }
+
+ function banned() {
+ global $_SERVER;
+
+ $banned = $this->db->read('banned',array(),array('priority'));
+ /* now check if the ip has been banned display the banned template */
+ foreach ($banned as $row) {
+ if ($this->matchIP($_SERVER['REMOTE_ADDR'],$row['ip'])) {
+ return $row['access'];
+ }
+ }
+ /* no match has been found */
+ return 'deny';
+ }
+
function run($action = '',$step = 0) {
global $_SERVER;
global $_SESSION;
@@ -279,6 +347,14 @@
$this->tpl->assign('script',$_SERVER['PHP_SELF']);
$this->tpl->assign('page',$this->page);
+ /* check for banned IP */
+ if ($this->banned() != 'allow') {
+ $this->page['content'] = $this->fetch('banned');
+ $this->page['title']= tr('IP Banned');
+ $this->tpl->assign('page',app()->page);
+ $this->display($this->mainPage);
+ exit;
+ }
/* depending on the acl some actions need authentication others don't */
if (!isset($this->actions[$this->action])) {
/* no module can handle this action */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-23 12:54:05
|
Revision: 61
http://openupload.svn.sourceforge.net/openupload/?rev=61&view=rev
Author: tsdogs
Date: 2008-10-23 10:26:33 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
move banned ip to main class, and add administration
Modified Paths:
--------------
trunk/templates/default/modules/admin/admin.tpl
trunk/templates/default/modules/admin/adminmenu.tpl
trunk/templates/default/modules/admin/files.tpl
Added Paths:
-----------
trunk/templates/default/banned.tpl
trunk/templates/default/modules/admin/banned.tpl
trunk/templates/default/modules/admin/bannedadd.tpl
trunk/templates/default/modules/admin/bannededit.tpl
Added: trunk/templates/default/banned.tpl
===================================================================
--- trunk/templates/default/banned.tpl (rev 0)
+++ trunk/templates/default/banned.tpl 2008-10-23 10:26:33 UTC (rev 61)
@@ -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
Modified: trunk/templates/default/modules/admin/admin.tpl
===================================================================
--- trunk/templates/default/modules/admin/admin.tpl 2008-10-23 10:25:26 UTC (rev 60)
+++ trunk/templates/default/modules/admin/admin.tpl 2008-10-23 10:26:33 UTC (rev 61)
@@ -1,5 +1,5 @@
{tr}Here you can administer{/tr}:<hr>
-<table border="0" width="400" height="200">
+<table border="0" width="400" height="300">
<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>
@@ -10,5 +10,10 @@
<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>
+<tr>
+ <td align="center"> </td>
+ <td align="center"><a href="{$script}?action=adminbanned"><img src="{$page.template}/img/admin/banned.png" border="0" ><br>{tr}Banned IPs{/tr}</a></td>
+ <td align="center"> </td>
+</tr>
{$plugins}
</table>
\ No newline at end of file
Modified: trunk/templates/default/modules/admin/adminmenu.tpl
===================================================================
--- trunk/templates/default/modules/admin/adminmenu.tpl 2008-10-23 10:25:26 UTC (rev 60)
+++ trunk/templates/default/modules/admin/adminmenu.tpl 2008-10-23 10:26:33 UTC (rev 61)
@@ -6,6 +6,7 @@
<li><a href="{$script}?action=adminusers">{tr}Users{/tr}</a></li>
<li><a href="{$script}?action=admingroups">{tr}Groups{/tr}</a></li>
<li><a href="{$script}?action=adminrights">{tr}Rights{/tr}</a></li>
+ <li style="border-right: 0px;"><a href="{$script}?action=adminbanned">{tr}Banned{/tr}</a></li>
</ul>
</div>
<hr>
\ No newline at end of file
Added: trunk/templates/default/modules/admin/banned.tpl
===================================================================
--- trunk/templates/default/modules/admin/banned.tpl (rev 0)
+++ trunk/templates/default/modules/admin/banned.tpl 2008-10-23 10:26:33 UTC (rev 61)
@@ -0,0 +1,38 @@
+{include file="default/modules/admin/adminmenu.tpl"}
+<div id="toolbar">
+<a href="{$script}?action={$action}&step=2"><img src="{$page.template}/img/admin/tadd.png"></a>
+<img src="{$page.template}/img/admin/tdelete.png">
+</div>
+<br>
+{if $pages>2}
+<center>{section name=page loop=$pages start=1 max=20}
+{if $pagen==$smarty.section.page.index}
+<b style="font-size: 12pt">{$smarty.section.page.index}</b>
+{else}
+<a style="font-size: 12pt" href="{$script}?action={$action}&page={$smarty.section.page.index}">{$smarty.section.page.index}</a>
+{/if}
+
+{/section} </center>
+{/if}
+<br>
+<table border="0" id="dbtable">
+<tr>
+ <th width="10">S</th>
+ <th width="200">IP</th>
+ <th width="50">Access</th>
+ <th width="80">Priority</th>
+ <th width="100">Actions</th>
+</tr>
+{foreach from=$banned item=b}
+{cycle values="row1,row2" advance=true assign=rid}
+<tr>
+ <td id="{$rid}"><input type="checkbox" name="ban_{$d.id}" value="1"></td>
+ <td id="{$rid}" style="text-align: left;"><a href="{$script}?action={$action}&step=3&id={$b.id}">{$b.ip}</a></td>
+ <td id="{$rid}">{$b.access}</td>
+ <td id="{$rid}">{$b.priority}</td>
+ <td id="{$rid}">
+ <a title="delete" href="{$script}?action={$action}&step=4&id={$b.id}"><img src="{$page.template}/img/admin/delete.png"></a>
+ </td>
+</tr>
+{/foreach}
+</table>
\ No newline at end of file
Added: trunk/templates/default/modules/admin/bannedadd.tpl
===================================================================
--- trunk/templates/default/modules/admin/bannedadd.tpl (rev 0)
+++ trunk/templates/default/modules/admin/bannedadd.tpl 2008-10-23 10:26:33 UTC (rev 61)
@@ -0,0 +1,16 @@
+{include file="default/modules/admin/adminmenu.tpl"}
+
+<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}IP{/tr}:</td><td><input type="text" name="addbannedip" value="{$banned.ip}"></td></tr>
+<tr><td>{tr}Access{/tr}:</td><td>
+<select name="addbannedaccess">
+{foreach from=$access item=a key=k}
+<option value="{$k}" {if $k==$banned.access}selected{/if}>{$a}</option>
+{/foreach}</td></tr>
+<tr><td>{tr}Priority{/tr}:</td><td><input type="text" name="addbannedpriority" value="{$banned.priority}"></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/bannededit.tpl
===================================================================
--- trunk/templates/default/modules/admin/bannededit.tpl (rev 0)
+++ trunk/templates/default/modules/admin/bannededit.tpl 2008-10-23 10:26:33 UTC (rev 61)
@@ -0,0 +1,17 @@
+{include file="default/modules/admin/adminmenu.tpl"}
+
+<form action="{$script}" method="post">
+<input type="hidden" name="action" value="{$action}">
+<input type="hidden" name="step" value="{$step}">
+<input type="hidden" name="editbannedid" value="{$banned.id}">
+<table border="0">
+<tr><td>{tr}IP{/tr}:</td><td><input type="text" name="editbannedip" value="{$banned.ip}"></td></tr>
+<tr><td>{tr}Access{/tr}:</td><td>
+<select name="editbannedaccess">
+{foreach from=$access item=a key=k}
+<option value="{$k}" {if $k==$banned.access}selected{/if}>{$a}</option>
+{/foreach}</td></tr>
+<tr><td>{tr}Priority{/tr}:</td><td><input type="text" name="editbannedpriority" value="{$banned.priority}"></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
Modified: trunk/templates/default/modules/admin/files.tpl
===================================================================
--- trunk/templates/default/modules/admin/files.tpl 2008-10-23 10:25:26 UTC (rev 60)
+++ trunk/templates/default/modules/admin/files.tpl 2008-10-23 10:26:33 UTC (rev 61)
@@ -14,7 +14,7 @@
<table border="0" id="dbtable">
<tr>
<th width="10">S</th>
- <th width="50">Id</th> <AZ
+ <th width="50">Id</th>
<th width="200">Name</th>
<th width="100">User</th>
<th width="100">IP</th>
@@ -28,7 +28,7 @@
<td id="{$rid}">{$f.id}</td>
<td id="{$rid}">{$f.name}</td>
<td id="{$rid}">{$users[$f.user_id].login}</td>
- <td id="{$rid}" style="text-align: left"><a title="ban IP {$f.ip}" href="{$script}?action={$action}&step=3&plugin=banned&ip={$f.ip}">
+ <td id="{$rid}" style="text-align: left"><a title="ban IP {$f.ip}" href="{$script}?action=adminbanned&step=2&ip={$f.ip}&newaction={$action}">
<img align="right" src="{$page.template}/img/admin/ban.png" ></a>{$f.ip} </td>
<td id="{$rid}">{$f.upload_date}</td>
<td id="{$rid}">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-23 12:53:48
|
Revision: 65
http://openupload.svn.sourceforge.net/openupload/?rev=65&view=rev
Author: tsdogs
Date: 2008-10-23 10:36:48 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
Documentation update
Modified Paths:
--------------
trunk/CHANGELOG
trunk/TODO
Modified: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG 2008-10-23 10:30:45 UTC (rev 64)
+++ trunk/CHANGELOG 2008-10-23 10:36:48 UTC (rev 65)
@@ -14,6 +14,7 @@
- Plugin ACL administration
- Rights Administration
- Display of actual configuration
+ - Administration of banned IPs
* User
- Manage profile (password/Name/E-Mail change)
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2008-10-23 10:30:45 UTC (rev 64)
+++ trunk/TODO 2008-10-23 10:36:48 UTC (rev 65)
@@ -2,9 +2,6 @@
RELEASE: not until api and db are stable.
******* MUST BE DONE BEFORE RELEASE *******
-Administration
-- Admin of banned IPs
-
Translation
- Update the translations
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-23 12:52:49
|
Revision: 62
http://openupload.svn.sourceforge.net/openupload/?rev=62&view=rev
Author: tsdogs
Date: 2008-10-23 10:29:08 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
Add banned ip administration
Modified Paths:
--------------
trunk/lib/modules/default/admin.inc.php
Modified: trunk/lib/modules/default/admin.inc.php
===================================================================
--- trunk/lib/modules/default/admin.inc.php 2008-10-23 10:26:33 UTC (rev 61)
+++ trunk/lib/modules/default/admin.inc.php 2008-10-23 10:29:08 UTC (rev 62)
@@ -44,6 +44,12 @@
3 => "rightedit",
4 => "rightdel",
),
+ "adminbanned" => array (
+ 1 => "banned",
+ 2 => "bannedadd",
+ 3 => "bannededit",
+ 4 => "banneddel",
+ ),
);
var $page;
@@ -405,6 +411,101 @@
function settings() {
$this->tpl->assign('config',app()->config);
}
+
+ function banned() {
+ $NUM = 50;
+
+ $page = 1;
+ if (isset($_GET['page'])) {
+ $page=$_GET['page'];
+ }
+ $limit = ($NUM*($page-1)).','.$NUM;
+ $count = app()->db->count('banned');
+ $this->tpl->assign('pages',ceil($count / $NUM)+1);
+ $this->tpl->assign('pagen',$page);
+ $banned = app()->db->read('banned',array(),array('priority'),$limit);
+ $this->tpl->assign('banned',$banned);
+ }
+
+ function bannedadd() {
+ global $_GET;
+ global $_POST;
+
+ if (isset($_GET['ip'])) {
+ $ip = $_GET['ip'];
+ $ban = app()->db->read('banned',array('ip' => $ip));
+ $ban = $ban[0];
+ if ($ban['ip']!=$ip) {
+ $ban['id']='';
+ $ban['priority']='10'; /* maybe a bigger one is better */
+ $ban['ip']=$ip;
+ $ban['access']='deny';
+ app()->db->insert('banned',$ban);
+ app()->message(tr('IP %1 has been banned!',$ip));
+ if (isset($_GET['nextaction']))
+ redirect('?action='.$_GET['nextaction']);
+ } else {
+ app()->error(tr('IP %1 was already in state: %2!',$ip,$ban['access']));
+ if (isset($_GET['newaction']))
+ redirect('?action='.$_GET['newaction']);
+ }
+ } else if (isset($_POST['addbannedip'])) {
+ $ip = $_POST['addbannedip'];
+ $ban = app()->db->read('banned',array('ip' => $ip));
+ $ban = $ban[0];
+ if ($ban['ip']!=$ip) {
+ $ban['id']='';
+ $ban['priority']=$_POST['addbannedpriority'];
+ $ban['ip']=$ip;
+ $ban['access']=$_POST['addbannedaccess'];
+ app()->db->insert('banned',$ban);
+ $this->nextStep(1);
+ } else {
+ app()->error(tr('IP %1 was already in state: %2!',$ip,$ban['access']));
+ }
+ } else {
+ $ban['access']='deny';
+ }
+ $this->tpl->assign('access',array('allow' => tr('Allow'), 'deny' => tr('Deny')));
+ $this->tpl->assign('banned',$ban);
+ }
+
+ function bannededit() {
+ global $_GET;
+ global $_POST;
+
+ if (isset($_GET['id'])) {
+ $id = $_GET['id'];
+ $ban = app()->db->read('banned',array('id' => $id));
+ $ban = $ban[0];
+ if ($ban['id']!=$id) {
+ $this->nextStep(1);
+ }
+ } else if (isset($_POST['editbannedid'])) {
+ $id = $_POST['editbannedid'];
+ $ban = app()->db->read('banned',array('id' => $id));
+ $ban = $ban[0];
+ if ($ban['id']==$id) {
+ $ban['priority']=$_POST['editbannedpriority'];
+ $ban['ip']=$_POST['editbannedip'];
+ $ban['access']=$_POST['editbannedaccess'];
+ app()->db->update('banned',$ban,array('id' => $ban['id']));
+ }
+ $this->nextStep(1);
+ }
+ $this->tpl->assign('access',array('allow' => tr('Allow'), 'deny' => tr('Deny')));
+ $this->tpl->assign('banned',$ban);
+ }
+
+ function banneddel() {
+ app()->db->delete('banned',array('id' => $_GET['id']));
+ $this->nextStep(1);
+ }
+
+ function bannedup() {
+ }
+ function banneddown() {
+ }
}
?>
\ 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-23 12:52:43
|
Revision: 64
http://openupload.svn.sourceforge.net/openupload/?rev=64&view=rev
Author: tsdogs
Date: 2008-10-23 10:30:45 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
Add .htaccess config options
Added Paths:
-----------
trunk/www/.htaccess
Added: trunk/www/.htaccess
===================================================================
--- trunk/www/.htaccess (rev 0)
+++ trunk/www/.htaccess 2008-10-23 10:30:45 UTC (rev 64)
@@ -0,0 +1,5 @@
+# Set this accordingly to your installation
+# N.B. For this to work, you'll need "AllowOvverride Options" in apache dir config
+php_value file_uploads "On"
+php_value upload_max_filesize "200M"
+php_value post_max_size "200M"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-23 11:05:15
|
Revision: 67
http://openupload.svn.sourceforge.net/openupload/?rev=67&view=rev
Author: tsdogs
Date: 2008-10-23 11:02:34 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
Add download timeout configuration option
Modified Paths:
--------------
trunk/CHANGELOG
trunk/TODO
trunk/lib/modules/default/files.inc.php
trunk/www/config.inc.php.example
Modified: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG 2008-10-23 10:42:46 UTC (rev 66)
+++ trunk/CHANGELOG 2008-10-23 11:02:34 UTC (rev 67)
@@ -1,5 +1,8 @@
Changelog before release (0.3?) (updated on 2008.10.18).
+* General
+ - make sub www folders not accessible by default (some index.html files)
+
* Registration
- Check for valid login name
- Enable registration with e-mail confirmation
@@ -32,6 +35,7 @@
* Download
- Changeed serve file method to not go over the memory php limit (output buffer)
+ - Make download timeout configurable.
* Web site
- Created index page
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2008-10-23 10:42:46 UTC (rev 66)
+++ trunk/TODO 2008-10-23 11:02:34 UTC (rev 67)
@@ -5,12 +5,6 @@
Translation
- Update the translations
-Download
-- Let it not reach timeout when serving a file.
-
-General
-- make sub www folders not accessible by default (some index.php/html files needed)
-
Templates
- remove absolute paths from templates, to retrieve default template file if template file is not found
Modified: trunk/lib/modules/default/files.inc.php
===================================================================
--- trunk/lib/modules/default/files.inc.php 2008-10-23 10:42:46 UTC (rev 66)
+++ trunk/lib/modules/default/files.inc.php 2008-10-23 11:02:34 UTC (rev 67)
@@ -245,6 +245,12 @@
/* if we got this far the download should begin serving */
$file = app()->config['DATA_PATH'].'/'.$finfo['id'];
$filesize = filesize($file);
+ /* set to not timeout within default setting */
+ if (isset(app()->config['max_download_time'])) {
+ set_time_limit(app()->config['max_download_time']*60);
+ } else {
+ set_time_limit(7200); /* 2 hours should be enough */
+ }
/* disable and clean output buffer so it won't reach memory limit */
ob_end_clean();
header('Content-Type: '.$finfo['mime']);
Modified: trunk/www/config.inc.php.example
===================================================================
--- trunk/www/config.inc.php.example 2008-10-23 10:42:46 UTC (rev 66)
+++ trunk/www/config.inc.php.example 2008-10-23 11:02:34 UTC (rev 67)
@@ -51,6 +51,9 @@
/* Set maximum default upload size in MB*/
$CONFIG['max_upload_size']=100;
+/* Set the maximum time (in minutes) a download should take (putting it to 0 will disable the timeout, but it's not suggested) */
+$CONFIG['max_download_time']=120;
+
/* if registration is enabled confirm it by e-amil ? */
$CONFIG['registration']['email_confirm']='yes';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-23 10:45:27
|
Revision: 66
http://openupload.svn.sourceforge.net/openupload/?rev=66&view=rev
Author: tsdogs
Date: 2008-10-23 10:42:46 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
Add direct access restrictions to sub folders.
Added Paths:
-----------
trunk/www/plugins/index.html
trunk/www/templates/default/img/admin/index.html
trunk/www/templates/default/img/index.html
trunk/www/templates/default/index.html
trunk/www/templates/index.html
Added: trunk/www/plugins/index.html
===================================================================
--- trunk/www/plugins/index.html (rev 0)
+++ trunk/www/plugins/index.html 2008-10-23 10:42:46 UTC (rev 66)
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<title>NO ACCESS</title>
+<meta http-equiv="REFRESH" content="0;url=../"></HEAD>
+<BODY>
+No direct access is allowed on this folder.
+</BODY>
+</HTML>
\ No newline at end of file
Added: trunk/www/templates/default/img/admin/index.html
===================================================================
--- trunk/www/templates/default/img/admin/index.html (rev 0)
+++ trunk/www/templates/default/img/admin/index.html 2008-10-23 10:42:46 UTC (rev 66)
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<title>NO ACCESS</title>
+<meta http-equiv="REFRESH" content="0;url=../../../../"></HEAD>
+<BODY>
+No direct access is allowed on this folder.
+</BODY>
+</HTML>
\ No newline at end of file
Added: trunk/www/templates/default/img/index.html
===================================================================
--- trunk/www/templates/default/img/index.html (rev 0)
+++ trunk/www/templates/default/img/index.html 2008-10-23 10:42:46 UTC (rev 66)
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<title>NO ACCESS</title>
+<meta http-equiv="REFRESH" content="0;url=../../../"></HEAD>
+<BODY>
+No direct access is allowed on this folder.
+</BODY>
+</HTML>
\ No newline at end of file
Added: trunk/www/templates/default/index.html
===================================================================
--- trunk/www/templates/default/index.html (rev 0)
+++ trunk/www/templates/default/index.html 2008-10-23 10:42:46 UTC (rev 66)
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<title>NO ACCESS</title>
+<meta http-equiv="REFRESH" content="0;url=../../"></HEAD>
+<BODY>
+No direct access is allowed on this folder.
+</BODY>
+</HTML>
\ No newline at end of file
Added: trunk/www/templates/index.html
===================================================================
--- trunk/www/templates/index.html (rev 0)
+++ trunk/www/templates/index.html 2008-10-23 10:42:46 UTC (rev 66)
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<title>NO ACCESS</title>
+<meta http-equiv="REFRESH" content="0;url=../"></HEAD>
+<BODY>
+No direct access is allowed on this folder.
+</BODY>
+</HTML>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-23 10:34:22
|
Revision: 63
http://openupload.svn.sourceforge.net/openupload/?rev=63&view=rev
Author: tsdogs
Date: 2008-10-23 10:30:01 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
remove banned plugin
Modified Paths:
--------------
trunk/www/config.inc.php.example
Added Paths:
-----------
trunk/www/templates/default/img/admin/banned.png
trunk/www/templates/default/img/admin/tadd.png
Removed Paths:
-------------
trunk/plugins/banned.inc.php
trunk/templates/default/plugins/banned/
Deleted: trunk/plugins/banned.inc.php
===================================================================
--- trunk/plugins/banned.inc.php 2008-10-23 10:29:08 UTC (rev 62)
+++ trunk/plugins/banned.inc.php 2008-10-23 10:30:01 UTC (rev 63)
@@ -1,109 +0,0 @@
-<?php
-
-
-class BannedPlugin extends OpenUploadPlugin {
-
- function BannedPlugin() {
- }
-
- function init() {
- global $_SERVER;
-
- $this->banned = app()->db->read('banned',array(),array('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;
- }
-
- function fileaction() {
- global $_GET;
- if (isset($_GET['ip'])) {
- $ban = app()->db->read('banned',array('ip' => $_GET['ip']));
- $ban = $ban[0];
- if ($ban['ip']!=$_GET['ip']) {
- $ban['id']='';
- $ban['priority']='1'; /* maybe a bigger one is better */
- $ban['ip']=$_GET['ip'];
- $ban['access']='deny';
- app()->db->insertRecord('banned',$ban);
- app()->message(tr('IP %1 has been banned!',$_GET['ip']));
- } else {
- app()->error(tr('IP %1 was already in state: %2!',$_GET['ip'],$ban['access']));
- }
- }
- }
-}
-?>
\ No newline at end of file
Modified: trunk/www/config.inc.php.example
===================================================================
--- trunk/www/config.inc.php.example 2008-10-23 10:29:08 UTC (rev 62)
+++ trunk/www/config.inc.php.example 2008-10-23 10:30:01 UTC (rev 63)
@@ -43,7 +43,6 @@
* they will need to enable the functionality
* on a group basis
*/
-$CONFIG['plugins'][] = 'banned';
$CONFIG['plugins'][] = 'mimetypes';
$CONFIG['plugins'][] = 'email';
$CONFIG['plugins'][] = 'password';
Added: trunk/www/templates/default/img/admin/banned.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/admin/banned.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: trunk/www/templates/default/img/admin/tadd.png
===================================================================
(Binary files differ)
Property changes on: trunk/www/templates/default/img/admin/tadd.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-22 18:41:44
|
Revision: 58
http://openupload.svn.sourceforge.net/openupload/?rev=58&view=rev
Author: tsdogs
Date: 2008-10-22 18:41:38 +0000 (Wed, 22 Oct 2008)
Log Message:
-----------
Update install instructions
Modified Paths:
--------------
trunk/INSTALL
Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL 2008-10-22 18:41:16 UTC (rev 57)
+++ trunk/INSTALL 2008-10-22 18:41:38 UTC (rev 58)
@@ -15,17 +15,17 @@
mysql:
- create the db and the user
create database <database>;
- grant all privileges on <database>.* to '<user>'@'localhost' deintified by '<password>';
+ grant all privileges on <database>.* to '<user>'@'localhost' ideintified by '<password>';
- import the database schema and default config options
mysql <database> -u <user> -p < sql/mysql/1_schema.sql
mysql <database> -u <user> -p < sql/mysql/2_base.sql
- import the configuration mode (it is not required):
- mysql <database> -u <user> -p < sql/mysql/3_<mode>.sql
+ mysql <database> -u <user> -p < sql/mysql/3_mode_<selected>.sql
txt:
- the txt is usable, but I would not suggest it unless it's a really low traffic site.
- make sure the "rootdir" for the txtdb folder is writable by your apache user
- copy the default files from sql/txt/*.txt to the "rootdir" folder
- - substitute the wanted mode configuration acl_<mode>.txt over the acl.txt
+ - substitute the wanted mode configuration txt/modes/acl_<mode>.txt over the acl.txt
8. Point your browser to http://localhost/<wherever>
9. Login with "admin" "admin"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-22 18:41:21
|
Revision: 57
http://openupload.svn.sourceforge.net/openupload/?rev=57&view=rev
Author: tsdogs
Date: 2008-10-22 18:41:16 +0000 (Wed, 22 Oct 2008)
Log Message:
-----------
Tool for conversion from mysql db to txtdb (only for development use)
Added Paths:
-----------
trunk/sql/mysql2txt.php
Added: trunk/sql/mysql2txt.php
===================================================================
--- trunk/sql/mysql2txt.php (rev 0)
+++ trunk/sql/mysql2txt.php 2008-10-22 18:41:16 UTC (rev 57)
@@ -0,0 +1,35 @@
+#!/bin/php
+<?php
+include('../www/config.inc.php');
+include('../lib/classes.inc.php');
+include('../lib/modules/db/mysql.inc.php');
+include('../lib/modules/db/txt.inc.php');
+if (isset($argv[1]))
+ $CONFIG['database']['name']=$argv[1];
+
+if (isset($argv[2]))
+ $CONFIG['database']['rootdir']=$argv[2];
+else
+ $CONFIG['database']['rootdir']='./txt';
+
+$mdb = new MysqlDb($CONFIG);
+$mdb = new mysqlDb($CONFIG['database']);
+$tdb = new txtDB($CONFIG['database']);
+
+$mdb->init();
+$tdb->init();
+
+function app() {
+ return NULL;
+}
+
+function tr($txt) {
+ return $txt;
+}
+
+foreach ($tdb->tables as $k => $t) {
+ $rows = $mdb->read($k,array(),$t['fields']);
+ $tdb->writeTxt($CONFIG['database']['rootdir'].'/'.$k.'.txt',$rows,$t['fields']);
+}
+
+?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-22 18:40:04
|
Revision: 56
http://openupload.svn.sourceforge.net/openupload/?rev=56&view=rev
Author: tsdogs
Date: 2008-10-22 18:40:00 +0000 (Wed, 22 Oct 2008)
Log Message:
-----------
Add txt default database.
Added Paths:
-----------
trunk/sql/txt/
trunk/sql/txt/acl.txt
trunk/sql/txt/banned.txt
trunk/sql/txt/file_options.txt
trunk/sql/txt/files.txt
trunk/sql/txt/groups.txt
trunk/sql/txt/langs.txt
trunk/sql/txt/modes/
trunk/sql/txt/modes/acl_private.txt
trunk/sql/txt/modes/acl_public.txt
trunk/sql/txt/modes/acl_restricted.txt
trunk/sql/txt/modes/acl_service.txt
trunk/sql/txt/plugin_acl.txt
trunk/sql/txt/plugin_options.txt
trunk/sql/txt/users.txt
Added: trunk/sql/txt/acl.txt
===================================================================
--- trunk/sql/txt/acl.txt (rev 0)
+++ trunk/sql/txt/acl.txt 2008-10-22 18:40:00 UTC (rev 56)
@@ -0,0 +1,5 @@
+id|module|action|group_id|access
+1|*|*|admins|allow
+2|admin|*|admins|allow
+3|admin|*|*|deny
+4|auth|login|unregistered|allow
Added: trunk/sql/txt/banned.txt
===================================================================
--- trunk/sql/txt/banned.txt (rev 0)
+++ trunk/sql/txt/banned.txt 2008-10-22 18:40:00 UTC (rev 56)
@@ -0,0 +1,3 @@
+id|ip|access|priority
+1|127.0.0.1|allow|1
+2|0.0.0.0/0|allow|9999999
Added: trunk/sql/txt/file_options.txt
===================================================================
--- trunk/sql/txt/file_options.txt (rev 0)
+++ trunk/sql/txt/file_options.txt 2008-10-22 18:40:00 UTC (rev 56)
@@ -0,0 +1 @@
+id|file_id|module|name|value
Added: trunk/sql/txt/files.txt
===================================================================
--- trunk/sql/txt/files.txt (rev 0)
+++ trunk/sql/txt/files.txt 2008-10-22 18:40:00 UTC (rev 56)
@@ -0,0 +1 @@
+id|name|mime|description|size|remove|user_id|ip|upload_date
Added: trunk/sql/txt/groups.txt
===================================================================
--- trunk/sql/txt/groups.txt (rev 0)
+++ trunk/sql/txt/groups.txt 2008-10-22 18:40:00 UTC (rev 56)
@@ -0,0 +1,4 @@
+name|description
+admins|Administrators group
+registered|Registered Users
+unregistered|Unregistered users
Added: trunk/sql/txt/langs.txt
===================================================================
--- trunk/sql/txt/langs.txt (rev 0)
+++ trunk/sql/txt/langs.txt 2008-10-22 18:40:00 UTC (rev 56)
@@ -0,0 +1,3 @@
+id|name|locale|browser|charset|active
+en|English|en_EN|[en];[en-EN]|iso-8559-1|1
+it|Italiano|it_IT.utf8|[it];[it-IT]|utf8|1
Added: trunk/sql/txt/modes/acl_private.txt
===================================================================
--- trunk/sql/txt/modes/acl_private.txt (rev 0)
+++ trunk/sql/txt/modes/acl_private.txt 2008-10-22 18:40:00 UTC (rev 56)
@@ -0,0 +1,10 @@
+id|module|action|group_id|access
+1|*|*|admins|allow
+2|admin|*|admins|allow
+3|admin|*|*|deny
+5|auth|register|*|deny
+6|auth|*|unregistered|deny
+7|auth|*|*|allow
+8|files|*|unregistered|deny
+9|files|*|*|allow
+10|auth|login|unregistered|allow
Added: trunk/sql/txt/modes/acl_public.txt
===================================================================
--- trunk/sql/txt/modes/acl_public.txt (rev 0)
+++ trunk/sql/txt/modes/acl_public.txt 2008-10-22 18:40:00 UTC (rev 56)
@@ -0,0 +1,7 @@
+id|module|action|group_id|access
+1|*|*|admins|allow
+2|admin|*|admins|allow
+3|admin|*|*|deny
+4|auth|login|unregistered|allow
+5|auth|*|*|deny
+6|files|*|*|allow
Added: trunk/sql/txt/modes/acl_restricted.txt
===================================================================
--- trunk/sql/txt/modes/acl_restricted.txt (rev 0)
+++ trunk/sql/txt/modes/acl_restricted.txt 2008-10-22 18:40:00 UTC (rev 56)
@@ -0,0 +1,12 @@
+id|module|action|group_id|access
+1|*|*|admins|allow
+2|admin|*|admins|allow
+3|admin|*|*|deny
+4|auth|login|unregistered|allow
+5|auth|register|*|deny
+6|auth|*|unregistered|deny
+7|auth|*|*|allow
+8|files|d|unregistered|allow
+9|files|g|unregistered|allow
+10|files|*|unregistered|deny
+11|files|*|*|allow
Added: trunk/sql/txt/modes/acl_service.txt
===================================================================
--- trunk/sql/txt/modes/acl_service.txt (rev 0)
+++ trunk/sql/txt/modes/acl_service.txt 2008-10-22 18:40:00 UTC (rev 56)
@@ -0,0 +1,10 @@
+id|module|action|group_id|access
+1|*|*|admins|allow
+2|admin|*|admins|allow
+3|admin|*|*|deny
+4|auth|login|unregistered|allow
+5|auth|register|unregistered|allow
+6|auth|*|unregistered|deny
+7|auth|register|*|deny
+8|auth|*|*|allow
+9|files|*|*|allow
Added: trunk/sql/txt/plugin_acl.txt
===================================================================
--- trunk/sql/txt/plugin_acl.txt (rev 0)
+++ trunk/sql/txt/plugin_acl.txt 2008-10-22 18:40:00 UTC (rev 56)
@@ -0,0 +1,10 @@
+id|group_id|plugin|access
+1|admins|password|enable
+2|admins|captcha|enable
+3|admins|email|enable
+4|registered|password|enable
+5|registered|captcha|enable
+6|registered|email|enable
+7|unregistered|mimetypes|enable
+8|unregistered|captcha|enable
+9|unregistered|password|enable
Added: trunk/sql/txt/plugin_options.txt
===================================================================
--- trunk/sql/txt/plugin_options.txt (rev 0)
+++ trunk/sql/txt/plugin_options.txt 2008-10-22 18:40:00 UTC (rev 56)
@@ -0,0 +1 @@
+id|plugin|group_id|name|value
Added: trunk/sql/txt/users.txt
===================================================================
--- trunk/sql/txt/users.txt (rev 0)
+++ trunk/sql/txt/users.txt 2008-10-22 18:40:00 UTC (rev 56)
@@ -0,0 +1,2 @@
+id|login|password|name|group_id|email|lang|reg_date|regid|active
+1|admin|$1$sLCQ3aFR$rCIb4Owhgi3mIHgYnbA351|Administrator|admins|ope...@yo...|en|0000-00-00 00:00:00||1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-22 18:38:57
|
Revision: 55
http://openupload.svn.sourceforge.net/openupload/?rev=55&view=rev
Author: tsdogs
Date: 2008-10-22 18:38:55 +0000 (Wed, 22 Oct 2008)
Log Message:
-----------
fix structure bug
Modified Paths:
--------------
trunk/sql/mysql/1_structure.sql
Modified: trunk/sql/mysql/1_structure.sql
===================================================================
--- trunk/sql/mysql/1_structure.sql 2008-10-22 18:38:27 UTC (rev 54)
+++ trunk/sql/mysql/1_structure.sql 2008-10-22 18:38:55 UTC (rev 55)
@@ -130,7 +130,7 @@
`id` int(11) NOT NULL auto_increment,
`plugin` varchar(100) NOT NULL,
`group_id` varchar(100) NOT NULL,
- `option` varchar(100) NOT NULL,
+ `name` varchar(100) NOT NULL,
`value` text,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
@@ -149,8 +149,8 @@
`group_id` varchar(50) NOT NULL default 'unregistered',
`email` varchar(250) NOT NULL,
`lang` varchar(10) NOT NULL default 'en',
- `reg_date` datetime NOT NULL default now(),
- `regid` varchar(50) NOT NULL default 'en',
+ `reg_date` datetime NOT NULL,
+ `regid` varchar(50) NOT NULL default '',
`active` tinyint(3) unsigned NOT NULL default '1',
PRIMARY KEY (`id`),
UNIQUE KEY `login` (`login`)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-22 18:38:37
|
Revision: 54
http://openupload.svn.sourceforge.net/openupload/?rev=54&view=rev
Author: tsdogs
Date: 2008-10-22 18:38:27 +0000 (Wed, 22 Oct 2008)
Log Message:
-----------
fix user deletion field to login
Modified Paths:
--------------
trunk/lib/modules/auth/default.inc.php
Modified: trunk/lib/modules/auth/default.inc.php
===================================================================
--- trunk/lib/modules/auth/default.inc.php 2008-10-22 18:38:06 UTC (rev 53)
+++ trunk/lib/modules/auth/default.inc.php 2008-10-22 18:38:27 UTC (rev 54)
@@ -40,7 +40,7 @@
}
function delete($id) {
- $this->db->delete('users',array('id' => $id));
+ $this->db->delete('users',array('login' => $id));
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-22 18:38:10
|
Revision: 53
http://openupload.svn.sourceforge.net/openupload/?rev=53&view=rev
Author: tsdogs
Date: 2008-10-22 18:38:06 +0000 (Wed, 22 Oct 2008)
Log Message:
-----------
add field name boundings
Modified Paths:
--------------
trunk/lib/modules/db/mysql.inc.php
Modified: trunk/lib/modules/db/mysql.inc.php
===================================================================
--- trunk/lib/modules/db/mysql.inc.php 2008-10-22 18:34:43 UTC (rev 52)
+++ trunk/lib/modules/db/mysql.inc.php 2008-10-22 18:38:06 UTC (rev 53)
@@ -19,12 +19,12 @@
function newId($tbl,$field = 'id',$keys = array ()) {
- $sql = 'SELECT max('.$field.') as newid FROM '.$this->prefix.$tbl;
+ $sql = 'SELECT max(`'.$field.'`) as newid FROM `'.$this->prefix.$tbl.'`';
if (count($keys)>0) {
$where = '';
foreach ($keys as $k => $v) {
if ($where != '') $where .= ' AND ';
- $where .= $k.'="'.(mysql_real_escape_string($v)).'"';
+ $where .= '`'.$k.'`="'.(mysql_real_escape_string($v)).'"';
}
$sql .= ' WHERE '.$where;
}
@@ -38,7 +38,7 @@
$found = true;
while ($found) {
$id = randomName(30,30);
- $sql = 'SELECT '.$field.' FROM '.$this->prefix.$tbl.' WHERE '.$field.'="'.$id.'"';
+ $sql = 'SELECT '.$field.' FROM `'.$this->prefix.$tbl.'` WHERE `'.$field.'`="'.$id.'"';
$res = mysql_query($sql);
$found = mysql_num_rows($res)>0;
mysql_free_result($res);
@@ -47,12 +47,12 @@
}
function count($tbl,$keys = array()) {
- $sql = 'SELECT count(*) AS num FROM '.$this->prefix.$tbl;
+ $sql = 'SELECT count(*) AS num FROM `'.$this->prefix.$tbl.'`';
if (count($keys)>0) {
$where = '';
foreach ($keys as $k => $v) {
if ($where != '') $where .= ' AND ';
- $where .= $k.'="'.(mysql_real_escape_string($v)).'"';
+ $where .= '`'.$k.'`="'.(mysql_real_escape_string($v)).'"';
}
$sql .= ' WHERE '.$where;
}
@@ -63,12 +63,12 @@
}
function read($tbl,$keys = array(), $sort = array(), $limit = '', $assoc = array()) {
- $sql = 'SELECT * FROM '.$this->prefix.$tbl;
+ $sql = 'SELECT * FROM `'.$this->prefix.$tbl.'`';
if (count($keys)>0) {
$where = '';
foreach ($keys as $k => $v) {
if ($where != '') $where .= ' AND ';
- $where .= $k.'="'.(mysql_real_escape_string($v)).'"';
+ $where .= '`'.$k.'`="'.(mysql_real_escape_string($v)).'"';
}
$sql .= ' WHERE '.$where;
}
@@ -76,7 +76,7 @@
$sorting = '';
foreach ($sort as $s) {
if ($sorting!='') $sorting.=',';
- $sorting .= $s;
+ $sorting .= '`'.$s.'`';
}
$sql .= ' ORDER BY '.$sorting;
}
@@ -84,6 +84,7 @@
$sql .= ' LIMIT '.$limit;
}
$res = mysql_query($sql);
+if (!$res) { die('query failed: '.$sql); }
$result = array();
while ($row = mysql_fetch_assoc($res)) {
if (count($assoc)) { /* maybe there is a better way to do this? */
@@ -102,21 +103,21 @@
}
function insert($tbl,$values,$fields = array()) {
- $sql = 'INSERT INTO '.$this->prefix.$tbl;
+ $sql = 'INSERT INTO `'.$this->prefix.$tbl.'`';
$flist = '';
$vlist = '';
if (count($fields)>0) {
foreach ($fields as $f) {
if ($flist!='') $flist .= ',';
if ($vlist!='') $vlist .= ',';
- $flist .= $f;
+ $flist .= '`'.$f.'`';
$vlist .= '"'.mysql_real_escape_string($values[$f]).'"';
}
} else {
foreach ($values as $k => $v) {
if ($flist!='') $flist .= ',';
if ($vlist!='') $vlist .= ',';
- $flist .= $k;
+ $flist .= '`'.$k.'`';
$vlist .= '"'.mysql_real_escape_string($v).'"';
}
}
@@ -125,17 +126,17 @@
}
function update($tbl,$values,$keys = array(),$fields = array()) {
- $sql = 'UPDATE '.$this->prefix.$tbl;
+ $sql = 'UPDATE `'.$this->prefix.$tbl.'`';
$set = '';
if (count($fields)>0) {
foreach ($fields as $f) {
if ($set!='') $set .= ',';
- $set .= $f.'="'.mysql_real_escape_string($values[$f]).'"';
+ $set .= '`'.$f.'`="'.mysql_real_escape_string($values[$f]).'"';
}
} else {
foreach ($values as $k => $v) {
if ($set!='') $set .= ',';
- $set .= $k.'="'.mysql_real_escape_string($v).'"';
+ $set .= '`'.$k.'`="'.mysql_real_escape_string($v).'"';
}
}
$sql .= ' SET '.$set;
@@ -143,7 +144,7 @@
$where = '';
foreach ($keys as $k => $v) {
if ($where != '') $where .= ' AND ';
- $where .= $k.'="'.mysql_real_escape_string($v).'"';
+ $where .= '`'.$k.'`="'.mysql_real_escape_string($v).'"';
}
$sql .= ' WHERE '.$where;
}
@@ -151,17 +152,16 @@
}
function delete($tbl,$keys = array()) {
- $sql = 'DELETE FROM '.$this->prefix.$tbl;
+ $sql = 'DELETE FROM `'.$this->prefix.$tbl.'`';
if (count($keys)>0) {
$where = '';
foreach ($keys as $k => $v) {
if ($where != '') $where .= ' AND ';
- $where .= $k.'="'.mysql_real_escape_string($v).'"';
+ $where .= '`'.$k.'`="'.mysql_real_escape_string($v).'"';
}
$sql .= ' WHERE '.$where;
}
- $res = mysql_query($sql);
- mysql_free_result($res);
+ mysql_query($sql);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-22 18:34:56
|
Revision: 52
http://openupload.svn.sourceforge.net/openupload/?rev=52&view=rev
Author: tsdogs
Date: 2008-10-22 18:34:43 +0000 (Wed, 22 Oct 2008)
Log Message:
-----------
fix app() function dependency.
Modified Paths:
--------------
trunk/lib/modules/db/txt.inc.php
Modified: trunk/lib/modules/db/txt.inc.php
===================================================================
--- trunk/lib/modules/db/txt.inc.php 2008-10-22 17:46:24 UTC (rev 51)
+++ trunk/lib/modules/db/txt.inc.php 2008-10-22 18:34:43 UTC (rev 52)
@@ -7,14 +7,13 @@
var $rootdir;
var $prefix;
- function txtDB() {
+ function txtDB($config) {
$this->tables = array (
"files" => array (
"type" => "file",
"fields" => array (
"id", "name", "mime", "description", "size", "remove", "user_id", "ip", "upload_date",
)
-
),
"users" => array (
"type" => "file",
@@ -59,7 +58,7 @@
"plugin_options" => array (
"type" => "file",
"fields" => array (
- "id", "plugin", "group_id", "option", "value",
+ "id", "plugin", "group_id", "name", "value",
),
"auto_increment" => "id",
),
@@ -71,6 +70,9 @@
"auto_increment" => "id",
),
);
+ $this->baseDir=$config['rootdir'];
+ $this->prefix=$config['prefix'];
+
}
function readTxt ($file) {
@@ -108,8 +110,6 @@
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!'));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-22 17:46:26
|
Revision: 51
http://openupload.svn.sourceforge.net/openupload/?rev=51&view=rev
Author: tsdogs
Date: 2008-10-22 17:46:24 +0000 (Wed, 22 Oct 2008)
Log Message:
-----------
Doc update
Modified Paths:
--------------
trunk/CHANGELOG
trunk/INSTALL
Modified: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG 2008-10-22 17:46:00 UTC (rev 50)
+++ trunk/CHANGELOG 2008-10-22 17:46:24 UTC (rev 51)
@@ -2,6 +2,8 @@
* Registration
- Check for valid login name
+ - Enable registration with e-mail confirmation
+
* Upload
- Added main maximum upload file size checks
@@ -27,6 +29,9 @@
- array module
- initial Italian translation
+* Download
+ - Changeed serve file method to not go over the memory php limit (output buffer)
+
* Web site
- Created index page
- Addedd Screen shots
Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL 2008-10-22 17:46:00 UTC (rev 50)
+++ trunk/INSTALL 2008-10-22 17:46:24 UTC (rev 51)
@@ -9,17 +9,34 @@
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
+6. Make sure the web server is able to write to the "data" directory
7. Create the database
+ see README for more information on mode and rights configuration
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
+ mysql <database> -u <user> -p < sql/mysql/1_schema.sql
+ mysql <database> -u <user> -p < sql/mysql/2_base.sql
+ - import the configuration mode (it is not required):
+ mysql <database> -u <user> -p < sql/mysql/3_<mode>.sql
+ txt:
+ - the txt is usable, but I would not suggest it unless it's a really low traffic site.
+ - make sure the "rootdir" for the txtdb folder is writable by your apache user
+ - copy the default files from sql/txt/*.txt to the "rootdir" folder
+ - substitute the wanted mode configuration acl_<mode>.txt over the acl.txt
8. Point your browser to http://localhost/<wherever>
+9. Login with "admin" "admin"
+10. Go to Profile and change your admin e-mail and password
+11. Enjoy! :)
+N.B. If you want to change something in the templates I'd suggest to create a site template and put there the needed changed files,
+ (templates/<yourtemplate> or www/templates/<yourtemplate>).
+ The program will check for the exsistence of a file in the selected template folder, and if not found will go back to the default.
+ This will avoid problems when updating the program to a new version.
+
BIG FAT NOTE:
The program will work even if you copy the whole folder into the web server root or a subdiretory.
But:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-22 17:46:03
|
Revision: 50
http://openupload.svn.sourceforge.net/openupload/?rev=50&view=rev
Author: tsdogs
Date: 2008-10-22 17:46:00 +0000 (Wed, 22 Oct 2008)
Log Message:
-----------
fix memory limit hit when serving big files (disable output buffer)
Modified Paths:
--------------
trunk/lib/modules/default/files.inc.php
Modified: trunk/lib/modules/default/files.inc.php
===================================================================
--- trunk/lib/modules/default/files.inc.php 2008-10-22 17:45:12 UTC (rev 49)
+++ trunk/lib/modules/default/files.inc.php 2008-10-22 17:46:00 UTC (rev 50)
@@ -245,7 +245,8 @@
/* if we got this far the download should begin serving */
$file = app()->config['DATA_PATH'].'/'.$finfo['id'];
$filesize = filesize($file);
- ob_clean();
+ /* disable and clean output buffer so it won't reach memory limit */
+ ob_end_clean();
header('Content-Type: '.$finfo['mime']);
header('Content-Length: '.$filesize);
header('Content-Disposition: attachment; filename="'.$finfo['name'].'"');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-22 17:45:22
|
Revision: 49
http://openupload.svn.sourceforge.net/openupload/?rev=49&view=rev
Author: tsdogs
Date: 2008-10-22 17:45:12 +0000 (Wed, 22 Oct 2008)
Log Message:
-----------
fix a few warnings
Modified Paths:
--------------
trunk/lib/modules/db/mysql.inc.php
Modified: trunk/lib/modules/db/mysql.inc.php
===================================================================
--- trunk/lib/modules/db/mysql.inc.php 2008-10-22 17:44:41 UTC (rev 48)
+++ trunk/lib/modules/db/mysql.inc.php 2008-10-22 17:45:12 UTC (rev 49)
@@ -121,9 +121,7 @@
}
}
$sql .= ' ('.$flist.') VALUES ('.$vlist.')';
-echo $sql;
- $res = mysql_query($sql);
- mysql_free_result($res);
+ mysql_query($sql);
}
function update($tbl,$values,$keys = array(),$fields = array()) {
@@ -149,8 +147,7 @@
}
$sql .= ' WHERE '.$where;
}
- $res = mysql_query($sql);
- mysql_free_result($res);
+ mysql_query($sql);
}
function delete($tbl,$keys = array()) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-22 17:44:48
|
Revision: 48
http://openupload.svn.sourceforge.net/openupload/?rev=48&view=rev
Author: tsdogs
Date: 2008-10-22 17:44:41 +0000 (Wed, 22 Oct 2008)
Log Message:
-----------
Add e-mail confirmation on registration
Modified Paths:
--------------
trunk/lib/modules/db/txt.inc.php
Modified: trunk/lib/modules/db/txt.inc.php
===================================================================
--- trunk/lib/modules/db/txt.inc.php 2008-10-22 17:44:07 UTC (rev 47)
+++ trunk/lib/modules/db/txt.inc.php 2008-10-22 17:44:41 UTC (rev 48)
@@ -19,7 +19,7 @@
"users" => array (
"type" => "file",
"fields" => array (
- "id", "login", "password", "name", "group_id", "email", "lang", "active",
+ "id", "login", "password", "name", "group_id", "email", "lang", "reg_date", "regid", "active",
),
"auto_increment" => "id",
),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ts...@us...> - 2008-10-22 17:44:15
|
Revision: 47
http://openupload.svn.sourceforge.net/openupload/?rev=47&view=rev
Author: tsdogs
Date: 2008-10-22 17:44:07 +0000 (Wed, 22 Oct 2008)
Log Message:
-----------
Add e-mail confirmation on registration
Modified Paths:
--------------
trunk/TODO
trunk/lib/modules/auth/default.inc.php
trunk/lib/modules/default/auth.inc.php
trunk/sql/mysql/1_structure.sql
trunk/sql/mysql/2_base.sql
trunk/templates/default/modules/auth/registerConfirm.tpl
trunk/templates/default/modules/auth/registerEnable.tpl
trunk/www/config.inc.php.example
Added Paths:
-----------
trunk/templates/default/modules/auth/emailconfirm.tpl
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2008-10-21 18:13:49 UTC (rev 46)
+++ trunk/TODO 2008-10-22 17:44:07 UTC (rev 47)
@@ -5,42 +5,34 @@
Administration
- Admin of banned IPs
-Registration
-- Enable registration moderation
-- Enable registration with e-mail confirmation
-
-Database
-- txtdb needs some work
-
Translation
- Update the translations
Download
-- Change serve file method to not go over the memory php limit and not timeout when serving a file.
+- Let it not reach timeout when serving a file.
General
-- make sub www folders not accessible by default (some index.php needed)
+- make sub www folders not accessible by default (some index.php/html files needed)
-******* MIGHT BE IN RELEASE *******
-Registration
-- Enable registration moderation
+Templates
+- remove absolute paths from templates, to retrieve default template file if template file is not found
+******* WOULD LIKE IT TO BE IN RELEASE *******
Authentication
- LDAP authentication for Openldap and AD support
-Database
-- pgsql module
-
Upload
- Display upload progress
-Administration
-- Rights switch mode (to switch from 1 mode to the other)
-- Rights better admin tool.
+Database
+- pgsql module
Plugins
-- Upload different filesize limiting depending on group
+- Upload different filesize limiting depending on group (needs plugin options based on groups)
+Maintainence
+- Create a script to clean up the files/tmpfiles.
+
******* OTHER THINGS/IDEAS *******
General
@@ -50,13 +42,24 @@
Users
- manage personal files (if allowed)
+Database
+- txtdb needs some work. might need file locks.
+
Administration
- Review the general administration module
- First setup script
- Config administration
- Language table admin.
- Plugin options
+- Rights switch mode (to switch from 1 mode to the other)
+- Rights better admin tool.
+Registration
+- Enable registration moderation
+
+User
+- e-mail change should need a confirmation e-mail too!
+
Download
- Fix double click on no blockings for download
@@ -74,7 +77,6 @@
- Add a database translator? not until base isn't complete.
Maintainence
-- Create a script to clean up the files/tmpfiles.
- Manage file deletion timeout probably better to be handled here.
Template
Modified: trunk/lib/modules/auth/default.inc.php
===================================================================
--- trunk/lib/modules/auth/default.inc.php 2008-10-21 18:13:49 UTC (rev 46)
+++ trunk/lib/modules/auth/default.inc.php 2008-10-22 17:44:07 UTC (rev 47)
@@ -5,7 +5,7 @@
var $userfields;
function defaultAuth() {
- $this->userfields = array('id','login','password','name','group_id','email','lang','active');
+ $this->userfields = array('id','login','password','name','group_id','email','lang','reg_date','regid','active');
$this->features = array('info','add', 'update', 'delete');
}
Modified: trunk/lib/modules/default/auth.inc.php
===================================================================
--- trunk/lib/modules/default/auth.inc.php 2008-10-21 18:13:49 UTC (rev 46)
+++ trunk/lib/modules/default/auth.inc.php 2008-10-22 17:44:07 UTC (rev 47)
@@ -16,6 +16,7 @@
"register" => array (
1 => "registerForm",
2 => "registerConfirm",
+ 3 => "registerEnable",
),
);
var $page;
@@ -82,8 +83,14 @@
function registerForm() {
global $_SESSION;
+ global $_GET;
global $_POST;
+ if (isset($_GET['regid'])) {
+ /* confirm registration */
+ $_SESSION['user']['regidconfirm']=$_GET['regid'];
+ $this->nextStep(3);
+ }
/* ask the plugins if require more options */
$result = app()->pluginAction('registerForm',$user);
if (!$result) {
@@ -134,15 +141,26 @@
$user['email'] = $_POST['registeremail'];
$user['lang'] = $_POST['registerlang'];
$user['group_id'] = app()->config['register']['default_group'];
- $user['active'] = 1;
+ $user['reg_date']=date('Y-m-d H:i:s');
$result = app()->pluginAction('registerConfirm',$user);
$_SESSION['register']=$user;
unset($_SESSION['register']['password']);
if (!$result) {
- $fauled = true;
+ $failed = true;
}
if ($failed)
$this->prevStep(1); /* back to registration form */
+
+ if (app()->config['registration']['email_confirm']=='yes') {
+ $user['active'] = 0;
+ $user['regid']=app()->db->newRandomId('users','regid');
+ $subject = tr('[%1] User registration confirmation e-mail',app()->config['site']['title']);
+ $this->tpl->assign('reguser',$user);
+ $this->tpl->assign('reglink',app()->config['WWW_SERVER'].app()->config['WWW_ROOT'].'/?action=register®id='.$user['regid']);
+ sendMail(app()->config['site']['email'],'noreply',$user['email'],$subject,'modules/auth/emailconfirm');
+ } else {
+ $user['active'] = 1;
+ }
app()->auth->add($user);
} else {
$this->prevStep(1); /* back to registration form */
@@ -156,12 +174,25 @@
/* simulate the user login and proceed */
unset($_SESSION['user']);
$this->authenticate();
+ } else {
+ /* display a message */
+ $this->tpl->assign('emailconfirm',app()->config['registration']['email_confirm']);
+ $this->tpl->assign('moderation',app()->config['registration']['moderation']);
}
}
function registerEnable() {
+ global $_SESSION;
/* if everything is ok register the user */
-
+ if (isset($_SESSION['user']['regidconfirm'])) {
+ $user = app()->db->read('users',array('regid' => $_SESSION['user']['regidconfirm']));
+ if (count($user)>0) {
+ $user = $user[0];
+ $user['active']=1;
+ $user['regid']=''; /* disable possibility to reactivate it if disabled by the admin */
+ app()->db->update('users',$user,array('id' => $user['id']),array('active','regid'));
+ }
+ }
}
function profile() {
Modified: trunk/sql/mysql/1_structure.sql
===================================================================
--- trunk/sql/mysql/1_structure.sql 2008-10-21 18:13:49 UTC (rev 46)
+++ trunk/sql/mysql/1_structure.sql 2008-10-22 17:44:07 UTC (rev 47)
@@ -149,6 +149,8 @@
`group_id` varchar(50) NOT NULL default 'unregistered',
`email` varchar(250) NOT NULL,
`lang` varchar(10) NOT NULL default 'en',
+ `reg_date` datetime NOT NULL default now(),
+ `regid` varchar(50) NOT NULL default 'en',
`active` tinyint(3) unsigned NOT NULL default '1',
PRIMARY KEY (`id`),
UNIQUE KEY `login` (`login`)
Modified: trunk/sql/mysql/2_base.sql
===================================================================
--- trunk/sql/mysql/2_base.sql 2008-10-21 18:13:49 UTC (rev 46)
+++ trunk/sql/mysql/2_base.sql 2008-10-22 17:44:07 UTC (rev 47)
@@ -39,7 +39,7 @@
-- Dump dei dati per la tabella `users`
--
-INSERT INTO `users` (`id`, `login`, `password`, `name`, `group_id`, `email`, `lang`, `active`) VALUES(1, 'admin', '$1$sLCQ3aFR$rCIb4Owhgi3mIHgYnbA351', 'Administrator', 'admins', 'ope...@yo...', 'en', 1);
+INSERT INTO `users` (`id`, `login`, `password`, `name`, `group_id`, `email`, `lang`, `active`) VALUES(1, 'admin', '$1$sLCQ3aFR$rCIb4Owhgi3mIHgYnbA351', 'Administrator', 'admins', 'ope...@yo...', 'en', now(), '', 1);
--
-- Dump dei dati per la tabella `acl`
Added: trunk/templates/default/modules/auth/emailconfirm.tpl
===================================================================
--- trunk/templates/default/modules/auth/emailconfirm.tpl (rev 0)
+++ trunk/templates/default/modules/auth/emailconfirm.tpl 2008-10-22 17:44:07 UTC (rev 47)
@@ -0,0 +1,88 @@
+This is a multi-part message MIME format.
+
+--{$boudary}
+Content-Type: text/plain; charset="iso-8559-1"
+Content-Transfer-Encoding: 7bit
+
+{tr}Dear {/tr} {$reguser.name},
+{tr}This e-mail message is sent to you to confirm your account registration has a valid e-mail address.{/tr}
+
+
+{tr}Open the following link in a browser to confirm your account.{/tr}:
+
+{$reglink}
+
+{tr}Best regards{/tr}.
+
+{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;
+}
+
+</style>
+{/literal}
+</header>
+<body>
+<p>{tr}Dear {/tr} {$reguser.name},<br>
+{tr}This e-mail message is sent to you to confirm your account registration has a valid e-mail address.{/tr}</p>
+
+
+<p>{tr}Open the following link in a browser to confirm your account.{/tr}:<br>
+<a href="{$reglink}">{$reglink}</a></p>
+
+<p>{tr}Best regards{/tr}.</p>
+
+{if isset($adminemail)}
+<hr>
+<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
Modified: trunk/templates/default/modules/auth/registerConfirm.tpl
===================================================================
--- trunk/templates/default/modules/auth/registerConfirm.tpl 2008-10-21 18:13:49 UTC (rev 46)
+++ trunk/templates/default/modules/auth/registerConfirm.tpl 2008-10-22 17:44:07 UTC (rev 47)
@@ -1 +1,8 @@
-Registration succeded. <a href="{$script}">back to home</a>
\ No newline at end of file
+{tr}Registration succeded{/tr}. <br>
+
+{if $emailconfirm=='yes'}
+<p>{tr}An e-mail has been sent for the accout activation{/tr}.<br>
+{tr}Please follow the e-mail instructions to activate your account.{/tr}</p>
+{/if}
+<br>
+<a href="{$script}">{tr}back to home{/tr}</a>
\ No newline at end of file
Modified: trunk/templates/default/modules/auth/registerEnable.tpl
===================================================================
--- trunk/templates/default/modules/auth/registerEnable.tpl 2008-10-21 18:13:49 UTC (rev 46)
+++ trunk/templates/default/modules/auth/registerEnable.tpl 2008-10-22 17:44:07 UTC (rev 47)
@@ -0,0 +1,2 @@
+{tr}Your account registration has been confirmed.{/tr} <br/><br/>
+{tr}You can now proceed with the login{/tr} <a href="{$script}?action=login">{tr}here{/tr}</a>
\ No newline at end of file
Modified: trunk/www/config.inc.php.example
===================================================================
--- trunk/www/config.inc.php.example 2008-10-21 18:13:49 UTC (rev 46)
+++ trunk/www/config.inc.php.example 2008-10-22 17:44:07 UTC (rev 47)
@@ -24,11 +24,9 @@
* 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']['type']='mysql';
$CONFIG['database']['host']='localhost';
$CONFIG['database']['user']='databaseuser';
$CONFIG['database']['password']='databasepwd';
@@ -38,6 +36,7 @@
//$CONFIG['database']['type']='txt';
//$CONFIG['database']['rootdir']=$CONFIG['INSTALL_ROOT'].'/txtdb';
+/* Table name prefix: should be common */
$CONFIG['database']['prefix']='';
/* PLUGINS: here you enable the plugins
@@ -53,7 +52,10 @@
/* Set maximum default upload size in MB*/
$CONFIG['max_upload_size']=100;
-/* SITE TITLE */
+/* if registration is enabled confirm it by e-amil ? */
+$CONFIG['registration']['email_confirm']='yes';
+
+/* SITE TITLE (also used for e-mails) */
$CONFIG['site']['title'] = 'Open Upload';
/* webmaster e-mail */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|