[vhffs-dev] [1989] removed Vhffs::Group::get_name_by_gid(), Vhffs::Group:: get_owner_username(), Vhffs::Group::set_owner_username()

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


Revision: 1989
Author:   gradator
Date:     2012-02-02 21:48:38 +0100 (Thu, 02 Feb 2012)
Log Message:
-----------
removed Vhffs::Group::get_name_by_gid(), Vhffs::Group::get_owner_username(), Vhffs::Group::set_owner_username()

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Functions.pm
    trunk/vhffs-api/src/Vhffs/Group.pm
    trunk/vhffs-irc/modobot.pl
    trunk/vhffs-panel/templates/group/prefs.tt
    trunk/vhffs-robots/src/listengine_publicarchives.pl

Modified: trunk/vhffs-api/src/Vhffs/Functions.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Functions.pm	2012-02-01 23:55:54 UTC (rev 1988)
+++ trunk/vhffs-api/src/Vhffs/Functions.pm	2012-02-02 20:48:38 UTC (rev 1989)
@@ -50,7 +50,6 @@
 use Locale::gettext;
 use Vhffs::Constants;
 
-my $password;
 srand(time ^ $$);
 
 # Return 1 if string is either 'yes', 'on', '1', 'y', else return 0

Modified: trunk/vhffs-api/src/Vhffs/Group.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Group.pm	2012-02-01 23:55:54 UTC (rev 1988)
+++ trunk/vhffs-api/src/Vhffs/Group.pm	2012-02-02 20:48:38 UTC (rev 1989)
@@ -340,65 +340,6 @@
     	return $self->{'main'}->get_config->get_datadir.'/groups/'.substr($self->get_groupname, 0, 1).'/'.substr($self->get_groupname, 1, 1).'/'.$self->get_groupname;
 }
 
-sub get_name_by_gid
-{
-	my $main = shift;
-	my $gid = shift;
-	my $request = $main->{'db'}->prepare('SELECT groupname FROM vhffs_groups where gid= ?') or return -2;
-	my $rows = $request->execute($gid);
-
-	if( $rows == 0 )
-	{
-		return( "nobody" );
-	}
-	else
-	{
-		my ( $result ) = $request->fetchrow();
-		return( $result );
-	}
-
-}
-
-
-sub get_owner_username
-{
-	my $self = shift;
-	my $request = $self->{'db'}->prepare('SELECT username FROM vhffs_users where uid=?') or return -2;
-	my $rows = $request->execute($self->{'owner_uid'});
-
-	if( $rows == 0 )
-	{
-		return( "nobody" );
-	}
-	else
-	{
-		my ($result) = $request->fetchrow();
-		return( $result );
-	}
-	
-}
-
-
-
-
-sub set_owner_username
-{
-	my( $self , $username ) = @_;
-
-	my $request = $self->{'db'}->prepare('SELECT uid FROM vhffs_users where username=?') or return -2;
-	my $rows = $request->execute( $username );
-
-	if( $rows == 0 )
-	{
-		return -1;
-	}
-	else
-	{
-		my $result = $request->fetchrow_hashref();
-		$self->{'owner_uid'} = $result->{'uid'};
-	}
-}
-
 sub get_users
 {
 	use Vhffs::User;

Modified: trunk/vhffs-irc/modobot.pl
===================================================================
--- trunk/vhffs-irc/modobot.pl	2012-02-01 23:55:54 UTC (rev 1988)
+++ trunk/vhffs-irc/modobot.pl	2012-02-02 20:48:38 UTC (rev 1989)
@@ -334,17 +334,14 @@
 
 sub find_group_from_web
 {
-    my $name = shift;
-    my $web;
-    if (! defined ($web = Vhffs::Services::Web::get_by_servername( $vhffs , $name)))
-   {
-       irc_msg ("$name : No such website");
-   }
-   else
-   {
-       irc_msg ("$name => group  ".Vhffs::Group::get_name_by_gid($vhffs,$web->get_owner_gid));
-   }
-
+	my $name = shift;
+	my $web = Vhffs::Services::Web::get_by_servername( $vhffs, $name );
+	unless( defined $web) {
+		irc_msg( $name.' : No such website' );
+	}
+	else {
+		irc_msg( $name.' => group  '.$web->get_group->get_groupname );
+	}
 }
 
 sub owner_info
@@ -368,22 +365,19 @@
     }
 }
 
-sub fetch_usergroup
-{
+sub fetch_usergroup {
 	my $groupname = shift;
 	my $group = Vhffs::Group::get_by_groupname( $vhffs , $groupname );
-	unless( defined $group )
-	{
+	unless( defined $group ) {
 		irc_msg ($groupname.' : No such group');
 		return;
 	}
 
 	my $users = Vhffs::Group::get_users( $group );
+	my $owner = $group->get_user->get_uid;
 	my $list = '';
-
-	foreach ( @{$users} )
-	{
-		$list .= '@' if( $_->get_username eq $group->get_owner_username );
+	foreach ( @{$users} ) {
+		$list .= '@' if $_->get_uid == $owner;
 		$list .= $_->get_username.' ';
 	}
 

Modified: trunk/vhffs-panel/templates/group/prefs.tt
===================================================================
--- trunk/vhffs-panel/templates/group/prefs.tt	2012-02-01 23:55:54 UTC (rev 1988)
+++ trunk/vhffs-panel/templates/group/prefs.tt	2012-02-02 20:48:38 UTC (rev 1989)
@@ -5,7 +5,7 @@
 <form class="table-like" method="post" action="#" accept-charset="utf-8">
     <p>
         <label>[% 'Project owner:' | i18n | html %]</label>
-        [% group.get_owner_username() | html %]
+        [% group.get_user.get_username() | html %]
     </p>
     <p><label for="realname" class="realname">[% 'Project full name:' | i18n | html %]</label><input type="text" size="30" maxlength="100" value="[% group.get_realname | html %]" name="realname" id="realname"/></p>
     <p><label for="description" class="description">[% 'Project description:' | i18n | html %]</label>

Modified: trunk/vhffs-robots/src/listengine_publicarchives.pl
===================================================================
--- trunk/vhffs-robots/src/listengine_publicarchives.pl	2012-02-01 23:55:54 UTC (rev 1988)
+++ trunk/vhffs-robots/src/listengine_publicarchives.pl	2012-02-02 20:48:38 UTC (rev 1989)
@@ -49,8 +49,6 @@
 my $lists = Vhffs::Services::MailingList::getall( $vhffs , Vhffs::Constants::ACTIVATED , undef );
 foreach my $list ( @{$lists} )
 {
-#		print $list->get_domain." ".$list->get_localpart." ".Vhffs::Group::get_name_by_gid( $vhffs , $list->get_owner_gid )." ".$list->get_oid." ".Vhffs::Functions::status_string_from_status_id( $list->get_status )."\n";
-
 	next if ( !defined $list->get_domain  ||  !defined $list->get_localpart  ||  $list->get_domain eq ""  ||  $list->get_localpart eq "" );
 
 	# delete previous public archives (if available) if there is no public archives for this list


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