[vhffs-dev] [svn] commit: r184 - in /trunk: ./ debian/ vhffs-api/debian/ vhffs-api/src/Vhffs/ vhffs-api/src/Vhffs/Services/ vhffs-listengine/src/ vhffs-panel/debian/

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


Author: soda
Date: Tue Apr 18 17:51:48 2006
New Revision: 184

Log:
- Remove debian/ directory from root
- Add some missing packages in debian/ for vhffs-api and vhffs-panel
- Improve Makefile
- Fix a bug in listengine (intl fix)
- Modify language selection for listengine (subscriber can now send lang french 
instead of lang fr_FR, more efficient)



Removed:
    trunk/debian/
    trunk/vhffs-api/src/Vhffs/Services.pm
    trunk/vhffs-api/src/Vhffs/Services/Listengine.pm
Modified:
    trunk/AUTHORS
    trunk/Makefile
    trunk/TODO
    trunk/vhffs-api/debian/control
    trunk/vhffs-api/src/Vhffs/Services/Mailing.pm
    trunk/vhffs-api/src/Vhffs/User.pm
    trunk/vhffs-listengine/src/listengine.pl
    trunk/vhffs-panel/debian/control

Modified: trunk/AUTHORS
==============================================================================
--- trunk/AUTHORS (original)
+++ trunk/AUTHORS Tue Apr 18 17:51:48 2006
@@ -1,7 +1,8 @@
-Official Developpers
- - Julien Delange <god at gunnm dot org>
- - Sylvain Rochet <gradator at gradator dot org>
+Developpers :
+ - Julien Delange <god at gunnm dot org> : API, Panel, Listengine, documentation, website, robots, tools, shells and backend
+ - Julien Danjou < jd at naquadah dot org> : Listengine improvements, english fixes
+ - Florent Bayle < florent at sarcelle dot net> : IRC bots
 
 Contributors :
- - Alexandre Cucumel <kiouk at ... dot ...>
- - Florent Bayle < florent at sarcelle dot net>
+ - Alexandre Cucumel <kiouk at ... dot ...> : Original CSS and templates
+ - Sylvain Rochet <gradator at gradator dot org> : Some Panel improvements

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Tue Apr 18 17:51:48 2006
@@ -10,13 +10,20 @@
 BOTSDIR=$(DESTDIR)/usr/lib/vhffs/bots/
 LEDIR=$(DESTDIR)/usr/lib/vhffs/listengine/
 TOOLSDIR=$(DESTDIR)/usr/bin/
+SHELLDIR=$(DESTDIR)/usr/bin/
 JABBERDIR=$(DESTDIR)/usr/share/vhffs/jabber/
 LEWEB=$(DESTDIR)/usr/share/vhffs/listengine/
 
-PERL_MODULES=HTML::Template Digest::MD5 CGI Locale::gettext Config::General DBI Email::Valid Crypt::PasswdMD5 GD::Text::Wrap GD MIME::Lite XML::RSS CGI::Session Encode utf8 LockFile::Simple
-DEBIAN_PACKAGES=libxml-rss-perl liblocale-gettext-perl libconfig-general-perl libhtml-template-perl libcrypt-passwdmd5-perl libgd-text-perl libmime-lite-perl libcgi-session-perl liblockfile-simple-perl libgd-perl
+PERL_MODULES=HTML::Template Digest::MD5 CGI Locale::gettext Config::General DBI Email::Valid Crypt::PasswdMD5 GD::Text::Wrap GD MIME::Lite XML::RSS CGI::Session Encode utf8 LockFile::Simple  Mail::Internet
+DEBIAN_PACKAGES=libxml-rss-perl liblocale-gettext-perl libconfig-general-perl libhtml-template-perl libcrypt-passwdmd5-perl libgd-text-perl libmime-lite-perl libcgi-session-perl liblockfile-simple-perl libgd-perl libclass-dbi-pg-perl libclass-dbi-perl libdbd-pg-perl
+
+all: help
+
+install: install-api install-panel install-listengine install-tools install-intl install-conf install-backend install-doc install-bots install-shell
 
 install-debian: debian-deps install
+
+check: test-deps
 
 help:
 	#Help for VHFFS makefile
@@ -46,9 +53,23 @@
         	}\
 		}\
 		print \"\n\n\n\n\n\n\t\tGood all perl-deps are installed\n\"; exit( 0 );" | perl
