]> git.saurik.com Git - apple/mdnsresponder.git/blob - Clients/ExplorerPlugin/LoginDialog.cpp
mDNSResponder-107.6.tar.gz
[apple/mdnsresponder.git] / Clients / ExplorerPlugin / LoginDialog.cpp
1 /* -*- Mode: C; tab-width: 4 -*-
2 *
3 * Copyright (c) 2003-2004 Apple Computer, Inc. All rights reserved.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16
17 Change History (most recent first):
18
19 $Log: LoginDialog.cpp,v $
20 Revision 1.3 2006/08/14 23:24:00 cheshire
21 Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0
22
23 Revision 1.2 2004/07/13 21:24:21 rpantos
24 Fix for <rdar://problem/3701120>.
25
26 Revision 1.1 2004/06/18 04:34:59 rpantos
27 Move to Clients from mDNSWindows
28
29 Revision 1.1 2004/01/30 03:01:56 bradley
30 Explorer Plugin to browse for DNS-SD advertised Web and FTP servers from within Internet Explorer.
31
32 */
33
34 #include <assert.h>
35 #include <stdlib.h>
36
37 #include "stdafx.h"
38
39 #include "LoginDialog.h"
40
41 // MFC Debugging
42
43 #ifdef _DEBUG
44 #define new DEBUG_NEW
45 #undef THIS_FILE
46 static char THIS_FILE[] = __FILE__;
47 #endif
48
49 //===========================================================================================================================
50 // Message Map
51 //===========================================================================================================================
52
53 BEGIN_MESSAGE_MAP( LoginDialog, CDialog )
54 END_MESSAGE_MAP()
55
56 //===========================================================================================================================
57 // LoginDialog
58 //===========================================================================================================================
59
60 LoginDialog::LoginDialog( CWnd *inParent )
61 : CDialog( LoginDialog::IDD, inParent )
62 {
63 //
64 }
65
66 //===========================================================================================================================
67 // OnInitDialog
68 //===========================================================================================================================
69
70 BOOL LoginDialog::OnInitDialog( void )
71 {
72 CDialog::OnInitDialog();
73 return( TRUE );
74 }
75
76 //===========================================================================================================================
77 // DoDataExchange
78 //===========================================================================================================================
79
80 void LoginDialog::DoDataExchange( CDataExchange *inDX )
81 {
82 CDialog::DoDataExchange( inDX );
83 }
84
85 //===========================================================================================================================
86 // OnOK
87 //===========================================================================================================================
88
89 void LoginDialog::OnOK( void )
90 {
91 const CWnd * control;
92
93 // Username
94
95 control = GetDlgItem( IDC_LOGIN_USERNAME_TEXT );
96 assert( control );
97 if( control )
98 {
99 control->GetWindowText( mUsername );
100 }
101
102 // Password
103
104 control = GetDlgItem( IDC_LOGIN_PASSWORD_TEXT );
105 assert( control );
106 if( control )
107 {
108 control->GetWindowText( mPassword );
109 }
110
111 CDialog::OnOK();
112 }
113
114 //===========================================================================================================================
115 // GetLogin
116 //===========================================================================================================================
117
118 BOOL LoginDialog::GetLogin( CString &outUsername, CString &outPassword )
119 {
120 if( DoModal() == IDOK )
121 {
122 outUsername = mUsername;
123 outPassword = mPassword;
124 return( TRUE );
125 }
126 return( FALSE );
127 }