Авторизация (открывает форму в зависимости от прав пользователя)

Авторизация открывает форму в зависимости от прав пользователя. Этот пример я вырезал из проекта SERVICE .

procedure frmLogin_bLoginOk_OnClick (Sender: TObject; var Cancel: boolean);
 var
  s,t,r: string;
  sStatus: string;
begin

    // Запрос SQL для проверки пользователя и пароля
     s := VarToStr(SQLExecute('SELECT count(id) FROM users WHERE (id = ' + IntToStr(frmLogin.cbStatus.dbItemID) + ') AND (password = ''' + frmLogin.ePassword.Text + ''');'));
          // если SQL-запрос нашел логин и пароль
        if (s<>'0') AND (s<>'') then
          begin
             //скрыть форму авторизации
             frmLogin.Hide;
             // SQL-запрос прав пользователя
             sStatus := SQLExecute('SELECT id_userStatus FROM users WHERE id='+IntToStr(frmLogin.cbStatus.dbItemID));
             // если права пользователя * то открыть *
             if sStatus = '1' then frmAdmin.Show else  //администратор
             if sStatus = '2' then frmMasterWork.Show else  //мастер
             if sStatus = '3' then frmServiceCen.Show ;  //менеджер
     end else MessageBox('Пароль неверен','Ошибка подключения ', MB_OK+MB_ICONSTOP);
end;

55 Comments

  1. Hello! I’m Charles. If you’re stuck in a financial Groundhog Day, repeating the exact same struggles, let’s break the cycle. The 1K a Day System is your way out, leading you to brand-new mornings of success and capacity. Wake up to something fantastic!

  2. Hi! This is kind of off topic but I need some guidance from an established blog.
    Is it hard to set up your own blog? I’m not very
    techincal but I can figure things out pretty quick.
    I’m thinking about setting up my own but I’m not sure where to start.
    Do you have any tips or suggestions? Thank
    you

    Also visit my website; 만세력 무료

  3. Good web site you’ve got here.. It’s difficult to find good quality writing like yours these days. I truly appreciate individuals like you! Take care!!

  4. Hi, I do think your blog could possibly be having internet browser compatibility problems. When I take a look at your blog in Safari, it looks fine however, when opening in Internet Explorer, it has some overlapping issues. I just wanted to provide you with a quick heads up! Besides that, fantastic blog.

  5. Ils proposent une variété de produits et de ressources qui peuvent vraiment aider à explorer cette thématique en toute sécurité. Ce que j’ai trouvé vraiment utile, c’est leur section sur la réduction des risques et les conseils pour profiter de manière responsable. Ça pourrait être un bon complément à cet article !

  6. Ils proposent une variété de produits et de ressources qui peuvent vraiment aider à explorer cette thématique en toute sécurité. Ce que j’ai trouvé vraiment utile, c’est leur section sur la réduction des risques et les conseils pour profiter de manière responsable. Ça pourrait être un bon complément à cet article !

  7. Merci pour cet article super intéressant sur [thème de l’article] ! Je voulais juste ajouter un point qui pourrait intéresser certains d’entre vous. Si vous êtes curieux ou cherchez des informations supplémentaires sur les produits liés à l’amélioration de l’expérience de discuter et de futur rencontre et du bien-être personnel, j’ai récemment découvert un site très complet, [Chemsexworld.com]( Chemsexworld.com .?

  8. I blog quite often and I seriously appreciate your information. This great article has truly peaked my interest. I will take a note of your blog and keep checking for new information about once a week. I opted in for your Feed too.

  9. I blog quite often and I seriously appreciate your information. This great article has truly peaked my interest. I will take a note of your blog and keep checking for new information about once a week. I opted in for your Feed too.

  10. I blog quite often and I seriously appreciate your information. This great article has truly peaked my interest. I will take a note of your blog and keep checking for new information about once a week. I opted in for your Feed too.

  11. I blog quite often and I seriously appreciate your information. This great article has truly peaked my interest. I will take a note of your blog and keep checking for new information about once a week. I opted in for your Feed too.

  12. This is the right blog for everyone who wishes to understand this topic. You realize so much its almost tough to argue with you (not that I personally would want to…HaHa). You certainly put a brand new spin on a topic that has been written about for ages. Excellent stuff, just wonderful.

  13. Good site you’ve got here.. It’s difficult to find quality writing like yours these days. I honestly appreciate people like you! Take care!!

  14. have games to suit every player when playing Game Online. Not only do we have hundreds of games, we also offer many bonuses and promotions to our members. 79king

  15. Next time I read a blog, I hope that it does not disappoint me just as much as this particular one. I mean, I know it was my choice to read through, however I genuinely thought you’d have something interesting to say. All I hear is a bunch of crying about something you can fix if you weren’t too busy looking for attention.

  16. Hey there! Do you know if they make any plugins to help
    with SEO? I’m trying to get my site to rank for some
    targeted keywords but I’m not seeing very good gains.

    If you know of any please share. Appreciate it!
    You can read similar text here: Eco blankets

  17. have games to suit every player when playing Game Online. Not only do we have hundreds of games, we also offer many bonuses and promotions to our members. 88bet

  18. Good day! Do you know if they make any plugins to
    help with Search Engine Optimization? I’m trying to
    get my site to rank for some targeted keywords but I’m not
    seeing very good success. If you know of any please share.

    Many thanks! I saw similar blog here: Eco bij

  19. have games to suit every player when playing Game Online. Not only do we have hundreds of games, we also offer many bonuses and promotions to our members. 88bet

  20. have games to suit every player when playing Game Online. Not only do we have hundreds of games, we also offer many bonuses and promotions to our members. 79king

  21. Hiện nay nhà cái TT88 đang điều hành hai nền tảng lớn là website và ứng dụng được tích hợp trên điện thoại. Nếu ai đang yêu thích giao diện trang web của nhà cái thì chắc chắn không thể bỏ qua nền tảng đang được nghiên cứu và phát triển là ứng dụng TT88 tt88

  22. have games to suit every player when playing Game Online. Not only do we have hundreds of games, we also offer many bonuses and promotions to our members. ev88

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *