summaryrefslogtreecommitdiffstats
path: root/qt-ui/subsurfacewebservices.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-22 11:10:40 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-22 11:10:40 -0700
commitce008f52db2359e042dc54d663b5d37fea6f98c3 (patch)
tree2c41e2f9d73875f8c7f9e879faa89e87bfd9401d /qt-ui/subsurfacewebservices.cpp
parent3ba3de8dafcd6478c762f172ec8c54a77a13c7f6 (diff)
downloadsubsurface-ce008f52db2359e042dc54d663b5d37fea6f98c3.tar.gz
Cloud storage: enable password update
This now allows the user to set a new password for the cloud service. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/subsurfacewebservices.cpp')
-rw-r--r--qt-ui/subsurfacewebservices.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index fd9f2fad1..875b8e65c 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -988,13 +988,17 @@ CloudStorageAuthenticate::CloudStorageAuthenticate(QObject *parent) :
#define CLOUDURL QString(prefs.cloud_base_url)
#define CLOUDBACKENDSTORAGE CLOUDURL + "/storage"
#define CLOUDBACKENDVERIFY CLOUDURL + "/verify"
+#define CLOUDBACKENDUPDATE CLOUDURL + "/update"
-QNetworkReply* CloudStorageAuthenticate::authenticate(QString email, QString password, QString pin)
+QNetworkReply* CloudStorageAuthenticate::backend(QString email, QString password, QString pin, QString newpasswd)
{
QString payload(email + " " + password);
QUrl requestUrl;
- if (pin == "") {
+ if (pin == "" && newpasswd == "") {
requestUrl = QUrl(CLOUDBACKENDSTORAGE);
+ } else if (newpasswd != "") {
+ requestUrl = QUrl(CLOUDBACKENDUPDATE);
+ payload += " " + newpasswd;
} else {
requestUrl = QUrl(CLOUDBACKENDVERIFY);
payload += " " + pin;