[Bps-public-commit] App-Changeloggr branch, master, updated. 9cd24e2345176aac757b64c3ff5712e8afd788d5

sartak at bestpractical.com sartak at bestpractical.com
Wed Apr 1 13:52:12 EDT 2009


The branch, master has been updated
       via  9cd24e2345176aac757b64c3ff5712e8afd788d5 (commit)
      from  264efd3744485b3c2ba6c156d982006e75540231 (commit)

Summary of changes:
 .../Changeloggr/Action/Mixin/RequiresAdminToken.pm |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit 9cd24e2345176aac757b64c3ff5712e8afd788d5
Author: Shawn M Moore <sartak at gmail.com>
Date:   Wed Apr 1 13:51:59 2009 -0400

    Get the real admin token as the superuser

diff --git a/lib/App/Changeloggr/Action/Mixin/RequiresAdminToken.pm b/lib/App/Changeloggr/Action/Mixin/RequiresAdminToken.pm
index a6b91ff..bebadb9 100644
--- a/lib/App/Changeloggr/Action/Mixin/RequiresAdminToken.pm
+++ b/lib/App/Changeloggr/Action/Mixin/RequiresAdminToken.pm
@@ -19,12 +19,13 @@ sub get_changelog {
 }
 
 sub validate_admin_token {
-    my $self        = shift;
-    my $admin_token = shift;
+    my $self            = shift;
+    my $got_admin_token = shift;
 
     my $changelog = $self->get_changelog;
+    my $expected_admin_token = $changelog->as_superuser->admin_token;
 
-    if ($changelog->admin_token eq $admin_token) {
+    if ($expected_admin_token eq $got_admin_token) {
         return $self->validation_ok('admin_token');
     }
     else {

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list