Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MainWindow::Entra(){
- QString us=login->text();
- QString pwd=password->text();
- Account* acclog=0;
- acclog=gestore->Login(us, pwd);
- QMessageBox msg2;
- if(!acclog){
- msg2.warning(this, "Attenzione!", "Dati incorretti");
- msg2.show();
- }
- else{
- //redirect pagina utente
- cout << "yeee";
- }
- }
- Account* Legami::Login(QString us, QString pwd){//QUANDO CHIAMERÒ LOGIN AVRÒ CARICATO GIÀ TT IL DATABASE?
- Account* acc=0;
- bool trovato=false;
- for(QVector<Account*>::iterator it=utenti->begin(); trovato==false && it!=utenti->end(); it++){
- QString username=(*it)->GetUsername();
- QString password=(*it)->GetPwd();
- if(username==us && password==pwd){
- acc=(*it);
- (*it)->SetGestore(this);
- trovato=true;
- }
- }
- cout << "Login";
- return acc;
- }
Add Comment
Please, Sign In to add comment