[vhffs-dev] [svn] commit: r114 - in /trunk: vhffs-api/src/Vhffs/ vhffs-api/src/Vhffs/Services/ vhffs-panel/public/ vhffs-panel/templates/public/ vhffs-panel/templates/public/misc/ vhffs-robots/src/ vhffs-robots/src/old/

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Author: soda
Date: Thu Dec 15 21:10:18 2005
New Revision: 114

Log:
improve intl for public area
fix cvs bot bug
merge cvsanonymous bot and cvs_fixperm


Added:
    trunk/vhffs-robots/src/old/cvsanonymous.pl
      - copied unchanged from r113, trunk/vhffs-robots/src/cvsanonymous.pl
Removed:
    trunk/vhffs-robots/src/cvsanonymous.pl
Modified:
    trunk/vhffs-api/src/Vhffs/Robots.pm
    trunk/vhffs-api/src/Vhffs/Services/Cvs.pm
    trunk/vhffs-panel/public/allgroups.pl
    trunk/vhffs-panel/public/allwebsites.pl
    trunk/vhffs-panel/public/group.pl
    trunk/vhffs-panel/public/index.pl
    trunk/vhffs-panel/public/lastgroups.pl
    trunk/vhffs-panel/public/lastusers.pl
    trunk/vhffs-panel/public/user.pl
    trunk/vhffs-panel/templates/public/allwebsites.tmpl
    trunk/vhffs-panel/templates/public/misc/web-part.tmpl
    trunk/vhffs-robots/src/create_cvs.pl
    trunk/vhffs-robots/src/cvs_fixperms.pl
    trunk/vhffs-robots/src/delete_svn.pl
    trunk/vhffs-robots/src/svn_public.pl

Modified: trunk/vhffs-api/src/Vhffs/Robots.pm
==============================================================================
--- trunk/vhffs-api/src/Vhffs/Robots.pm (original)
+++ trunk/vhffs-api/src/Vhffs/Robots.pm Thu Dec 15 21:10:18 2005
@@ -12,20 +12,21 @@
 
 sub lock
 {
-	LockFile::Simple::lock( "/tmp/vhffslock" ) or exit( 1 );
+	LockFile::Simple::lock( ::LOCKFILE ) or exit( 1 );
 	return 0;
 }
 
 sub unlock
 {
-	LockFile::Simple::unlock( "/tmp/vhffslock" );
+	LockFile::Simple::unlock( ::LOCKFILE );
 	return 0;
 }
 
 sub vhffs_log
 {
 	my $sent = shift;
-	open( FILE , ">>/var/log/vhffslog" ) or return -1;
+	my $file = ::LOGFILE;
+	open( FILE , ">>$file" ) or return -1;
 	
 	print FILE $sent."\n";
 	close FILE ;

Modified: trunk/vhffs-api/src/Vhffs/Services/Cvs.pm
==============================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Cvs.pm (original)
+++ trunk/vhffs-api/src/Vhffs/Services/Cvs.pm Thu Dec 15 21:10:18 2005
@@ -58,6 +58,7 @@
     $request->execute or return -1;
 
 	return -1 if( $self->SUPER::delete < 0 );
+	return 1;
 }
 
 sub create

Modified: trunk/vhffs-panel/public/allgroups.pl
==============================================================================
--- trunk/vhffs-panel/public/allgroups.pl (original)
+++ trunk/vhffs-panel/public/allgroups.pl Thu Dec 15 21:10:18 2005
@@ -12,10 +12,11 @@
 use Vhffs::Panel::Main;
 use Vhffs::Constants;
 use CGI;
+my $vhffs = init Vhffs::Main;
+my $cookie = Vhffs::Panel::Main::cook_lang( $vhffs );
 
 my $cgi = new CGI;
 
-my $vhffs = init Vhffs::Main;
 my $template;
 my $templatedir = $vhffs->get_config->get_templatedir;
 my $group;
@@ -30,9 +31,6 @@
 
 $maintemplate->param( THEME => Vhffs::Panel::Main::get_theme_name( $cgi->cookie("theme") ) );
 $maintemplate->param( TEXT_TITLE => sprintf( gettext("All groups on %s") , $hostname ) );
-setlocale(LC_ALL, CGI->cookie("language") );
-bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-textdomain("vhffs");
 
 
 foreach $group (@{$groups})

Modified: trunk/vhffs-panel/public/allwebsites.pl
==============================================================================
--- trunk/vhffs-panel/public/allwebsites.pl (original)
+++ trunk/vhffs-panel/public/allwebsites.pl Thu Dec 15 21:10:18 2005
@@ -16,6 +16,7 @@
 use Vhffs::Services::Httpd;
 
 my $vhffs = init Vhffs::Main;
+my $cookie = Vhffs::Panel::Main::cook_lang( $vhffs );
 my $template;
 my $templatedir = $vhffs->get_config->get_templatedir;
 my $webs = Vhffs::Services::Httpd::getall( $vhffs  , Vhffs::Constants::ACTIVATED);