-	
-
-install: install-api install-panel install-listengine install-tools install-intl install-conf install-backend install-doc
+
+install-shell: build-shell add-shell
+
+build-shell:
+	install -d -m 755 $(SHELLDIR)
+	gcc -Wall -pedantic -o $(SHELLDIR)/tuxshell vhffs-shells/tuxshell.c
+
+add-shell:
+	install -d -m 755 $(DESTDIR)/etc
+	if [ -f $(DESTDIR)/etc/shells ]; then sed "s/\/bin\/tuxshell//" $(DESTDIR)/etc/shells > shells.tmp ; echo "/bin/tuxshell" >> shells.tmp ; cp -f shells.tmp $(DESTDIR)/etc/shells ; rm -f shells.tmp ; else echo "/bin/tuxshell" >> $(DESTDIR)/etc/shells ; fi 
+
+install-bots:
+	install -d -m 755 $(BOTSDIR)	
+	install -d -m 755 $(BOTSDIR)/misc/
+	install -m 755 vhffs-robots/src/*.pl $(BOTSDIR)/
+	install -m 644 vhffs-robots/misc/awstats.conf $(BOTSDIR)/misc/
+	install -m 644 vhffs-robots/misc/awstats.sample $(BOTSDIR)/misc/
 
 install-doc:
 	install -d -m 755 $(DOCDIR)	

Modified: trunk/TODO
==============================================================================
--- trunk/TODO (original)
+++ trunk/TODO Tue Apr 18 17:51:48 2006
@@ -1,4 +1,5 @@
 - improve listengine
 - improve archives format for listengine
 - improve panel, see ajax or css design
+- continue the document of the API
 

Modified: trunk/vhffs-api/debian/control
==============================================================================
--- trunk/vhffs-api/debian/control (original)
+++ trunk/vhffs-api/debian/control Tue Apr 18 17:51:48 2006
@@ -7,6 +7,6 @@
 
 Package: libvhffs-perl
 Architecture: any
-Depends: ${perl:Depends}, libcgi-session-perl, libconfig-general-perl, libhtml-template-perl, liblocale-gettext-perl, libmailtools-perl, liblockfile-simple-perl
+Depends: ${perl:Depends}, libcgi-session-perl, libconfig-general-perl, libhtml-template-perl, liblocale-gettext-perl, libmailtools-perl, liblockfile-simple-perl , libcrypt-passwdmd5-perl , liblockfile-simple-perl , libclass-dbi-perl , libdbd-pg-perl 
 Description: Perl VHFFS API 
  This package contains the Perl VHFFS API.

Modified: trunk/vhffs-api/src/Vhffs/Services/Mailing.pm
==============================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Mailing.pm (original)
+++ trunk/vhffs-api/src/Vhffs/Services/Mailing.pm Tue Apr 18 17:51:48 2006
@@ -411,6 +411,19 @@
     my $query,
     my $request;
 
+	if( $lang =~ /^fr$|^fr_FR$|^french$/ )
+	{
+		$lang = "fr_FR";
+	}
+	elsif( $lang =~ /^es$|^es_ES$|^spanish$/ )
+	{
+		$lang = "es_ES";
+	}
+	else
+	{
+		$lang = "en_US";
+	}
+
     $query = "SELECT * FROM vhffs_ml_lang WHERE member='".$sub."'";
     $request = $vhffs->{'db'}->{'DB_READ'}->prepare( $query );
     if ( $request->execute <= 0 )

Modified: trunk/vhffs-api/src/Vhffs/User.pm
==============================================================================
--- trunk/vhffs-api/src/Vhffs/User.pm (original)
+++ trunk/vhffs-api/src/Vhffs/User.pm Tue Apr 18 17:51:48 2006
@@ -193,9 +193,9 @@
     $self = shift;
     $group  = shift;
     
-    return -1 if ( ( ! $group ) || ( ! $group->{'gid'} ) ) ;
-
-    $request = $self->{'db'}->{'DB_WRITE'}->prepare("INSERT INTO vhffs_user_group VALUES( $self->{'uid'} , $group->{'gid'}  )");
+    return -1 if ( $group->fetch < 0 ) ;
+
+    $request = $self->{'db'}->{'DB_WRITE'}->prepare("INSERT INTO vhffs_user_group VALUES( $self->get_uid , $group->get_gid  )");
 
     $request->execute() or return -2;
 
@@ -824,3 +824,142 @@
 }
 
 1;
+
+__END__
+
+=head1 NAME
+
+Vhffs::User - Vhffs Interface to handle *NIX users
+
+=head1 SYNOPSIS
+
+	use Vhffs::Main;
+	$vhffs = init Vhffs::Main;
+	$user = new Vhffs::User( $vhffs , "myuser" , 401 );
+	if( $user->fetch > 0 )
+	{
+		print "User exists\n";
+	}
+	else
+	{
+		print "User does not exists\n";
+	}
+	...
+	if( $user->create > 0 )
+	{
+		print "User created";
+	}
+	else
+	{
+		print "User error\n";
+	}
+	...
+	print "Username: $user->get_username";
+	...
+	if( $user->commit > 0 )
+	{
+		print "Update user status : succesfull\n";
+	}
+
+=head1 METHODS
+
+For each method, returns 1 if success, 0 otherwise. If the method should returns a reference, returns undef if fails.
+
+new( Vhffs::Main , "username" , "uid" ) : instanciate a new user
+
+exists( ) : return 1 if the user exists, 0 otherwise
+
+fetch( ) : fetch informations for this user from the database. You have to call fetch before working on the user
+
+get_all_unix_users( ) - static method : returns a hashref with all unix users. Hashkey is the username
+
+get_all_users( ) - static method : returns a hashref with all users. Hashkey is the username
+
+add_group( Vhffs::Group ) : add a user in a group. Returns 1 if success, 0 otherwise
+
+create( ) : create the user. Returns 1 if success, 0 otherwise
+
+commit( ) : commit changes on the current instance on the database
+
+delete( ) : delete the user from the platform
+
+send_mail( $subject , $content ) : send a mail to the user. The subject of the mail is the first argument, the second if the content of the mail
+
+generate_password( ) : generate a new password for this user. Returns the password.
+
+get_username( )
+
+get_firstname( )
+
+get_lastname( )
+
+get_city( )
+
+get_country( )
+
+get_gpg( )
+
+get_zipcode( )
+
+get_home( )
+
+get_password( ) : returns the encrypted password
+
+get_uid( )
+
+get_gid( )
+
+get_mail( )
+
+get_group( )
+
+get_address( )
+
+get_shell( )
+
+set_username( $name )
+
+set_firstname( $firstname )
+
+set_lastname( $lastname )
+
+set_city( $city )
+
+set_country( $country )
+
+set_gpg( $gpg )
+
+set_zipcode( $zc )
+
+set_admin( 1 or 0 )
+
+set_mail( $mail )
+
+set_address( )
+
+set_shell( )
+
+is_admin( ) : returns 1 if the user is admin 0 otherwise
+
+is_moderator( ) : returns 1 if the user is moderator 0 otherwise
+
+get_name_by_uid( $uid ) : returns the name that correspond to the uid given in parameter. Return "nobody" if no user own this uid
+
+getall( Vhffs::Main , $state , $name )
+
+get_last_users( ) : returns an array with the last 10 users
+
+get_groups( ) : returns a arrayred with the groups of the user
+
+
+
+
+
+
+=head1 SEE ALSO
+
+Vhffs::Group , Vhffs::Main , Vhffs::Constants
+
+=head1 AUTHOR
+
+Julien Delange <julien at tuxfamily dot org>

Modified: trunk/vhffs-listengine/src/listengine.pl
==============================================================================
--- trunk/vhffs-listengine/src/listengine.pl (original)
+++ trunk/vhffs-listengine/src/listengine.pl Tue Apr 18 17:51:48 2006
@@ -589,6 +589,13 @@
 }
 
 
+
+#################
+# Treat a mail that seems ok
+#
+# This function treat request, sended to list-request@xxxxxxxxxx
+# It does not treat posts on list, sended to list@xxxxxxxxxx
+#################################
 sub treat_request
 {
     my $mail = shift;
@@ -604,38 +611,48 @@
     my $temp;
     my $members = $list->get_members;
 
+	$lang = Vhffs::Services::Mailing::get_lang_for_sub( $from );
+	#If the user specified a lang, we change it to get internationalized messages
+	if( defined $lang )
+	{
+		bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
+		textdomain("vhffs");
+	}
+
+
+
     if( $subject =~ /^help$/ )
     {
-	$email = Mail::Internet->new( [ <> ],
-				     Body => Vhffs::Listengine::Intl::generate_help
-				     );
-	$email->replace('From' ,  $LISTMASTER );
-	$email->replace('To' ,  $from );
-	$email->replace('Subject' , gettext("listengine help") );
+		$email = Mail::Internet->new( [ <> ],
+			     Body => Vhffs::Listengine::Intl::generate_help
+			     );
+		$email->replace('From' ,  $LISTMASTER );
+		$email->replace('To' ,  $from );
+		$email->replace('Subject' , gettext("listengine help") );
     	$email->replace('Date' , gmtime()." +00");
-	sendmail( $email , $from );
+		sendmail( $email , $from );
     }
     elsif( $subject =~ /^subscribe$/ )
     {
-	subscribe_to_list( $list , $from );
+		subscribe_to_list( $list , $from );
     }
     elsif( $subject =~ /^unsubscribe$/ )
     {
-	unsubscribe_to_list( $list , $from );
+		unsubscribe_to_list( $list , $from );
     }
     elsif( ( $lang ) = $subject =~ /^lang\s([a-zA-Z\_\-]+)$/ )
     {
-	#Try to change the language for this subscriber on whole listengine subsystem
-	if( Vhffs::Services::Mailing::set_lang_for_sub( $vhffs , $from , $lang ) < 0 )
-	{
-	    $email = Mail::Internet->new( [ <> ],
+		#Try to change the language for this subscriber on whole listengine subsystem
+		if( Vhffs::Services::Mailing::set_lang_for_sub( $vhffs , $from , $lang ) < 0 )
+		{
+		    $email = Mail::Internet->new( [ <> ],
 					 Body => Vhffs::Listengine::Intl::lang_change_error( $from , $lang )
 					 );
-	    $email->replace('From' ,  $LISTMASTER );
-	    $email->replace('To' ,  $from );
-	    $email->replace('Subject' , gettext("listengine help") );
-	    $email->replace('Date' , gmtime()." +00");
-	    sendmail( $email , $from );
+		    $email->replace('From' ,  $LISTMASTER );
+		    $email->replace('To' ,  $from );
+		    $email->replace('Subject' , gettext("listengine help") );
+		    $email->replace('Date' , gmtime()." +00");
+		    sendmail( $email , $from );
 	}
 	else
 	{
@@ -761,36 +778,38 @@
     }
     elsif( ( ( $action , $hash ) = $subject =~ /[.\s]*confirm\s([a-zA-Z0-9]+)\s(.+)$/i ) )
     {
-
-	if( $action =~ /^subscribe$/i )
-	{
-	    #Here, this is a confirmation a subscribing
-	    confirm_sub( $list , $from , $hash );
-	}
-	elsif( $action =~ /^unsubscribe$/i )
-	{
-	    #It's a confirmation to unsubscribe
-	    confirm_unsub( $list , $from , $hash );
-	}
+		if( $action =~ /^subscribe$/i )
+		{
+		    #Here, this is a confirmation a subscribing
+		    confirm_sub( $list , $from , $hash );
+		}
+		elsif( $action =~ /^unsubscribe$/i )
+		{
+		    #It's a confirmation to unsubscribe
+		    confirm_unsub( $list , $from , $hash );
+		}
        
     }
     else
     {
-	$mail = Mail::Internet->new( [ <> ],
-				     Body => Vhffs::Listengine::Intl::unknown_command( $list )
-				     );
-	$mail->replace('From' ,  $LISTMASTER );
-	$mail->replace('To' ,  $from );
-	$mail->replace('Subject' , gettext("listengine: unknown command") );
-    	$mail->replace('Date' , gmtime()." +00");
-	sendmail( $mail , $from );
-    }
-
-}
-
-
-
+		$mail = Mail::Internet->new( [ <> ],
+			     Body => Vhffs::Listengine::Intl::unknown_command( $list )
+			     );
+		$mail->replace('From' ,  $LISTMASTER );
+		$mail->replace('To' ,  $from );
+		$mail->replace('Subject' , gettext("listengine: unknown command") );
+  	  	$mail->replace('Date' , gmtime()." +00");
+		sendmail( $mail , $from );
+    }
+
+}
+
+
+####################################
 # Fetch the mail from standard input
+#
+# In fact, exim and others mail-server software give the mail
+# through a pipe. So, the mail can be read by the standard input
 ###############
 sub fetch_mail_from_stdin
 {    
@@ -853,8 +872,13 @@
 }
 
 
-#Get language parameter for subscriber
+
+
+#######################################
+#Get language parameter for poster
+#
 #Internationalisation inside :-)
+######################
 sub get_lang
 {
     my $mail = shift;
@@ -864,12 +888,17 @@
     if( defined $lang )
     {	
 	#Change current locale to user preferences if defined
-	setlocale(LC_ALL, $lang  );
-	bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
-	textdomain("vhffs");
-    }
-}
-
+		bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
+		textdomain("vhffs");
+		setlocale(LC_ALL, $lang  );
+    }
+}
+
+
+#####################################
+# Verify if the mail is conform
+#
+##############################
 sub verify_mail_with_list
 {
         my $list = shift;

Modified: trunk/vhffs-panel/debian/control
==============================================================================
--- trunk/vhffs-panel/debian/control (original)
+++ trunk/vhffs-panel/debian/control Tue Apr 18 17:51:48 2006
@@ -7,6 +7,6 @@
 
 Package: vhffs-panel
 Architecture: any
-Depends: ${perl:Depends}, libxml-rss-perl, liblocale-gettext-perl, libhtml-template-perl, libcrypt-passwdmd5-perl, libcgi-session-perl, libgd-gd2-perl, libcgi-perl
+Depends: ${perl:Depends}, libxml-rss-perl, liblocale-gettext-perl, libhtml-template-perl, libcgi-session-perl, libgd-gd2-perl, libcgi-perl , libgd-text-perl
 Description: VHFFS panel
  This package contains the VHFFS web panel.




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