| @@ 1475-1493 (lines=19) @@ | ||
| 1472 | throw new \InvalidArgumentException('String expected'); |
|
| 1473 | } |
|
| 1474 | $blocks = explode('-', $guid); |
|
| 1475 | if(count($blocks) !== 5) { |
|
| 1476 | /* |
|
| 1477 | * Why not throw an Exception instead? This method is a utility |
|
| 1478 | * called only when trying to figure out whether a "missing" known |
|
| 1479 | * LDAP user was or was not renamed on the LDAP server. And this |
|
| 1480 | * even on the use case that a reverse lookup is needed (UUID known, |
|
| 1481 | * not DN), i.e. when finding users (search dialog, users page, |
|
| 1482 | * login, …) this will not be fired. This occurs only if shares from |
|
| 1483 | * a users are supposed to be mounted who cannot be found. Throwing |
|
| 1484 | * an exception here would kill the experience for a valid, acting |
|
| 1485 | * user. Instead we write a log message. |
|
| 1486 | */ |
|
| 1487 | \OC::$server->getLogger()->info( |
|
| 1488 | 'Passed string does not resemble a valid GUID. Known UUID ' . |
|
| 1489 | '({uuid}) probably does not match UUID configuration.', |
|
| 1490 | [ 'app' => 'user_ldap', 'uuid' => $guid ] |
|
| 1491 | ); |
|
| 1492 | return $guid; |
|
| 1493 | } |
|
| 1494 | for($i=0; $i < 3; $i++) { |
|
| 1495 | $pairs = str_split($blocks[$i], 2); |
|
| 1496 | $pairs = array_reverse($pairs); |
|
| @@ 291-296 (lines=6) @@ | ||
| 288 | */ |
|
| 289 | public function deleteUser($uid) { |
|
| 290 | $marked = $this->ocConfig->getUserValue($uid, 'user_ldap', 'isDeleted', 0); |
|
| 291 | if(intval($marked) === 0) { |
|
| 292 | \OC::$server->getLogger()->notice( |
|
| 293 | 'User '.$uid . ' is not marked as deleted, not cleaning up.', |
|
| 294 | array('app' => 'user_ldap')); |
|
| 295 | return false; |
|
| 296 | } |
|
| 297 | \OC::$server->getLogger()->info('Cleaning up after user ' . $uid, |
|
| 298 | array('app' => 'user_ldap')); |
|
| 299 | ||