Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
domain is sent to server during registration
Signed-off-by: Pekka Lundstrom <pekka.lundstrom@jollamobile.com>
  • Loading branch information
Pekka Lundstrom committed Jan 16, 2013
1 parent f4c46c8 commit b7d8734
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions libssu/ssu.cpp
Expand Up @@ -474,15 +474,14 @@ void Ssu::sendRegistration(QString usernameDomain, QString password){
errorFlag = false;

QString ssuCaCertificate, ssuRegisterUrl;
QString username, domain;
QString username, domainName;

// Username can include also domain, (user@domain), separate those
if (usernameDomain.contains('@')) {
// separate domain/username and set domain
username = usernameDomain.section('@', 0, 0);
domain = usernameDomain.section('@', 1, 1);
setDomain(domain);
qDebug() << "got username:" << username << "at domain:" << domain;
domainName = usernameDomain.section('@', 1, 1);
setDomain(domainName);
} else {
// No domain defined
username = usernameDomain;
Expand Down Expand Up @@ -529,8 +528,13 @@ void Ssu::sendRegistration(QString usernameDomain, QString password){
QUrl form;
form.addQueryItem("protocolVersion", SSU_PROTOCOL_VERSION);
form.addQueryItem("deviceModel", deviceModel());
if (!domain().isEmpty()){
form.addQueryItem("domain", domain());
}

qDebug() << "Sending request to " << request.url();
qDebug() << form.encodedQueryItems();

QNetworkReply *reply;

pendingRequests++;
Expand All @@ -541,8 +545,8 @@ void Ssu::sendRegistration(QString usernameDomain, QString password){
if (!homeUrl.isEmpty()){
// clear header, the other request bits are reusable
request.setHeader(QNetworkRequest::ContentTypeHeader, 0);
qDebug() << "sending request to " << homeUrl;
request.setUrl(homeUrl + "/authorized_keys");
qDebug() << "sending request to " << request.url();
pendingRequests++;
manager->get(request);
}
Expand Down Expand Up @@ -704,9 +708,6 @@ void Ssu::updateCredentials(bool force){
qDebug() << request.url();
request.setSslConfiguration(sslConfiguration);

QUrl form;
form.addQueryItem("protocolVersion", SSU_PROTOCOL_VERSION);

pendingRequests++;
manager->get(request);
}
Expand Down

0 comments on commit b7d8734

Please sign in to comment.