user.rb 623 Bytes
class DsAdmin::Model::User
  include DsAdmin::Model

  attr_accessor :name, :pass, :uid, :gid, :shell, :home

  def initialize(args = {})
    return if args.empty?
    super(args)

    @name             = args[:name]
    @pass             = args[:pass]
    @uid              = args[:uid]
    @gid              = args[:gid]
    @shell            = args[:shell]
    @home             = args[:home]
    @shadowmax        = args[:shadowmax]
    @shadowwarning    = args[:shadowwarning]
    @shadowlastchange = args[:shadowlastchange]
  end

  def save
    @shadowlastchange = (Time::now.to_i/60/60/24).to_s
    super
  end
end