fixed interactions between webui and jsonapi in GUI

This commit is contained in:
csoler 2019-11-16 18:19:07 +01:00
parent 6878a7773d
commit 9491f1a78e
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
10 changed files with 94 additions and 27 deletions

View file

@ -31,6 +31,7 @@
#include "util/rsthreads.h"
#include "util/rsdebug.h"
#include "retroshare/rswebui.h"
#include "retroshare/rsjsonapi.h"
#define TEXT_HTML 0
#define TEXT_CSS 1
@ -139,3 +140,12 @@ int p3WebUI::status() const
return WEBUI_STATUS_NOT_RUNNING;
}
void p3WebUI::setUserPassword(const std::string& passwd)
{
#ifdef RS_JSONAPI
if(!rsJsonAPI->authorizeUser("webui",passwd))
std::cerr << "(EE) Cannot register webui token. Some error occurred when calling authorizeUser()" << std::endl;
#else
std::cerr << "(EE) JsonAPI is not available in this buildof Retroshare! Cannot register a user password for the WebUI" << std::endl;
#endif
}