Jump to content

I want to login with username and password in /server section.


pro_imaj

Recommended Posts

Hi,

I want to login with username and password in /server section.

Username is logged in without asking for password even though I have added the code below, is there any need for another setting?

 

procedure TUniServerModule.UniGUIServerModuleControlPanelLogin
  (ASession: TUniGUISession; const AUser, APassword: string;
  var LoginValid: Boolean; LoginAttempt: Integer);
begin
  if SameText(AUser, 'demo') and SameText(APassword, 'demo') then
    LoginValid := True
  else
  begin
    if LoginAttempt = 3 then
      ASession.Terminate('Error!');
  end;
end;

 

Link to comment
Share on other sites

59 minutes ago, pro_imaj said:

Hi,

I want to login with username and password in /server section.

Username is logged in without asking for password even though I have added the code below, is there any need for another setting?

 

procedure TUniServerModule.UniGUIServerModuleControlPanelLogin
  (ASession: TUniGUISession; const AUser, APassword: string;
  var LoginValid: Boolean; LoginAttempt: Integer);
begin
  if SameText(AUser, 'demo') and SameText(APassword, 'demo') then
    LoginValid := True
  else
  begin
    if LoginAttempt = 3 then
      ASession.Terminate('Error!');
  end;
end;

 

I copied the servermodule in a previously working project to the project, but the result is negative.

So the screen comes directly without asking for a password, this little problem drove me crazy. :(

Link to comment
Share on other sites

6 minutes ago, Hayri ASLAN said:

Merhaba

OnControlPanelLogin olayının servermodule'de atandığından emin olun.

İçinde herhangi bir kodunuz olmasa bile, giriş sayfası görünecektir.

 

image.thumb.png.00f1e226d6f0d05136ed830f3b247508.png

I coded it exactly as you said. But again it didn't. unfortunately. Unfortunately, I solved them by creating a new project and copying the mainmodule and servermodule in the new project.

Thank you.

Link to comment
Share on other sites

25 minutes ago, Hayri ASLAN said:

Hello

Make sure OnControlPanelLogin event is assigned in servermodule.

even if you don't have any code in it, login page will show up.

 

image.thumb.png.00f1e226d6f0d05136ed830f3b247508.png

When I change some settings on the Unimainmodule screen, it still does not ask for a password.

Link to comment
Share on other sites

On 8/5/2022 at 7:03 PM, Hayri ASLAN said:

What settings are you changing?

 

I couldn't find out which setting has changed for now, but when I make the same settings with other projects, it doesn't work. I made a new mainmodule settings, and for now I solved the problem by not making the old settings.

Thank you for your interest, Mr. Hayri.

As always, I would like to express my gratitude to all concerned.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...