Added Fetch Email on page load

This commit is contained in:
Gitea
2025-04-26 00:22:03 +05:30
parent 9aa1b3ab8e
commit 89f6410578
16 changed files with 136 additions and 267 deletions

View File

@@ -65,7 +65,8 @@ class Action extends Component
$this->dispatch('closeModal');
}
public function deleteEmail() {
public function deleteEmail(): void
{
ZEmail::removeEmail($this->email);
// if (count($this->emails) <= 1 && json_decode(config('app.settings.configuration_settings'))->after_last_email_delete == 'redirect_to_homepage') {
// return redirect()->route('home');
@@ -82,7 +83,8 @@ class Action extends Component
$this->dispatch('showAlert', ['type' => $type, 'message' => $message]);
}
private function checkEmailLimit() {
private function checkEmailLimit(): bool
{
$logs = Log::select('ip', 'email')->where('ip', request()->ip())->where('created_at', '>', Carbon::now()->subDay())->groupBy('email')->groupBy('ip')->get();
if (count($logs) >= json_decode(config('app.settings.configuration_settings'))->email_limit) {
return false;
@@ -90,7 +92,8 @@ class Action extends Component
return true;
}
private function checkUsedEmail() {
private function checkUsedEmail(): bool
{
if (json_decode(config('app.settings.configuration_settings'))->disable_used_email) {
$check = Log::where('email', $this->user . '@' . $this->domain)->where('ip', '<>', request()->ip())->count();
if ($check > 0) {