File tree Expand file tree Collapse file tree
Sources/Pascal/Server/ConsoleAdmin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -367,7 +367,45 @@ procedure UserManagement_ADD(aServer : TGRIDServer);
367367end ;
368368
369369procedure UserManagement_DEL (aServer : TGRIDServer);
370+ var l : TCNCUserConfiguration;
371+ u : TCNCUser;
372+ a : string;
370373begin
374+ l := TCNCUserConfiguration.Create;
375+ try
376+ // Check from file only !
377+ if FileExists(CST_CNC_FILENAME_USERCONF) then
378+ l.LoadFromFile(CST_CNC_FILENAME_USERCONF);
379+
380+
381+ writeln(' User deletion : ' );
382+ if l.UsersList.Count>0 then
383+ begin
384+ writeln(' ----------------------------------------------' );
385+ DisplayUserConfig;
386+ writeln(' ----------------------------------------------' );
387+ writeln(' Enter user name to delete : ' );
388+ Readln(a);
389+ if l.UsersList.Get(a,u) then
390+ begin
391+ writeln(' --> Delete "' +u.UserName+' : confirm Y/n : ' );
392+ readln(a);
393+ if a = ' Y' then
394+ begin
395+ l.UsersList.Remove(u.UserName);
396+ l.SaveToFile(CST_CNC_FILENAME_USERCONF);
397+ writeln(' user deleted.' );
398+ end
399+ else
400+ writeln(' User'' s list remain untouched.' );
401+ end
402+ else
403+ writeln(' User "' +a+' " not found : User'' s list remain untouched.' );
404+ end ;
405+ finally
406+
407+ end ;
408+
371409end ;
372410
373411
You can’t perform that action at this time.
0 commit comments