open_directory_utils 0.1.9 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +10 -1
- data/lib/open_directory_utils/commands_user_attribs.rb +13 -0
- data/lib/open_directory_utils/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97476363fb4501f2512cdd697ccda07dbaf0fc20103fcfa6c2c9055eb33c7950
|
4
|
+
data.tar.gz: 32eb0be00ff8205850cd5293b46f74b5a2513ae485602b53eae51270ae34eec5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c57ddd2c3f63739795cf0c030050c0df8dcd1565b0b889b624409debb90d4a6c7dc72ff0787918dea0b621efa8d37eccd409d18bdb140e0ce57b94baa0ace346
|
7
|
+
data.tar.gz: b1b196058867d99ac45f934adc82a21b08e99f02105a59fb40740f1499d1cd7e2241f4c0cdabb0222c13806c70220793a580644f2b7bac486bc0cc4c4421e6fd
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -7,6 +7,8 @@ One can also build custom DSCL commands and send them to the server as needed to
|
|
7
7
|
|
8
8
|
## Change Log
|
9
9
|
|
10
|
+
* **v0.1.11** - 2018-06-28
|
11
|
+
- add attribute delete method for user
|
10
12
|
* **v0.1.10** - 2018-06-??
|
11
13
|
- remove attribs[:value] side effect (return original attribs - always)
|
12
14
|
* **v0.1.9** - 2018-06-??
|
@@ -88,7 +90,8 @@ od.version
|
|
88
90
|
|
89
91
|
user_params = { user_name: 'someone', user_number: 9876,
|
90
92
|
first_name: 'Someone', last__name: 'Special',
|
91
|
-
group_number: 4321,group_name: 'employee'
|
93
|
+
group_number: 4321,group_name: 'employee',
|
94
|
+
mobile_phone: '+41 11 111 11 11'
|
92
95
|
}
|
93
96
|
group_params = {group_name: 'agroup', real_name: 'A Group',
|
94
97
|
group_number: 5432
|
@@ -131,7 +134,13 @@ od.run( command: :user_remove_from_group,
|
|
131
134
|
# delete a group
|
132
135
|
od.run( command: :group_delete, params: {group__name: 'agroup'})
|
133
136
|
|
137
|
+
# delete an attribute
|
138
|
+
# requires passing in a user_name to find the user record
|
139
|
+
# and the name of the attribute you wish to delete
|
140
|
+
od.run( command: :user_delete_attribute, params: {user_name: 'someone', attribute: 'MobileNumber'})
|
141
|
+
|
134
142
|
# delete a user
|
143
|
+
od.run( command: :user_delete, params: user_params)
|
135
144
|
|
136
145
|
```
|
137
146
|
|
@@ -876,5 +876,18 @@ module OpenDirectoryUtils
|
|
876
876
|
alias_method :user_set_blog, :user_set_weblog
|
877
877
|
# alias_method :las_sync_date, :user_set_weblog
|
878
878
|
|
879
|
+
def user_delete_attribute(attribs, dir_info)
|
880
|
+
attribs = user_record_name_alternatives(attribs)
|
881
|
+
check_critical_attribute( attribs, :record_name )
|
882
|
+
|
883
|
+
attribs = tidy_attribs(attribs)
|
884
|
+
attribute = attribs[:attribute]
|
885
|
+
attribs[:value] = nil
|
886
|
+
|
887
|
+
command = {action: 'delete', scope: 'Users', attribute: attribute}
|
888
|
+
user_attrs = attribs.merge(command)
|
889
|
+
|
890
|
+
dscl(user_attrs, dir_info)
|
891
|
+
end
|
879
892
|
end
|
880
893
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: open_directory_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bill Tihen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-06-
|
12
|
+
date: 2018-06-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: net-ssh
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
122
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.7.
|
123
|
+
rubygems_version: 2.7.7
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: A ruby wrapper to access MacOpenDirectory management commands remotely
|