Advertisement
Guest User

sadasd

a guest
May 4th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. uzytkownik * logowanie(){
  2. string imie;
  3. xml_node<>*user=NULL;
  4. string nazwisko;
  5. string haslo;
  6. cout<<"Podaj imie: ";
  7. cin>>imie;
  8. cout<<"Podaj nazwisko: ";
  9. cin>>nazwisko;
  10. if(imie=="admin" && nazwisko=="admin"){
  11. string haslo;
  12. cout<<"Podaj haslo: ";
  13. cin>>haslo;
  14. if(haslo=="admin"){
  15. admin_menu();
  16. }
  17. }
  18. else{
  19. xml_node<>*temp=Dane.XML->first_node();
  20. temp=temp->first_node();
  21. //cout<<*temp->next_sibling()<<"<-temp";
  22. while(temp){
  23. if(strcmp(temp->name(), "uzytkownik")==0){
  24. xml_attribute<>*cos=temp->first_attribute()->next_attribute();
  25. //cout<<*cos->value()<<" cos"<<endl;
  26. xml_attribute<>*pass=cos->next_attribute()->next_attribute();
  27. //cout<<*pass->value()<<" pass"<<endl;
  28. if(cos->value()==imie && cos->next_attribute()->value()==nazwisko){
  29. cout<<"Podaj haslo: ";
  30. cin>>haslo;
  31. if(pass->value()==haslo){
  32. user=temp;
  33. uzytkownik_menu();
  34. }
  35. else{
  36. cout<<"Blad podczas logowania";
  37. }
  38. }
  39. }
  40. temp=temp->next_sibling();
  41. }
  42. }
  43. return user;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement