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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed1cf0c08b79e4832c6903edb72dd0ffa10c2ec26a2e36e0165853cdbb8e66d8
4
- data.tar.gz: d256232b25ef945bea92165aa186a5195307fcc7963302113f0aef582a5e9404
3
+ metadata.gz: 97476363fb4501f2512cdd697ccda07dbaf0fc20103fcfa6c2c9055eb33c7950
4
+ data.tar.gz: 32eb0be00ff8205850cd5293b46f74b5a2513ae485602b53eae51270ae34eec5
5
5
  SHA512:
6
- metadata.gz: 5a6c8cc13d45f02c715a1656315c98dd7f2769f32270c8b687d82c411d0136caa1857676a57447ed442d773373e02c547323910c545182818d2f3c0dba0ff032
7
- data.tar.gz: 6033b13f07cff2c8eb90d5a6f1ac5e3d3549b06605032ef9b3cb588f7b090812022676431e215dd8a1efa701bff0e0a697d5482e4b0511b2910a898ca70d7e83
6
+ metadata.gz: c57ddd2c3f63739795cf0c030050c0df8dcd1565b0b889b624409debb90d4a6c7dc72ff0787918dea0b621efa8d37eccd409d18bdb140e0ce57b94baa0ace346
7
+ data.tar.gz: b1b196058867d99ac45f934adc82a21b08e99f02105a59fb40740f1499d1cd7e2241f4c0cdabb0222c13806c70220793a580644f2b7bac486bc0cc4c4421e6fd
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- open_directory_utils (0.1.9)
4
+ open_directory_utils (0.1.11)
5
5
  net-ssh (~> 4.2)
6
6
 
7
7
  GEM
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
@@ -1,5 +1,5 @@
1
1
  module OpenDirectoryUtils
2
2
  module Version
3
- VERSION = "0.1.9"
3
+ VERSION = "0.1.11"
4
4
  end
5
5
  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.9
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-20 00:00:00.000000000 Z
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.6
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