Welcome to mirror list, hosted at ThFree Co, Russian Federation.

remotewipe.h « gui « src - github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b1353e8646c9717fceac32b7497c6a466ec192d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef REMOTEWIPE_H
#define REMOTEWIPE_H

#include "accountmanager.h"
#include <QNetworkAccessManager>

class QJsonDocument;
class TestRemoteWipe;

namespace OCC {

class RemoteWipe : public QObject
{
    Q_OBJECT
public:
    explicit RemoteWipe(AccountPtr account, QObject *parent = nullptr);

signals:
    /**
     * Notify if wipe was requested
     */
    void authorized(AccountState*);

    /**
     * Notify if user only needs to login again
     */
    void askUserCredentials();

public slots:
    /**
     * Once receives a 401 or 403 status response it will do a fetch to
     * <server>/index.php/core/wipe/check
     */
    void startCheckJobWithAppPassword(QString);

private slots:
    /**
     * If wipe is requested, delete account and data, if not continue by asking
     * the user to login again
     */
    void checkJobSlot();

    /**
     * Once the client has wiped all the required data a POST to
     * <server>/index.php/core/wipe/success
     */
    void notifyServerSuccessJob(AccountState *accountState, bool);
    void notifyServerSuccessJobSlot();

private:
    AccountPtr _account;
    QString _appPassword;
    bool _accountRemoved;
    QNetworkAccessManager _networkManager;
    QNetworkReply *_networkReplyCheck;
    QNetworkReply *_networkReplySuccess;

    friend class ::TestRemoteWipe;
};
}
#endif // REMOTEWIPE_H