Changeset 376:0d8179eea17f in SMSSender for gateways/Post/business/account_task_login.cpp


Ignore:
Timestamp:
Apr 14, 2014 1:28:38 PM (5 years ago)
Author:
Sämy Zehnder <saemy.zehnder@…>
Branch:
separation-frontend-backend
Message:
  • Separates backend and frontend code in the Post gateway.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • gateways/Post/business/account_task_login.cpp

    r315 r376  
    11/*
    22  Swiss Post gateway plugin - The smssender plugin for the Swiss Post platform.
    3   Copyright (C) 2011-2012, gorrión. See http://smssender.gorrion.ch
     3  Copyright (C) 2011-2014, gorrión. See http://smssender.gorrion.ch
    44
    55  This program is free software: you can redistribute it and/or modify
     
    1818#include "account_tasks.h"
    1919
    20 #include <exceptions/eloginaccountloginexception.h>
    21 #include <network/snetworkreply.h>
    22 
    23 #include "business/gateway.h"
    24 #include "library.h"
     20#include "common/exceptions/eloginaccountloginexception.h"
     21#include "common/network/snetworkreply.h"
     22#include "gateways/Post/business/gateway.h"
    2523
    2624namespace Post {
    2725
    2826AccountLoginTask::AccountLoginTask(Account *account)
    29     : AbstractAccountLoginTask(account)
     27    : BaseAccountLoginTask(account)
    3028{
    3129}
     
    6967}
    7068
    71 QString AccountLoginTask::postSamlRequest(QString lastHtml) {
     69QString AccountLoginTask::postSamlRequest(const QString &lastHtml) {
    7270    /* Find URL */
    73     QRegExp rx("<form method=\"post\" action=\"([^\"]+)\">");
     71    QRegExp rx("<form.*action=\"([^\"]+)\".*>");
     72    rx.setMinimal(true);
    7473    if (rx.indexIn(lastHtml) == -1) {
    7574        LoginAccount::ELoginException(LoginAccount::ELoginException::RequestError)
     
    109108}
    110109
    111 QString AccountLoginTask::postSamlResponse(QString lastHtml) {
     110QString AccountLoginTask::postSamlResponse(const QString &lastHtml) {
    112111    /*
    113112                <form id="saml_form" action="https://organizer.sso.post.ch/sso-navi/assertion_consumer.php" method="POST" enctype="application/x-www-form-urlencoded">
     
    117116    */
    118117    /* Find URL */
    119     QRegExp rx("<form id=\"saml_form\" action=\"([^\"]+)\"");
     118    QRegExp rx("<form.*action=\"([^\"]+)\".*");
     119    rx.setMinimal(true);
    120120    if (rx.indexIn(lastHtml) == -1) {
    121121        LoginAccount::ELoginException(LoginAccount::ELoginException::RequestError)
     
    157157
    158158Account* AccountLoginTask::account() const {
    159     return static_cast<Account*>(AbstractAccountLoginTask::account());
     159    return static_cast<Account*>(BaseAccountLoginTask::account());
    160160}
    161161
Note: See TracChangeset for help on using the changeset viewer.