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