@@ -27,10 +28,6 @@
 
 $maintemplate = new HTML::Template( filename => $templatedir."/public/allwebsites.tmpl" );
 
-
-setlocale(LC_ALL, CGI->cookie("language") );
-bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-textdomain("vhffs");
 
 $maintemplate->param( THEME => Vhffs::Panel::Main::get_theme_name( $cgi->cookie("theme") ) );
 $maintemplate->param( TEXT_TITLE => sprintf( gettext("All websites on %s") , $hostname ) );

Modified: trunk/vhffs-panel/public/group.pl
==============================================================================
--- trunk/vhffs-panel/public/group.pl (original)
+++ trunk/vhffs-panel/public/group.pl Thu Dec 15 21:10:18 2005
@@ -17,6 +17,7 @@
 use Vhffs::Functions;
 
 my $vhffs = init Vhffs::Main;
+my $cookie = Vhffs::Panel::Main::cook_lang( $vhffs );
 my $template;
 my $templatedir = $vhffs->get_config->get_templatedir;
 my $cgi = new CGI;
@@ -25,10 +26,6 @@
 my $name = $cgi->param("name");
 $name = Vhffs::Functions::check_arg( $name );
 
-
-setlocale(LC_ALL, CGI->cookie("language") );
-bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-textdomain("vhffs");
 
 my $group;
 my $message;

Modified: trunk/vhffs-panel/public/index.pl
==============================================================================
--- trunk/vhffs-panel/public/index.pl (original)
+++ trunk/vhffs-panel/public/index.pl Thu Dec 15 21:10:18 2005
@@ -21,10 +21,7 @@
 
 $hostname = $vhffs->get_config->get_host_name;
 $hostname = "VHFFS" if( ! defined $hostname );
-
-setlocale(LC_ALL, CGI->cookie("language") );
-bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-textdomain("vhffs");
+my $cookie = Vhffs::Panel::Main::cook_lang( $vhffs );
 
 
 $template = new HTML::Template( filename => $templatedir."/public/index.tmpl" );

Modified: trunk/vhffs-panel/public/lastgroups.pl
==============================================================================
--- trunk/vhffs-panel/public/lastgroups.pl (original)
+++ trunk/vhffs-panel/public/lastgroups.pl Thu Dec 15 21:10:18 2005
@@ -12,9 +12,10 @@
 use Vhffs::Panel::Main;
 use CGI;
 
-my $cgi = new CGI;
 
 my $vhffs = init Vhffs::Main;
+my $cookie = Vhffs::Panel::Main::cook_lang( $vhffs );
+my $cgi = new CGI;
 my $template;
 my $templatedir = $vhffs->get_config->get_templatedir;
 my $group;
@@ -29,9 +30,6 @@
 
 $maintemplate->param( THEME => Vhffs::Panel::Main::get_theme_name( $cgi->cookie("theme") ) );
 $maintemplate->param( TEXT_TITLE => sprintf( gettext("Last groups on %s") , $hostname ) );
-setlocale(LC_ALL, CGI->cookie("language") );
-bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-textdomain("vhffs");
 
 
 foreach $group (@{$groups})

Modified: trunk/vhffs-panel/public/lastusers.pl
==============================================================================
--- trunk/vhffs-panel/public/lastusers.pl (original)
+++ trunk/vhffs-panel/public/lastusers.pl Thu Dec 15 21:10:18 2005
@@ -14,6 +14,7 @@
 use Vhffs::Constants;
 use Vhffs::Panel::Main;
 my $vhffs = init Vhffs::Main;
+my $cookie = Vhffs::Panel::Main::cook_lang( $vhffs );
 my $template;
 my $templatedir = $vhffs->get_config->get_templatedir;
 my $users = Vhffs::User::get_last_users( $vhffs );
@@ -29,10 +30,6 @@
 
 $maintemplate = new HTML::Template( filename => $templatedir."/public/lastusers.tmpl" );
 
-
-setlocale(LC_ALL, CGI->cookie("language") );
-bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-textdomain("vhffs");
 
 $maintemplate->param( THEME => Vhffs::Panel::Main::get_theme_name( $cgi->cookie("theme") ) );
 $maintemplate->param( TEXT_TITLE => sprintf( gettext("Last users on %s") , $hostname ) );

Modified: trunk/vhffs-panel/public/user.pl
==============================================================================
--- trunk/vhffs-panel/public/user.pl (original)
+++ trunk/vhffs-panel/public/user.pl Thu Dec 15 21:10:18 2005
@@ -17,6 +17,7 @@
 use Vhffs::Functions;
 
 my $vhffs = init Vhffs::Main;
+my $cookie = Vhffs::Panel::Main::cook_lang( $vhffs );
 my $template;
 my $templatedir = $vhffs->get_config->get_templatedir;
 my $cgi = new CGI;

Modified: trunk/vhffs-panel/templates/public/allwebsites.tmpl
==============================================================================
--- trunk/vhffs-panel/templates/public/allwebsites.tmpl (original)
+++ trunk/vhffs-panel/templates/public/allwebsites.tmpl Thu Dec 15 21:10:18 2005
@@ -12,8 +12,8 @@
 	<body>
 
 <h1><tmpl_var name="TEXT_TITLE"></h1>
