author | wimpie <wimpie> | 2004-08-12 12:46:55 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-08-12 12:46:55 (UTC) |
commit | 8f215ba9ceb395f262517855a99d7d2d303ca760 (patch) (unidiff) | |
tree | aa5f9b14c249217b4d3fc30f4771bdaf1c3545d3 /noncore/settings/networksettings2/ppp/PPPAuthedit.cpp | |
parent | ef64880308b5035cc8ca2e4e79325db613af525b (diff) | |
download | opie-8f215ba9ceb395f262517855a99d7d2d303ca760.zip opie-8f215ba9ceb395f262517855a99d7d2d303ca760.tar.gz opie-8f215ba9ceb395f262517855a99d7d2d303ca760.tar.bz2 |
MANY changes
- now generates peers/pap-chap secrets files
(no chatscript yet)
(not all usefull ppp options included yet)
- still not ready for prime time yet
Diffstat (limited to 'noncore/settings/networksettings2/ppp/PPPAuthedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/ppp/PPPAuthedit.cpp | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp b/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp index f305cc4..450d560 100644 --- a/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp +++ b/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp | |||
@@ -6,23 +6,30 @@ | |||
6 | #include <GUIUtils.h> | 6 | #include <GUIUtils.h> |
7 | #include "PPPAuthedit.h" | 7 | #include "PPPAuthedit.h" |
8 | 8 | ||
9 | PPPAuthEdit::PPPAuthEdit( QWidget * Parent ) : PPPAuthGUI( Parent ){ | 9 | PPPAuthEdit::PPPAuthEdit( QWidget * Parent ) : PPPAuthGUI( Parent ){ |
10 | } | 10 | } |
11 | 11 | ||
12 | bool PPPAuthEdit::PAP_Checked( void ) { | ||
13 | return ( Pap_RB->isChecked() || | ||
14 | Chap_RB->isChecked() || | ||
15 | EAP_RB->isChecked() | ||
16 | ); | ||
17 | } | ||
18 | |||
12 | QString PPPAuthEdit::acceptable( void ) { | 19 | QString PPPAuthEdit::acceptable( void ) { |
13 | if( Login_RB->isChecked() ) { | 20 | if( Login_RB->isChecked() ) { |
14 | if( LoginSend_LE->text().isEmpty() ) | 21 | if( LoginSend_LE->text().isEmpty() ) |
15 | return tr("Login send missing"); | 22 | return tr("Login send missing"); |
16 | if( LoginExpect_LE->text().isEmpty() ) | 23 | if( LoginExpect_LE->text().isEmpty() ) |
17 | return tr("Login expect missing"); | 24 | return tr("Login expect missing"); |
18 | if( PasswordSend_LE->text().isEmpty() ) | 25 | if( PasswordSend_LE->text().isEmpty() ) |
19 | return tr("Password send missing"); | 26 | return tr("Password send missing"); |
20 | if( PasswordExpect_LE->text().isEmpty() ) | 27 | if( PasswordExpect_LE->text().isEmpty() ) |
21 | return tr("Password expect missing"); | 28 | return tr("Password expect missing"); |
22 | } else if( PapChap_RB->isChecked() ) { | 29 | } else if( PAP_Checked() ) { |
23 | if( Client_LE->text().isEmpty() ) | 30 | if( Client_LE->text().isEmpty() ) |
24 | return tr("Pap/Chap/EAP client id missing"); | 31 | return tr("Pap/Chap/EAP client id missing"); |
25 | if( Server_LE->text().isEmpty() ) | 32 | if( Server_LE->text().isEmpty() ) |
26 | return tr("Pap/Chap/EAP server id missing"); | 33 | return tr("Pap/Chap/EAP server id missing"); |
27 | if( Secret_LE->text().isEmpty() ) | 34 | if( Secret_LE->text().isEmpty() ) |
28 | return tr("Pap/Chap/EAP secret id missing"); | 35 | return tr("Pap/Chap/EAP secret id missing"); |
@@ -31,55 +38,68 @@ QString PPPAuthEdit::acceptable( void ) { | |||
31 | } | 38 | } |
32 | 39 | ||
33 | bool PPPAuthEdit::commit( PPPData_t & D ) { | 40 | bool PPPAuthEdit::commit( PPPData_t & D ) { |
34 | bool SM = 0; | 41 | bool SM = 0; |
35 | 42 | ||
36 | if( ( D.Auth.Mode == 0 && ! Login_RB->isChecked() ) || | 43 | if( ( D.Auth.Mode == 0 && ! Login_RB->isChecked() ) || |
37 | ( D.Auth.Mode == 1 && ! PapChap_RB->isChecked() ) || | 44 | ( D.Auth.Mode == 1 && ! PAP_Checked() ) || |
38 | ( D.Auth.Mode == 2 && ! Terminal_RB->isChecked() ) ) { | 45 | ( D.Auth.Mode == 2 && ! Terminal_RB->isChecked() ) ) { |
39 | // mode modifed | 46 | // mode modifed |
40 | SM = 1; | 47 | SM = 1; |
41 | D.Auth.Mode = ( Login_RB->isChecked() ) ? | 48 | D.Auth.Mode = ( Login_RB->isChecked() ) ? |
42 | 0 : | 49 | 0 : |
43 | ( ( PapChap_RB->isChecked() ) ? | 50 | ( PAP_Checked() ) ? 1 : 2; |
44 | 1 : 2 ); | ||
45 | } | 51 | } |
46 | 52 | ||
47 | if( Login_RB->isChecked() ) { | 53 | if( Login_RB->isChecked() ) { |
48 | TXTM( D.Auth.Login.Expect, LoginExpect_LE, SM ); | 54 | TXTM( D.Auth.Login.Expect, LoginExpect_LE, SM ); |
49 | TXTM( D.Auth.Login.Send, LoginSend_LE, SM ); | 55 | TXTM( D.Auth.Login.Send, LoginSend_LE, SM ); |
50 | TXTM( D.Auth.Password.Expect, PasswordExpect_LE, SM ); | 56 | TXTM( D.Auth.Password.Expect, PasswordExpect_LE, SM ); |
51 | TXTM( D.Auth.Password.Send, PasswordSend_LE, SM ); | 57 | TXTM( D.Auth.Password.Send, PasswordSend_LE, SM ); |
52 | } else if( PapChap_RB->isChecked() ) { | 58 | } else if( PAP_Checked() ) { |
53 | TXTM( D.Auth.Client, Client_LE, SM ); | 59 | TXTM( D.Auth.Client, Client_LE, SM ); |
54 | TXTM( D.Auth.Server, Server_LE, SM ); | 60 | TXTM( D.Auth.Server, Server_LE, SM ); |
55 | TXTM( D.Auth.Secret, Secret_LE, SM ); | 61 | TXTM( D.Auth.Secret, Secret_LE, SM ); |
56 | CIM( D.Auth.PCEMode, AuthMethod_CB, SM ); | 62 | if( Pap_RB->isChecked() ) { |
63 | D.Auth.PCEMode = 0; | ||
64 | } else if( Chap_RB->isChecked() ) { | ||
65 | D.Auth.PCEMode = 1; | ||
66 | } else if( EAP_RB->isChecked() ) { | ||
67 | D.Auth.PCEMode = 2; | ||
68 | } | ||
57 | } | 69 | } |
58 | return SM; | 70 | return SM; |
59 | } | 71 | } |
60 | 72 | ||
61 | void PPPAuthEdit::showData( PPPData_t & D ) { | 73 | void PPPAuthEdit::showData( PPPData_t & D ) { |
62 | 74 | ||
63 | switch( D.Auth.Mode ) { | 75 | switch( D.Auth.Mode ) { |
64 | case 0 : | 76 | case 0 : |
65 | Login_RB->isChecked(); | 77 | Login_RB->setChecked( TRUE ); |
66 | break; | 78 | break; |
67 | case 1 : | 79 | case 1 : |
68 | PapChap_RB->isChecked(); | 80 | switch( D.Auth.PCEMode ) { |
81 | case 0 : | ||
82 | Pap_RB->setChecked( TRUE ); | ||
83 | break; | ||
84 | case 1 : | ||
85 | Chap_RB->setChecked( TRUE ); | ||
86 | break; | ||
87 | case 2 : | ||
88 | EAP_RB->setChecked( TRUE ); | ||
89 | break; | ||
90 | } | ||
69 | break; | 91 | break; |
70 | case 2 : | 92 | case 2 : |
71 | Terminal_RB->isChecked(); | 93 | Terminal_RB->setChecked( TRUE ); |
72 | break; | 94 | break; |
73 | } | 95 | } |
74 | 96 | ||
75 | LoginExpect_LE->setText( D.Auth.Login.Expect ); | 97 | LoginExpect_LE->setText( D.Auth.Login.Expect ); |
76 | PasswordExpect_LE->setText( D.Auth.Password.Expect ); | 98 | PasswordExpect_LE->setText( D.Auth.Password.Expect ); |
77 | LoginSend_LE->setText( D.Auth.Login.Send ); | 99 | LoginSend_LE->setText( D.Auth.Login.Send ); |
78 | PasswordSend_LE->setText( D.Auth.Password.Send ); | 100 | PasswordSend_LE->setText( D.Auth.Password.Send ); |
79 | 101 | ||
80 | Client_LE->setText( D.Auth.Client ); | 102 | Client_LE->setText( D.Auth.Client ); |
81 | Server_LE->setText( D.Auth.Server ); | 103 | Server_LE->setText( D.Auth.Server ); |
82 | Secret_LE->setText( D.Auth.Secret ); | 104 | Secret_LE->setText( D.Auth.Secret ); |
83 | |||
84 | AuthMethod_CB->setCurrentItem( D.Auth.PCEMode ); | ||
85 | } | 105 | } |