| @@ 1444-1462 (lines=19) @@ | ||
| 1441 | throw new \InvalidArgumentException('String expected'); |
|
| 1442 | } |
|
| 1443 | $blocks = explode('-', $guid); |
|
| 1444 | if(count($blocks) !== 5) { |
|
| 1445 | /* |
|
| 1446 | * Why not throw an Exception instead? This method is a utility |
|
| 1447 | * called only when trying to figure out whether a "missing" known |
|
| 1448 | * LDAP user was or was not renamed on the LDAP server. And this |
|
| 1449 | * even on the use case that a reverse lookup is needed (UUID known, |
|
| 1450 | * not DN), i.e. when finding users (search dialog, users page, |
|
| 1451 | * login, …) this will not be fired. This occurs only if shares from |
|
| 1452 | * a users are supposed to be mounted who cannot be found. Throwing |
|
| 1453 | * an exception here would kill the experience for a valid, acting |
|
| 1454 | * user. Instead we write a log message. |
|
| 1455 | */ |
|
| 1456 | \OC::$server->getLogger()->info( |
|
| 1457 | 'Passed string does not resemble a valid GUID. Known UUID ' . |
|
| 1458 | '({uuid}) probably does not match UUID configuration.', |
|
| 1459 | [ 'app' => 'user_ldap', 'uuid' => $guid ] |
|
| 1460 | ); |
|
| 1461 | return $guid; |
|
| 1462 | } |
|
| 1463 | for($i=0; $i < 3; $i++) { |
|
| 1464 | $pairs = str_split($blocks[$i], 2); |
|
| 1465 | $pairs = array_reverse($pairs); |
|
| @@ 316-321 (lines=6) @@ | ||
| 313 | */ |
|
| 314 | public function deleteUser($uid) { |
|
| 315 | $marked = $this->ocConfig->getUserValue($uid, 'user_ldap', 'isDeleted', 0); |
|
| 316 | if(intval($marked) === 0) { |
|
| 317 | \OC::$server->getLogger()->notice( |
|
| 318 | 'User '.$uid . ' is not marked as deleted, not cleaning up.', |
|
| 319 | array('app' => 'user_ldap')); |
|
| 320 | return false; |
|
| 321 | } |
|
| 322 | \OC::$server->getLogger()->info('Cleaning up after user ' . $uid, |
|
| 323 | array('app' => 'user_ldap')); |
|
| 324 | ||