connectionutilities/ConnectionDialogs/cconndlg/clientsrc/GenConAgentDialogServer.cpp
branchRCL_3
changeset 58 83ca720e2b9a
parent 57 05bc53fe583b
--- a/connectionutilities/ConnectionDialogs/cconndlg/clientsrc/GenConAgentDialogServer.cpp	Tue Aug 31 15:35:44 2010 +0300
+++ b/connectionutilities/ConnectionDialogs/cconndlg/clientsrc/GenConAgentDialogServer.cpp	Wed Sep 01 12:23:51 2010 +0100
@@ -20,14 +20,11 @@
 // INCLUDE FILES
 #include "GenConAgentDialogServer.h"
 #include "ConnectionDialogsUidDefs.h"
+#include "ActiveLogin.h"
 #include "ConnectionDialogsLogger.h"
 
 #include <agentdialog.h>
 
-// NOTE that the functionality this file is DEPRECATED
-// None on the methods have UI functionality, the plugins complete the requests
-// immediately when they are started
-
 
 // ---------------------------------------------------------
 // ThreadFunction
@@ -226,20 +223,31 @@
     {
     CLOG_ENTERFN( "RGenConAgentDialogServer::Authenticate" );
 
-    // To get rid of compile warnings;
-    aPassword = aPassword;
-    aUsername = aUsername;
-    
+    CActiveLogin* activeLogin = NULL;
+
+    TRAPD( err, activeLogin = CActiveLogin::NewL( aUsername, aPassword ) );
 
-    // temporaty variable to get the notifier started
-    TPckgBuf<TUint32> notUsed;
-
-    if ( iNotifier )
+    iNotUsed() = ( TUint32 )activeLogin;
+    
+    if ( err != KErrNone )
+        {
+        TRequestStatus* pS = &aStatus;
+        User::RequestComplete( pS, err );
+        }
+    else
         {
-        iNotifier->StartNotifierAndGetResponse( aStatus,
-                                                KUidCConnDlgAuthentication,
-                                                notUsed,
-                                                notUsed );
+        activeLogin->Observe( aStatus );
+
+        TPckgBuf<TAuthenticationPairBuff>* authenticationPairBuff = 
+                                                    activeLogin->GetBuffer();
+
+        if ( iNotifier )
+            {
+            iNotifier->StartNotifierAndGetResponse( activeLogin->iStatus,
+                                                    KUidCConnDlgAuthentication,
+                                                    *authenticationPairBuff,
+                                                    *authenticationPairBuff );
+            }
         }
 
     CLOG_LEAVEFN( "RGenConAgentDialogServer::Authenticate" );
@@ -431,6 +439,11 @@
         iNotifier->CancelNotifier( KUidCConnDlgAuthentication );
         }
 
+    CActiveLogin* activeLogin = ( CActiveLogin* )iNotUsed();
+
+    activeLogin->Cancel();
+    delete activeLogin;
+
     CLOG_LEAVEFN( "RGenConAgentDialogServer::CancelAuthenticate" );
     }