summaryrefslogtreecommitdiff
path: root/core/launcher/transferserver.h
Unidiff
Diffstat (limited to 'core/launcher/transferserver.h') (more/less context) (ignore 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,8 +1,8 @@
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
@@ -35,8 +35,22 @@ public:
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
@@ -64,8 +78,9 @@ public:
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:
@@ -130,10 +145,8 @@ protected slots:
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 );
@@ -163,6 +176,4 @@ private:
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);