open_directory_utils 0.1.8 → 0.1.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed1cf0c08b79e4832c6903edb72dd0ffa10c2ec26a2e36e0165853cdbb8e66d8
|
4
|
+
data.tar.gz: d256232b25ef945bea92165aa186a5195307fcc7963302113f0aef582a5e9404
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a6c8cc13d45f02c715a1656315c98dd7f2769f32270c8b687d82c411d0136caa1857676a57447ed442d773373e02c547323910c545182818d2f3c0dba0ff032
|
7
|
+
data.tar.gz: 6033b13f07cff2c8eb90d5a6f1ac5e3d3549b06605032ef9b3cb588f7b090812022676431e215dd8a1efa701bff0e0a697d5482e4b0511b2910a898ca70d7e83
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -7,8 +7,12 @@ 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.
|
10
|
+
* **v0.1.10** - 2018-06-??
|
11
11
|
- remove attribs[:value] side effect (return original attribs - always)
|
12
|
+
* **v0.1.9** - 2018-06-??
|
13
|
+
- add address, town, city, state, postal_code, country, weblog and homepage, title, company added to user_create and user_update
|
14
|
+
* **v0.1.8** - 2018-06-19
|
15
|
+
- added department and keywords to user_create and user_update
|
12
16
|
* **v0.1.7** - 2018-06-19
|
13
17
|
- add update user method
|
14
18
|
- fix unused variable warnings
|
@@ -655,6 +655,28 @@ module OpenDirectoryUtils
|
|
655
655
|
end
|
656
656
|
alias_method :user_set_keyword, :user_set_keywords
|
657
657
|
|
658
|
+
# /usr/bin/dscl -u diradmin -P A-B1g-S3cret /LDAPv3/127.0.0.1 -append /Users/$shortname_USERNAME apple-keyword "$VALUE"
|
659
|
+
def user_set_home_page(attribs, dir_info)
|
660
|
+
attribs = user_record_name_alternatives(attribs)
|
661
|
+
check_critical_attribute( attribs, :record_name )
|
662
|
+
|
663
|
+
attribs[:value] = attribs[:value] || attribs[:home_page]
|
664
|
+
attribs[:value] = attribs[:value] || attribs[:homepage]
|
665
|
+
attribs[:value] = attribs[:value] || attribs[:web_page]
|
666
|
+
attribs[:value] = attribs[:value] || attribs[:webpage]
|
667
|
+
attribs[:value] = attribs[:value] || attribs[:url]
|
668
|
+
|
669
|
+
check_critical_attribute( attribs, :value, :home_page )
|
670
|
+
attribs = tidy_attribs(attribs)
|
671
|
+
|
672
|
+
command = {action: 'create', scope: 'Users', attribute: 'URL'}
|
673
|
+
user_attrs = attribs.merge(command)
|
674
|
+
|
675
|
+
answer = dscl( user_attrs, dir_info )
|
676
|
+
attribs[:value] = nil
|
677
|
+
return answer
|
678
|
+
end
|
679
|
+
|
658
680
|
# /usr/bin/dscl -u diradmin -P A-B1g-S3cret /LDAPv3/127.0.0.1 -append /Users/$shortname_USERNAME apple-keyword "$VALUE"
|
659
681
|
def user_set_home_phone(attribs, dir_info)
|
660
682
|
attribs = user_record_name_alternatives(attribs)
|
@@ -87,10 +87,34 @@ module OpenDirectoryUtils
|
|
87
87
|
attribs[:value] = nil
|
88
88
|
answer << user_set_organization_info(attribs, dir_info)
|
89
89
|
end
|
90
|
+
if attribs[:title]
|
91
|
+
attribs[:value] = nil
|
92
|
+
answer << user_set_title(attribs, dir_info)
|
93
|
+
end
|
90
94
|
if attribs[:department] or attribs[:departmentnumber] or attribs[:department_number]
|
91
95
|
attribs[:value] = nil
|
92
96
|
answer << user_set_department(attribs, dir_info)
|
93
97
|
end
|
98
|
+
if attribs[:company]
|
99
|
+
attribs[:value] = nil
|
100
|
+
answer << user_set_company(attribs, dir_info)
|
101
|
+
end
|
102
|
+
if attribs[:address]
|
103
|
+
attribs[:value] = nil
|
104
|
+
answer << user_set_address(attribs, dir_info)
|
105
|
+
end
|
106
|
+
if attribs[:city] or attribs[:town]
|
107
|
+
attribs[:value] = nil
|
108
|
+
answer << user_set_city(attribs, dir_info)
|
109
|
+
end
|
110
|
+
if attribs[:state]
|
111
|
+
attribs[:value] = nil
|
112
|
+
answer << user_set_state(attribs, dir_info)
|
113
|
+
end
|
114
|
+
if attribs[:country]
|
115
|
+
attribs[:value] = nil
|
116
|
+
answer << user_set_country(attribs, dir_info)
|
117
|
+
end
|
94
118
|
if attribs[:keyword] or attribs[:keywords]
|
95
119
|
attribs[:value] = nil
|
96
120
|
answer << user_set_keywords(attribs, dir_info)
|
@@ -154,14 +178,51 @@ module OpenDirectoryUtils
|
|
154
178
|
attribs[:value] = nil
|
155
179
|
answer << user_set_organization_info(attribs, dir_info)
|
156
180
|
end
|
181
|
+
if attribs[:title] or attribs[:job_title]
|
182
|
+
attribs[:value] = nil
|
183
|
+
answer << user_set_title(attribs, dir_info)
|
184
|
+
end
|
157
185
|
if attribs[:department] or attribs[:departmentnumber] or attribs[:department_number]
|
158
186
|
attribs[:value] = nil
|
159
187
|
answer << user_set_department(attribs, dir_info)
|
160
188
|
end
|
189
|
+
if attribs[:company]
|
190
|
+
attribs[:value] = nil
|
191
|
+
answer << user_set_company(attribs, dir_info)
|
192
|
+
end
|
193
|
+
if attribs[:address]
|
194
|
+
attribs[:value] = nil
|
195
|
+
answer << user_set_address(attribs, dir_info)
|
196
|
+
end
|
197
|
+
if attribs[:city] or attribs[:town]
|
198
|
+
attribs[:value] = nil
|
199
|
+
answer << user_set_city(attribs, dir_info)
|
200
|
+
end
|
201
|
+
if attribs[:state]
|
202
|
+
attribs[:value] = nil
|
203
|
+
answer << user_set_state(attribs, dir_info)
|
204
|
+
end
|
205
|
+
if attribs[:postal_code] or attribs[:zip_code] or attribs[:zip]
|
206
|
+
attribs[:value] = nil
|
207
|
+
answer << user_set_postal_code(attribs, dir_info)
|
208
|
+
end
|
209
|
+
if attribs[:country]
|
210
|
+
attribs[:value] = nil
|
211
|
+
answer << user_set_country(attribs, dir_info)
|
212
|
+
end
|
213
|
+
if attribs[:home_page] or attribs[:homepage] or
|
214
|
+
attribs[:web_page] or attribs[:webpage] or attribs[:url]
|
215
|
+
attribs[:value] = nil
|
216
|
+
answer << user_set_home_page(attribs, dir_info)
|
217
|
+
end
|
161
218
|
if attribs[:keyword] or attribs[:keywords]
|
162
219
|
attribs[:value] = nil
|
163
220
|
answer << user_set_keywords(attribs, dir_info)
|
164
221
|
end
|
222
|
+
if attribs[:weblog] or attribs[:blog]
|
223
|
+
attribs[:value] = nil
|
224
|
+
answer << user_set_weblog(attribs, dir_info)
|
225
|
+
end
|
165
226
|
|
166
227
|
return answer.flatten
|
167
228
|
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.9
|
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-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: net-ssh
|