|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "rasdef.h" |
|
17 |
|
18 CLoginBox::CLoginBox(CNtRas* aNtRas) |
|
19 : CActive(KKeyReaderPriority), iNtRas(aNtRas) |
|
20 { |
|
21 __DECLARE_NAME(_S("CLoginBox")); |
|
22 CActiveScheduler::Add(this); |
|
23 } |
|
24 |
|
25 CLoginBox::~CLoginBox() |
|
26 { |
|
27 Cancel(); |
|
28 } |
|
29 |
|
30 CLoginBox* CLoginBox::NewL(CNtRas* aNtRas, TDes& aUsername, TDes& aPassword) |
|
31 { |
|
32 |
|
33 CLoginBox* p = new (ELeave) CLoginBox(aNtRas); |
|
34 CleanupStack::PushL(p); |
|
35 p->ConstructL(aUsername, aPassword); |
|
36 CleanupStack::Pop(); |
|
37 return p; |
|
38 } |
|
39 |
|
40 void CLoginBox::ConstructL(TDes& aUsername, TDes& aPassword) |
|
41 { |
|
42 TInt res=iNtRas->ReadDes(RAS_AUTHENTICATENAME, aUsername); |
|
43 if(res==KErrNone) |
|
44 res=iNtRas->ReadDes(RAS_AUTHENTICATEPASSWORD, aPassword); |
|
45 |
|
46 SetActive(); |
|
47 TRequestStatus* sp = &iStatus; |
|
48 User::RequestComplete(sp, res); |
|
49 } |
|
50 |
|
51 |
|
52 void CLoginBox::RunL() |
|
53 { |
|
54 |
|
55 iNtRas->AuthenticateDialogComplete(iStatus.Int()); |
|
56 } |
|
57 |
|
58 void CLoginBox::DoCancel() |
|
59 { |
|
60 } |