foreman_users 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/foreman_users/group.rb +1 -1
- data/app/models/foreman_users/user.rb +1 -1
- data/app/views/foreman_users/users/_form.html.erb +2 -2
- data/app/views/foreman_users/users/_list.html.erb +1 -1
- data/app/views/foreman_users/users/_sub.html.erb +1 -1
- data/app/views/foreman_users/users/show.html.erb +2 -2
- data/db/migrate/20150918022911_create_foreman_users_users.rb +8 -6
- data/db/migrate/20150918050939_create_foreman_users_groups.rb +3 -2
- data/lib/foreman_users/version.rb +1 -1
- metadata +1 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
module ForemanUsers
|
2
2
|
class Group < ActiveRecord::Base
|
3
|
-
attr_accessible :
|
3
|
+
attr_accessible :groupname, :ensure, :gid, :groupable_type, :groupable_id, :user_id
|
4
4
|
belongs_to :user, class_name: "ForemanUsers::User"
|
5
5
|
end
|
6
6
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module ForemanUsers
|
2
2
|
class User < ActiveRecord::Base
|
3
3
|
require "fileutils"
|
4
|
-
attr_accessible :title, :body, :
|
4
|
+
attr_accessible :title, :body, :username, :ensure , :gid, :groups, :home , :password, :password_max_age, :password_min_age, :shell, :uid, :groups_attributes
|
5
5
|
|
6
6
|
|
7
7
|
has_many :groups, :class_name => 'ForemanTasks::Group', :foreign_key => :user_id
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<div class="row">
|
7
7
|
<div class="form-group col-md-6">
|
8
8
|
<label>name</label>
|
9
|
-
<%= f.text_field :
|
9
|
+
<%= f.text_field :username, :size => "col-md-6", placeholder: "填写用户名", class: "form-control" %>
|
10
10
|
</div>
|
11
11
|
<div class="form-group col-md-6">
|
12
12
|
<label for="user_ensure">ensure</label> <br />
|
@@ -69,7 +69,7 @@
|
|
69
69
|
|
70
70
|
<div class="row">
|
71
71
|
<div class=" form-group col-md-4">
|
72
|
-
<%= groups_form.text_field :
|
72
|
+
<%= groups_form.text_field :groupname, :size => "col-md-4", placeholder: "填写shell,例如: /bin/bash" , class: "form-control"%>
|
73
73
|
</div>
|
74
74
|
<div class=" form-group col-md-4">
|
75
75
|
<%= groups_form.text_field :ensure, :size => "col-md-4", placeholder: "填写shell,例如: /bin/bash" , class: "form-control"%>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<tbody>
|
20
20
|
<% users.each do |user| %>
|
21
21
|
<tr>
|
22
|
-
<td class=''><%= user.
|
22
|
+
<td class=''><%= user.username %></td>
|
23
23
|
<td class="hidden-xs"><%= user.ensure %></td>
|
24
24
|
<td class="hidden-xs"><%= user.gid %></td>
|
25
25
|
<td class="hidden-tablet hidden-xs"><%= user.groups %></td>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<%= f.fields_for :group do |f| %>
|
3
3
|
<div class="row">
|
4
4
|
<div class="col-md-4 column form-group">
|
5
|
-
<%= text_f f, :
|
5
|
+
<%= text_f f, :groupname, :help_inline => _("填写用户名") %>
|
6
6
|
</div>
|
7
7
|
<div class="col-md-4 column form-group">
|
8
8
|
<%= text_f f, :name, :help_inline => _("填写用户名") %>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<td><strong>groups</strong></td>
|
20
20
|
</tr>
|
21
21
|
<tr>
|
22
|
-
<td><%= @user.
|
22
|
+
<td><%= @user.username %></td>
|
23
23
|
<td><%= @user.ensure %></td>
|
24
24
|
<td><%= @user.gid %></td>
|
25
25
|
<td><%= @user.groups %></td>
|
@@ -65,7 +65,7 @@
|
|
65
65
|
<tbody>
|
66
66
|
<% @user.groups.each do |group|%>
|
67
67
|
<tr class="success">
|
68
|
-
<td><%= group.
|
68
|
+
<td><%= group.groupname %></td>
|
69
69
|
<td><%= group.ensure %></td>
|
70
70
|
<td><%= group.gid %></td>
|
71
71
|
</tr>
|
@@ -1,17 +1,19 @@
|
|
1
1
|
class CreateForemanUsersUsers < ActiveRecord::Migration
|
2
2
|
def change
|
3
|
+
drop_table :foreman_users_users if table_exists? :foreman_users_users
|
4
|
+
|
3
5
|
create_table :foreman_users_users do |t|
|
4
|
-
t.string :
|
5
|
-
t.string :ensure
|
6
|
-
t.string :gid
|
7
|
-
t.string :groups
|
8
|
-
t.string :home
|
6
|
+
t.string :username
|
7
|
+
t.string :ensure
|
8
|
+
t.string :gid
|
9
|
+
t.string :groups
|
10
|
+
t.string :home
|
9
11
|
t.string :password
|
10
12
|
t.string :password_max_age
|
11
13
|
t.string :password_min_age
|
12
14
|
t.string :shell
|
13
15
|
t.string :uid
|
14
16
|
t.timestamps
|
15
|
-
end
|
17
|
+
end unless table_exists? :foreman_users_users
|
16
18
|
end
|
17
19
|
end
|
@@ -1,13 +1,14 @@
|
|
1
1
|
class CreateForemanUsersGroups < ActiveRecord::Migration
|
2
2
|
def change
|
3
|
+
drop_table :foreman_users_groups if table_exists? :foreman_users_groups
|
3
4
|
create_table :foreman_users_groups do |t|
|
4
|
-
t.string :
|
5
|
+
t.string :groupname
|
5
6
|
t.string :ensure
|
6
7
|
t.string :gid
|
7
8
|
t.string :groupable_type
|
8
9
|
t.integer :groupable_id
|
9
10
|
t.integer :user_id
|
10
11
|
t.timestamps
|
11
|
-
end
|
12
|
+
end unless table_exists? :foreman_users_groups
|
12
13
|
end
|
13
14
|
end
|