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