Skip to content

Commit 5032236

Browse files
authored
Remove all terms of use logic code (#1182)
* Drop database tables * Remove Laravel Jobs * Remove any logic and tests related to Terms of Use Bug: T430532
1 parent c9b333f commit 5032236

10 files changed

Lines changed: 15 additions & 250 deletions

app/Jobs/CreateFirstTermsOfUseVersionJob.php

Lines changed: 0 additions & 26 deletions
This file was deleted.

app/Jobs/UserCreateJob.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33
namespace App\Jobs;
44

5-
use App\TermsOfUseVersion;
65
use App\User;
7-
use App\UserTermsOfUseAcceptance;
86
use Illuminate\Support\Facades\Hash;
9-
use Illuminate\Support\Facades\Log;
107

118
class UserCreateJob extends Job {
129
private $email;
@@ -33,17 +30,7 @@ public function handle() {
3330
'verified' => $this->verified,
3431
]);
3532

36-
$latest = TermsOfUseVersion::latestActiveVersion();
37-
if ($latest) {
38-
UserTermsOfUseAcceptance::create([
39-
'user_id' => $user->id,
40-
'tou_version' => $latest->version,
41-
'tou_accepted_at' => now(),
42-
]);
43-
} else {
44-
Log::warning("No active Terms of Use version found when creating user {$user->email} (ID {$user->id}).");
45-
}
46-
4733
return $user;
34+
4835
}
4936
}

app/Jobs/UserTouAcceptanceJob.php

Lines changed: 0 additions & 40 deletions
This file was deleted.

app/TermsOfUseVersion.php

Lines changed: 0 additions & 37 deletions
This file was deleted.

app/User.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
namespace App;
44

55
use App\Notifications\ResetPasswordNotification;
6-
use http\Exception\RuntimeException;
76
use Illuminate\Contracts\Auth\MustVerifyEmail;
87
use Illuminate\Database\Eloquent\Collection;
98
use Illuminate\Database\Eloquent\Factories\HasFactory;
109
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
11-
use Illuminate\Database\Eloquent\Relations\HasMany;
1210
use Illuminate\Foundation\Auth\User as Authenticatable;
1311
use Illuminate\Notifications\DatabaseNotification;
1412
use Illuminate\Notifications\DatabaseNotificationCollection;
@@ -93,10 +91,6 @@ public function managesWikis(): BelongsToMany {
9391
return $this->belongsToMany(Wiki::class, 'wiki_managers');
9492
}
9593

96-
public function touAcceptances(): HasMany {
97-
return $this->hasMany(UserTermsOfUseAcceptance::class, 'user_id');
98-
}
99-
10094
public function hasVerifiedEmail() {
10195
return (bool) $this->verified;
10296
}

app/UserTermsOfUseAcceptance.php

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Support\Facades\Schema;
5+
6+
return new class() extends Migration {
7+
/**
8+
* Run the migrations.
9+
*/
10+
public function up(): void {
11+
Schema::dropIfExists('tou_versions');
12+
Schema::dropIfExists('tou_acceptances');
13+
}
14+
};

tests/Jobs/CreateFirstTermsOfUseVersionJobTest.php

Lines changed: 0 additions & 22 deletions
This file was deleted.

tests/Jobs/UserTermsOfUseAcceptanceTest.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

tests/Jobs/UserTouAcceptanceJobTest.php

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)