summaryrefslogtreecommitdiff
path: root/core/launcher/transferserver.h
Unidiff
Diffstat (limited to 'core/launcher/transferserver.h') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/transferserver.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/core/launcher/transferserver.h b/core/launcher/transferserver.h
index 076e460..a3bb060 100644
--- a/core/launcher/transferserver.h
+++ b/core/launcher/transferserver.h
@@ -1,10 +1,10 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
@@ -33,12 +33,26 @@ public:
33 TransferServer( Q_UINT16 port, QObject *parent = 0, const char* name = 0 ); 33 TransferServer( Q_UINT16 port, QObject *parent = 0, const char* name = 0 );
34 virtual ~TransferServer(); 34 virtual ~TransferServer();
35 35
36 void newConnection( int socket ); 36 void newConnection( int socket );
37}; 37};
38 38
39class SyncAuthentication : QObject
40{
41 Q_OBJECT
42
43public:
44 static int isAuthorized(QHostAddress peeraddress);
45 static bool checkPassword(const QString& pw);
46 static bool checkUser(const QString& user);
47
48 static QString serverId();
49 static QString loginName();
50 static QString ownerName();
51};
52
39 53
40class ServerDTP : public QSocket 54class ServerDTP : public QSocket
41{ 55{
42 Q_OBJECT 56 Q_OBJECT
43 57
44public: 58public:
@@ -62,12 +76,13 @@ public:
62 void retrieveGzipFile( const QString &fn, const QHostAddress& host, Q_UINT16 port ); 76 void retrieveGzipFile( const QString &fn, const QHostAddress& host, Q_UINT16 port );
63 void retrieveByteArray(); 77 void retrieveByteArray();
64 void retrieveByteArray( const QHostAddress& host, Q_UINT16 port ); 78 void retrieveByteArray( const QHostAddress& host, Q_UINT16 port );
65 79
66 Mode dtpMode() { return mode; } 80 Mode dtpMode() { return mode; }
67 QByteArray buffer() { return buf.buffer(); } 81 QByteArray buffer() { return buf.buffer(); }
82 QString fileName() const { return file.name(); }
68 83
69 void setSocket( int socket ); 84 void setSocket( int socket );
70 85
71signals: 86signals:
72 void completed(); 87 void completed();
73 void failed(); 88 void failed();
@@ -128,14 +143,12 @@ protected slots:
128 void dtpCompleted(); 143 void dtpCompleted();
129 void dtpFailed(); 144 void dtpFailed();
130 void dtpError( int ); 145 void dtpError( int );
131 void newConnection( int socket ); 146 void newConnection( int socket );
132 147
133protected: 148protected:
134 bool checkUser( const QString& user );
135 bool checkPassword( const QString& pw );
136 bool checkReadFile( const QString& file ); 149 bool checkReadFile( const QString& file );
137 bool checkWriteFile( const QString& file ); 150 bool checkWriteFile( const QString& file );
138 bool parsePort( const QString& pw ); 151 bool parsePort( const QString& pw );
139 bool backupRestoreGzip( const QString &file, QStringList &targets ); 152 bool backupRestoreGzip( const QString &file, QStringList &targets );
140 bool backupRestoreGzip( const QString &file ); 153 bool backupRestoreGzip( const QString &file );
141 154
@@ -161,8 +174,6 @@ private:
161 QDir directory; 174 QDir directory;
162 QByteArray waitarray; 175 QByteArray waitarray;
163 QString renameFrom; 176 QString renameFrom;
164 QString lastCommand; 177 QString lastCommand;
165 int waitsocket; 178 int waitsocket;
166}; 179};
167
168bool accessAuthorized(QHostAddress peeraddress);