| @@ 1428-1446 (lines=19) @@ | ||
| 1425 | throw new \InvalidArgumentException('String expected'); |
|
| 1426 | } |
|
| 1427 | $blocks = explode('-', $guid); |
|
| 1428 | if(count($blocks) !== 5) { |
|
| 1429 | /* |
|
| 1430 | * Why not throw an Exception instead? This method is a utility |
|
| 1431 | * called only when trying to figure out whether a "missing" known |
|
| 1432 | * LDAP user was or was not renamed on the LDAP server. And this |
|
| 1433 | * even on the use case that a reverse lookup is needed (UUID known, |
|
| 1434 | * not DN), i.e. when finding users (search dialog, users page, |
|
| 1435 | * login, …) this will not be fired. This occurs only if shares from |
|
| 1436 | * a users are supposed to be mounted who cannot be found. Throwing |
|
| 1437 | * an exception here would kill the experience for a valid, acting |
|
| 1438 | * user. Instead we write a log message. |
|
| 1439 | */ |
|
| 1440 | \OC::$server->getLogger()->info( |
|
| 1441 | 'Passed string does not resemble a valid GUID. Known UUID ' . |
|
| 1442 | '({uuid}) probably does not match UUID configuration.', |
|
| 1443 | [ 'app' => 'user_ldap', 'uuid' => $guid ] |
|
| 1444 | ); |
|
| 1445 | return $guid; |
|
| 1446 | } |
|
| 1447 | for($i=0; $i < 3; $i++) { |
|
| 1448 | $pairs = str_split($blocks[$i], 2); |
|
| 1449 | $pairs = array_reverse($pairs); |
|
| @@ 282-287 (lines=6) @@ | ||
| 279 | */ |
|
| 280 | public function deleteUser($uid) { |
|
| 281 | $marked = $this->ocConfig->getUserValue($uid, 'user_ldap', 'isDeleted', 0); |
|
| 282 | if(intval($marked) === 0) { |
|
| 283 | \OC::$server->getLogger()->notice( |
|
| 284 | 'User '.$uid . ' is not marked as deleted, not cleaning up.', |
|
| 285 | array('app' => 'user_ldap')); |
|
| 286 | return false; |
|
| 287 | } |
|
| 288 | \OC::$server->getLogger()->info('Cleaning up after user ' . $uid, |
|
| 289 | array('app' => 'user_ldap')); |
|
| 290 | ||