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