void LoginDialog::canContinue() { PMSettings *pmsettings = new PMSettings(); if (pmsettings->getAttributeSettings("autologin") == "true") { LhcWebServiceClient *lhwsc = LhcWebServiceClient::instance(); QString host = ui.HostEdit->text().replace(QString("index.php"), QString("")); QHttp::ConnectionMode mode; if (host.indexOf("https://") != -1){ mode = QHttp::ConnectionModeHttps; host = host.replace(QString("https://"),QString("")); } else { mode = QHttp::ConnectionModeHttp; host = host.replace(QString("http://"),QString("")); } if (!host.endsWith("/")){ host += "/"; } lhwsc->setFetchURL(host,mode); delete pmsettings; QStringList filter; filter.append("username="******"password="******"/xml/checklogin/",(QObject*) this, LoginDialog::LoginCheckedCallback); } }
void ChatRoomsWindow::synschronize() { LhcWebServiceClient *lhwsc = LhcWebServiceClient::instance(); lhwsc->LhcSendRequest("/xml/lists/",(QObject*) this, ChatRoomsWindow::receivedDataCallback); }
void LHQTableWidget::setQuery(QString query) { LhcWebServiceClient *lhwsc =LhcWebServiceClient::instance(); lhwsc->LhcSendRequest(query,(QObject*) this, LHQTableWidget::resultCallback); };
void LoginDialog::on_okButton_clicked() { lgUserName = ui.UsernameEdit->text(); if (!lgUserName.isEmpty()) { lgUserPassword = ui.PasswordEdit->text(); if (!lgUserPassword.isEmpty()) { QString host = ui.HostEdit->text().replace(QString("index.php"), QString("")); QHttp::ConnectionMode mode; if (host.indexOf("https://") != -1){ mode = QHttp::ConnectionModeHttps; host = host.replace(QString("https://"),QString("")); } else { mode = QHttp::ConnectionModeHttp; host = host.replace(QString("http://"),QString("")); } if (!host.endsWith("/")){ host += "/"; } if (!host.isEmpty()) { PMSettings *pmsettings = new PMSettings(); if (ui.RememberLoginsChk->isChecked()){ pmsettings->setAttribute("username",lgUserName); pmsettings->setAttribute("password",lgUserPassword); pmsettings->setAttribute("remember","true"); } else { pmsettings->setAttribute("username",""); pmsettings->setAttribute("password",""); pmsettings->setAttribute("remember","false"); } pmsettings->setAttribute("host", (mode == QHttp::ConnectionModeHttp ? "http://" : "https://")+host); if (ui.AutoLogincheckBox->isChecked()) pmsettings->setAttribute("autologin","true"); else pmsettings->setAttribute("autologin","false"); pmsettings->sync(); delete pmsettings; LhcWebServiceClient *lhwsc = LhcWebServiceClient::instance(); lhwsc->setFetchURL(host,mode); QStringList filter; filter.append("username="******"password="******"/xml/checklogin/",(QObject*) this, LoginDialog::LoginCheckedCallback); }else { QMessageBox::warning(this, tr("Warning"), tr("The host field is empty!"), tr("&OK"), QString::null , 0, 0, 1); ui.HostEdit->setFocus(); } }else { QMessageBox::warning(this, tr("Warning"), tr("The password field is empty!"), tr("&OK"), QString::null , 0, 0, 1); ui.PasswordEdit->setFocus(); } } else { QMessageBox::warning(this, tr("Warning"), tr("The username field is empty!"), tr("&OK"), QString::null , 0, 0, 1); ui.UsernameEdit->setFocus(); } }