26
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
36
|
14 |
* Description:
|
|
15 |
* EAP Authentication Notitier implementation
|
26
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
34
|
19 |
/*
|
36
|
20 |
* %version: 21 %
|
34
|
21 |
*/
|
|
22 |
|
36
|
23 |
// System include files
|
26
|
24 |
#include <hb/hbcore/hbsymbianvariant.h>
|
|
25 |
#include <e32debug.h>
|
36
|
26 |
#include <EapExpandedType.h>
|
|
27 |
// User include files
|
26
|
28 |
#include "eap_auth_notifier.h"
|
|
29 |
#include "eap_auth_observer.h"
|
|
30 |
#include "eap_auth_ui_strings.h"
|
|
31 |
|
36
|
32 |
// External function prototypes
|
|
33 |
|
|
34 |
// Local constants
|
26
|
35 |
const TInt KVariableLength = 30;
|
|
36 |
const TInt KDlgTypeStrLength = 100;
|
|
37 |
const TInt KMaxAuthMethodLength = 50;
|
|
38 |
|
|
39 |
_LIT( KUsername, "username");
|
|
40 |
_LIT( KAuthmethod, "authmethod");
|
|
41 |
_LIT( KPacservername, "pacservername");
|
|
42 |
_LIT( KPacfilename, "pacfilename");
|
|
43 |
_LIT( KEaptype, "eaptype");
|
|
44 |
_LIT( KMessage, "messagetxt");
|
|
45 |
_LIT( KFastprovwaitnote, "notificationtxt");
|
|
46 |
|
|
47 |
_LIT(KTypeunamepwddlg, "com.nokia.eap.usernamepassworddialog/1.0");
|
|
48 |
_LIT(KTypepwdquerydlg, "com.nokia.eap.passwordquerydialog/1.0");
|
|
49 |
_LIT(KTypequerydlg, "com.nokia.eap.querydialog/1.0");
|
|
50 |
_LIT(KTypeinstallpacquerydlg, "com.nokia.eap.fastinstallpacquerydialog/1.0");
|
|
51 |
_LIT(KTypepacstorepwquerydlg, "com.nokia.eap.fastpacstorepwquerydialog/1.0");
|
|
52 |
_LIT(KTypemasterkeyquerydlg, "com.nokia.eap.fastcreatemasterkeyquerydialog/1.0");
|
|
53 |
_LIT(KTypepacfilepwquerydlg, "com.nokia.eap.fastpacfilepwquerydialog/1.0");
|
|
54 |
_LIT(KTypeprovwaitnotedlg, "com.nokia.eap.fastprovwaitnotedialog/1.0");
|
|
55 |
_LIT(KTypepwdexpnotedlg,"com.nokia.eap.mschapv2passwordexpirednotedialog/1.0");
|
|
56 |
_LIT(KTypeoldpwddlg,"com.nokia.eap.mschapv2oldpassworddialog/1.0");
|
|
57 |
_LIT(KTypenewpwddlg,"com.nokia.eap.mschapv2newpassworddialog/1.0");
|
|
58 |
_LIT(KTypeshowprovnotsuccdlg,"com.nokia.eap.fastshowprovnotsuccessnotedialog/1.0");
|
|
59 |
|
36
|
60 |
// ======== LOCAL FUNCTIONS ========
|
|
61 |
|
|
62 |
// ======== MEMBER FUNCTIONS ========
|
|
63 |
|
|
64 |
// ---------------------------------------------------------------------------
|
|
65 |
// Constructor
|
|
66 |
// ---------------------------------------------------------------------------
|
26
|
67 |
//
|
|
68 |
CEapAuthNotifier::CEapAuthNotifier( MNotificationCallback& aClient )
|
34
|
69 |
:iClient(aClient),
|
|
70 |
iDialog(NULL),
|
|
71 |
iObserver(NULL),
|
|
72 |
iCompleted(EFalse),
|
|
73 |
iCancelled(EFalse)
|
26
|
74 |
{
|
|
75 |
RDebug::Print(_L("CEapAuthNotifier::CEapAuthNotifier DLL++") );
|
|
76 |
|
|
77 |
}
|
|
78 |
|
36
|
79 |
// ---------------------------------------------------------------------------
|
|
80 |
// Destructor
|
|
81 |
// ---------------------------------------------------------------------------
|
26
|
82 |
//
|
|
83 |
CEapAuthNotifier::~CEapAuthNotifier()
|
|
84 |
{
|
|
85 |
RDebug::Print(_L("CEapAuthNotifier::~CEapAuthNotifier") );
|
|
86 |
|
|
87 |
if ( iCancelled == EFalse )
|
|
88 |
{
|
|
89 |
iCompleted = ETrue;
|
|
90 |
if ( iDialog )
|
|
91 |
{
|
|
92 |
iDialog->Cancel();
|
|
93 |
}
|
|
94 |
}
|
|
95 |
if ( iDialog )
|
|
96 |
{
|
|
97 |
delete iDialog;
|
|
98 |
}
|
|
99 |
if ( iObserver )
|
|
100 |
{
|
|
101 |
delete iObserver;
|
|
102 |
}
|
|
103 |
}
|
|
104 |
|
36
|
105 |
// ---------------------------------------------------------------------------
|
|
106 |
// Two-phased constructor
|
|
107 |
// ---------------------------------------------------------------------------
|
26
|
108 |
//
|
34
|
109 |
EXPORT_C CEapAuthNotifier* CEapAuthNotifier::NewL(
|
|
110 |
MNotificationCallback& aClient )
|
26
|
111 |
{
|
|
112 |
RDebug::Print(_L("CEapAuthNotifier::NewL"));
|
|
113 |
|
34
|
114 |
CEapAuthNotifier* self =
|
|
115 |
new ( ELeave ) CEapAuthNotifier( aClient );
|
|
116 |
CleanupStack::PushL( self );
|
|
117 |
self->ConstructL();
|
|
118 |
CleanupStack::Pop( self );
|
26
|
119 |
return self;
|
|
120 |
}
|
|
121 |
|
36
|
122 |
// ---------------------------------------------------------------------------
|
|
123 |
// ConstructL for the Notifier
|
|
124 |
// ---------------------------------------------------------------------------
|
34
|
125 |
//
|
|
126 |
void CEapAuthNotifier::ConstructL()
|
|
127 |
{
|
|
128 |
RDebug::Print(_L("CEapAuthNotifier::ConstructL"));
|
|
129 |
//Observer is needed in order to get the user inputs
|
|
130 |
iObserver = CEapAuthObserver::NewL( this );
|
|
131 |
iDialog = CHbDeviceDialogSymbian::NewL();
|
|
132 |
}
|
|
133 |
|
36
|
134 |
// ---------------------------------------------------------------------------
|
|
135 |
// Start the Notifier
|
|
136 |
// ---------------------------------------------------------------------------
|
26
|
137 |
//
|
|
138 |
EXPORT_C void CEapAuthNotifier::StartL(
|
|
139 |
EEapNotifierType aType,
|
|
140 |
TEapDialogInfo* aEapInfo,
|
|
141 |
TEapExpandedType& aEapType )
|
|
142 |
{
|
|
143 |
TInt error;
|
|
144 |
TBuf<KDlgTypeStrLength> EapNtfType;
|
|
145 |
TBuf16<KMaxAuthMethodLength> authMethod;
|
|
146 |
|
|
147 |
RDebug::Print(_L("CEapAuthNotifier::StartL: ENTERING"));
|
|
148 |
|
|
149 |
iCancelled = EFalse;
|
|
150 |
iCompleted = EFalse;
|
|
151 |
iEapInfo = aEapInfo;
|
34
|
152 |
|
|
153 |
//Method must be called before using the observer
|
|
154 |
iObserver->SetNotifierType(aType);
|
26
|
155 |
|
|
156 |
//The variant map is needed to construct the dialog correctly,
|
|
157 |
CHbSymbianVariantMap* map = CHbSymbianVariantMap::NewL();
|
|
158 |
CleanupStack::PushL( map );
|
|
159 |
|
|
160 |
if ( aType == EEapNotifierTypeLEapUsernamePasswordDialog )
|
|
161 |
{
|
|
162 |
authMethod.Copy(EapAuthUiStrings::Leap);
|
|
163 |
SetUsernamePasswordDataL( aEapInfo, aEapType, map, authMethod );
|
|
164 |
EapNtfType.Copy(KTypeunamepwddlg);
|
|
165 |
}
|
|
166 |
else if ( aType == EEapNotifierTypeGTCUsernamePasswordDialog )
|
|
167 |
{
|
|
168 |
authMethod.Copy(EapAuthUiStrings::EapGtc);
|
|
169 |
SetUsernamePasswordDataL( aEapInfo, aEapType, map, authMethod );
|
|
170 |
EapNtfType.Copy(KTypeunamepwddlg);
|
|
171 |
}
|
|
172 |
else if ( aType == EEapNotifierTypePapUsernamePasswordDialog )
|
|
173 |
{
|
|
174 |
authMethod.Copy(EapAuthUiStrings::Pap);
|
|
175 |
SetUsernamePasswordDataL( aEapInfo, aEapType, map, authMethod );
|
|
176 |
EapNtfType.Copy(KTypeunamepwddlg);
|
|
177 |
}
|
|
178 |
else if ( aType == EEapNotifierTypeEapMsChapV2UsernamePasswordDialog )
|
|
179 |
{
|
|
180 |
authMethod.Copy(EapAuthUiStrings::EapMschapv2);
|
|
181 |
SetUsernamePasswordDataL( aEapInfo, aEapType, map, authMethod );
|
|
182 |
EapNtfType.Copy(KTypeunamepwddlg);
|
|
183 |
}
|
|
184 |
else if ( aType == EEapNotifierTypeMsChapV2UsernamePasswordDialog )
|
|
185 |
{
|
|
186 |
authMethod.Copy(EapAuthUiStrings::Mschapv2);
|
|
187 |
SetUsernamePasswordDataL( aEapInfo, aEapType, map, authMethod );
|
|
188 |
EapNtfType.Copy(KTypeunamepwddlg);
|
|
189 |
}
|
34
|
190 |
else if ( aType == EEapNotifierTypeGtcChallengeDialog )
|
26
|
191 |
{
|
|
192 |
authMethod.Copy(EapAuthUiStrings::EapGtc);
|
34
|
193 |
SetQueryDialogDataL( aEapInfo, map, authMethod );
|
|
194 |
EapNtfType.Copy(KTypequerydlg);
|
|
195 |
}
|
|
196 |
else if ( aType == EEapNotifierTypePapChallengeDialog )
|
26
|
197 |
{
|
|
198 |
authMethod.Copy(EapAuthUiStrings::Pap);
|
34
|
199 |
SetQueryDialogDataL( aEapInfo, map, authMethod );
|
|
200 |
EapNtfType.Copy(KTypequerydlg);
|
26
|
201 |
}
|
|
202 |
else if ( aType == EEapNotifierTypeGTCQueryDialog )
|
|
203 |
{
|
|
204 |
authMethod.Copy(EapAuthUiStrings::EapGtc);
|
34
|
205 |
SetPasswordQueryDataL( aEapType, map, authMethod );
|
|
206 |
EapNtfType.Copy(KTypepwdquerydlg);
|
26
|
207 |
}
|
|
208 |
else if ( aType == EEapNotifierTypePapAuthQueryDialog )
|
|
209 |
{
|
|
210 |
authMethod.Copy(EapAuthUiStrings::Pap);
|
34
|
211 |
SetPasswordQueryDataL( aEapType, map, authMethod );
|
|
212 |
EapNtfType.Copy(KTypepwdquerydlg);
|
26
|
213 |
}
|
|
214 |
else if ( aType == EEapNotifierTypeFastInstallPacQueryDialog )
|
|
215 |
{
|
|
216 |
SetFastInstallPacQueryDialogDataL( aEapInfo, map );
|
|
217 |
EapNtfType.Copy(KTypeinstallpacquerydlg);
|
|
218 |
}
|
|
219 |
else if ( aType == EEapNotifierTypeFastPacStorePwQueryDialog )
|
|
220 |
{
|
|
221 |
EapNtfType.Copy(KTypepacstorepwquerydlg);
|
|
222 |
}
|
|
223 |
else if ( aType == EEapNotifierTypeFastCreateMasterkeyQueryDialog )
|
|
224 |
{
|
|
225 |
EapNtfType.Copy(KTypemasterkeyquerydlg);
|
|
226 |
}
|
|
227 |
else if ( aType == EEapNotifierTypeFastPacFilePwQueryDialog )
|
|
228 |
{
|
36
|
229 |
SetFastPacFileQueryPwDialogDataL( aEapInfo, map );
|
26
|
230 |
EapNtfType.Copy(KTypepacfilepwquerydlg);
|
|
231 |
}
|
|
232 |
else if ( aType == EEapNotifierTypeFastStartAuthProvWaitNote )
|
|
233 |
{
|
36
|
234 |
SetFastProvWaitNoteDialogDataL( map, ETrue );
|
26
|
235 |
EapNtfType.Copy(KTypeprovwaitnotedlg);
|
|
236 |
}
|
|
237 |
else if ( aType == EEapNotifierTypeFastStartUnauthProvWaitNote )
|
|
238 |
{
|
36
|
239 |
SetFastProvWaitNoteDialogDataL( map, EFalse );
|
26
|
240 |
EapNtfType.Copy(KTypeprovwaitnotedlg);
|
|
241 |
}
|
|
242 |
else if ( aType == EEapNotifierTypeMsChapV2PasswordExpiredNote )
|
|
243 |
{
|
|
244 |
EapNtfType.Copy(KTypepwdexpnotedlg);
|
|
245 |
}
|
|
246 |
else if ( aType == EEapNotifierTypeMsChapV2OldPasswordDialog )
|
|
247 |
{
|
|
248 |
EapNtfType.Copy(KTypeoldpwddlg);
|
|
249 |
}
|
|
250 |
else if ( aType == EEapNotifierTypeMsChapV2NewPasswordDialog )
|
|
251 |
{
|
|
252 |
EapNtfType.Copy(KTypenewpwddlg);
|
|
253 |
}
|
|
254 |
else if ( aType == EEapNotifierTypeFastShowProvNotSuccessNote )
|
|
255 |
{
|
|
256 |
EapNtfType.Copy(KTypeshowprovnotsuccdlg);
|
|
257 |
}
|
|
258 |
|
|
259 |
RDebug::Print(_L("CEapAuthNotifier::StartL: Load the Dialog NOW!"));
|
34
|
260 |
|
|
261 |
//Show the dialog.
|
26
|
262 |
error = iDialog->Show( EapNtfType, *map, iObserver );
|
|
263 |
|
|
264 |
User::LeaveIfError( error );
|
|
265 |
CleanupStack::PopAndDestroy( map );
|
|
266 |
|
|
267 |
RDebug::Print(_L("CEapAuthNotifier::StartL: LEAVING") );
|
|
268 |
}
|
|
269 |
|
36
|
270 |
// ---------------------------------------------------------------------------
|
|
271 |
// Set data for the EAP-FAST provisioning wait note Dialog(s)
|
|
272 |
// ---------------------------------------------------------------------------
|
26
|
273 |
//
|
36
|
274 |
void CEapAuthNotifier::SetFastProvWaitNoteDialogDataL(
|
26
|
275 |
CHbSymbianVariantMap* aMap,
|
|
276 |
TBool aAuthProvWaitNote )
|
|
277 |
{
|
|
278 |
TInt error;
|
|
279 |
TBuf<KVariableLength> key(KFastprovwaitnote);
|
|
280 |
|
|
281 |
CHbSymbianVariant *variant = NULL;
|
|
282 |
|
36
|
283 |
RDebug::Print(_L("CEapAuthNotifier::SetFastProvWaitNoteDialogDataL: ENTERING"));
|
26
|
284 |
|
|
285 |
//Create the variant data information for the plugin
|
36
|
286 |
variant =
|
|
287 |
CHbSymbianVariant::NewL (
|
|
288 |
&aAuthProvWaitNote, CHbSymbianVariant::EBool );
|
26
|
289 |
CleanupStack::PushL( variant );
|
|
290 |
error = aMap->Add( key, variant);
|
|
291 |
User::LeaveIfError( error );
|
|
292 |
CleanupStack::Pop( variant ); // map's cleanup sequence handles variant.
|
|
293 |
|
36
|
294 |
RDebug::Print(_L("CEapAuthNotifier::SetFastProvWaitNoteDialogDataL: LEAVING") );
|
26
|
295 |
}
|
|
296 |
|
36
|
297 |
// ---------------------------------------------------------------------------
|
|
298 |
// Set data for the EAP-FAST PAC file query Dialog(s)
|
|
299 |
// ---------------------------------------------------------------------------
|
26
|
300 |
//
|
36
|
301 |
void CEapAuthNotifier::SetFastPacFileQueryPwDialogDataL(
|
26
|
302 |
TEapDialogInfo* aEapInfo,
|
|
303 |
CHbSymbianVariantMap* aMap )
|
|
304 |
{
|
|
305 |
TInt error;
|
|
306 |
TBuf<KVariableLength> key(KPacfilename);
|
|
307 |
|
|
308 |
CHbSymbianVariant *variant = NULL;
|
|
309 |
|
36
|
310 |
RDebug::Print(_L("CEapAuthNotifier::SetFastPacFileQueryPwDialogDataL: ENTERING"));
|
26
|
311 |
|
|
312 |
if( 0 < aEapInfo->iUidata.Length() )
|
|
313 |
{
|
36
|
314 |
RDebug::Print(_L("CEapAuthNotifier::SetFastPacFileQueryPwDialogDataL: Set PAC filename"));
|
|
315 |
RDebug::Print(_L("CEapAuthNotifier::SetFastPacFileQueryPwDialogDataL: aEapInfo->iUidata = %S\n"), &aEapInfo->iUidata );
|
26
|
316 |
|
|
317 |
// Create the variant data information for the plugin
|
36
|
318 |
variant =
|
|
319 |
CHbSymbianVariant::NewL (
|
|
320 |
&aEapInfo->iUidata, CHbSymbianVariant::EDes );
|
26
|
321 |
CleanupStack::PushL( variant );
|
|
322 |
error = aMap->Add( key, variant);
|
|
323 |
User::LeaveIfError( error );
|
|
324 |
CleanupStack::Pop( variant ); // map's cleanup sequence handles variant.
|
|
325 |
}
|
36
|
326 |
RDebug::Print(_L("CEapAuthNotifier::SetFastPacFileQueryPwDialogDataL: LEAVING") );
|
26
|
327 |
}
|
|
328 |
|
36
|
329 |
// ---------------------------------------------------------------------------
|
|
330 |
// Set data for the EAP-FAST Install PAC query Dialog(s)
|
|
331 |
// ---------------------------------------------------------------------------
|
26
|
332 |
//
|
|
333 |
void CEapAuthNotifier::SetFastInstallPacQueryDialogDataL(
|
|
334 |
TEapDialogInfo* aEapInfo,
|
|
335 |
CHbSymbianVariantMap* aMap )
|
|
336 |
{
|
|
337 |
TInt error;
|
|
338 |
TBuf<KVariableLength> key(KPacservername);
|
|
339 |
|
|
340 |
CHbSymbianVariant *variant = NULL;
|
|
341 |
|
|
342 |
RDebug::Print(_L("CEapAuthNotifier::SetFastInstallPacQueryDialogData: ENTERING"));
|
|
343 |
|
|
344 |
if( 0 < aEapInfo->iUidata.Length() )
|
|
345 |
{
|
|
346 |
RDebug::Print(_L("CEapAuthNotifier::SetFastInstallPacQueryDialogData: Set PAC Install server name"));
|
|
347 |
RDebug::Print(_L("CEapAuthNotifier::SetFastInstallPacQueryDialogData: aEapInfo->iUidata = %S\n"), &aEapInfo->iUidata );
|
|
348 |
|
|
349 |
// Create the variant data information for the plugin
|
36
|
350 |
variant =
|
|
351 |
CHbSymbianVariant::NewL (
|
|
352 |
&aEapInfo->iUidata, CHbSymbianVariant::EDes );
|
26
|
353 |
CleanupStack::PushL( variant );
|
|
354 |
error = aMap->Add( key, variant);
|
|
355 |
User::LeaveIfError( error );
|
|
356 |
CleanupStack::Pop( variant ); // map's cleanup sequence handles variant.
|
|
357 |
}
|
|
358 |
RDebug::Print(_L("CEapAuthNotifier::SetFastInstallPacQueryDialogData: LEAVING") );
|
|
359 |
}
|
|
360 |
|
36
|
361 |
// ---------------------------------------------------------------------------
|
|
362 |
// Set data for the Challenge Query Dialog(s)
|
|
363 |
// ---------------------------------------------------------------------------
|
26
|
364 |
//
|
|
365 |
void CEapAuthNotifier::SetQueryDialogDataL(
|
|
366 |
TEapDialogInfo* aEapInfo,
|
|
367 |
CHbSymbianVariantMap* aMap,
|
34
|
368 |
const TDesC& aAuthMethod )
|
26
|
369 |
{
|
|
370 |
TInt error;
|
|
371 |
TBuf<KVariableLength> key1(KAuthmethod);
|
|
372 |
TBuf<KVariableLength> key2(KMessage);
|
|
373 |
|
|
374 |
CHbSymbianVariant *variant = NULL;
|
|
375 |
|
|
376 |
RDebug::Print(_L("CEapAuthNotifier::SetQueryDialogData: ENTERING"));
|
|
377 |
|
|
378 |
RDebug::Print(_L("CEapAuthNotifier::SetQueryDialogData: Set Heading"));
|
|
379 |
RDebug::Print(_L("CEapAuthNotifier::SetQueryDialogData: aAuthMethod = %S\n"), &aAuthMethod );
|
|
380 |
|
|
381 |
// Create the variant data information for the plugin
|
36
|
382 |
variant =
|
|
383 |
CHbSymbianVariant::NewL ( &aAuthMethod, CHbSymbianVariant::EDes );
|
26
|
384 |
CleanupStack::PushL( variant );
|
|
385 |
error = aMap->Add( key1, variant);
|
|
386 |
User::LeaveIfError( error );
|
|
387 |
CleanupStack::Pop( variant ); // map's cleanup sequence handles variant.
|
|
388 |
|
|
389 |
if( 0 < aEapInfo->iUidata.Length() )
|
|
390 |
{
|
|
391 |
RDebug::Print(_L("CEapAuthNotifier::SetQueryDialogData: Set user input message"));
|
|
392 |
RDebug::Print(_L("CEapAuthObserver::SetQueryDialogData: aEapInfo->iUidata = %S\n"), &aEapInfo->iUidata );
|
|
393 |
|
|
394 |
// Create the variant data information for the plugin
|
36
|
395 |
variant =
|
|
396 |
CHbSymbianVariant::NewL (
|
|
397 |
&aEapInfo->iUidata, CHbSymbianVariant::EDes );
|
26
|
398 |
CleanupStack::PushL( variant );
|
|
399 |
error = aMap->Add( key2, variant);
|
|
400 |
User::LeaveIfError( error );
|
|
401 |
CleanupStack::Pop( variant ); // map's cleanup sequence handles variant.
|
|
402 |
}
|
|
403 |
RDebug::Print(_L("CEapAuthNotifier::SetQueryDialogData: LEAVING") );
|
|
404 |
}
|
|
405 |
|
36
|
406 |
// ---------------------------------------------------------------------------
|
|
407 |
// Set data for the Password Query Dialog(s)
|
|
408 |
// ---------------------------------------------------------------------------
|
26
|
409 |
//
|
|
410 |
void CEapAuthNotifier::SetPasswordQueryDataL(
|
|
411 |
TEapExpandedType& aEapType,
|
|
412 |
CHbSymbianVariantMap* aMap,
|
34
|
413 |
const TDesC& aAuthMethod )
|
26
|
414 |
{
|
|
415 |
TInt error;
|
|
416 |
TBuf<KVariableLength> key2(KAuthmethod);
|
34
|
417 |
TBuf<KVariableLength> key3(KEaptype);
|
26
|
418 |
CHbSymbianVariant *variant = NULL;
|
|
419 |
|
|
420 |
RDebug::Print(_L("CEapAuthNotifier::SetPasswordQueryData: ENTERING"));
|
|
421 |
RDebug::Print(_L("CEapAuthNotifier::SetPasswordQueryData: aAuthMethod = %S\n"), &aAuthMethod );
|
|
422 |
|
|
423 |
//Create the variant data information for the plugin
|
|
424 |
//Set authentication method
|
36
|
425 |
variant =
|
|
426 |
CHbSymbianVariant::NewL ( &aAuthMethod, CHbSymbianVariant::EDes );
|
26
|
427 |
CleanupStack::PushL( variant );
|
|
428 |
error = aMap->Add( key2, variant);
|
|
429 |
User::LeaveIfError( error );
|
|
430 |
CleanupStack::Pop( variant ); // map's cleanup sequence handles variant.
|
|
431 |
|
|
432 |
//Set EAP type
|
36
|
433 |
variant =
|
|
434 |
CHbSymbianVariant::NewL(
|
|
435 |
&aEapType.GetValue(), CHbSymbianVariant::EBinary );
|
26
|
436 |
CleanupStack::PushL( variant );
|
|
437 |
error = aMap->Add( key3, variant);
|
|
438 |
User::LeaveIfError( error );
|
|
439 |
CleanupStack::Pop( variant ); // map's cleanup sequence handles variant.
|
|
440 |
RDebug::Print(_L("CEapAuthNotifier::SetPasswordQueryData: LEAVING") );
|
|
441 |
}
|
|
442 |
|
36
|
443 |
// ---------------------------------------------------------------------------
|
|
444 |
// Set data for the UsernamePassword Dialog(s)
|
|
445 |
// ---------------------------------------------------------------------------
|
26
|
446 |
//
|
|
447 |
void CEapAuthNotifier::SetUsernamePasswordDataL(
|
|
448 |
TEapDialogInfo* aEapInfo,
|
|
449 |
TEapExpandedType& aEapType,
|
|
450 |
CHbSymbianVariantMap* aMap,
|
34
|
451 |
const TDesC& aAuthMethod )
|
26
|
452 |
{
|
|
453 |
TInt error;
|
|
454 |
TBuf<KVariableLength> key1(KUsername);
|
|
455 |
TBuf<KVariableLength> key2(KAuthmethod);
|
|
456 |
TBuf<KVariableLength> key3(KEaptype);
|
|
457 |
CHbSymbianVariant *variant = NULL;
|
|
458 |
|
|
459 |
RDebug::Print(_L("CEapAuthNotifier::SetUsernamePasswordData: ENTERING"));
|
|
460 |
RDebug::Print(_L("CEapAuthNotifier::SetUsernamePasswordData: aAuthMethod = %S\n"), &aAuthMethod );
|
|
461 |
|
|
462 |
//Create the variant data information for the plugin
|
|
463 |
//Set authentication method
|
36
|
464 |
variant =
|
|
465 |
CHbSymbianVariant::NewL ( &aAuthMethod, CHbSymbianVariant::EDes );
|
26
|
466 |
CleanupStack::PushL( variant );
|
|
467 |
error = aMap->Add( key2, variant);
|
|
468 |
User::LeaveIfError( error );
|
|
469 |
CleanupStack::Pop( variant ); // map's cleanup sequence handles variant.
|
|
470 |
|
|
471 |
//Set username
|
|
472 |
if( 0 < aEapInfo->iUsername.Length() )
|
|
473 |
{
|
|
474 |
RDebug::Print(_L("CEapAuthNotifier::SetUsernamePasswordData: Set default UNAME"));
|
|
475 |
RDebug::Print(_L("CEapAuthNotifier::SetUsernamePasswordData: iEapInfo->iUsername = %S\n"), &iEapInfo->iUsername );
|
|
476 |
|
|
477 |
// Create the variant data information for the plugin
|
36
|
478 |
variant =
|
|
479 |
CHbSymbianVariant::NewL (
|
|
480 |
&aEapInfo->iUsername, CHbSymbianVariant::EDes );
|
26
|
481 |
CleanupStack::PushL( variant );
|
|
482 |
error = aMap->Add( key1, variant);
|
|
483 |
User::LeaveIfError( error );
|
|
484 |
CleanupStack::Pop( variant ); // map's cleanup sequence handles variant.
|
|
485 |
}
|
|
486 |
|
|
487 |
//Set EAP type
|
36
|
488 |
variant =
|
|
489 |
CHbSymbianVariant::NewL(
|
|
490 |
&aEapType.GetValue(), CHbSymbianVariant::EBinary );
|
26
|
491 |
CleanupStack::PushL( variant );
|
|
492 |
error = aMap->Add( key3, variant);
|
|
493 |
User::LeaveIfError( error );
|
|
494 |
CleanupStack::Pop( variant ); // map's cleanup sequence handles variant.
|
|
495 |
RDebug::Print(_L("CEapAuthNotifier::SetUsernamePasswordData: LEAVING") );
|
|
496 |
}
|
|
497 |
|
36
|
498 |
// ---------------------------------------------------------------------------
|
|
499 |
// Sets the selected user name and password of the presented dialog
|
|
500 |
// ---------------------------------------------------------------------------
|
26
|
501 |
//
|
|
502 |
void CEapAuthNotifier::SetSelectedUnameAndPwd ( TEapDialogInfo& aEapInfo )
|
|
503 |
{
|
|
504 |
RDebug::Print(_L("CEapAuthNotifier::SetSelectedUnameAndPwd"));
|
|
505 |
|
|
506 |
iEapInfo->iIsIdentityQuery = aEapInfo.iIsIdentityQuery;
|
|
507 |
if ( aEapInfo.iIsIdentityQuery )
|
|
508 |
{
|
|
509 |
iEapInfo->iUsername = aEapInfo.iUsername;
|
|
510 |
RDebug::Print(_L("CEapAuthNotifier::SetSelectedUnameAndPwd: iEapInfo->iUsername = %S\n"), &iEapInfo->iUsername );
|
|
511 |
}
|
|
512 |
|
|
513 |
iEapInfo->iPasswordPromptEnabled = aEapInfo.iPasswordPromptEnabled;
|
|
514 |
if ( aEapInfo.iPasswordPromptEnabled )
|
|
515 |
{
|
|
516 |
iEapInfo->iPassword = aEapInfo.iPassword;
|
|
517 |
RDebug::Print(_L("CEapAuthNotifier::SetSelectedUnameAndPwd: iEapInfo->iPassword = %S\n"), &iEapInfo->iPassword );
|
|
518 |
}
|
|
519 |
}
|
|
520 |
|
36
|
521 |
// ---------------------------------------------------------------------------
|
|
522 |
// Sets the selected password of the presented dialog
|
|
523 |
// ---------------------------------------------------------------------------
|
26
|
524 |
//
|
|
525 |
void CEapAuthNotifier::SetSelectedPassword ( TEapDialogInfo& aPasswordInfo )
|
|
526 |
{
|
|
527 |
RDebug::Print(_L("CEapAuthNotifier::SetSelectedPassword"));
|
|
528 |
|
|
529 |
iEapInfo->iPassword = aPasswordInfo.iPassword;
|
|
530 |
RDebug::Print(_L("CEapAuthNotifier::SetSelectedPassword: iEapInfo->iPassword = %S\n"), &iEapInfo->iPassword );
|
|
531 |
}
|
|
532 |
|
36
|
533 |
// ---------------------------------------------------------------------------
|
|
534 |
// Sets the selected Old password of the presented dialog
|
|
535 |
// ---------------------------------------------------------------------------
|
26
|
536 |
//
|
|
537 |
void CEapAuthNotifier::SetSelectedOldPassword ( TEapDialogInfo& aPasswordInfo )
|
|
538 |
{
|
|
539 |
RDebug::Print(_L("CEapAuthNotifier::SetSelectedOldPassword"));
|
|
540 |
|
|
541 |
iEapInfo->iOldPassword = aPasswordInfo.iOldPassword;
|
|
542 |
RDebug::Print(_L("CEapAuthNotifier::SetSelectedOldPassword: iEapInfo->iOldPassword = %S\n"), &iEapInfo->iOldPassword );
|
|
543 |
}
|
|
544 |
|
36
|
545 |
// ---------------------------------------------------------------------------
|
|
546 |
// The notifier is complete
|
|
547 |
// ---------------------------------------------------------------------------
|
26
|
548 |
//
|
|
549 |
void CEapAuthNotifier::CompleteL( TInt aStatus )
|
|
550 |
{
|
|
551 |
RDebug::Print(_L("CEapAuthNotifier::CompleteL"));
|
|
552 |
|
|
553 |
if ( !iCompleted )
|
|
554 |
{
|
|
555 |
iClient.DlgComplete(aStatus);
|
|
556 |
iCompleted = ETrue;
|
|
557 |
}
|
|
558 |
}
|
|
559 |
|
36
|
560 |
// ---------------------------------------------------------------------------
|
|
561 |
// Cancel() the notifier
|
|
562 |
// ---------------------------------------------------------------------------
|
26
|
563 |
//
|
|
564 |
EXPORT_C void CEapAuthNotifier::Cancel()
|
|
565 |
{
|
|
566 |
RDebug::Print(_L("CEapAuthNotifier::Cancel"));
|
|
567 |
if ( !iCompleted )
|
|
568 |
{
|
|
569 |
iCancelled = ETrue;
|
|
570 |
iDialog->Cancel();
|
|
571 |
}
|
|
572 |
}
|