Parent

Methods

Sys::Admin::User

The User class encapsulates the information found in /etc/passwd.

Attributes

access_class[RW]

The user’s access class.

age[RW]

Used in the past for password aging. Deprecated by /etc/shadow.

change[RW]

Next date a password change will be needed.

comment[RW]

Another comment field.

dir[RW]

The absolute path name of the user’s home directory.

expire[RW]

The account’s expiration date

fields[RW]

TODO: Forgot what this is.

gecos[RW]

A comment field. Rarely used now.

gid[RW]

The user’s group ID.

login_device[RW]

The name of the terminal device the user last logged on with.

login_host[RW]

The host name from which the user last logged in.

login_time[RW]

The last time the user logged in.

name[RW]

The user name associated with the account.

passwd[RW]

The user’s encrypted password. Deprecated by /etc/shadow.

quota[RW]

The user’s alloted amount of disk space.

shell[RW]

The user’s login shell.

uid[RW]

The user’s user ID.

Public Class Methods

new() click to toggle source

Creates and returns a User object, which encapsulates the information typically found within an /etc/passwd entry, i.e. a struct passwd.

If a block is provided, yields the object back to the block.

# File lib/sys/admin/common.rb, line 100
def initialize
  yield self if block_given?
end

Public Instance Methods

groups() click to toggle source

An array of groups to which the user belongs.

# File lib/sys/admin/common.rb, line 105
def groups
  array = []

  Sys::Admin.groups.each{ |grp|
    array << grp.name if grp.members.include?(self.name)
  }

  array
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.