[vhffs-dev] [883] now using UID from object instance

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


Revision: 883
Author:   gradator
Date:     2007-09-09 03:06:55 +0000 (Sun, 09 Sep 2007)

Log Message:
-----------
now using UID from object instance

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Object.pm
    trunk/vhffs-panel/admin/moderation.pl
    trunk/vhffs-panel/admin/moderation_submit.pl
    trunk/vhffs-panel/templates/admin/misc/moderation_part.tmpl


Modified: trunk/vhffs-api/src/Vhffs/Object.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Object.pm	2007-09-09 02:31:37 UTC (rev 882)
+++ trunk/vhffs-api/src/Vhffs/Object.pm	2007-09-09 03:06:55 UTC (rev 883)
@@ -387,9 +387,12 @@
 # Accept this object
 sub moderate_accept
 {
+	use Vhffs::User;
+
 	my $self = shift;
-	my $user = shift;
+
 	my $vhffs = $self->{main};
+	my $user = Vhffs::User::get_by_uid( $vhffs , $self->get_owner_uid );
 
 	$self->set_status( Vhffs::Constants::WAITING_FOR_CREATION );
 
@@ -422,10 +425,13 @@
 # Refuse this object
 sub moderate_refuse
 {
+	use Vhffs::User;
+
 	my $self = shift;
-	my $user = shift;
 	my $reason = shift;
+
 	my $vhffs = $self->{main};
+	my $user = Vhffs::User::get_by_uid( $vhffs , $self->get_owner_uid );
 
 	$self->set_status( Vhffs::Constants::VALIDATION_REFUSED );
 

Modified: trunk/vhffs-panel/admin/moderation.pl
===================================================================
--- trunk/vhffs-panel/admin/moderation.pl	2007-09-09 02:31:37 UTC (rev 882)
+++ trunk/vhffs-panel/admin/moderation.pl	2007-09-09 03:06:55 UTC (rev 883)
@@ -107,7 +107,6 @@
 			if( $vhffs->get_config->get_users->{'use_notation'} eq 'yes' )
 			{
 				$subtemplate->param( NOTE	=> Vhffs::Note::get_note( $vhffs , $user ) );
-				$subtemplate->param( UID_ASKER	=> $user->get_uid);
 			}
 
 			$subtemplate->param( GROUP		=> $group->get_groupname );

Modified: trunk/vhffs-panel/admin/moderation_submit.pl
===================================================================
--- trunk/vhffs-panel/admin/moderation_submit.pl	2007-09-09 02:31:37 UTC (rev 882)
+++ trunk/vhffs-panel/admin/moderation_submit.pl	2007-09-09 03:06:55 UTC (rev 883)
@@ -41,6 +41,7 @@
 use lib '%VHFFS_LIB_DIR%';
 use Vhffs::Panel::Main;
 use Vhffs::Panel::Menu;
+use Vhffs::Object;
 use Vhffs::ObjectFactory;
 
 my $panel = new Vhffs::Panel::Main();
@@ -66,10 +67,7 @@
 }
 else
 {
-	use Vhffs::Object;
 	my $oid = $cgi->param('OID');
-	my $uidasker = $cgi->param('UID_ASKER');
-	my $userasker = Vhffs::User::get_by_uid( $vhffs , $uidasker );
 	my $object = Vhffs::ObjectFactory::fetch_object( $vhffs , $oid );
 
 	if( ( ! defined $oid ) || ( ! defined $object ) || ( ! defined $accept ) )
@@ -82,11 +80,11 @@
 
 		if( $accept == 1 )
 		{
-			$ok = $object->moderate_accept( $userasker );
+			$ok = $object->moderate_accept;
 		}
 		else
 		{
-			$ok = $object->moderate_refuse( $userasker , $reason );
+			$ok = $object->moderate_refuse( $reason );
 		}
 		
 		if( $ok < 0 )

Modified: trunk/vhffs-panel/templates/admin/misc/moderation_part.tmpl
===================================================================
--- trunk/vhffs-panel/templates/admin/misc/moderation_part.tmpl	2007-09-09 02:31:37 UTC (rev 882)
+++ trunk/vhffs-panel/templates/admin/misc/moderation_part.tmpl	2007-09-09 03:06:55 UTC (rev 883)
@@ -24,7 +24,6 @@
 	<td>
 		<form method="post" action="moderation_submit.pl">
 			<input type="hidden" name="OID" value="<TMPL_VAR NAME="OID">" />
-			<input type="hidden" name="UID_ASKER" value="<TMPL_VAR NAME="UID_ASKER">" />
 			<input type="hidden" name="ACCEPT" value="1" />
 			<input type="submit" value="<TMPL_VAR NAME="ACCEPT">" />
 		</form>
@@ -34,7 +33,6 @@
 		<form method="post" action="moderation_submit.pl">
 			<textarea name="reason" cols="30" rows="4"></textarea>
 			<input type="hidden" name="OID" value="<TMPL_VAR NAME="OID">" />
-			<input type="hidden" name="UID_ASKER" value="<TMPL_VAR NAME="UID_ASKER">" />
 			<input type="hidden" name="ACCEPT" value="0" />
 			<input type="submit" value="<TMPL_VAR NAME="REFUSE">" />
 		</form>


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