[vhffs-dev] [721] Removed a lot of useless functions. |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 721
Author: beuss
Date: 2007-07-12 15:28:05 +0000 (Thu, 12 Jul 2007)
Log Message:
-----------
Removed a lot of useless functions.
Removed references to old owner_uid/gid from Panel.
Modified Paths:
--------------
trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm
trunk/vhffs-api/src/Vhffs/Panel/DNS.pm
trunk/vhffs-api/src/Vhffs/Panel/Group.pm
trunk/vhffs-api/src/Vhffs/Panel/Mail.pm
trunk/vhffs-api/src/Vhffs/Panel/Mailinglist.pm
trunk/vhffs-api/src/Vhffs/Panel/Mysql.pm
trunk/vhffs-api/src/Vhffs/Panel/Pgsql.pm
trunk/vhffs-api/src/Vhffs/Panel/Repository.pm
trunk/vhffs-api/src/Vhffs/Panel/Svn.pm
trunk/vhffs-api/src/Vhffs/Panel/User.pm
trunk/vhffs-api/src/Vhffs/Panel/Web.pm
trunk/vhffs-api/src/Vhffs/Services/DNS.pm
trunk/vhffs-api/src/Vhffs/Services/Httpd.pm
trunk/vhffs-api/src/Vhffs/Services/Mail.pm
trunk/vhffs-api/src/Vhffs/Services/Mailing.pm
trunk/vhffs-api/src/Vhffs/Services/Mysql.pm
trunk/vhffs-api/src/Vhffs/Services/Postgres.pm
trunk/vhffs-api/src/Vhffs/Services/Repository.pm
trunk/vhffs-api/src/Vhffs/Services/Svn.pm
Modified: trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -47,18 +47,6 @@
use Vhffs::Panel::Main;
use Vhffs::Constants;
-sub getall_cvs_to_moderate
-{
- my( $main , $query , $request);
- $main = shift;
- $query = "SELECT c.cvsroot , o.description , u.username , g.groupname , o.object_id FROM vhffs_cvs c, vhffs_object o , vhffs_users u , vhffs_groups g WHERE u.uid=c.owner_uid AND g.gid=c.owner_gid AND o.object_id=c.object_id AND o.state='".Vhffs::Constants::WAITING_FOR_VALIDATION."'";
- $request = $main->{'db'}->prepare( $query );
-
- return undef if ( $request->execute <= 0 );
- return( $request->fetchall_hashref('cvsroot') );
-}
-
-
sub search
{
my ($main, $name) = @_;
@@ -67,10 +55,10 @@
my $cvs = [];
if( defined $name ) {
- $sql = 'SELECT c.cvsroot, g.groupname, c.object_id AS oid, o.state FROM vhffs_cvs c INNER JOIN vhffs_object o ON o.object_id = c.object_id INNER JOIN vhffs_groups g ON g.gid = c.owner_gid WHERE cvsroot LIKE ?';
+ $sql = 'SELECT c.cvsroot, g.groupname, c.object_id AS oid, o.state FROM vhffs_cvs c INNER JOIN vhffs_object o ON o.object_id = c.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid WHERE cvsroot LIKE ?';
push(@params, '%'.$name.'%');
} else {
- $sql = 'SELECT c.cvsroot, g.groupname, c.object_id AS oid, o.state FROM vhffs_cvs c INNER JOIN vhffs_object o ON o.object_id = c.object_id INNER JOIN vhffs_groups g ON g.gid = c.owner_gid';
+ $sql = 'SELECT c.cvsroot, g.groupname, c.object_id AS oid, o.state FROM vhffs_cvs c INNER JOIN vhffs_object o ON o.object_id = c.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid';
}
my $dbh = $main->get_db_object();
my $sth = $dbh->prepare($sql) or return undef;
@@ -119,7 +107,7 @@
my ( $main, $gid ) = @_;
my $dbh = $main->get_db_object;
- my $sql = 'SELECT c.object_id AS oid, c.cvsroot AS displayname, o.state FROM vhffs_cvs c INNER JOIN vhffs_object o ON c.object_id = o.object_id WHERE c.owner_gid = ? ORDER BY c.cvsroot';
+ my $sql = 'SELECT c.object_id AS oid, c.cvsroot AS displayname, o.state FROM vhffs_cvs c INNER JOIN vhffs_object o ON c.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY c.cvsroot';
my $sth = $dbh->prepare($sql) or return -1;
$sth->execute($gid) or return -2;
my $cvs = [];
Modified: trunk/vhffs-api/src/Vhffs/Panel/DNS.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/DNS.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Panel/DNS.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -47,19 +47,6 @@
use Vhffs::Services::DNS;
-sub getall_domain_to_moderate
-{
- my( $main , $query , $request);
- $main = shift;
- $query = "SELECT n.domain , o.description , u.username , g.groupname , o.object_id FROM vhffs_dns n, vhffs_object o , vhffs_users u , vhffs_groups g WHERE u.uid=n.owner_uid AND g.gid=n.owner_gid AND n.object_id=o.object_id AND o.state='".Vhffs::Constants::WAITING_FOR_VALIDATION."'";
- $request = $main->{'db'}->prepare( $query );
-
- return undef if ( $request->execute <= 0 );
- return( $request->fetchall_hashref('domain') );
-}
-
-
-
sub search
{
my ($main, $name) = @_;
@@ -68,10 +55,10 @@
my @params;
if( defined $name ) {
- $sql = 'SELECT ns.domain, ns.object_id AS oid, g.groupname, o.state FROM vhffs_dns ns INNER JOIN vhffs_object o ON o.object_id = ns.object_id INNER JOIN vhffs_groups g ON g.gid = ns.owner_gid WHERE ns.domain LIKE ?';
+ $sql = 'SELECT ns.domain, ns.object_id AS oid, g.groupname, o.state FROM vhffs_dns ns INNER JOIN vhffs_object o ON o.object_id = ns.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid WHERE ns.domain LIKE ?';
push(@params, '%'.$name.'%');
} else {
- $sql = 'SELECT ns.domain, ns.object_id AS oid, g.groupname, o.state FROM vhffs_dns ns INNER JOIN vhffs_object o ON o.object_id = ns.object_id INNER JOIN vhffs_groups g ON g.gid = ns.owner_gid';
+ $sql = 'SELECT ns.domain, ns.object_id AS oid, g.groupname, o.state FROM vhffs_dns ns INNER JOIN vhffs_object o ON o.object_id = ns.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid';
}
my $dbh = $main->get_db_object();
@@ -137,7 +124,7 @@
my ( $main, $gid ) = @_;
my $dbh = $main->get_db_object;
- my $sql = 'SELECT ns.object_id AS oid, ns.domain AS displayname, o.state FROM vhffs_dns ns INNER JOIN vhffs_object o ON ns.object_id = o.object_id WHERE ns.owner_gid = ? ORDER BY ns.domain';
+ my $sql = 'SELECT ns.object_id AS oid, ns.domain AS displayname, o.state FROM vhffs_dns ns INNER JOIN vhffs_object o ON ns.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY ns.domain';
my $sth = $dbh->prepare($sql) or return -1;
$sth->execute($gid) or return -2;
my $dns = [];
Modified: trunk/vhffs-api/src/Vhffs/Panel/Group.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Group.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Panel/Group.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -83,10 +83,10 @@
my $groups = [];
if( defined $name ) {
- $sql = 'SELECT g.groupname, g.object_id AS OID, o.state, u.username FROM vhffs_groups g INNER JOIN vhffs_object o ON g.object_id = o.object_id INNER JOIN vhffs_users u ON u.uid = g.owner_uid WHERE g.groupname LIKE ?';
+ $sql = 'SELECT g.groupname, g.object_id AS OID, o.state, u.username FROM vhffs_groups g INNER JOIN vhffs_object o ON g.object_id = o.object_id INNER JOIN vhffs_users u ON u.uid = o.owner_uid WHERE g.groupname LIKE ?';
push(@params, '%'.$name.'%');
} else {
- $sql = 'SELECT g.groupname, g.object_id AS OID, o.state, u.username FROM vhffs_groups g INNER JOIN vhffs_object o ON g.object_id = o.object_id INNER JOIN vhffs_users u ON u.uid = g.owner_uid WHERE g.groupname NOT IN ( SELECT username FROM vhffs_users )';
+ $sql = 'SELECT g.groupname, g.object_id AS OID, o.state, u.username FROM vhffs_groups g INNER JOIN vhffs_object o ON g.object_id = o.object_id INNER JOIN vhffs_users u ON u.uid = o.owner_uid WHERE g.groupname NOT IN ( SELECT username FROM vhffs_users )';
}
my $dbh = $main->get_db_object();
my $sth = $dbh->prepare( $sql ) or return undef;
@@ -101,20 +101,6 @@
return $groups;
}
-
-
-sub getall_groups_to_moderate
-{
- my( $main , $query , $request);
- $main = shift;
- $query = "SELECT o.description , u.username , g.groupname , o.object_id FROM vhffs_groups g INNER JOIN vhffs_object o ON o.object_id = g.object_id INNER JOIN vhffs_users ON u.uid = g.owner_uid WHERE u.username!=g.groupname AND o.state='".Vhffs::Constants::WAITING_FOR_VALIDATION."'";
- $request = $main->{'db'}->prepare( $query );
-
- return undef if ( $request->execute <= 0 );
- return( $request->fetchall_hashref('groupname') );
-}
-
-
sub getall_groups_per_user
{
my ( $user , $main ) = @_;
Modified: trunk/vhffs-api/src/Vhffs/Panel/Mail.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Mail.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Panel/Mail.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -52,10 +52,10 @@
my $mails = [];
if( defined $name ) {
- $sql = 'SELECT m.domain, m.object_id AS oid, o.state, g.groupname FROM vhffs_mxdomain m INNER JOIN vhffs_object o ON o.object_id = m.object_id INNER JOIN vhffs_groups g ON g.gid = m.owner_gid WHERE m.domain LIKE ?';
+ $sql = 'SELECT m.domain, m.object_id AS oid, o.state, g.groupname FROM vhffs_mxdomain m INNER JOIN vhffs_object o ON o.object_id = m.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid WHERE m.domain LIKE ?';
push(@params, '%'.$name.'%');
} else {
- $sql = 'SELECT m.domain, m.object_id AS oid, o.state, g.groupname FROM vhffs_mxdomain m INNER JOIN vhffs_object o ON o.object_id = m.object_id INNER JOIN vhffs_groups g ON g.gid = m.owner_gid';
+ $sql = 'SELECT m.domain, m.object_id AS oid, o.state, g.groupname FROM vhffs_mxdomain m INNER JOIN vhffs_object o ON o.object_id = m.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid';
}
my $dbh = $main->get_db_object();
@@ -71,20 +71,6 @@
return $mails
}
-
-
-sub getall_mail_to_moderate
-{
- my( $main , $query , $request);
- $main = shift;
- $query = "SELECT m.domain, o.description , u.username , g.groupname , o.object_id FROM vhffs_mxdomain m, vhffs_object o , vhffs_users u , vhffs_groups g WHERE u.uid=m.owner_uid AND g.gid=m.owner_gid AND m.object_id=o.object_id AND o.state='".Vhffs::Constants::WAITING_FOR_VALIDATION."'";
- $request = $main->{'db'}->prepare( $query );
-
- return undef if ( $request->execute <= 0 );
- return( $request->fetchall_hashref('domain') );
-}
-
-
=pod
=head2 getall_per_group
@@ -102,7 +88,7 @@
my ( $main, $gid ) = @_;
my $dbh = $main->get_db_object;
- my $sql = 'SELECT m.object_id AS oid, m.domain AS displayname, o.state FROM vhffs_mxdomain m INNER JOIN vhffs_object o ON m.object_id = o.object_id WHERE m.owner_gid = ? ORDER BY m.domain';
+ my $sql = 'SELECT m.object_id AS oid, m.domain AS displayname, o.state FROM vhffs_mxdomain m INNER JOIN vhffs_object o ON m.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY m.domain';
my $sth = $dbh->prepare($sql) or return -1;
$sth->execute($gid) or return -2;
my $mails = [];
@@ -129,41 +115,13 @@
my ($main, $domain, $gid) = @_;
my $dbh = $main->get_db_object;
- my $sql = 'SELECT COUNT(*) FROM vhffs_mxdomain WHERE domain = ? AND owner_gid = ?';
+ my $sql = 'SELECT COUNT(*) FROM vhffs_mxdomain m INNER JOIN vhffs_object o ON o.object_id = m.object_id WHERE m.domain = ? AND o.owner_gid = ?';
my $sth = $dbh->prepare( $sql );
$sth->execute( $domain, $gid );
my ($count) = $sth->fetchrow_array();
return $count > 0;
}
-sub getall_mail_per_group
-{
- my $group = shift;
- my $main = shift ;
- my $state = shift;
-
- return undef unless( defined $group );
-
- my $query;
-
- if( defined $state )
- {
- $query = "SELECT m.domain, m.object_id, o.state FROM vhffs_mxdomain m, vhffs_object o WHERE o.object_id=m.object_id AND o.state='".$state."' AND m.owner_gid='".$group->get_gid."'";
- }
- else
- {
- $query = "SELECT m.domain, m.object_id, o.state FROM vhffs_mxdomain m, vhffs_object o WHERE o.object_id=m.object_id AND m.owner_gid='".$group->get_gid."'";
- }
-
- my $request = $main->{'db'}->prepare( $query ) or return -1;
-
- return undef if ( $request->execute() <= 0);
-
- return( $request->fetchall_hashref('domain') );
-}
-
-
-
sub create_mail
{
my( $main , $domain , $description, $user , $group ) = @_;
Modified: trunk/vhffs-api/src/Vhffs/Panel/Mailinglist.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Mailinglist.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Panel/Mailinglist.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -45,19 +45,6 @@
use Vhffs::Panel::Main;
use Vhffs::Services::Mailing;
-
-
-sub getall_list_to_moderate
-{
- my( $main , $query , $request);
- $main = shift;
- $query = "SELECT l.ml_id , l.local_part , l.domain, o.description , u.username , g.groupname , o.object_id FROM vhffs_ml l, vhffs_object o , vhffs_users u , vhffs_groups g WHERE u.uid=l.owner_uid AND g.gid=l.owner_gid AND l.object_id=o.object_id AND o.state='".Vhffs::Constants::WAITING_FOR_VALIDATION."'";
- $request = $main->{'db'}->prepare( $query );
-
- return undef if ( $request->execute <= 0 );
- return( $request->fetchall_hashref('ml_id') );
-}
-
sub search
{
my ($main, $name) = @_;
@@ -66,11 +53,11 @@
my $mls = [];
if( defined $name ) {
- $sql = 'SELECT l.local_part, l.domain, g.groupname, l.object_id AS oid, o.state FROM vhffs_ml l INNER JOIN vhffs_object o ON o.object_id = l.object_id INNER JOIN vhffs_groups g ON g.gid = l.owner_gid WHERE l.local_part LIKE ? OR l.domain LIKE ?';
+ $sql = 'SELECT l.local_part, l.domain, g.groupname, l.object_id AS oid, o.state FROM vhffs_ml l INNER JOIN vhffs_object o ON o.object_id = l.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid WHERE l.local_part LIKE ? OR l.domain LIKE ?';
push(@params, '%'.$name.'%');
push(@params, '%'.$name.'%');
} else {
- $sql = 'SELECT l.local_part, l.domain, g.groupname, l.object_id AS oid, o.state FROM vhffs_ml l INNER JOIN vhffs_object o ON o.object_id = l.object_id INNER JOIN vhffs_groups g ON g.gid = l.owner_gid';
+ $sql = 'SELECT l.local_part, l.domain, g.groupname, l.object_id AS oid, o.state FROM vhffs_ml l INNER JOIN vhffs_object o ON o.object_id = l.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid';
}
my $dbh = $main->get_db_object();
my $sth = $dbh->prepare($sql) or return undef;
@@ -101,7 +88,7 @@
my ( $main, $gid ) = @_;
my $dbh = $main->get_db_object;
- my $sql = 'SELECT l.object_id AS oid, l.local_part || \'@\' || l.domain AS displayname, o.state FROM vhffs_ml l INNER JOIN vhffs_object o ON l.object_id = o.object_id WHERE l.owner_gid = ? ORDER BY l.local_part, l.domain';
+ my $sql = 'SELECT l.object_id AS oid, l.local_part || \'@\' || l.domain AS displayname, o.state FROM vhffs_ml l INNER JOIN vhffs_object o ON l.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY l.local_part, l.domain';
my $sth = $dbh->prepare($sql) or return -1;
$sth->execute($gid) or return -2;
my $mls = [];
@@ -128,7 +115,7 @@
my ($main, $gid) = @_;
my $dbh = $main->get_db_object;
- my $sql = q{ SELECT m.domain FROM vhffs_mxdomain m INNER JOIN vhffs_object o ON o.object_id = m.object_id WHERE m.owner_gid = ? AND o.state = ? ORDER BY m.domain };
+ my $sql = q{ SELECT m.domain FROM vhffs_mxdomain m INNER JOIN vhffs_object o ON o.object_id = m.object_id WHERE o.owner_gid = ? AND o.state = ? ORDER BY m.domain };
return ($dbh->selectall_arrayref($sql, { Slice => {} }, $gid, Vhffs::Constants::ACTIVATED) );
}
Modified: trunk/vhffs-api/src/Vhffs/Panel/Mysql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Mysql.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Panel/Mysql.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -56,18 +56,6 @@
=cut
-sub getall_dbs_to_moderate
-{
- my( $main , $query , $request);
- $main = shift;
- $query = "SELECT m.dbname , o.description , u.username , g.groupname , o.object_id FROM vhffs_mysql m, vhffs_object o , vhffs_users u , vhffs_groups g WHERE u.uid=m.owner_uid AND g.gid=m.owner_gid AND m.object_id=o.object_id AND o.state='".Vhffs::Constants::WAITING_FOR_VALIDATION."'";
- $request = $main->{'db'}->prepare( $query );
-
- return undef if ( $request->execute <= 0 );
- return( $request->fetchall_hashref('dbname') );
-}
-
-
sub search
{
my ($main, $name) = @_;
@@ -77,11 +65,11 @@
my $mys = [];
if( defined $name ) {
- $sql = 'SELECT m.dbname, m.object_id AS oid, g.groupname, o.state FROM vhffs_mysql m INNER JOIN vhffs_object o ON o.object_id = m.object_id INNER JOIN vhffs_groups g ON g.gid = m.owner_gid WHERE m.dbname LIKE ? OR m.dbuser LIKE ?';
+ $sql = 'SELECT m.dbname, m.object_id AS oid, g.groupname, o.state FROM vhffs_mysql m INNER JOIN vhffs_object o ON o.object_id = m.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid WHERE m.dbname LIKE ? OR m.dbuser LIKE ?';
push(@params, '%'.$name.'%');
push(@params, '%'.$name.'%');
} else {
- $sql = 'SELECT m.dbname, m.object_id AS oid, g.groupname, o.state FROM vhffs_mysql m INNER JOIN vhffs_object o ON o.object_id = m.object_id INNER JOIN vhffs_groups g ON g.gid = m.owner_gid';
+ $sql = 'SELECT m.dbname, m.object_id AS oid, g.groupname, o.state FROM vhffs_mysql m INNER JOIN vhffs_object o ON o.object_id = m.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid';
}
my $dbh = $main->get_db_object();
@@ -135,7 +123,7 @@
my ( $main, $gid ) = @_;
my $dbh = $main->get_db_object;
- my $sql = 'SELECT m.object_id AS oid, m.dbname AS displayname, o.state FROM vhffs_mysql m INNER JOIN vhffs_object o ON m.object_id = o.object_id WHERE m.owner_gid = ? ORDER BY m.dbname';
+ my $sql = 'SELECT m.object_id AS oid, m.dbname AS displayname, o.state FROM vhffs_mysql m INNER JOIN vhffs_object o ON m.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY m.dbname';
my $sth = $dbh->prepare($sql) or return -1;
$sth->execute($gid) or return -2;
my $mysql = [];
Modified: trunk/vhffs-api/src/Vhffs/Panel/Pgsql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Pgsql.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Panel/Pgsql.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -55,10 +55,10 @@
my $pgs = [];
if( defined $name ) {
- $sql = 'SELECT p.dbname, p.object_id AS oid, g.groupname, o.state FROM vhffs_pgsql p INNER JOIN vhffs_object o ON o.object_id = p.object_id INNER JOIN vhffs_groups g ON g.gid = p.owner_gid WHERE p.dbname LIKE ? OR p.dbuser LIKE ?';
+ $sql = 'SELECT p.dbname, p.object_id AS oid, g.groupname, o.state FROM vhffs_pgsql p INNER JOIN vhffs_object o ON o.object_id = p.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid WHERE p.dbname LIKE ? OR p.dbuser LIKE ?';
push(@params, '%'.$name.'%', '%'.$name.'%');
} else {
- $sql = 'SELECT p.dbname, p.object_id AS oid, g.groupname, o.state FROM vhffs_pgsql p INNER JOIN vhffs_object o ON o.object_id = p.object_id INNER JOIN vhffs_groups g ON g.gid = p.owner_gid';
+ $sql = 'SELECT p.dbname, p.object_id AS oid, g.groupname, o.state FROM vhffs_pgsql p INNER JOIN vhffs_object o ON o.object_id = p.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid';
}
my $dbh = $main->get_db_object();
@@ -74,17 +74,6 @@
}
-sub getall_dbs_to_moderate
-{
- my( $main , $query , $request);
- $main = shift;
- $query = "SELECT p.dbname , o.description , u.username , g.groupname , o.object_id FROM vhffs_pgsql p, vhffs_object o , vhffs_users u , vhffs_groups g WHERE u.uid=p.owner_uid AND g.gid=p.owner_gid AND p.object_id=o.object_id AND o.state='".Vhffs::Constants::WAITING_FOR_VALIDATION."'";
- $request = $main->{'db'}->prepare( $query );
-
- return undef if ( $request->execute <= 0 );
- return( $request->fetchall_hashref('dbname') );
-}
-
=pod
=head2 getall_per_group
@@ -102,7 +91,7 @@
my ( $main, $gid ) = @_;
my $dbh = $main->get_db_object;
- my $sql = 'SELECT p.object_id AS oid, p.dbname AS displayname, o.state FROM vhffs_pgsql p INNER JOIN vhffs_object o ON p.object_id = o.object_id WHERE p.owner_gid = ? ORDER BY p.dbname';
+ my $sql = 'SELECT p.object_id AS oid, p.dbname AS displayname, o.state FROM vhffs_pgsql p INNER JOIN vhffs_object o ON p.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY p.dbname';
my $sth = $dbh->prepare($sql) or return -1;
$sth->execute($gid) or return -2;
my $pgsql = [];
Modified: trunk/vhffs-api/src/Vhffs/Panel/Repository.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Repository.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Panel/Repository.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -47,17 +47,6 @@
use Vhffs::Panel::Main;
use Vhffs::Constants;
-sub getall_repository_to_moderate
-{
- my( $main , $query , $request);
- $main = shift;
- $query = "SELECT r.name , o.description , u.username , g.groupname , o.object_id FROM vhffs_repository r, vhffs_object o , vhffs_users u , vhffs_groups g WHERE u.uid=r.owner_uid AND g.gid=r.owner_gid AND o.object_id=r.object_id AND o.state='".Vhffs::Constants::WAITING_FOR_VALIDATION."'";
- $request = $main->{'db'}->prepare( $query );
-
- return undef if ( $request->execute <= 0 );
- return( $request->fetchall_hashref('name') );
-}
-
=pod
=head2 getall_per_group
@@ -74,7 +63,7 @@
my ( $main, $gid ) = @_;
my $dbh = $main->get_db_object;
- my $sql = 'SELECT r.object_id AS oid, r.name AS displayname, o.state FROM vhffs_repository r INNER JOIN vhffs_object o ON r.object_id = o.object_id WHERE r.owner_gid = ? ORDER BY r.name';
+ my $sql = 'SELECT r.object_id AS oid, r.name AS displayname, o.state FROM vhffs_repository r INNER JOIN vhffs_object o ON r.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY r.name';
my $sth = $dbh->prepare($sql) or return -1;
$sth->execute($gid) or return -2;
my $mysql = [];
@@ -94,10 +83,10 @@
my $reps = [];
if( defined $name ) {
- $sql = 'SELECT r.name, g.groupname, o.state, r.object_id AS oid FROM vhffs_repository r INNER JOIN vhffs_object o ON o.object_id=r.object_id INNER JOIN vhffs_groups g ON g.gid = r.owner_gid WHERE r.name LIKE ?';
+ $sql = 'SELECT r.name, g.groupname, o.state, r.object_id AS oid FROM vhffs_repository r INNER JOIN vhffs_object o ON o.object_id=r.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid WHERE r.name LIKE ?';
push(@params, '%'.$name.'%');
} else {
- $sql = 'SELECT r.name, g.groupname, o.state, r.object_id AS oid FROM vhffs_repository r INNER JOIN vhffs_object o ON o.object_id=r.object_id INNER JOIN vhffs_groups g ON g.gid = r.owner_gid';
+ $sql = 'SELECT r.name, g.groupname, o.state, r.object_id AS oid FROM vhffs_repository r INNER JOIN vhffs_object o ON o.object_id=r.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid';
}
my $dbh = $main->get_db_object();
Modified: trunk/vhffs-api/src/Vhffs/Panel/Svn.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Svn.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Panel/Svn.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -49,18 +49,6 @@
use Vhffs::Functions;
-sub getall_svn_to_moderate
-{
- my( $main , $query , $request);
- $main = shift;
- $query = "SELECT s.reponame , o.description , u.username , g.groupname , o.object_id FROM vhffs_svn s, vhffs_object o , vhffs_users u , vhffs_groups g WHERE u.uid=s.owner_uid AND g.gid=s.owner_gid AND o.object_id=s.object_id AND o.state='".Vhffs::Constants::WAITING_FOR_VALIDATION."'";
- $request = $main->{'db'}->prepare( $query );
-
- return undef if ( $request->execute <= 0 );
- return( $request->fetchall_hashref('reponame') );
-}
-
-
=pod
=head2 getall_per_group
@@ -78,7 +66,7 @@
my ( $main, $gid ) = @_;
my $dbh = $main->get_db_object;
- my $sql = 'SELECT s.object_id AS oid, s.reponame AS displayname, o.state FROM vhffs_svn s INNER JOIN vhffs_object o ON s.object_id = o.object_id WHERE s.owner_gid = ? ORDER BY s.reponame';
+ my $sql = 'SELECT s.object_id AS oid, s.reponame AS displayname, o.state FROM vhffs_svn s INNER JOIN vhffs_object o ON s.object_id = o.object_id WHERE o.owner_gid = ? ORDER BY s.reponame';
my $sth = $dbh->prepare($sql) or return -1;
$sth->execute($gid) or return -2;
my $svn = [];
@@ -98,10 +86,10 @@
my $svns = [];
if( defined $name ) {
- $sql = 'SELECT s.reponame AS svnroot, g.groupname, o.state, s.object_id AS oid FROM vhffs_svn s INNER JOIN vhffs_object o ON o.object_id=s.object_id INNER JOIN vhffs_groups g ON g.gid = s.owner_gid WHERE s.reponame LIKE ?';
+ $sql = 'SELECT s.reponame AS svnroot, g.groupname, o.state, s.object_id AS oid FROM vhffs_svn s INNER JOIN vhffs_object o ON o.object_id=s.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid WHERE s.reponame LIKE ?';
push(@params, '%'.$name.'%');
} else {
- $sql = 'SELECT s.reponame AS svnroot, g.groupname, o.state, s.object_id AS oid FROM vhffs_svn s INNER JOIN vhffs_object o ON o.object_id=s.object_id INNER JOIN vhffs_groups g ON g.gid = s.owner_gid';
+ $sql = 'SELECT s.reponame AS svnroot, g.groupname, o.state, s.object_id AS oid FROM vhffs_svn s INNER JOIN vhffs_object o ON o.object_id=s.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid';
}
my $dbh = $main->get_db_object();
Modified: trunk/vhffs-api/src/Vhffs/Panel/User.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/User.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Panel/User.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -207,10 +207,10 @@
push @params, $user->get_uid;
if( defined $relation) {
if( $relation == $RELATION_OWNER ) {
- $sql = 'SELECT g.groupname AS project, o.state FROM vhffs_groups g INNER JOIN vhffs_object o ON o.object_id = g.object_id WHERE g.owner_uid = ? AND g.groupname != ? ORDER BY g.groupname';
+ $sql = 'SELECT g.groupname AS project, o.state FROM vhffs_groups g INNER JOIN vhffs_object o ON o.object_id = g.object_id WHERE o.owner_uid = ? AND g.groupname != ? ORDER BY g.groupname';
push @params, $user->get_username;
} else {
- $sql = 'SELECT g.groupname AS project, o.state FROM vhffs_groups g INNER JOIN vhffs_user_group ug ON g.gid=ug.gid INNER JOIN vhffs_object o ON o.object_id = g.object_id WHERE ug.uid=? AND g.owner_uid != ug.uid ORDER BY g.groupname';
+ $sql = 'SELECT g.groupname AS project, o.state FROM vhffs_groups g INNER JOIN vhffs_user_group ug ON g.gid=ug.gid INNER JOIN vhffs_object o ON o.object_id = g.object_id WHERE ug.uid=? AND o.owner_uid != ug.uid ORDER BY g.groupname';
}
} else {
$sql = 'SELECT g.groupname AS project, o.state FROM vhffs_groups g INNER JOIN vhffs_user_group ug ON g.gid=ug.gid INNER JOIN vhffs_object o ON o.object_id = g.object_id WHERE ug.uid=? ORDER BY g.groupname';
Modified: trunk/vhffs-api/src/Vhffs/Panel/Web.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Web.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Panel/Web.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -55,22 +55,6 @@
=head2 METHODS
-=cut
-
-sub getall_web_to_moderate
-{
- my( $main , $query , $request);
- $main = shift;
- $query = "SELECT w.servername , o.description , u.username , g.groupname , o.object_id FROM vhffs_httpd w, vhffs_object o , vhffs_users u , vhffs_groups g WHERE u.uid=w.owner_uid AND g.gid=w.owner_gid AND w.object_id=o.object_id AND o.state='".Vhffs::Constants::WAITING_FOR_VALIDATION."'";
- $request = $main->{'db'}->prepare( $query );
-
- return undef if ( $request->execute <= 0 );
- return( $request->fetchall_hashref('servername') );
-}
-
-
-=pod
-
=head2 get_all_per_group
my $areas = Vhffs::Panel::Web::getall_per_group($vhffs, $main);
@@ -84,7 +68,7 @@
my ($main, $gid) = @_;
my $dbh = $main->get_db_object;
- my $sql = 'SELECT w.servername AS displayname, w.object_id AS oid, o.state FROM vhffs_httpd w INNER JOIN vhffs_object o ON o.object_id = w.object_id WHERE w.owner_gid = ? ORDER BY w.servername';
+ my $sql = 'SELECT w.servername AS displayname, w.object_id AS oid, o.state FROM vhffs_httpd w INNER JOIN vhffs_object o ON o.object_id = w.object_id WHERE o.owner_gid = ? ORDER BY w.servername';
my $sth = $dbh->prepare($sql) or return -1;
$sth->execute($gid) or return -2;
my $web = [];
@@ -104,10 +88,10 @@
my $webs = [];
if( defined $name ) {
- $sql = 'SELECT w.servername, w.object_id AS oid, o.state, g.groupname FROM vhffs_httpd w INNER JOIN vhffs_object o ON o.object_id = w.object_id INNER JOIN vhffs_groups g ON g.gid = w.owner_gid WHERE w.servername LIKE ?';
+ $sql = 'SELECT w.servername, w.object_id AS oid, o.state, g.groupname FROM vhffs_httpd w INNER JOIN vhffs_object o ON o.object_id = w.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid WHERE w.servername LIKE ?';
push(@params, '%'.$name.'%');
} else {
- $sql = 'SELECT w.servername, w.object_id AS oid, o.state, g.groupname FROM vhffs_httpd w INNER JOIN vhffs_object o ON o.object_id = w.object_id INNER JOIN vhffs_groups g ON g.gid = w.owner_gid';
+ $sql = 'SELECT w.servername, w.object_id AS oid, o.state, g.groupname FROM vhffs_httpd w INNER JOIN vhffs_object o ON o.object_id = w.object_id INNER JOIN vhffs_groups g ON g.gid = o.owner_gid';
}
my $dbh = $main->get_db_object();
Modified: trunk/vhffs-api/src/Vhffs/Services/DNS.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/DNS.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Services/DNS.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -1075,22 +1075,6 @@
$self->{'ttl'} = $value;
}
-sub set_user
-{
- my $self = shift;
- my $user = shift;
-
- $self->{'user'} = $user;
-}
-
-sub set_group
-{
- my $self = shift;
- my $group = shift;
-
- $self->{'group'} = $group;
-}
-
sub get_domain
{
my $self = shift;
Modified: trunk/vhffs-api/src/Vhffs/Services/Httpd.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Httpd.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Services/Httpd.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -130,18 +130,6 @@
return $self->{'servername'};
}
-sub set_user
-{
- my( $self , $user ) = @_;
- $self->{'user'} = $user;
-}
-
-sub set_group
-{
- my( $self , $group ) = @_;
- $self->{'group'} = $group;
-}
-
sub get_title
{
my $self = shift;
Modified: trunk/vhffs-api/src/Vhffs/Services/Mail.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Mail.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Services/Mail.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -471,18 +471,6 @@
return -1;
}
-sub set_user
-{
- my( $self , $user ) = @_;
- $self->{'user'} = $user;
-}
-
-sub set_group
-{
- my( $self , $group ) = @_;
- $self->{'group'} = $group;
-}
-
=pod
=head2 get_by_mxdomain
Modified: trunk/vhffs-api/src/Vhffs/Services/Mailing.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Mailing.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Services/Mailing.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -475,18 +475,6 @@
$self->{'prefix'} = $value;
}
-sub set_user
-{
- my( $self , $user ) = @_;
- $self->{'user'} = $user;
-}
-
-sub set_group
-{
- my( $self , $group ) = @_;
- $self->{'group'} = $group;
-}
-
sub getall_subs
{
my $self = shift;
Modified: trunk/vhffs-api/src/Vhffs/Services/Mysql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Mysql.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Services/Mysql.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -210,18 +210,6 @@
return 1;
}
-sub set_group
-{
- my( $self , $group ) = @_;
- $self->{'group'} = $group;
-}
-
-sub set_user
-{
- my( $self , $user ) = @_;
- $self->{'user'} = $user;
-}
-
sub _new {
my ($class, $main, $mysql_id, $owner_gid, $dbname, $dbuser, $dbpass, $oid, $owner_uid, $date_creation, $state, $description) = @_;
my $self = $class->SUPER::_new($main, $oid, $owner_uid, $owner_gid, $date_creation, $description, $state, Vhffs::Constants::TYPE_MYSQL);
Modified: trunk/vhffs-api/src/Vhffs/Services/Postgres.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Postgres.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Services/Postgres.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -214,19 +214,6 @@
return 1;
}
-sub set_group
-{
- my( $self , $group ) = @_;
- $self->{'group'} = $group;
-}
-
-sub set_user
-{
- my( $self , $user ) = @_;
- $self->{'user'} = $user;
-}
-
-
sub blank_password
{
my $self = shift;
Modified: trunk/vhffs-api/src/Vhffs/Services/Repository.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Repository.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Services/Repository.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -216,19 +216,6 @@
return $self->{'name'};
}
-sub set_user
-{
- my ( $self , $user ) = @_;
- $self->{'user'} = $user;
-}
-
-sub set_group
-{
- my ( $self , $group ) = @_;
- $self->{'group'} = $group;
-}
-
-
sub get_name
{
my $self = shift;
Modified: trunk/vhffs-api/src/Vhffs/Services/Svn.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Svn.pm 2007-07-12 14:25:20 UTC (rev 720)
+++ trunk/vhffs-api/src/Vhffs/Services/Svn.pm 2007-07-12 15:28:05 UTC (rev 721)
@@ -172,18 +172,6 @@
}
}
-sub set_user
-{
- my ( $self , $user ) = @_;
- $self->{'user'} = $user;
-}
-
-sub set_group
-{
- my ( $self , $group ) = @_;
- $self->{'group'} = $group;
-}
-
sub get_reponame
{
my $self = shift;