diff --git a/jceGrade.pro b/jceGrade.pro
index f9bd75e..d7d2946 100644
--- a/jceGrade.pro
+++ b/jceGrade.pro
@@ -10,7 +10,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = jceGrade
TEMPLATE = app
RC_FILE = appConfigure.rc
-CONFIG += c++11 static
+CONFIG += c++11 static console
SOURCES += main/coursestablemanager.cpp \
main/loginhandler.cpp \
diff --git a/main/loginhandler.cpp b/main/loginhandler.cpp
index 4b2d736..a7531b6 100644
--- a/main/loginhandler.cpp
+++ b/main/loginhandler.cpp
@@ -46,6 +46,7 @@ bool loginHandler::makeConnection()
}
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");
jceLog->closeAll();
diff --git a/main/mainscreen.cpp b/main/mainscreen.cpp
index a79d9f7..803fad7 100644
--- a/main/mainscreen.cpp
+++ b/main/mainscreen.cpp
@@ -34,7 +34,6 @@ MainScreen::MainScreen(QWidget *parent) :QMainWindow(parent), ui(new Ui::MainScr
updateDates();
- std::cout << "hello world" << std::endl;
}
@@ -166,6 +165,8 @@ void MainScreen::uiSetDisconnectMode()
void MainScreen::uiSetConnectMode()
{
+ std::string page;
+
if (this->jceLog != NULL)
delete jceLog;
@@ -188,12 +189,19 @@ void MainScreen::uiSetConnectMode()
userLoginSetting->setPassword(password);
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);
this->loginHandel = new loginHandler(jceLog,statusLabel,ui->pswdLineEdit,ui->usrnmLineEdit);
if (loginHandel->makeConnection() == true)
{
+ page = this->jceLog->getPage();
+ ui->textEdit->setText(ui->textEdit->toPlainText() + QString::fromStdString(page));
setLabelConnectionStatus(jceLogin::jceStatus::JCE_YOU_ARE_IN);
ui->loginButton->setText("&Logout");
this->ui->ratesButton->setEnabled(true);
diff --git a/main/mainscreen.ui b/main/mainscreen.ui
index da52fb8..3c4e301 100644
--- a/main/mainscreen.ui
+++ b/main/mainscreen.ui
@@ -299,6 +299,9 @@ font-size: 15px;
+ -
+
+
diff --git a/src/connection/qtsslsocket.cpp b/src/connection/qtsslsocket.cpp
index db8bb29..ad8cd96 100644
--- a/src/connection/qtsslsocket.cpp
+++ b/src/connection/qtsslsocket.cpp
@@ -17,8 +17,9 @@ bool qtsslsocket::isCon()
bool qtsslsocket::send(std::string str)
{
- bool flag = true;
- this->socket->write(str.c_str());
+ bool flag = isCon();
+ if (flag)
+ this->socket->write(str.c_str());
return flag;
}
diff --git a/src/connection/qtsslsocket.h b/src/connection/qtsslsocket.h
index 35236ea..d0dadce 100644
--- a/src/connection/qtsslsocket.h
+++ b/src/connection/qtsslsocket.h
@@ -7,7 +7,7 @@
#include
#include
#include
-#define milisTimeOut 3000
+#define milisTimeOut 5000
class qtsslsocket : public QObject
{
diff --git a/src/jce/jcelogin.cpp b/src/jce/jcelogin.cpp
index 7833023..dd559be 100644
--- a/src/jce/jcelogin.cpp
+++ b/src/jce/jcelogin.cpp
@@ -21,19 +21,24 @@ jceLogin::~jceLogin()
*/
void jceLogin::makeConnection() throw (jceStatus)
{
- jceStatus status;
+ jceStatus status = jceStatus::JCE_NOT_CONNECTED;
if (checkConnection() == true) //connected to host
{
if (makeFirstVisit() == true) //requst and send first validation
{
-
+ std::cout << "visit 1\n";
+ std::cout << *(this->recieverPage);
status = jceStatus::JCE_FIRST_VALIDATION_PASSED;
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;
if (makeSecondVisit() == true) //siging in the website
{
+ std::cout << "visit 3\n";
+ std::cout << *(this->recieverPage);
status = jceStatus::JCE_YOU_ARE_IN;
setLoginFlag(true);
}
@@ -91,7 +96,6 @@ int jceLogin::makeFirstVisit()
{
std::string usr = jceA->getUsername();
std::string psw = jceA->getPassword();
-
if (JceConnector->send(jceLoginHtmlScripts::makeRequest(jceLoginHtmlScripts::getFirstValidationStep(*jceA))))
{
if (!JceConnector->recieve(*recieverPage))
@@ -157,6 +161,7 @@ std::string jceLogin::getPage()
bool jceLogin::checkValidation()
{
//finds the hashed password
+ std::cout << *recieverPage << std::endl;
std::size_t hasspass_position1 = recieverPage->find("-A,-N");
hasspass_position1 += 5;