Skip to content

Commit

Permalink
del user management
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentGsell committed Aug 3, 2019
1 parent 86eab38 commit 21b0757
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Sources/Pascal/Server/ConsoleAdmin/GridServerConsole.AdminMode.pas
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,45 @@ procedure UserManagement_ADD(aServer : TGRIDServer);
end;

procedure UserManagement_DEL(aServer : TGRIDServer);
var l : TCNCUserConfiguration;
u : TCNCUser;
a : string;
begin
l := TCNCUserConfiguration.Create;
try
//Check from file only !
if FileExists(CST_CNC_FILENAME_USERCONF) then
l.LoadFromFile(CST_CNC_FILENAME_USERCONF);


writeln('User deletion : ');
if l.UsersList.Count>0 then
begin
writeln('----------------------------------------------');
DisplayUserConfig;
writeln('----------------------------------------------');
writeln('Enter user name to delete : ');
Readln(a);
if l.UsersList.Get(a,u) then
begin
writeln('--> Delete "'+u.UserName+' : confirm Y/n : ');
readln(a);
if a = 'Y' then
begin
l.UsersList.Remove(u.UserName);
l.SaveToFile(CST_CNC_FILENAME_USERCONF);
writeln('user deleted.');
end
else
writeln('User''s list remain untouched.');
end
else
writeln('User "'+a+'" not found : User''s list remain untouched.');
end;
finally

end;

end;


Expand Down

0 comments on commit 21b0757

Please sign in to comment.