|
|
@ -145,6 +145,10 @@ class AuthSettingsController extends Controller { |
|
|
return $this->getServiceNotAvailableResponse(); |
|
|
return $this->getServiceNotAvailableResponse(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (mb_strlen($name) > 128) { |
|
|
|
|
|
$name = mb_substr($name, 0, 120) . '…'; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
$token = $this->generateRandomDeviceToken(); |
|
|
$token = $this->generateRandomDeviceToken(); |
|
|
$deviceToken = $this->tokenProvider->generateToken($token, $this->uid, $loginName, $password, $name, IToken::PERMANENT_TOKEN); |
|
|
$deviceToken = $this->tokenProvider->generateToken($token, $this->uid, $loginName, $password, $name, IToken::PERMANENT_TOKEN); |
|
|
$tokenData = $deviceToken->jsonSerialize(); |
|
|
$tokenData = $deviceToken->jsonSerialize(); |
|
|
@ -241,6 +245,10 @@ class AuthSettingsController extends Controller { |
|
|
$this->publishActivity($scope['filesystem'] ? Provider::APP_TOKEN_FILESYSTEM_GRANTED : Provider::APP_TOKEN_FILESYSTEM_REVOKED, $token->getId(), ['name' => $currentName]); |
|
|
$this->publishActivity($scope['filesystem'] ? Provider::APP_TOKEN_FILESYSTEM_GRANTED : Provider::APP_TOKEN_FILESYSTEM_REVOKED, $token->getId(), ['name' => $currentName]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (mb_strlen($name) > 128) { |
|
|
|
|
|
$name = mb_substr($name, 0, 120) . '…'; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if ($token instanceof INamedToken && $name !== $currentName) { |
|
|
if ($token instanceof INamedToken && $name !== $currentName) { |
|
|
$token->setName($name); |
|
|
$token->setName($name); |
|
|
$this->publishActivity(Provider::APP_TOKEN_RENAMED, $token->getId(), ['name' => $currentName, 'newName' => $name]); |
|
|
$this->publishActivity(Provider::APP_TOKEN_RENAMED, $token->getId(), ['name' => $currentName, 'newName' => $name]); |
|
|
|