Signed-off-by: Robin Appelman <icewind@owncloud.com>tags/v11.0RC2
$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['canDelete'] = true; | |||||
return [ | return [ | ||||
'token' => $token, | 'token' => $token, | ||||
'loginName' => $loginName, | 'loginName' => $loginName, | ||||
'deviceToken' => $deviceToken | |||||
'deviceToken' => $tokenData | |||||
]; | ]; | ||||
} | } | ||||
} | } | ||||
#sessions .token-list a.icon, | #sessions .token-list a.icon, | ||||
#apppasswords .token-list a.icon { | #apppasswords .token-list a.icon { | ||||
display: block; | |||||
opacity: 0.6; | opacity: 0.6; | ||||
margin-top: 4px; | margin-top: 4px; | ||||
display: none; | |||||
} | |||||
#sessions .token-list tr:hover a.icon, | |||||
#apppasswords .token-list tr:hover a.icon { | |||||
display: block; | |||||
} | } | ||||
#sessions .token-list td div.configure, | #sessions .token-list td div.configure, | ||||
#apppasswords .token-list td div.configure { | #apppasswords .token-list td div.configure { | ||||
display: none; | display: none; | ||||
height: 18px; | |||||
} | } | ||||
#sessions .token-list tr.active div.configure, | #sessions .token-list tr.active div.configure, |
var list = this.$('.token-list'); | var list = this.$('.token-list'); | ||||
var tokens = this.collection.filter(function (token) { | var tokens = this.collection.filter(function (token) { | ||||
return parseInt(token.get('type'), 10) === _this.type; | |||||
return token.get('type') === _this.type; | |||||
}); | }); | ||||
list.html(''); | list.html(''); | ||||
var ts = viewData.lastActivity * 1000; | var ts = viewData.lastActivity * 1000; | ||||
viewData.lastActivity = OC.Util.relativeModifiedDate(ts); | viewData.lastActivity = OC.Util.relativeModifiedDate(ts); | ||||
viewData.lastActivityTime = OC.Util.formatDate(ts, 'LLL'); | viewData.lastActivityTime = OC.Util.formatDate(ts, 'LLL'); | ||||
viewData.canScope = token.get('type') === '1'; | |||||
viewData.canScope = token.get('type') === 1; | |||||
// preserve title for cases where we format it further | // preserve title for cases where we format it further | ||||
viewData.title = viewData.name; | viewData.title = viewData.name; |