add debugging to check before disrbute
This commit is contained in:
parent
a887f5c211
commit
f3d6ec7059
7 changed files with 26 additions and 8 deletions
|
@ -10,7 +10,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||||
TARGET = jceGrade
|
TARGET = jceGrade
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
RC_FILE = appConfigure.rc
|
RC_FILE = appConfigure.rc
|
||||||
CONFIG += c++11 static
|
CONFIG += c++11 static console
|
||||||
|
|
||||||
SOURCES += main/coursestablemanager.cpp \
|
SOURCES += main/coursestablemanager.cpp \
|
||||||
main/loginhandler.cpp \
|
main/loginhandler.cpp \
|
||||||
|
|
|
@ -46,6 +46,7 @@ bool loginHandler::makeConnection()
|
||||||
}
|
}
|
||||||
else if (a == jceLogin::ERROR_ON_VALIDATION_USER_BLOCKED)
|
else if (a == jceLogin::ERROR_ON_VALIDATION_USER_BLOCKED)
|
||||||
{
|
{
|
||||||
|
std::cout << "error!!!!!!" << (jceLog->getPage()) << std::endl;
|
||||||
popMessage("You were blocked, please wait couple of minutes or contact JCE");
|
popMessage("You were blocked, please wait couple of minutes or contact JCE");
|
||||||
jceLog->closeAll();
|
jceLog->closeAll();
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,6 @@ MainScreen::MainScreen(QWidget *parent) :QMainWindow(parent), ui(new Ui::MainScr
|
||||||
|
|
||||||
|
|
||||||
updateDates();
|
updateDates();
|
||||||
std::cout << "hello world" << std::endl;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,6 +165,8 @@ void MainScreen::uiSetDisconnectMode()
|
||||||
|
|
||||||
void MainScreen::uiSetConnectMode()
|
void MainScreen::uiSetConnectMode()
|
||||||
{
|
{
|
||||||
|
std::string page;
|
||||||
|
|
||||||
if (this->jceLog != NULL)
|
if (this->jceLog != NULL)
|
||||||
delete jceLog;
|
delete jceLog;
|
||||||
|
|
||||||
|
@ -188,12 +189,19 @@ void MainScreen::uiSetConnectMode()
|
||||||
userLoginSetting->setPassword(password);
|
userLoginSetting->setPassword(password);
|
||||||
|
|
||||||
this->repaint();
|
this->repaint();
|
||||||
|
page = "connecting with username ";
|
||||||
|
page = username;
|
||||||
|
page += "and password: ";
|
||||||
|
page += password;
|
||||||
|
ui->textEdit->setText(ui->textEdit->toPlainText() + QString::fromStdString(page));
|
||||||
|
|
||||||
jceLog = new jceLogin(userLoginSetting);
|
jceLog = new jceLogin(userLoginSetting);
|
||||||
this->loginHandel = new loginHandler(jceLog,statusLabel,ui->pswdLineEdit,ui->usrnmLineEdit);
|
this->loginHandel = new loginHandler(jceLog,statusLabel,ui->pswdLineEdit,ui->usrnmLineEdit);
|
||||||
|
|
||||||
if (loginHandel->makeConnection() == true)
|
if (loginHandel->makeConnection() == true)
|
||||||
{
|
{
|
||||||
|
page = this->jceLog->getPage();
|
||||||
|
ui->textEdit->setText(ui->textEdit->toPlainText() + QString::fromStdString(page));
|
||||||
setLabelConnectionStatus(jceLogin::jceStatus::JCE_YOU_ARE_IN);
|
setLabelConnectionStatus(jceLogin::jceStatus::JCE_YOU_ARE_IN);
|
||||||
ui->loginButton->setText("&Logout");
|
ui->loginButton->setText("&Logout");
|
||||||
this->ui->ratesButton->setEnabled(true);
|
this->ui->ratesButton->setEnabled(true);
|
||||||
|
|
|
@ -299,6 +299,9 @@ font-size: 15px;
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QTextEdit" name="textEdit"/>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="CoursesTab">
|
<widget class="QWidget" name="CoursesTab">
|
||||||
|
|
|
@ -17,8 +17,9 @@ bool qtsslsocket::isCon()
|
||||||
|
|
||||||
bool qtsslsocket::send(std::string str)
|
bool qtsslsocket::send(std::string str)
|
||||||
{
|
{
|
||||||
bool flag = true;
|
bool flag = isCon();
|
||||||
this->socket->write(str.c_str());
|
if (flag)
|
||||||
|
this->socket->write(str.c_str());
|
||||||
|
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#define milisTimeOut 3000
|
#define milisTimeOut 5000
|
||||||
|
|
||||||
class qtsslsocket : public QObject
|
class qtsslsocket : public QObject
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,19 +21,24 @@ jceLogin::~jceLogin()
|
||||||
*/
|
*/
|
||||||
void jceLogin::makeConnection() throw (jceStatus)
|
void jceLogin::makeConnection() throw (jceStatus)
|
||||||
{
|
{
|
||||||
jceStatus status;
|
jceStatus status = jceStatus::JCE_NOT_CONNECTED;
|
||||||
|
|
||||||
if (checkConnection() == true) //connected to host
|
if (checkConnection() == true) //connected to host
|
||||||
{
|
{
|
||||||
if (makeFirstVisit() == true) //requst and send first validation
|
if (makeFirstVisit() == true) //requst and send first validation
|
||||||
{
|
{
|
||||||
|
std::cout << "visit 1\n";
|
||||||
|
std::cout << *(this->recieverPage);
|
||||||
status = jceStatus::JCE_FIRST_VALIDATION_PASSED;
|
status = jceStatus::JCE_FIRST_VALIDATION_PASSED;
|
||||||
if (checkValidation() == true) //check if username and password are matching
|
if (checkValidation() == true) //check if username and password are matching
|
||||||
{
|
{
|
||||||
|
std::cout << "visit 2\n";
|
||||||
|
std::cout << *(this->recieverPage);
|
||||||
status = jceStatus::JCE_SECOND_VALIDATION_PASSED;
|
status = jceStatus::JCE_SECOND_VALIDATION_PASSED;
|
||||||
if (makeSecondVisit() == true) //siging in the website
|
if (makeSecondVisit() == true) //siging in the website
|
||||||
{
|
{
|
||||||
|
std::cout << "visit 3\n";
|
||||||
|
std::cout << *(this->recieverPage);
|
||||||
status = jceStatus::JCE_YOU_ARE_IN;
|
status = jceStatus::JCE_YOU_ARE_IN;
|
||||||
setLoginFlag(true);
|
setLoginFlag(true);
|
||||||
}
|
}
|
||||||
|
@ -91,7 +96,6 @@ int jceLogin::makeFirstVisit()
|
||||||
{
|
{
|
||||||
std::string usr = jceA->getUsername();
|
std::string usr = jceA->getUsername();
|
||||||
std::string psw = jceA->getPassword();
|
std::string psw = jceA->getPassword();
|
||||||
|
|
||||||
if (JceConnector->send(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getFirstValidationStep(*jceA))))
|
if (JceConnector->send(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getFirstValidationStep(*jceA))))
|
||||||
{
|
{
|
||||||
if (!JceConnector->recieve(*recieverPage))
|
if (!JceConnector->recieve(*recieverPage))
|
||||||
|
@ -157,6 +161,7 @@ std::string jceLogin::getPage()
|
||||||
bool jceLogin::checkValidation()
|
bool jceLogin::checkValidation()
|
||||||
{
|
{
|
||||||
//finds the hashed password
|
//finds the hashed password
|
||||||
|
std::cout << *recieverPage << std::endl;
|
||||||
|
|
||||||
std::size_t hasspass_position1 = recieverPage->find("-A,-N");
|
std::size_t hasspass_position1 = recieverPage->find("-A,-N");
|
||||||
hasspass_position1 += 5;
|
hasspass_position1 += 5;
|
||||||
|
|
Loading…
Reference in a new issue