[vhffs-dev] [388] add user lang in modobot.pl and copy Vhffs::Panel::user-> get_lang into Vhffs::User->get_lang |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
- To: vhffs-dev@xxxxxxxxx
- Subject: [vhffs-dev] [388] add user lang in modobot.pl and copy Vhffs::Panel::user-> get_lang into Vhffs::User->get_lang
- From: subversion@xxxxxxxxx
- Date: Sun, 07 Jan 2007 00:10:41 +0100
Revision: 388
Author: misric
Date: 2007-01-06 23:10:40 +0000 (Sat, 06 Jan 2007)
Log Message:
-----------
add user lang in modobot.pl and copy Vhffs::Panel::user->get_lang into Vhffs::User->get_lang
Modified Paths:
--------------
branches/vhffs_4.1/vhffs-api/src/Vhffs/User.pm
branches/vhffs_4.1/vhffs-irc/modobot.pl
trunk/vhffs-api/src/Vhffs/User.pm
trunk/vhffs-irc/modobot.pl
Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/User.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/User.pm 2006-12-30 19:25:35 UTC (rev 387)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/User.pm 2007-01-06 23:10:40 UTC (rev 388)
@@ -676,7 +676,24 @@
}
}
+sub get_lang
+{
+ my $self = shift;
+ my $query = "SELECT language FROM vhffs_panel_user_prefs WHERE uid='".$self->get_uid."'";
+ my $request = $self->{'db'}->{'DB_READ'}->prepare( $query );
+ my $rows = $request->execute;
+
+ if( $rows == 0 )
+ {
+ return Vhffs::Constants::DEFAULT_LANG;
+ }
+ else
+ {
+ my $value = $request->fetchrow_arrayref;
+ return $value->[0];
+ }
+}
sub get_mail
@@ -1055,6 +1072,8 @@
get_gid( )
+get_lang( )
+
get_mail( )
get_group( )
Modified: branches/vhffs_4.1/vhffs-irc/modobot.pl
===================================================================
--- branches/vhffs_4.1/vhffs-irc/modobot.pl 2006-12-30 19:25:35 UTC (rev 387)
+++ branches/vhffs_4.1/vhffs-irc/modobot.pl 2007-01-06 23:10:40 UTC (rev 388)
@@ -87,7 +87,7 @@
map { last GR if (($_->get_oid eq $temp->get_oid) && ($_->get_groupname eq $temp->get_groupname)); } @oldgroup;
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("Groupe : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_groupname . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("Groupe : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_groupname . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
@@ -115,7 +115,7 @@
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("Web : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_group->get_groupname . " " . $temp->get_servername . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("Web : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_group->get_groupname . " " . $temp->get_servername . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
@@ -143,7 +143,7 @@
map { last DN if (($_->get_oid eq $temp->get_oid) && ($_->get_domain eq $temp->get_domain)); } @olddns;
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("DNS : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_group->get_groupname . " " . $temp->get_domain . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("DNS : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_group->get_groupname . " " . $temp->get_domain . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
@@ -172,7 +172,7 @@
map { last CV if (($_->get_oid eq $temp->get_oid) && ($_->get_cvsroot eq $temp->get_cvsroot)); } @oldcvs;
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("CVS : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_group->get_groupname . " " . $temp->get_cvsroot . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("CVS : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_group->get_groupname . " " . $temp->get_cvsroot . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
@@ -228,7 +228,7 @@
map { last SV if (($_->get_oid eq $temp->get_oid) && ($_->get_reponame eq $temp->get_reponame)); } @oldsvn;
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("SVN : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_group->get_groupname . " " . $temp->get_reponame . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("SVN : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_group->get_groupname . " " . $temp->get_reponame . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
@@ -256,7 +256,7 @@
map { last MA if (($_->get_oid eq $temp->get_oid) && ($_->get_domain eq $temp->get_domain)); } @oldmail;
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("Mail : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_group->get_groupname . " " . $temp->get_domain . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("Mail : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_group->get_groupname . " " . $temp->get_domain . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
@@ -284,7 +284,7 @@
map { last MY if (($_->get_oid eq $temp->get_oid) && ($_->get_dbname eq $temp->get_dbname)); } @oldmysql;
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("MySql : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_group->get_groupname . " " . $temp->get_dbname . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("MySql : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_group->get_groupname . " " . $temp->get_dbname . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
@@ -312,7 +312,7 @@
map { last PO if (($_->get_oid eq $temp->get_oid) && ($_->get_dbname eq $temp->get_dbname)); } @oldpostgres;
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("Postgres : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_group->get_groupname . " " . $temp->get_dbname . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("Postgres : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_group->get_groupname . " " . $temp->get_dbname . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
@@ -340,7 +340,7 @@
map { last RP if (($_->get_oid eq $temp->get_oid) && ($_->get_name eq $temp->get_name)); } @oldrepository;
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("REPOSITORY : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_group->get_groupname . " " . $temp->get_name . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("REPOSITORY : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_group->get_groupname . " " . $temp->get_name . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
Modified: trunk/vhffs-api/src/Vhffs/User.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/User.pm 2006-12-30 19:25:35 UTC (rev 387)
+++ trunk/vhffs-api/src/Vhffs/User.pm 2007-01-06 23:10:40 UTC (rev 388)
@@ -595,9 +595,27 @@
}
}
+sub get_lang
+{
+ my $self = shift;
+ my $query = "SELECT language FROM vhffs_panel_user_prefs WHERE uid='".$self->get_uid."'";
+ my $request = $self->{'db'}->{'DB_READ'}->prepare( $query );
+ my $rows = $request->execute;
+
+ if( $rows == 0 )
+ {
+ return Vhffs::Constants::DEFAULT_LANG;
+ }
+ else
+ {
+ my $value = $request->fetchrow_arrayref;
+ return $value->[0];
+ }
+}
+
sub get_mail
{
my $self = shift;
@@ -946,6 +964,8 @@
get_gid( )
+get_lang( )
+
get_mail( )
get_group( )
Modified: trunk/vhffs-irc/modobot.pl
===================================================================
--- trunk/vhffs-irc/modobot.pl 2006-12-30 19:25:35 UTC (rev 387)
+++ trunk/vhffs-irc/modobot.pl 2007-01-06 23:10:40 UTC (rev 388)
@@ -87,7 +87,7 @@
map { last GR if (($_->get_oid eq $temp->get_oid) && ($_->get_groupname eq $temp->get_groupname)); } @oldgroup;
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("Groupe : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_groupname . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("Groupe : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_groupname . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
@@ -115,7 +115,7 @@
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("Web : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_group->get_groupname . " " . $temp->get_servername . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("Web : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_group->get_groupname . " " . $temp->get_servername . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
@@ -143,7 +143,7 @@
map { last DN if (($_->get_oid eq $temp->get_oid) && ($_->get_domain eq $temp->get_domain)); } @olddns;
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("DNS : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_group->get_groupname . " " . $temp->get_domain . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("DNS : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_group->get_groupname . " " . $temp->get_domain . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
@@ -172,7 +172,7 @@
map { last CV if (($_->get_oid eq $temp->get_oid) && ($_->get_cvsroot eq $temp->get_cvsroot)); } @oldcvs;
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("CVS : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_group->get_groupname . " " . $temp->get_cvsroot . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("CVS : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_group->get_groupname . " " . $temp->get_cvsroot . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
@@ -200,7 +200,7 @@
map { last ML if (($_->get_oid eq $temp->get_oid) && ($_->get_localpart eq $temp->get_localpart)); } @oldmailing;
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("Mailing list : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_group->get_groupname . " " . $temp->get_localpart . "@" . $temp->get_domain . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("Mailing list : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_group->get_groupname . " " . $temp->get_localpart . "@" . $temp->get_domain . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
@@ -228,7 +228,7 @@
map { last SV if (($_->get_oid eq $temp->get_oid) && ($_->get_reponame eq $temp->get_reponame)); } @oldsvn;
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("SVN : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_group->get_groupname . " " . $temp->get_reponame . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("SVN : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_group->get_groupname . " " . $temp->get_reponame . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
@@ -256,7 +256,7 @@
map { last MA if (($_->get_oid eq $temp->get_oid) && ($_->get_domain eq $temp->get_domain)); } @oldmail;
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("Mail : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_group->get_groupname . " " . $temp->get_domain . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("Mail : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_group->get_groupname . " " . $temp->get_domain . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
@@ -284,7 +284,7 @@
map { last MY if (($_->get_oid eq $temp->get_oid) && ($_->get_dbname eq $temp->get_dbname)); } @oldmysql;
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("MySql : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_group->get_groupname . " " . $temp->get_dbname . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("MySql : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_group->get_groupname . " " . $temp->get_dbname . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
@@ -312,7 +312,7 @@
map { last PO if (($_->get_oid eq $temp->get_oid) && ($_->get_dbname eq $temp->get_dbname)); } @oldpostgres;
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("Postgres : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_group->get_groupname . " " . $temp->get_dbname . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("Postgres : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_group->get_groupname . " " . $temp->get_dbname . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{
@@ -340,7 +340,7 @@
map { last RP if (($_->get_oid eq $temp->get_oid) && ($_->get_name eq $temp->get_name)); } @oldrepository;
if( $vhffs->get_config->use_notation == 1 )
{
- irc_msg ("REPOSITORY : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") " . $temp->get_group->get_groupname . " " . $temp->get_name . " " . Vhffs::Functions::stripslashes($temp->get_description));
+ irc_msg ("REPOSITORY : " . $temp->get_oid . " " . $temp->get_user->get_username . "(" . Vhffs::Note::get_note( $vhffs , $temp->get_user ) . ") [".$temp->get_user->get_lang."] " . $temp->get_group->get_groupname . " " . $temp->get_name . " " . Vhffs::Functions::stripslashes($temp->get_description));
}
else
{