[vhffs-dev] [svn] commit: r253 - in /trunk: ./ vhffs-api/src/Vhffs/ vhffs-api/src/Vhffs/Panel/ vhffs-api/src/Vhffs/Services/ vhffs-backend/conf/ vhffs-panel/acl/ vhffs-panel/admin/ vhffs-panel/admin/cvs/ vhffs-panel/admin/repository/ vhffs-panel/repository/ vhffs-panel/templates/admin/main/ vhffs-panel/templates/admin/misc/ vhffs-panel/templates/admin/repository/ vhffs-panel/templates/menu/ vhffs-panel/templates/repository/ |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
- To: vhffs-dev@xxxxxxxxx
- Subject: [vhffs-dev] [svn] commit: r253 - in /trunk: ./ vhffs-api/src/Vhffs/ vhffs-api/src/Vhffs/Panel/ vhffs-api/src/Vhffs/Services/ vhffs-backend/conf/ vhffs-panel/acl/ vhffs-panel/admin/ vhffs-panel/admin/cvs/ vhffs-panel/admin/repository/ vhffs-panel/repository/ vhffs-panel/templates/admin/main/ vhffs-panel/templates/admin/misc/ vhffs-panel/templates/admin/repository/ vhffs-panel/templates/menu/ vhffs-panel/templates/repository/
- From: vhffs-dev@xxxxxxxxx
- Date: Sun, 29 Oct 2006 16:44:32 -0000
Author: gradator
Date: Sun Oct 29 17:44:31 2006
New Revision: 253
Log:
Add repository support, panel this time
Added:
trunk/vhffs-api/src/Vhffs/Panel/Repository.pm
trunk/vhffs-panel/admin/repository/
trunk/vhffs-panel/admin/repository/edit.pl (with props)
trunk/vhffs-panel/admin/repository/edit_submit.pl (with props)
trunk/vhffs-panel/admin/repository/list.pl (with props)
trunk/vhffs-panel/admin/repository/search.pl (with props)
trunk/vhffs-panel/admin/repository/show.pl (with props)
trunk/vhffs-panel/repository/
trunk/vhffs-panel/repository/create.pl (with props)
trunk/vhffs-panel/repository/delete.pl (with props)
trunk/vhffs-panel/repository/prefs.pl (with props)
trunk/vhffs-panel/repository/prefs_save.pl (with props)
trunk/vhffs-panel/repository/repository_submit.pl (with props)
trunk/vhffs-panel/templates/admin/repository/
trunk/vhffs-panel/templates/admin/repository/edit.tmpl
trunk/vhffs-panel/templates/admin/repository/menu.tmpl
trunk/vhffs-panel/templates/admin/repository/part-modo.tmpl
trunk/vhffs-panel/templates/admin/repository/part.tmpl
trunk/vhffs-panel/templates/admin/repository/search.tmpl
trunk/vhffs-panel/templates/admin/repository/show.tmpl
trunk/vhffs-panel/templates/repository/
trunk/vhffs-panel/templates/repository/create.tmpl
trunk/vhffs-panel/templates/repository/menu.tmpl
trunk/vhffs-panel/templates/repository/menu_sub.tmpl
trunk/vhffs-panel/templates/repository/menu_sub_wait.tmpl
trunk/vhffs-panel/templates/repository/prefs.tmpl
Modified:
trunk/Makefile
trunk/vhffs-api/src/Vhffs/Conf.pm
trunk/vhffs-api/src/Vhffs/Panel/Admin.pm
trunk/vhffs-api/src/Vhffs/Panel/Menu.pm
trunk/vhffs-api/src/Vhffs/Services/Repository.pm
trunk/vhffs-backend/conf/vhffs.conf
trunk/vhffs-panel/acl/view.pl
trunk/vhffs-panel/admin/cvs/list.pl
trunk/vhffs-panel/admin/moderation.pl
trunk/vhffs-panel/templates/admin/main/main.tmpl
trunk/vhffs-panel/templates/admin/misc/moderation.tmpl
trunk/vhffs-panel/templates/menu/group.tmpl
Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Sun Oct 29 17:44:31 2006
@@ -163,6 +163,7 @@
install -d -m 755 $(TEMPLATESDIR)/admin/dns
install -d -m 755 $(TEMPLATESDIR)/admin/group
install -d -m 755 $(TEMPLATESDIR)/admin/largefile
+ install -d -m 755 $(TEMPLATESDIR)/admin/repository
install -d -m 755 $(TEMPLATESDIR)/admin/mail
install -d -m 755 $(TEMPLATESDIR)/admin/mailing
install -d -m 755 $(TEMPLATESDIR)/admin/main
@@ -177,6 +178,7 @@
install -d -m 755 $(TEMPLATESDIR)/dns
install -d -m 755 $(TEMPLATESDIR)/group
install -d -m 755 $(TEMPLATESDIR)/largefile
+ install -d -m 755 $(TEMPLATESDIR)/repository
install -d -m 755 $(TEMPLATESDIR)/mail
install -d -m 755 $(TEMPLATESDIR)/mailinglist
install -d -m 755 $(TEMPLATESDIR)/main
@@ -195,6 +197,7 @@
install -m 755 vhffs-panel/templates/admin/dns/*.tmpl $(TEMPLATESDIR)/admin/dns/
install -m 755 vhffs-panel/templates/admin/group/*.tmpl $(TEMPLATESDIR)/admin/group/
install -m 755 vhffs-panel/templates/admin/largefile/*.tmpl $(TEMPLATESDIR)/admin/largefile/
+ install -m 755 vhffs-panel/templates/admin/repository/*.tmpl $(TEMPLATESDIR)/admin/repository/
install -m 755 vhffs-panel/templates/admin/mail/*.tmpl $(TEMPLATESDIR)/admin/mail/
install -m 755 vhffs-panel/templates/admin/mailing/*.tmpl $(TEMPLATESDIR)/admin/mailing/
install -m 755 vhffs-panel/templates/admin/main/*.tmpl $(TEMPLATESDIR)/admin/main/
@@ -209,6 +212,7 @@
install -m 755 vhffs-panel/templates/dns/*.tmpl $(TEMPLATESDIR)/dns/
install -m 755 vhffs-panel/templates/group/*.tmpl $(TEMPLATESDIR)/group/
install -m 755 vhffs-panel/templates/largefile/*.tmpl $(TEMPLATESDIR)/largefile/
+ install -m 755 vhffs-panel/templates/repository/*.tmpl $(TEMPLATESDIR)/repository/
install -m 755 vhffs-panel/templates/mail/*.tmpl $(TEMPLATESDIR)/mail/
install -m 755 vhffs-panel/templates/mailinglist/*.tmpl $(TEMPLATESDIR)/mailinglist/
install -m 755 vhffs-panel/templates/main/*.tmpl $(TEMPLATESDIR)/main/
@@ -225,12 +229,13 @@
install-panel: install-templates
install -d -m 755 $(PANELDIR)
install -d -m 755 $(PANELDIR)/acl
- install -d -m 755 $(PANELDIR)/admin $(PANELDIR)/admin/cvs $(PANELDIR)/admin/dns $(PANELDIR)/admin/group $(PANELDIR)/admin/largefile $(PANELDIR)/admin/mail $(PANELDIR)/admin/mailing $(PANELDIR)/admin/mysql $(PANELDIR)/admin/object $(PANELDIR)/admin/pgsql $(PANELDIR)/admin/svn $(PANELDIR)/admin/user $(PANELDIR)/admin/web
+ install -d -m 755 $(PANELDIR)/admin $(PANELDIR)/admin/cvs $(PANELDIR)/admin/dns $(PANELDIR)/admin/group $(PANELDIR)/admin/largefile $(PANELDIR)/admin/repository $(PANELDIR)/admin/mail $(PANELDIR)/admin/mailing $(PANELDIR)/admin/mysql $(PANELDIR)/admin/object $(PANELDIR)/admin/pgsql $(PANELDIR)/admin/svn $(PANELDIR)/admin/user $(PANELDIR)/admin/web
install -d -m 755 $(PANELDIR)/cvs
install -d -m 755 $(PANELDIR)/dns
install -d -m 755 $(PANELDIR)/group
install -d -m 755 $(PANELDIR)/help
install -d -m 755 $(PANELDIR)/largefile
+ install -d -m 755 $(PANELDIR)/repository
install -d -m 755 $(PANELDIR)/mail
install -d -m 755 $(PANELDIR)/mailinglist
install -d -m 755 $(PANELDIR)/mysql
@@ -251,6 +256,7 @@
install -m 755 vhffs-panel/admin/dns/*.pl $(PANELDIR)/admin/dns/
install -m 755 vhffs-panel/admin/group/*.pl $(PANELDIR)/admin/group/
install -m 755 vhffs-panel/admin/largefile/*.pl $(PANELDIR)/admin/largefile/
+ install -m 755 vhffs-panel/admin/repository/*.pl $(PANELDIR)/admin/repository/
install -m 755 vhffs-panel/admin/mail/*.pl $(PANELDIR)/admin/mail/
install -m 755 vhffs-panel/admin/mailing/*.pl $(PANELDIR)/admin/mailing/
install -m 755 vhffs-panel/admin/mysql/*.pl $(PANELDIR)/admin/mysql/
@@ -264,6 +270,7 @@
install -m 755 vhffs-panel/group/*.pl $(PANELDIR)/group/
install -m 755 vhffs-panel/help/*.html $(PANELDIR)/help/
install -m 755 vhffs-panel/largefile/*.pl $(PANELDIR)/largefile/
+ install -m 755 vhffs-panel/repository/*.pl $(PANELDIR)/repository/
install -m 755 vhffs-panel/mail/*.pl $(PANELDIR)/mail/
install -m 755 vhffs-panel/mailinglist/*.pl $(PANELDIR)/mailinglist/
install -m 755 vhffs-panel/mysql/*.pl $(PANELDIR)/mysql/
Modified: trunk/vhffs-api/src/Vhffs/Conf.pm
==============================================================================
--- trunk/vhffs-api/src/Vhffs/Conf.pm (original)
+++ trunk/vhffs-api/src/Vhffs/Conf.pm Sun Oct 29 17:44:31 2006
@@ -240,6 +240,14 @@
return 0;
}
+
+sub use_repository
+{
+ return -1 if( ! defined $Config{"global"}{"modules"}{'use_repository'} );
+ return 1 if( $Config{"global"}{"modules"}{'use_repository'} eq "yes");
+ return 0;
+}
+
sub use_mail
{
return -1 if( ! defined $Config{"global"}{"modules"}{'use_mail'} );
@@ -807,6 +815,19 @@
}
}
+
+sub get_repositoryurl
+{
+ if( defined $Config{"services"}{"repository"}{"repository_url"} )
+ {
+ return $Config{"services"}{"repository"}{"repository_url"};
+ }
+ else
+ {
+ return "repository";
+ }
+}
+
sub use_nospam
{
return -1 if( ! defined $Config{"services"}{"mail"} );
Modified: trunk/vhffs-api/src/Vhffs/Panel/Admin.pm
==============================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Admin.pm (original)
+++ trunk/vhffs-api/src/Vhffs/Panel/Admin.pm Sun Oct 29 17:44:31 2006
@@ -232,6 +232,19 @@
$template->param( ADMIN_LARGEFILE => "" );
}
+ if( $vhffs->get_config->use_repository == 1 )
+ {
+ $subtemplate = new HTML::Template( filename => "$templatesdir/admin/repository/menu.tmpl" );
+ $subtemplate->param( TEXT_ADMIN_REPOSITORY => gettext( "Download repository admin" ) );
+ $subtemplate->param( TEXT_LIST_REPOSITORY => gettext( "List all download repositories" ) );
+ $subtemplate->param( TEXT_SEARCH_REPOSITORY => gettext( "Search for a download repository" ) );
+ $template->param( ADMIN_REPOSITORY => $subtemplate->output );
+ }
+ else
+ {
+ $template->param( ADMIN_REPOSITORY => "" );
+ }
+
return $template->output;
}
Modified: trunk/vhffs-api/src/Vhffs/Panel/Menu.pm
==============================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Menu.pm (original)
+++ trunk/vhffs-api/src/Vhffs/Panel/Menu.pm Sun Oct 29 17:44:31 2006
@@ -51,6 +51,7 @@
use Vhffs::Panel::Mail;
use Vhffs::Panel::Mailinglist;
use Vhffs::Panel::LargeFile;
+use Vhffs::Panel::Repository;
sub new
{
@@ -180,12 +181,20 @@
$projecttemplate->param( MAILINGLIST_MENU => $mailingmenu );
}
+ # Large files
if( $vhffs->get_config->use_largefile == 1 )
{
$menu = menu Vhffs::Panel::LargeFile($data);
$projecttemplate->param( LARGEFILE_MENU => $menu );
}
+ # Download repository
+ if( $vhffs->get_config->use_repository == 1 )
+ {
+ $menu = menu Vhffs::Panel::Repository($data);
+ $projecttemplate->param( REPOSITORY_MENU => $menu );
+ }
+
$menutemplate->param( PROJECT_MENU => $projecttemplate->output );
}
Modified: trunk/vhffs-api/src/Vhffs/Services/Repository.pm
==============================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Repository.pm (original)
+++ trunk/vhffs-api/src/Vhffs/Services/Repository.pm Sun Oct 29 17:44:31 2006
@@ -210,6 +210,12 @@
}
+sub get_title
+{
+ my $self = shift;
+ return $self->{'name'};
+}
+
sub set_user
{
my ( $self , $user ) = @_;
@@ -246,6 +252,18 @@
{
my ($self , $value) = @_;
$self->{'quota'} = $value;
+}
+
+sub get_quotaused
+{
+ my $self = shift;
+ return $self->{'quota_used'};
+}
+
+sub set_quotaused
+{
+ my ($self , $value) = @_;
+ $self->{'quota_used'} = $value;
}
sub get_owneruid
Modified: trunk/vhffs-backend/conf/vhffs.conf
==============================================================================
--- trunk/vhffs-backend/conf/vhffs.conf (original)
+++ trunk/vhffs-backend/conf/vhffs.conf Sun Oct 29 17:44:31 2006
@@ -46,17 +46,18 @@
#For example, to disable the web service, you
#can specify use_web = no
<modules>
- use_web = yes
- use_mysql = yes
- use_mail = no
- use_cvs = no
- use_svn = no
+ use_web = yes
+ use_mysql = yes
+ use_mail = no
+ use_cvs = no
+ use_svn = no
use_postgres = no
- use_dns = no
+ use_dns = no
use_mailling = no
- use_mailing = no
+ use_mailing = no
use_mailuser = no
use_largefile = no
+ use_repository = no
</modules>
####################
@@ -296,6 +297,11 @@
</server>
</mirrors>
</largefile>
+
+ #Configuration of download repository
+ <repository>
+ repository_url = "http://download.vhffs.org/"
+ </repository>
</services>
Modified: trunk/vhffs-panel/acl/view.pl
==============================================================================
--- trunk/vhffs-panel/acl/view.pl (original)
+++ trunk/vhffs-panel/acl/view.pl Sun Oct 29 17:44:31 2006
@@ -114,6 +114,10 @@
{
$object = new Vhffs::Services::LargeFile( $vhffs , $name , $user , $group );
}
+elsif( $type eq "repository" )
+{
+ $object = new Vhffs::Services::Repository( $vhffs , $name , $user , $group );
+}
else
{
#If the type was not found, we juste print an error
Modified: trunk/vhffs-panel/admin/cvs/list.pl
==============================================================================
--- trunk/vhffs-panel/admin/cvs/list.pl (original)
+++ trunk/vhffs-panel/admin/cvs/list.pl Sun Oct 29 17:44:31 2006
@@ -85,7 +85,7 @@
use Vhffs::Services::Cvs;
- my $cvs = Vhffs::Services::Cvs::getall( $vhffs , undef , undef , undef );
+ my $cvs = Vhffs::Services::Cvs::getall( $vhffs , undef , $name , undef );
my $c;
my $output = "";
Modified: trunk/vhffs-panel/admin/moderation.pl
==============================================================================
--- trunk/vhffs-panel/admin/moderation.pl (original)
+++ trunk/vhffs-panel/admin/moderation.pl Sun Oct 29 17:44:31 2006
@@ -510,6 +510,48 @@
}
}
+
+ if( $vhffs->get_config->use_repository == 1 )
+ {
+ use Vhffs::Services::Repository;
+ $template->param( TEXT_REPOSITORY => gettext( "Download repository awaiting validation" ) );
+ my $repos = Vhffs::Services::Repository::getall( $vhffs , Vhffs::Constants::WAITING_FOR_VALIDATION );
+ $output = "";
+
+ if( defined @{$repos} )
+ {
+ foreach $temp ( @{$repos} )
+ {
+ my $subtemplate = new HTML::Template( filename => "$templatesdir/admin/misc/moderation_part.tmpl" );
+
+ if( $vhffs->get_config->use_notation == 1 )
+ {
+ $subtemplate->param( OWNER => $temp->get_user->get_username);
+ $subtemplate->param( NOTE => Vhffs::Note::get_note( $vhffs , $temp->get_user ) );
+ $subtemplate->param( OID_ASKER => $temp->get_user->get_oid);
+ }
+ else
+ {
+ $subtemplate->param( OWNER => $temp->get_user->get_username );
+ }
+
+ $subtemplate->param( NAME => $temp->get_name );
+ $subtemplate->param( GROUP => $temp->get_group->get_groupname );
+ $subtemplate->param( OID => $temp->get_oid );
+ $subtemplate->param( DESCRIPTION => $temp->get_description );
+ $subtemplate->param( ACCEPT => gettext("Accept") );
+ $subtemplate->param( REFUSE => gettext("Refuse") );
+ $output.= $subtemplate->output;
+ }
+
+ $template->param( MODERATION_REPOSITORY => $output );
+ }
+ else
+ {
+ $template->param( MODERATION_REPOSITORY => gettext("No repository to validate") );
+ }
+ }
+
}
Modified: trunk/vhffs-panel/templates/admin/main/main.tmpl
==============================================================================
--- trunk/vhffs-panel/templates/admin/main/main.tmpl (original)
+++ trunk/vhffs-panel/templates/admin/main/main.tmpl Sun Oct 29 17:44:31 2006
@@ -14,4 +14,5 @@
<tmpl_var name="ADMIN_MAIL">
<tmpl_var name="ADMIN_MAILLINGLIST">
<tmpl_var name="ADMIN_LARGEFILE">
+ <tmpl_var name="ADMIN_REPOSITORY">
</ul>
Modified: trunk/vhffs-panel/templates/admin/misc/moderation.tmpl
==============================================================================
--- trunk/vhffs-panel/templates/admin/misc/moderation.tmpl (original)
+++ trunk/vhffs-panel/templates/admin/misc/moderation.tmpl Sun Oct 29 17:44:31 2006
@@ -70,4 +70,11 @@
<TMPL_VAR NAME="MODERATION_LARGEFILE">
</table>
+ <h2>
+ <TMPL_VAR NAME="TEXT_REPOSITORY">
+ </h2>
+ <table>
+ <TMPL_VAR NAME="MODERATION_REPOSITORY">
+ </table>
+
Modified: trunk/vhffs-panel/templates/menu/group.tmpl
==============================================================================
--- trunk/vhffs-panel/templates/menu/group.tmpl (original)
+++ trunk/vhffs-panel/templates/menu/group.tmpl Sun Oct 29 17:44:31 2006
@@ -19,4 +19,5 @@
<tmpl_var name="MAIL_MENU">
<tmpl_var name="MAILINGLIST_MENU">
<tmpl_var name="LARGEFILE_MENU">
+ <tmpl_var name="REPOSITORY_MENU">
</ul>