1 | <?php |
||
39 | class User extends \FreeIPA\APIAccess\Base |
||
40 | { |
||
41 | |||
42 | /** |
||
43 | * Search user through of user_find method. |
||
44 | * If $args is a string, the server will search in login, first_name and |
||
45 | * last_name fields. |
||
46 | * |
||
47 | * @param array $args arguments for user_find method |
||
48 | * @param array $options options for user_find method |
||
49 | * @return array|bool false if the user was not found |
||
50 | * @since GIT: 0.1.0 |
||
51 | * @version GIT: 0.2.0 |
||
52 | * @throws \Exception if error in json return |
||
53 | * @see ../../docs/return_samples/user_find.txt |
||
54 | * @see \FreeIPA\APIAccess\Connection\buildRequest() |
||
55 | */ |
||
56 | public function find($args = array(), $options = array()) |
||
85 | |||
86 | /** |
||
87 | * Search user by field |
||
88 | * Principal fields are: |
||
89 | * 'givenname' => first name |
||
90 | * 'sn' => last name |
||
91 | * 'cn' => full name |
||
92 | * 'in_group' => user is in group |
||
93 | * 'not_in_group' => user it not in group |
||
94 | * 'mail' => e-mail address |
||
95 | * 'uid' => user unique name |
||
96 | * 'uidnumber' => user unique number |
||
97 | * |
||
98 | * @param array $field field name. See examples above |
||
99 | * @param string $value field value |
||
100 | * @return array|bool false if the user was not found |
||
101 | * @since GIT: 0.1.0 |
||
102 | * @version GIT: 0.1.0 |
||
103 | * @see find() |
||
104 | */ |
||
105 | public function findBy($field = null, $value = null) |
||
114 | |||
115 | /** |
||
116 | * Get user data by login through user_show method |
||
117 | * |
||
118 | * @param string|array $params user login or some parameters |
||
119 | * @param array $options options for user_show method |
||
120 | * @return array|bool false if the user was not found |
||
121 | * @since GIT: 0.1.0 |
||
122 | * @version GIT: 0.2.0 |
||
123 | * @throws \Exception se houver erro no retorno json |
||
124 | * @see ../../docs/return_samples/user_show.txt |
||
125 | * @see \FreeIPA\APIAccess\Connection\buildRequest() |
||
126 | */ |
||
127 | public function get($params = null, $options = array()) |
||
169 | |||
170 | /** |
||
171 | * Adds a user |
||
172 | * The main fields in $data: |
||
173 | * 'givenname' => first name |
||
174 | * 'sn' => last name |
||
175 | * 'cn' => full name |
||
176 | * 'mail' => e-mail address |
||
177 | * 'uid' => login (required field) |
||
178 | * 'userpassword' => user password |
||
179 | * |
||
180 | * @param array $data user data. See example above |
||
181 | * @return object|bool Object with new user data or false if the user was not found |
||
182 | * @since GIT: 0.1.0 |
||
183 | * @version GIT: 0.1.0 |
||
184 | * @see \FreeIPA\APIAccess\Connection\buildRequest() |
||
185 | */ |
||
186 | public function add($data) |
||
213 | |||
214 | /** |
||
215 | * Change user data |
||
216 | * The main fields in $data: |
||
217 | * 'givenname' => first name |
||
218 | * 'sn' => last name |
||
219 | * 'cn' => full name |
||
220 | * 'mail' => e-mail address |
||
221 | * 'userpassword' => user password |
||
222 | * 'krbprincipalexpiration' => Date of password expiration (Python __datetime__). Example: 20150816010101Z |
||
223 | * |
||
224 | * If user does not exists, the \FreeIPA\APIAccess\Connection\buildRequest() method will return \Exception. |
||
225 | * Please, note that change the user password will be subject to server policies, such as |
||
226 | * length, expiration date and freeIPA behavior that will invalidate the first password. |
||
227 | * If password was invalidated the user don't will be able to make login through authenticate() method |
||
228 | * |
||
229 | * @param string $login uid user that will be changed |
||
230 | * @param array $data See above |
||
231 | * @return object|bool Object with new 1user data or false if the user was not found |
||
232 | * @since GIT: 0.1.0 |
||
233 | * @version GIT: 0.1.0 |
||
234 | * @see ../../docs/return_samples/user_mod.txt |
||
235 | * @see \FreeIPA\APIAccess\Connection\buildRequest() |
||
236 | * @link https://www.freeipa.org/page/New_Passwords_Expired |
||
237 | * @link https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Identity_Management_Guide/changing-pwds.html |
||
238 | * @link http://docs.fedoraproject.org/en-US/Fedora/17/html/FreeIPA_Guide/pwd-expiration.html |
||
239 | */ |
||
240 | public function modify($login = null, $data = array()) |
||
265 | |||
266 | } |
||
267 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.