pro_imaj Posted August 5, 2022 Share Posted August 5, 2022 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; Quote Link to comment Share on other sites More sharing options...
pro_imaj Posted August 5, 2022 Author Share Posted August 5, 2022 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. Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted August 5, 2022 Share Posted August 5, 2022 Hello Make sure OnControlPanelLogin event is assigned in servermodule. even if you don't have any code in it, login page will show up. 1 Quote Link to comment Share on other sites More sharing options...
pro_imaj Posted August 5, 2022 Author Share Posted August 5, 2022 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. 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. Quote Link to comment Share on other sites More sharing options...
pro_imaj Posted August 5, 2022 Author Share Posted August 5, 2022 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. When I change some settings on the Unimainmodule screen, it still does not ask for a password. Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted August 5, 2022 Share Posted August 5, 2022 1 hour ago, pro_imaj said: When I change some settings on the Unimainmodule screen, it still does not ask for a password. What settings are you changing? Quote Link to comment Share on other sites More sharing options...
pro_imaj Posted August 6, 2022 Author Share Posted August 6, 2022 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.