diff options
Diffstat (limited to 'UCoreClasses.pas')
| -rw-r--r-- | UCoreClasses.pas | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/UCoreClasses.pas b/UCoreClasses.pas index 0267843..0c2a605 100644 --- a/UCoreClasses.pas +++ b/UCoreClasses.pas @@ -21,16 +21,16 @@ unit UCoreClasses; interface -uses gdk2pixbuf, gtk2, gdk2, glib2, SysUtils, Classes, Libc, IniFiles, GTKClasses, GTKStdCtrls, GTKDialogs, GTKPixbuf, UGnome, +uses gdk2pixbuf, gtk2, gdk2, glib2, SysUtils, Classes, ULibc, IniFiles, GTKClasses, GTKStdCtrls, GTKDialogs, GTKPixbuf, UGnome, UEngines; -type TUser = class +type TSystemUser = class public UserName, FullName, HomeDir, LoginShell: string; UID, GID: Cardinal; end; - TGroup = class + TSystemGroup = class public GroupName: string; GID: Cardinal; @@ -103,10 +103,10 @@ uses GTKForms, GTKUtils, ULocale, UConfig, UCore, UCoreUtils; (********************************************************************************************************************************) (********************************************************************************************************************************) constructor TUserManager.Create; -var pwd: PPasswordRecord; - User: TUser; +var pwd: PPasswd; + User: TSystemUser; grp: PGroup; - Group: TGroup; + Group: TSystemGroup; i: integer; begin inherited Create; @@ -117,7 +117,7 @@ begin setpwent; pwd := getpwent; while pwd <> nil do begin - User := TUser.Create; + User := TSystemUser.Create; User.UserName := String(StrToUTF8(pwd^.pw_name)); User.FullName := String(StrToUTF8(pwd^.pw_gecos)); User.HomeDir := String(StrToUTF8(pwd^.pw_dir)); @@ -134,7 +134,7 @@ begin setgrent; grp := getgrent; while grp <> nil do begin - Group := TGroup.Create; + Group := TSystemGroup.Create; Group.GroupName := String(StrToUTF8(grp^.gr_name)); Group.GID := grp^.gr_gid; Group.Users := TStringList.Create; @@ -159,16 +159,16 @@ var i: integer; begin if UserList.Count > 0 then for i := UserList.Count - 1 downto 0 do begin - TUser(UserList[i]).Free; + TSystemUser(UserList[i]).Free; UserList.Delete(i); end; UserList.Clear; UserList.Free; if GroupList.Count > 0 then for i := GroupList.Count - 1 downto 0 do begin - TGroup(GroupList[i]).Users.Clear; - TGroup(GroupList[i]).Users.Free; - TGroup(GroupList[i]).Free; + TSystemGroup(GroupList[i]).Users.Clear; + TSystemGroup(GroupList[i]).Users.Free; + TSystemGroup(GroupList[i]).Free; GroupList.Delete(i); end; GroupList.Clear; @@ -183,8 +183,8 @@ begin else Result := IntToStr(UID); if UserList.Count > 0 then for i := 0 to UserList.Count - 1 do - if TUser(UserList[i]).UID = UID then begin - Result := TUser(UserList[i]).UserName; + if TSystemUser(UserList[i]).UID = UID then begin + Result := TSystemUser(UserList[i]).UserName; Break; end; end; @@ -196,8 +196,8 @@ begin else Result := IntToStr(GID); if GroupList.Count > 0 then for i := 0 to GroupList.Count - 1 do - if TGroup(GroupList[i]).GID = GID then begin - Result := TGroup(GroupList[i]).GroupName; + if TSystemGroup(GroupList[i]).GID = GID then begin + Result := TSystemGroup(GroupList[i]).GroupName; Break; end; end; |
