130
adoConnection.Connected := True;
except
//
on E : Exception do
begin
//
Application.MainForm.Show;
MessageDlg (E.Message, mtError, [mbOK], 0);
MessageDlg ('Приложение будет закрыто.', mtInformation, [mbOK], 0);
Application.Terminate;
end;
end;
end;
procedure TdmServer.DSAuthenticationManagerUserAuthenticate(Sender:
TObject;
const Protocol, Context, User, Password: string; var valid: Boolean;
UserRoles: TStrings);
var
//
UserKey, UserTypeKey : Integer;
CI : TConnectionInfo;
Blocked : Boolean;
begin
//
UserKey := GetUserKey (User, Password, Blocked, UserTypeKey);
if (UserTypeKey <> 1) and (UserTypeKey <> 2) and (UserTypeKey <> 9) then
raise Exception.Create('Данному типу пользователей доступ закрыт');
if (Blocked = True) then raise Exception.Create('Вход в систему невозможен.
Ваш аккаунт заблокирован.');
valid := UserKey > 0;