int main(void) { Login user; user.RegistrationPage(); return 0; }
void Manager::on_pushButton_logout_clicked() { this->hide(); Login *login = new Login(); login->show(); return; }
bool FormBaseModel::loginUser(Login& login, User& user, LoginState state) { if (!user.isValid()) return false; if (user.status() == User::Disabled) { setValidation (LoginNameField, WValidator::Result(WValidator::Invalid, WString::tr("Wt.Auth.account-disabled"))); login.login(user, DisabledLogin); return false; } else if (baseAuth()->emailVerificationRequired() && user.email().empty()) { setValidation (LoginNameField, WValidator::Result(WValidator::Invalid, WString::tr("Wt.Auth.email-unverified"))); login.login(user, DisabledLogin); return false; } else { login.login(user, state); return true; } }
/** * Validates that the provided password is correct. * This is used in the GUI to guard access to certain actions. * * @param szPassword The password to check. * @param pOk Set to true if the password is good, or false otherwise. */ tABC_CC ABC_LoginPasswordOk(Login &login, const char *szPassword, bool *pOk, tABC_Error *pError) { tABC_CC cc = ABC_CC_Ok; tABC_CarePackage *pCarePackage = NULL; tABC_LoginPackage *pLoginPackage = NULL; AutoU08Buf LP; AutoU08Buf LP2; AutoU08Buf MK; *pOk = false; // Load the packages: ABC_CHECK_RET(ABC_LoginDirLoadPackages(login.lobby().dir(), &pCarePackage, &pLoginPackage, pError)); // LP = L + P: ABC_BUF_STRCAT(LP, login.lobby().username().c_str(), szPassword); ABC_CHECK_RET(ABC_CryptoScryptSNRP(LP, pCarePackage->pSNRP2, &LP2, pError)); // Try to decrypt MK: tABC_Error error; if (ABC_CC_Ok == ABC_CryptoDecryptJSONObject(pLoginPackage->EMK_LP2, LP2, &MK, &error)) { *pOk = true; } exit: ABC_CarePackageFree(pCarePackage); ABC_LoginPackageFree(pLoginPackage); return cc; }
int main(int argc, char *argv[]) { #ifdef Q_OS_OSX QGuiApplication a(argc, argv); #else QCoreApplication a(argc, argv); #endif if (a.arguments().size() < 2) { qDebug() << "Not specify token file, do login."; // NOTE: should create on heap Login* login = new Login(&a); login->doInput(); login->doLogin(); } else { Client *client = Client::create(a.arguments()[1], &a); if (0 == client) { QCoreApplication::exit(EXIT_FAILURE); } Player *player = new Player(&a); Control *control = new Control(client, player, &a); new RemoteControl(control, player, &a); control->start(); } return a.exec(); }
int main(void) { Login user; user.ConfirmPage(); return 0; }
ToDoApp::ToDoApp(const WEnvironment &env) : WApplication(env), sqlite3_(Wt::WApplication::appRoot() + "todo.db") { setTheme(new WBootstrapTheme()); session.setConnection(sqlite3_); sqlite3_.setProperty("show-queries", "true"); session.mapClass<UserAccount>("user_account"); session.mapClass<Todo>("todo"); dbo::Transaction transaction(session); try { session.createTables(); log("info") << "db created"; } catch (...) { log("info") << "using existing db"; } transaction.commit(); messageResourceBundle().use(appRoot() + "todo"); useStyleSheet("./todo.css"); Login *login = new Login(root()); login->loggedIn().connect(this, &ToDoApp::login); }
/************************************ Method: wind_close FullName: bossWindow::wind_close Author: Bianx Access: private Returns: void Qualifier: Created Time: 2013/11/24 11:17 Last Change: 2013/11/24 11:17 version: 1.0.0 Description:自定义关闭窗口动作 Remark: *************************************/ void bossWindow::wind_close() { Login *temp; temp = new Login; temp->show(); this->close(); }
int main(void) { Login user; user.LogoutPage(); return 0; }
int main(int argc, char* argv[]) { QApplication app(argc, argv); Login oLogin; oLogin.show(); return app.exec(); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); a.setWindowIcon(QIcon(":/res/icons/stockwatcher.ico")); Login w; w.show(); return a.exec(); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); Login w; w.show(); return a.exec(); }
Status loginRecoverySet(Login &login, const std::string &recoveryQuestions, const std::string &recoveryAnswers) { std::string LRA = login.lobby.username() + recoveryAnswers; // Load the packages: CarePackage carePackage; LoginPackage loginPackage; ABC_CHECK(carePackage.load(login.paths.carePackagePath())); ABC_CHECK(loginPackage.load(login.paths.loginPackagePath())); // Load the old keys: DataChunk authKey = login.authKey(); // Update scrypt parameters: JsonSnrp snrp; ABC_CHECK(snrp.create()); ABC_CHECK(carePackage.snrp3Set(snrp)); ABC_CHECK(snrp.create()); ABC_CHECK(carePackage.snrp4Set(snrp)); // Make questionKey (unlocks questions): DataChunk questionKey; ABC_CHECK(carePackage.snrp4().hash(questionKey, login.lobby.username())); // Encrypt the questions: JsonBox box; ABC_CHECK(box.encrypt(recoveryQuestions, questionKey)); ABC_CHECK(carePackage.questionBoxSet(box)); // Make recoveryKey (unlocks dataKey): DataChunk recoveryKey; ABC_CHECK(carePackage.snrp3().hash(recoveryKey, LRA)); // Encrypt dataKey: ABC_CHECK(box.encrypt(login.dataKey(), recoveryKey)); ABC_CHECK(loginPackage.recoveryBoxSet(box)); // Make recoveryAuthKey (unlocks the server): DataChunk recoveryAuthKey; ABC_CHECK(usernameSnrp().hash(recoveryAuthKey, LRA)); // Encrypt recoveryAuthKey (needed for atomic password updates): ABC_CHECK(box.encrypt(recoveryAuthKey, login.dataKey())); ABC_CHECK(loginPackage.ELRA1Set(box)); // Change the server login: ABC_CHECK(loginServerChangePassword(login, authKey, recoveryAuthKey, carePackage, loginPackage)); // Change the on-disk login: ABC_CHECK(carePackage.save(login.paths.carePackagePath())); ABC_CHECK(loginPackage.save(login.paths.loginPackagePath())); return Status(); }
Status loginRecoverySet(Login &login, const std::string &recoveryQuestions, const std::string &recoveryAnswers) { std::string LRA = login.store.username() + recoveryAnswers; // Load the packages: CarePackage carePackage; LoginPackage loginPackage; ABC_CHECK(carePackage.load(login.paths.carePackagePath())); ABC_CHECK(loginPackage.load(login.paths.loginPackagePath())); // Load the old keys: DataChunk passwordAuth = login.passwordAuth(); // Update scrypt parameters: JsonSnrp snrp; ABC_CHECK(snrp.create()); ABC_CHECK(carePackage.recoveryKeySnrpSet(snrp)); ABC_CHECK(snrp.create()); ABC_CHECK(carePackage.questionKeySnrpSet(snrp)); // Make questionKey (unlocks questions): DataChunk questionKey; ABC_CHECK(carePackage.questionKeySnrp().hash(questionKey, login.store.username())); // Encrypt the questions: JsonBox questionBox; ABC_CHECK(questionBox.encrypt(recoveryQuestions, questionKey)); ABC_CHECK(carePackage.questionBoxSet(questionBox)); // Make recoveryKey (unlocks dataKey): DataChunk recoveryKey; ABC_CHECK(carePackage.recoveryKeySnrp().hash(recoveryKey, LRA)); // Encrypt dataKey: JsonBox recoveryBox; ABC_CHECK(recoveryBox.encrypt(login.dataKey(), recoveryKey)); ABC_CHECK(loginPackage.recoveryBoxSet(recoveryBox)); // Make recoveryAuth (unlocks the server): DataChunk recoveryAuth; ABC_CHECK(usernameSnrp().hash(recoveryAuth, LRA)); // Change the server login: ABC_CHECK(loginServerChangePassword(login, passwordAuth, recoveryAuth, carePackage, loginPackage)); // Change the on-disk login: ABC_CHECK(carePackage.save(login.paths.carePackagePath())); ABC_CHECK(loginPackage.save(login.paths.loginPackagePath())); return Status(); }
void PasswordPromptDialog::check() { bool valid = enterPasswordFields_->validate(login_.user()); if (valid) { Login *login = &login_; accept(); login->login(login->user(), StrongLogin); } }
int main(int argc, char *argv[]) { QApplication a(argc, argv); Login login; login.show(); // IconDisplayerWidget widget; // widget.show(); return a.exec(); }
void RedMineManager::authenticationRequired(QNetworkReply* reply, QAuthenticator* authenticator) { Q_UNUSED(reply); Login dlg; if (dlg.exec() == QDialog::Rejected) QApplication::quit(); authenticator->setUser(dlg.login()); authenticator->setPassword(dlg.password()); }
Login* LoginList::getLogin( Channel* pChannel ) { Login* login = _list.front(); while ( login ) { if ( login->getChannel() == pChannel ) return login; login = login->next(); } return 0; }
void WMWindow::slotDoLogin(const QString& login, const QString& pass, const QUrl& wiki) { m_login = login; m_pass = pass; m_wiki = wiki; m_mediawiki = new MediaWiki(wiki); Login* loginJob = new Login(*m_mediawiki, login, pass); connect(loginJob, SIGNAL(result(KJob*)), this, SLOT(slotLoginHandle(KJob*))); loginJob->start(); }
void ApplicationUI::login(){ Login *login = new Login(); TextField *emailText = navPane->findChild<TextField*>("emailText"); TextField *passwordText = navPane->findChild<TextField*>("passwordText"); bool res = QObject::connect(login, SIGNAL(userLoggedIn()), this, SLOT(handleUserLoggedIn())); Q_ASSERT(res); Q_UNUSED(res); login->loginUser(emailText->text(), passwordText->text()); }
void newUser::on_buttonBox_accepted() { Login w; QString fullName, username, password, password2, dOB, country, add, city, zip, telephone, email; fullName = ui->lineEdit->text(); username = ui->lineEdit_9->text(); password = ui->lineEdit_10->text(); password2 = ui->lineEdit_11->text(); dOB = ui->dateEdit->text(); country = ui->lineEdit_2->text(); add = ui->lineEdit_4->text(); city = ui->lineEdit_3->text(); zip = ui->lineEdit_5->text(); telephone = ui->lineEdit_6->text(); email = ui->lineEdit_7->text(); if(username == NULL || password == NULL || password != password2 || fullName == NULL) { QMessageBox::critical(this,tr("Error::"), "Missing Information!"); return; } bool conn = w.connOpen(); if(!conn) { cout << "Failed to open the database"; return; } QSqlQuery* qry = new QSqlQuery(w.mydb); qry->prepare("INSERT INTO users(username, password) VALUES('"+username+"', '"+password+"')"); bool users = qry->exec(); qry->prepare("INSERT INTO customers(full_name, date_of_birth, country, city, address, post_code, phone, email) VALUES('"+fullName+"', '"+dOB+"'" ", '"+country+"', '"+add+"', '"+city+"', '"+zip+"', '"+telephone+"', '"+email+"')"); if(users && qry->exec()) { QMessageBox::information(this,tr("Save"), tr("Saved")); w.connClose(); } else { QMessageBox::critical(this,tr("Error::"),qry->lastError().text()); } }
UInt32 LoginList::sendLoginClose() { UInt32 count = 0; Login* login = _list.front(); while ( login ) { login->sendLoginClose(); ++count; login = login->next(); } return count; }
int main(int argc, char *argv[]) { QStringList paths = QApplication::libraryPaths(); paths.append( QFileInfo(argv[0]).dir().path() + QStringLiteral( "/plugins" ) ); QApplication::setLibraryPaths( paths ); QApplication a(argc, argv); MainWindow w; Login l ( &w ); l.show(); return a.exec(); }
void PasswordPromptDialog::check() { impl_->updateModelField(model_, AuthModel::PasswordField); if (model_->validate()) { Login *login = &login_; accept(); login->login(login->user(), StrongLogin); } else { impl_->updateViewField(model_, AuthModel::PasswordField); WPushButton *okButton = impl_->resolve<WPushButton *>("ok-button"); model_->updateThrottling(okButton); } }
Login* Login::create() { Login *layer = new Login(); if (layer && layer->init()) { layer->autorelease(); } else { delete layer; layer = NULL; } return layer; }
void Frame::SwitchPanels(){ if(panel_login->IsShown()){ //Switch from login to overview SetSize(1400,850); panel_login->Hide(); panel_overview->Show(); SetMenuBar(menubar_overview); } else { //Switch from overview back to login SetSize(700,500); panel_overview->Hide(); panel_login->Show(); SetMenuBar(menubar_login); } Layout(); }//SwithPanels
void Client::login_frame (const Login& frame) { if (!logged_in ()) { user = std::make_shared<User> (fd, frame.nickname()); WimfInfo info; Login *confirmation = info.mutable_login(); confirmation->set_id(fd); confirmation->set_nickname(frame.nickname()); protocol.send_frame(info); } }
void Juncture::LoginOperation(const Operation & op, OpVector & res) { log(INFO, "Juncture got login"); const std::vector<Root> & args = op->getArgs(); if (args.empty()) { error(op, "No argument to connect op", res, getId()); return; } const Root & arg = args.front(); Element username_attr; if (arg->copyAttr("username", username_attr) != 0 || !username_attr.isString()) { error(op, "Argument to connect op has no username", res, getId()); return; } const std::string & username = username_attr.String(); Element password_attr; if (arg->copyAttr("password", password_attr) != 0 || !password_attr.isString()) { error(op, "Argument to connect op has no password", res, getId()); return; } const std::string & password = password_attr.String(); if (m_peer == 0) { error(op, "Juncture not connected", res, getId()); return; } assert(m_socket == 0); if (m_peer->getAuthState() != PEER_INIT) { error(op, "Juncture not ready", res, getId()); return; } Anonymous account; account->setAttr("username", username); account->setAttr("password", password); Login l; l->setArgs1(account); if (!op->isDefaultSerialno()) { l->setSerialno(op->getSerialno()); } // Send the login op m_peer->send(l); m_peer->setAuthState(PEER_AUTHENTICATING); }
int main(int argc, char** argv){ Screen::Get().Init(); move(0, 0); addstr("By: Vargeux"); if(!has_colors()){ mvprintw( Screen::Get().getH() / 2, Screen::Get().getW() / 2 - strlen("No color!") / 2, "No color!"); return -1; } start_color(); //Start color handling init_color(COLOR_WHITE, 500, 500, 500); //White will be gray init_pair(1, COLOR_WHITE, COLOR_BLUE); //Regular window color refresh(); //Swap buffers, print result getch(); //Read key SocketServer::Get().Init(); int window = 1; bool end = false; do{ if(window == 0){ //Exit end = true; }else if(window == 1){ Login* login = new Login(); login->loop() ? window++ : window--; delete login; Screen::Get().fillScreen(' '); }else if(window == 2){ Stats* stats = new Stats(); stats->loop() ? window++ : window--; delete stats; Screen::Get().fillScreen(' '); }else{ end = true; } }while(!end); SocketServer::Get().Close(); Screen::Get().Close(); return 0; }
int main(int argc, char *argv[]) { QApplication a(argc, argv); QPixmap pixmap(":/splash"); QSplashScreen *splash = new QSplashScreen(pixmap); splash->show(); // check for updates QString path = a.applicationDirPath(); if (0 && checkForUpdates(path)) { QProcess updater; updater.startDetached("wyUpdate"); if (updater.waitForStarted()) { } a.quit(); } // end check for updates QtGest *mw = 0; Login *ld = new Login(); splash->finish(ld); int status; do { if (ld->exec()) { if (!mw) { mw = new QtGest(); } mw->resetPrivileges(); mw->setWindowTitle(QString("QtGest - %1").arg(ld->getUsername())); mw->setUsername(ld->getUsername()); mw->showMaximized(); a.exec(); status = 1; } else { status = 0; } } while (status != 0); return status; }