-<p>
+<ul>
 <tmpl_var name="VALUES">
-</p>
+</ul>
 </body>
-</html>
+</html>

Modified: trunk/vhffs-panel/templates/public/misc/web-part.tmpl
==============================================================================
--- trunk/vhffs-panel/templates/public/misc/web-part.tmpl (original)
+++ trunk/vhffs-panel/templates/public/misc/web-part.tmpl Thu Dec 15 21:10:18 2005
@@ -1,2 +1,3 @@
-
+<li>
 <a href="http://<tmpl_var name="SERVERNAME">"><tmpl_var name="SERVERNAME"></a> - <tmpl_var name="TEXT_GROUPNAME"> <a href="group.pl?name=<tmpl_var name="GROUPNAME">"><tmpl_var name="GROUPNAME"></a> - <tmpl_var name="DESCRIPTION"><br/>
+</li>

Modified: trunk/vhffs-robots/src/create_cvs.pl
==============================================================================
--- trunk/vhffs-robots/src/create_cvs.pl (original)
+++ trunk/vhffs-robots/src/create_cvs.pl Thu Dec 15 21:10:18 2005
@@ -14,7 +14,7 @@
 
 foreach $c ( @{$cvs} )
 {
-		if( Vhffs::Robots::Cvs::create_cvs( $cvs ) > 0 )
+		if( Vhffs::Robots::Cvs::create_cvs( $c ) > 0 )
 		{
 			Vhffs::Robots::vhffs_log( sprintf( "CVS %s is created" , $c->get_cvsroot ) );
 		}

Modified: trunk/vhffs-robots/src/cvs_fixperms.pl
==============================================================================
--- trunk/vhffs-robots/src/cvs_fixperms.pl (original)
+++ trunk/vhffs-robots/src/cvs_fixperms.pl Thu Dec 15 21:10:18 2005
@@ -66,7 +66,7 @@
 			close( FILE );
 
 			open( FILE , ">$passwd_file" ) or die( "cannot open $passwd_file" );
-			print FILE "anonymous::".$username;
+			print FILE "anonymous::".$user->get_username;
 			close( FILE );
 			chown $cvs->get_owneruid , $cvs->get_ownergid , $passwd_file;
 			chown $cvs->get_owneruid , $cvs->get_ownergid , $readers_file;

Modified: trunk/vhffs-robots/src/delete_svn.pl
==============================================================================
--- trunk/vhffs-robots/src/delete_svn.pl (original)
+++ trunk/vhffs-robots/src/delete_svn.pl Thu Dec 15 21:10:18 2005
@@ -17,12 +17,13 @@
 	{
 		if( Vhffs::Robots::Svn::delete_repo( $vhffs , $svn ) < 0 )
 		{
-			Vhffs::Robots::vhffs_log( sprintf( "Delete files from SVN repository %s" , $svn->get_reponame ));
+			Vhffs::Robots::vhffs_log( sprintf( "Cannot delete files from SVN repository %s" , $svn->get_reponame ));
 		}
 		else
 		{
-			Vhffs::Robots::vhffs_log( sprintf( "Cannot delete files from SVN repository %s" , $svn->get_reponame ));
+			Vhffs::Robots::vhffs_log( sprintf( "Delete files from SVN repository %s" , $svn->get_reponame ));
 		}
+
 		if( $svn->delete < 0 )
 		{
 			Vhffs::Robots::vhffs_log( sprintf( "Cannot delete SVN repository object %s" , $svn->get_reponame ));

Modified: trunk/vhffs-robots/src/svn_public.pl
==============================================================================
--- trunk/vhffs-robots/src/svn_public.pl (original)
+++ trunk/vhffs-robots/src/svn_public.pl Thu Dec 15 21:10:18 2005
@@ -15,12 +15,24 @@
 {
 	if( $svn->fetch >= 0)
 	{
+		$user = $svn->get_user;
+		$group = $svn->get_group;
+		#First, update uid and gid informations on files
+		if( ( $user->fetch > 0 ) && ( $group->fetch > 0 ) )
+		{
+			Vhffs::Robots::vhffs_log( sprintf( "SVN change owner/group to %s/%s for repository %s" , $user->get_username , $group->get_groupname , $svn->get_dir ) );
+			Vhffs::Functions::change_owner_recur( $svn->get_dir , $user->get_uid , $group->get_gid );
+		}
+
+
 		if( $svn->is_public == 1 )
 		{
+			Vhffs::Robots::vhffs_log( sprintf( "SVN change status %s is now public" , $svn->get_dir ) );
 			Vhffs::Functions::chmod_recur( $svn->get_dir , 0664 , 02775 );
 		}
 		else
 		{
+			Vhffs::Robots::vhffs_log( sprintf( "SVN change status %s is now private" , $svn->get_dir ) );
 			Vhffs::Functions::chmod_recur( $svn->get_dir , 0660 , 02770 );
 		}
 




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/