Also shorten the name of the invitation tokens

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/10213/head
Joas Schilling 7 years ago
parent b7de6d7a24
commit daed1bed57
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
  1. 2
      apps/dav/lib/BackgroundJob/CleanupInvitationTokenJob.php
  2. 2
      apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
  3. 2
      apps/dav/lib/Controller/InvitationResponseController.php
  4. 8
      apps/dav/lib/Migration/Version1006Date20180619154313.php
  5. 4
      apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php
  6. 6
      apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php
  7. 4
      apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php

@ -45,7 +45,7 @@ class CleanupInvitationTokenJob extends TimedJob {
public function run($argument) {
$query = $this->db->getQueryBuilder();
$query->delete('calendar_invitation_tokens')
$query->delete('calendar_invitations')
->where($query->expr()->lt('expiration',
$query->createNamedParameter($this->timeFactory->getTime())))
->execute();

@ -536,7 +536,7 @@ class IMipPlugin extends SabreIMipPlugin {
$uid = $vevent->{'UID'};
$query = $this->db->getQueryBuilder();
$query->insert('calendar_invitation_tokens')
$query->insert('calendar_invitations')
->values([
'token' => $query->createNamedParameter($token),
'attendee' => $query->createNamedParameter($attendee),

@ -162,7 +162,7 @@ class InvitationResponseController extends Controller {
private function getTokenInformation(string $token) {
$query = $this->db->getQueryBuilder();
$query->select('*')
->from('calendar_invitation_tokens')
->from('calendar_invitations')
->where($query->expr()->eq('token', $query->createNamedParameter($token)));
$stmt = $query->execute();
$row = $stmt->fetch(\PDO::FETCH_ASSOC);

@ -22,8 +22,8 @@ class Version1006Date20180619154313 extends SimpleMigrationStep {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
if (!$schema->hasTable('calendar_invitation_tokens')) {
$table = $schema->createTable('calendar_invitation_tokens');
if (!$schema->hasTable('calendar_invitations')) {
$table = $schema->createTable('calendar_invitations');
$table->addColumn('id', Type::BIGINT, [
'autoincrement' => true,
@ -62,8 +62,8 @@ class Version1006Date20180619154313 extends SimpleMigrationStep {
'unsigned' => true,
]);
$table->setPrimaryKey(['id'], 'calendar_invitation_tokens_id_idx');
$table->addIndex(['token'], 'calendar_invitation_tokens_token_idx');
$table->setPrimaryKey(['id']);
$table->addIndex(['token'], 'calendar_invitation_tokens');
return $schema;
}

@ -84,7 +84,7 @@ class CleanupInvitationTokenJobTest extends TestCase {
$queryBuilder->expects($this->at(0))
->method('delete')
->with('calendar_invitation_tokens')
->with('calendar_invitations')
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(3))
->method('where')
@ -97,4 +97,4 @@ class CleanupInvitationTokenJobTest extends TestCase {
$this->backgroundJob->run([]);
}
}
}

@ -96,7 +96,7 @@ class IMipPluginTest extends TestCase {
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(0))
->method('insert')
->with('calendar_invitation_tokens')
->with('calendar_invitations')
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(8))
->method('values')
@ -176,7 +176,7 @@ class IMipPluginTest extends TestCase {
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(0))
->method('insert')
->with('calendar_invitation_tokens')
->with('calendar_invitations')
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(8))
->method('values')
@ -264,7 +264,7 @@ class IMipPluginTest extends TestCase {
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(0))
->method('insert')
->with('calendar_invitation_tokens')
->with('calendar_invitations')
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(8))
->method('values')

@ -438,7 +438,7 @@ EOF;
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(1))
->method('from')
->with('calendar_invitation_tokens')
->with('calendar_invitations')
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(4))
->method('where')
@ -452,4 +452,4 @@ EOF;
$this->timeFactory->method('getTime')
->will($this->returnValue($time));
}
}
}

Loading…
Cancel
Save