-rw-r--r-- | core/launcher/qcopbridge.cpp | 2 | ||||
-rw-r--r-- | core/launcher/qcopbridge.h | 3 | ||||
-rw-r--r-- | core/launcher/transferserver.cpp | 28 |
3 files changed, 26 insertions, 7 deletions
diff --git a/core/launcher/qcopbridge.cpp b/core/launcher/qcopbridge.cpp index b45f0cc..9bca360 100644 --- a/core/launcher/qcopbridge.cpp +++ b/core/launcher/qcopbridge.cpp @@ -160,17 +160,17 @@ void QCopBridge::desktopMessage( const QCString &command, const QByteArray &data if ( m_mode & Qtopia1_7 ) { // send the command to all open connections QCopBridgePI *pi; for ( pi = openConnections.first(); pi != 0; pi = openConnections.next() ) { pi->sendDesktopMessage( command, data ); } } - if ( m_mode & Sharp ) + if ( ( m_mode & Sharp ) || (m_mode & IntelliSync) ) sendDesktopMessageOld( command, data ); } #ifndef OPIE_NO_OLD_SYNC_CODE /* * Old compat mode */ void QCopBridge::sendDesktopMessageOld( const QCString& command, const QByteArray& args) { diff --git a/core/launcher/qcopbridge.h b/core/launcher/qcopbridge.h index 9483d9d..d5988cd 100644 --- a/core/launcher/qcopbridge.h +++ b/core/launcher/qcopbridge.h @@ -32,17 +32,18 @@ class QCopBridgePI; class QCopChannel; class QTimer; class QCopBridge : public QServerSocket { Q_OBJECT public: - enum Mode { Qtopia1_7= 0x01, Sharp = 0x02, Both = Qtopia1_7 | Sharp }; + /* can not or anymore :) */ + enum Mode { Qtopia1_7= 0x01, Sharp = 0x02, IntelliSync = 0x04 }; QCopBridge( Q_UINT16 port, QObject *parent = 0, const char* name = 0 ); virtual ~QCopBridge(); void newConnection( int socket ); void closeOpenConnections(); void authorizeConnections(); public slots: diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp index 9cb9d7a..8367a62 100644 --- a/core/launcher/transferserver.cpp +++ b/core/launcher/transferserver.cpp @@ -189,25 +189,43 @@ bool SyncAuthentication::checkPassword( const QString& password ) return TRUE; #endif static int lastdenial=0; static int denials=0; int now = time(0); Config cfg("Security"); - cfg.setGroup("Sync"); - QString syncapp = cfg.readEntry("syncapp","Qtopia"); + cfg.setGroup("SyncMode"); + int mode = cfg.readNumEntry("Mode", 0x02 ); - //No password needed if the user really wants it - if (syncapp == "IntelliSync") { + //No pass word needed if the user really needs it + if (mode & 0x04) { + QMessageBox unauth( + tr("Sync Connection"), + tr("<qt><p>An unauthorized system is requesting access to this device." + "<p>You chose IntelliSync so you may I allow or deny this connection.</qt>" ), + QMessageBox::Warning, + QMessageBox::Ok, QMessageBox::Cancel|QMessageBox::Default, QMessageBox::NoButton, + 0, QString::null, TRUE, WStyle_StaysOnTop); + unauth.setButtonText(QMessageBox::Ok, tr("Allow" ) ); + unauth.setButtonText(QMessageBox::Cancel, tr("Deny")); + switch( unauth.exec() ) { + case QMessageBox::Ok: return TRUE; + break; + case QMessageBox::Cancel: + default: + denials++; + lastdenial=now; + return FALSE; + } } - // Detect old Qtopia Desktop (no password) + // Detect old Qtopia Desktop (no password) and fail if ( password.isEmpty() ) { if ( denials < 3 || now > lastdenial+600 ) { QMessageBox unauth( tr("Sync Connection"), tr("<p>An unauthorized system is requesting access to this device." "<p>If you are using a version of Qtopia Desktop older than 1.5.1, " "please upgrade or change the security setting to use IntelliSync." ), QMessageBox::Warning, |