clientprovisioning/cpqtsp/src/CWPBioControl.cpp
changeset 71 a6c938002837
parent 67 fdbfe0a95492
--- a/clientprovisioning/cpqtsp/src/CWPBioControl.cpp	Fri Oct 15 11:39:02 2010 +0530
+++ b/clientprovisioning/cpqtsp/src/CWPBioControl.cpp	Thu Oct 28 03:48:30 2010 +0530
@@ -74,6 +74,7 @@
     ibootstrap = NULL;
     iMsg = new(ELeave)CpMessage(this);
     iWait = new( ELeave ) CActiveSchedulerWait;
+    iPreAuthenticated = EFalse;
     FLOG( _L( "[ProvisioningBC] CWPBioControl::ConstructL: done" ) );
     }
 
@@ -134,7 +135,10 @@
         //result = KErrMsgBioMessageNotValid;
         }
     FTRACE(RDebug::Print(_L("[ProvisioningBC] CWPBioControl::RestoreMsgL result (%d)"), result));
-    User::LeaveIfError( result );    
+    User::LeaveIfError( result );
+    
+    // Get the value of the authentication before authenticating the message
+    iPreAuthenticated = iMessage->Authenticated();
 	AuthenticateL( *iMessage );
 	CleanupStack::PopAndDestroy();
 	if(iAuth == KAUTENTICATIONCANCEL || iAuth == KAUTENTICATIONSUCCESS)
@@ -191,8 +195,8 @@
            User::LeaveIfError(err);
            }
 
-    TBool preAuthenticated( iMessage->Authenticated() );
-    if( !iEntry.ReadOnly() && preAuthenticated != iMessage->Authenticated() )
+    
+    if( !iEntry.ReadOnly() && iPreAuthenticated != iMessage->Authenticated() )
         {
         // If the entry can be written to, get its edit store and save
         // authentication flag. Failing is not dangerous, as the only