[vhffs-dev] [472] Fixed some typo (Internal Server Error) and a parameter name problem on moderation.

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


Revision: 472
Author:   beuss
Date:     2007-02-17 11:47:37 +0000 (Sat, 17 Feb 2007)

Log Message:
-----------
Fixed some typo (Internal Server Error) and a parameter name problem on moderation.

Modified Paths:
--------------
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Note.pm
    branches/vhffs_4.1/vhffs-panel/templates/admin/misc/moderation_part.tmpl


Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Note.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Note.pm	2007-02-17 11:39:22 UTC (rev 471)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Note.pm	2007-02-17 11:47:37 UTC (rev 472)
@@ -47,7 +47,7 @@
 
     my $sql = 'UPDATE vhffs_user SET note = ? WHERE uid = ?';
     my $dbh = $user->get_db_object;
-    my $sth = $sbh->prepare($sql);
+    my $sth = $dbh->prepare($sql);
     $sth->execute($value, $user->get_uid());
 
     return 1;
@@ -60,10 +60,8 @@
 	my $vhffs        	= shift;
 	my $user 			= shift;
 	my $increase 		= shift;
-	my $note   			= 0;
-	my $already_exists 	= 0;
 
-	return -1 if( $entity->fetch < 0 );
+	return -1 unless( defined $user );
 
     my $sql = 'UPDATE vhffs_users SET note = note + ? WHERE uid = ?';
     my $sth = $vhffs->{'db'}->prepare( $sql );
@@ -77,10 +75,12 @@
 	my $vhffs			=	shift;
 	my $user 			= 	shift;
 
+    return -1 unless(defined $user);
+
     my $query = 'SELECT note FROM vhffs_users WHERE uid = ?';	
 
 	my $request = $vhffs->{'db'}->prepare( $query );
-	$request->execute($entity->get_uid);
+	$request->execute($user->get_uid);
     my ($note) = $request->fetchrow();
     return ($note || 0);
 }

Modified: branches/vhffs_4.1/vhffs-panel/templates/admin/misc/moderation_part.tmpl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/templates/admin/misc/moderation_part.tmpl	2007-02-17 11:39:22 UTC (rev 471)
+++ branches/vhffs_4.1/vhffs-panel/templates/admin/misc/moderation_part.tmpl	2007-02-17 11:47:37 UTC (rev 472)
@@ -21,7 +21,7 @@
 	<td>
 		<form method="post" action="moderation_submit.pl">
 			<input type="hidden" name="OID" value="<TMPL_VAR NAME="OID">" />
-			<input type="hidden" name="OID_ASKER" value="<TMPL_VAR NAME="OID_ASKER">" />
+			<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>
@@ -31,7 +31,7 @@
 		<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="OID_ASKER" value="<TMPL_VAR NAME="OID_ASKER">" />
+			<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/