author | tille <tille> | 2003-06-03 14:08:04 (UTC) |
---|---|---|
committer | tille <tille> | 2003-06-03 14:08:04 (UTC) |
commit | 60d9f66d2b31c659ac652c15423ecaca89a5f312 (patch) (unidiff) | |
tree | bfda269b58eb1c72893057d9d7fae5a6a2e45abc /noncore/settings/networksettings/ppp/interfaceppp.cpp | |
parent | aaf7709f64dda5a6cb81eeb96e421ba4189654d6 (diff) | |
download | opie-60d9f66d2b31c659ac652c15423ecaca89a5f312.zip opie-60d9f66d2b31c659ac652c15423ecaca89a5f312.tar.gz opie-60d9f66d2b31c659ac652c15423ecaca89a5f312.tar.bz2 |
authentication (except when passwd not stored)
and minor things
Diffstat (limited to 'noncore/settings/networksettings/ppp/interfaceppp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/interfaceppp.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/noncore/settings/networksettings/ppp/interfaceppp.cpp b/noncore/settings/networksettings/ppp/interfaceppp.cpp index dc24824..98bb4da 100644 --- a/noncore/settings/networksettings/ppp/interfaceppp.cpp +++ b/noncore/settings/networksettings/ppp/interfaceppp.cpp | |||
@@ -24,118 +24,117 @@ PPPData* InterfacePPP::data() | |||
24 | _dataPtr->setAccount( getHardwareName() ); | 24 | _dataPtr->setAccount( getHardwareName() ); |
25 | } | 25 | } |
26 | return _dataPtr; | 26 | return _dataPtr; |
27 | } | 27 | } |
28 | 28 | ||
29 | Modem* InterfacePPP::modem() | 29 | Modem* InterfacePPP::modem() |
30 | { | 30 | { |
31 | if (!_modemPtr){ | 31 | if (!_modemPtr){ |
32 | qDebug("creating new modem obj"); | 32 | qDebug("creating new modem obj"); |
33 | _modemPtr = new Modem( data() ); | 33 | _modemPtr = new Modem( data() ); |
34 | } | 34 | } |
35 | return _modemPtr; | 35 | return _modemPtr; |
36 | } | 36 | } |
37 | 37 | ||
38 | bool InterfacePPP::refresh() | 38 | bool InterfacePPP::refresh() |
39 | { | 39 | { |
40 | qDebug("InterfacePPP::refresh()"); | 40 | qDebug("InterfacePPP::refresh()"); |
41 | QMessageBox::information(0,"Not Implemented","This feature is not yet implemneted... ;-("); | 41 | QMessageBox::information(0,"Not Implemented","This feature is not yet implemneted... ;-("); |
42 | return false; | 42 | return false; |
43 | } | 43 | } |
44 | 44 | ||
45 | void InterfacePPP::start() | 45 | void InterfacePPP::start() |
46 | { | 46 | { |
47 | qDebug("InterfacePPP::start"); | 47 | qDebug("InterfacePPP::start"); |
48 | if (data()->storedPassword() != "" ){ | 48 | if (data()->password().isEmpty() ){ |
49 | data()->setPassword(data()->storedPassword()); | 49 | //FIXME: ask for password |
50 | }else{ | ||
51 | //FIXME: | ||
52 | qDebug("using dummy password"); | 50 | qDebug("using dummy password"); |
53 | data()->setPassword( "dummy" ); | 51 | QMessageBox::critical( 0, "no password", "you should be prompted for a password, but you are not! ;-)"); |
54 | } | 52 | } |
55 | 53 | ||
56 | 54 | ||
57 | QFileInfo info(pppdPath()); | 55 | QFileInfo info(pppdPath()); |
58 | 56 | ||
59 | if(!info.exists()){ | 57 | if(!info.exists()){ |
60 | QMessageBox::warning(0, tr("Error"), | 58 | QMessageBox::warning(0, tr("Error"), |
61 | i18n("<qt>Cannot find the PPP daemon!<br>" | 59 | i18n("<qt>Cannot find the PPP daemon!<br>" |
62 | "Make sure that pppd is installed and " | 60 | "Make sure that pppd is installed and " |
63 | "that you have entered the correct path.</qt>")); | 61 | "that you have entered the correct path.</qt>")); |
64 | return; | 62 | return; |
65 | } | 63 | } |
66 | //#if 0 | 64 | //#if 0 |
67 | if(!info.isExecutable()){ | 65 | if(!info.isExecutable()){ |
68 | 66 | ||
69 | QString string; | 67 | QString string; |
70 | string = i18n( "<qt>Cannot execute:<br> %1<br>" | 68 | string = i18n( "<qt>Cannot execute:<br> %1<br>" |
71 | "Please make sure that you have given " | 69 | "Please make sure that you have given " |
72 | "setuid permission and that " | 70 | "setuid permission and that " |
73 | "pppd is executable.<br>").arg(pppdPath()); | 71 | "pppd is executable.<br>").arg(pppdPath()); |
74 | QMessageBox::warning(0, tr("Error"), string); | 72 | QMessageBox::warning(0, tr("Error"), string); |
75 | return; | 73 | return; |
76 | 74 | ||
77 | } | 75 | } |
78 | //#endif | 76 | //#endif |
79 | 77 | ||
80 | QFileInfo info2(data()->modemDevice()); | 78 | QFileInfo info2(data()->modemDevice()); |
81 | 79 | ||
82 | if(!info2.exists()){ | 80 | if(!info2.exists()){ |
83 | QString string; | 81 | QString string; |
84 | string = i18n( "<qt>Cannot find:<br> %1<br>" | 82 | string = i18n( "<qt>Cannot find:<br> %1<br>" |
85 | "Please make sure you have setup " | 83 | "Please make sure you have setup " |
86 | "your modem device properly " | 84 | "your modem device properly " |
87 | "and/or adjust the location of the modem device on " | 85 | "and/or adjust the location of the modem device on " |
88 | "the modem tab of " | 86 | "the modem tab of " |
89 | "the setup dialog.</qt>").arg(data()->modemDevice()); | 87 | "the setup dialog.</qt>").arg(data()->modemDevice()); |
90 | QMessageBox::warning(0, tr("Error"), string); | 88 | QMessageBox::warning(0, tr("Error"), string); |
91 | return; | 89 | return; |
92 | } | 90 | } |
93 | 91 | ||
94 | // if this is a PAP or CHAP account, ensure that username is | 92 | // if this is a PAP or CHAP account, ensure that username is |
95 | // supplied | 93 | // supplied |
96 | if(data()->authMethod() == AUTH_PAP || | 94 | if(data()->authMethod() == AUTH_PAP || |
97 | data()->authMethod() == AUTH_CHAP || | 95 | data()->authMethod() == AUTH_CHAP || |
98 | data()->authMethod() == AUTH_PAPCHAP ) { | 96 | data()->authMethod() == AUTH_PAPCHAP ) { |
99 | if(false){ //ID_Edit->text().isEmpty()) { | 97 | if(false){ //FIXME: ID_Edit->text().isEmpty()) { |
100 | QMessageBox::warning(0,tr("Error"), | 98 | QMessageBox::warning(0,tr("Error"), |
101 | i18n("<qt>You have selected the authentication method PAP or CHAP. This requires that you supply a username and a password!</qt>")); | 99 | i18n("<qt>You have selected the authentication method PAP or CHAP. This requires that you supply a username and a password!</qt>")); |
102 | // FIXME: return; | 100 | // FIXME: return; |
103 | } else { | 101 | } else { |
104 | if(!modem()->setSecret(data()->authMethod(), | 102 | if(!modem()->setSecret(data()->authMethod(), |
105 | PPPData::encodeWord(data()->storedUsername()), | 103 | PPPData::encodeWord(data()->storedUsername()), |
106 | PPPData::encodeWord(data()->password())) | 104 | PPPData::encodeWord(data()->password())) |
107 | ) { | 105 | ) { |
108 | QString s; | 106 | QString s; |
109 | s = i18n("<qt>Cannot create PAP/CHAP authentication<br>" | 107 | s = i18n("<qt>Cannot create PAP/CHAP authentication<br>" |
110 | "file \"%1\"</qt>").arg(PAP_AUTH_FILE); | 108 | "file \"%1\"</qt>").arg(PAP_AUTH_FILE); |
111 | QMessageBox::warning(0, tr("Error"), s); | 109 | QMessageBox::warning(0, tr("Error"), s); |
112 | return; | 110 | return; |
113 | } | 111 | } |
114 | } | 112 | } |
115 | } | 113 | } |
116 | 114 | ||
117 | if (data()->phonenumber().isEmpty()) { | 115 | if (data()->phonenumber().isEmpty()) { |
118 | QString s = i18n("You must specify a telephone number!"); | 116 | QString s = i18n("You must specify a telephone number!"); |
119 | QMessageBox::warning(0, tr("Error"), s); | 117 | QMessageBox::warning(0, tr("Error"), s); |
120 | return; | 118 | return; |
121 | } | 119 | } |
122 | 120 | ||
123 | // this->hide(); | 121 | // SEGFAULTS: |
124 | 122 | // setStatus( true ); | |
125 | QString tit = i18n("Connecting to: %1").arg(data()->accname()); | 123 | // emit updateInterface((Interface*) this); |
126 | // con->setCaption(tit); | ||
127 | |||
128 | // con->show(); | ||
129 | |||
130 | 124 | ||
131 | emit begin_connect(); | 125 | emit begin_connect(); |
132 | 126 | ||
133 | qDebug("InterfacePPP::start END"); | 127 | qDebug("InterfacePPP::start END"); |
134 | } | 128 | } |
135 | 129 | ||
136 | void InterfacePPP::stop() | 130 | void InterfacePPP::stop() |
137 | { | 131 | { |
138 | qDebug("InterfacePPP::stop"); | 132 | qDebug("InterfacePPP::stop"); |
139 | 133 | ||
140 | } | 134 | } |
141 | 135 | ||
136 | void InterfacePPP::save() | ||
137 | { | ||
138 | data()->save(); | ||
139 | emit updateInterface((Interface*) this); | ||
140 | } | ||