socialforge/lib/trustie/gitlab/manage_user.rb

37 lines
693 B
Ruby

#coding=utf-8
#
#
require_relative 'helper'
module Trustie
module Gitlab
module ManageUser
include Helper
def self.included(base)
base.class_eval {
#before_create :add_gitlab_user
#before_destroy :delete_gitlab_user
before_save :change_gitlab_user
}
end
def add_gitlab_user
add_user(self)
end
def delete_gitlab_user
del_user(self)
end
def change_gitlab_user
change_password(self.gid, self.hashed_password, self.salt)
end
def g
@g ||= ::Gitlab.client
end
end
end
end