Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uzytkownik * logowanie(){
- string imie;
- xml_node<>*user=NULL;
- string nazwisko;
- string haslo;
- cout<<"Podaj imie: ";
- cin>>imie;
- cout<<"Podaj nazwisko: ";
- cin>>nazwisko;
- if(imie=="admin" && nazwisko=="admin"){
- string haslo;
- cout<<"Podaj haslo: ";
- cin>>haslo;
- if(haslo=="admin"){
- admin_menu();
- }
- }
- else{
- xml_node<>*temp=Dane.XML->first_node();
- temp=temp->first_node();
- //cout<<*temp->next_sibling()<<"<-temp";
- while(temp){
- if(strcmp(temp->name(), "uzytkownik")==0){
- xml_attribute<>*cos=temp->first_attribute()->next_attribute();
- //cout<<*cos->value()<<" cos"<<endl;
- xml_attribute<>*pass=cos->next_attribute()->next_attribute();
- //cout<<*pass->value()<<" pass"<<endl;
- if(cos->value()==imie && cos->next_attribute()->value()==nazwisko){
- cout<<"Podaj haslo: ";
- cin>>haslo;
- if(pass->value()==haslo){
- user=temp;
- uzytkownik_menu();
- }
- else{
- cout<<"Blad podczas logowania";
- }
- }
- }
- temp=temp->next_sibling();
- }
- }
- return user;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement