mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
Disable account registering from disabled email provider
This commit is contained in:
557
config/disposable-email-providers.php
Normal file
557
config/disposable-email-providers.php
Normal file
@@ -0,0 +1,557 @@
|
||||
<?php
|
||||
|
||||
// List based on michenriksen/disposable-email-provider-domains
|
||||
// https://gist.github.com/michenriksen/8710649
|
||||
|
||||
return [
|
||||
'0815.ru',
|
||||
'0wnd.net',
|
||||
'0wnd.org',
|
||||
'10minutemail.co.za',
|
||||
'10minutemail.com',
|
||||
'123-m.com',
|
||||
'1fsdfdsfsdf.tk',
|
||||
'1pad.de',
|
||||
'20minutemail.com',
|
||||
'21cn.com',
|
||||
'2fdgdfgdfgdf.tk',
|
||||
'2prong.com',
|
||||
'30minutemail.com',
|
||||
'33mail.com',
|
||||
'3trtretgfrfe.tk',
|
||||
'4gfdsgfdgfd.tk',
|
||||
'4warding.com',
|
||||
'5ghgfhfghfgh.tk',
|
||||
'6hjgjhgkilkj.tk',
|
||||
'6paq.com',
|
||||
'7tags.com',
|
||||
'9ox.net',
|
||||
'a-bc.net',
|
||||
'agedmail.com',
|
||||
'ama-trade.de',
|
||||
'amilegit.com',
|
||||
'amiri.net',
|
||||
'amiriindustries.com',
|
||||
'anonmails.de',
|
||||
'anonymbox.com',
|
||||
'antichef.com',
|
||||
'antichef.net',
|
||||
'antireg.ru',
|
||||
'antispam.de',
|
||||
'antispammail.de',
|
||||
'armyspy.com',
|
||||
'artman-conception.com',
|
||||
'azmeil.tk',
|
||||
'baxomale.ht.cx',
|
||||
'beefmilk.com',
|
||||
'bigstring.com',
|
||||
'binkmail.com',
|
||||
'bio-muesli.net',
|
||||
'bobmail.info',
|
||||
'bodhi.lawlita.com',
|
||||
'bofthew.com',
|
||||
'bootybay.de',
|
||||
'boun.cr',
|
||||
'bouncr.com',
|
||||
'breakthru.com',
|
||||
'brefmail.com',
|
||||
'bsnow.net',
|
||||
'bspamfree.org',
|
||||
'bugmenot.com',
|
||||
'bund.us',
|
||||
'burstmail.info',
|
||||
'buymoreplays.com',
|
||||
'byom.de',
|
||||
'c2.hu',
|
||||
'card.zp.ua',
|
||||
'casualdx.com',
|
||||
'cek.pm',
|
||||
'centermail.com',
|
||||
'centermail.net',
|
||||
'chammy.info',
|
||||
'childsavetrust.org',
|
||||
'chogmail.com',
|
||||
'choicemail1.com',
|
||||
'clixser.com',
|
||||
'cmail.net',
|
||||
'cmail.org',
|
||||
'coldemail.info',
|
||||
'cool.fr.nf',
|
||||
'courriel.fr.nf',
|
||||
'courrieltemporaire.com',
|
||||
'crapmail.org',
|
||||
'cust.in',
|
||||
'cuvox.de',
|
||||
'd3p.dk',
|
||||
'dacoolest.com',
|
||||
'dandikmail.com',
|
||||
'dayrep.com',
|
||||
'dcemail.com',
|
||||
'deadaddress.com',
|
||||
'deadspam.com',
|
||||
'delikkt.de',
|
||||
'despam.it',
|
||||
'despammed.com',
|
||||
'devnullmail.com',
|
||||
'dfgh.net',
|
||||
'digitalsanctuary.com',
|
||||
'dingbone.com',
|
||||
'disposableaddress.com',
|
||||
'disposableemailaddresses.com',
|
||||
'disposableinbox.com',
|
||||
'dispose.it',
|
||||
'dispostable.com',
|
||||
'dodgeit.com',
|
||||
'dodgit.com',
|
||||
'donemail.ru',
|
||||
'dontreg.com',
|
||||
'dontsendmespam.de',
|
||||
'drdrb.net',
|
||||
'dump-email.info',
|
||||
'dumpandjunk.com',
|
||||
'dumpyemail.com',
|
||||
'e-mail.com',
|
||||
'e-mail.org',
|
||||
'e4ward.com',
|
||||
'easytrashmail.com',
|
||||
'einmalmail.de',
|
||||
'einrot.com',
|
||||
'eintagsmail.de',
|
||||
'emailgo.de',
|
||||
'emailias.com',
|
||||
'emaillime.com',
|
||||
'emailsensei.com',
|
||||
'emailtemporanea.com',
|
||||
'emailtemporanea.net',
|
||||
'emailtemporar.ro',
|
||||
'emailtemporario.com.br',
|
||||
'emailthe.net',
|
||||
'emailtmp.com',
|
||||
'emailwarden.com',
|
||||
'emailx.at.hm',
|
||||
'emailxfer.com',
|
||||
'emeil.in',
|
||||
'emeil.ir',
|
||||
'emz.net',
|
||||
'ero-tube.org',
|
||||
'evopo.com',
|
||||
'explodemail.com',
|
||||
'express.net.ua',
|
||||
'eyepaste.com',
|
||||
'fakeinbox.com',
|
||||
'fakeinformation.com',
|
||||
'fansworldwide.de',
|
||||
'fantasymail.de',
|
||||
'fightallspam.com',
|
||||
'filzmail.com',
|
||||
'fivemail.de',
|
||||
'fleckens.hu',
|
||||
'frapmail.com',
|
||||
'friendlymail.co.uk',
|
||||
'fuckingduh.com',
|
||||
'fudgerub.com',
|
||||
'fyii.de',
|
||||
'garliclife.com',
|
||||
'gehensiemirnichtaufdensack.de',
|
||||
'get2mail.fr',
|
||||
'getairmail.com',
|
||||
'getmails.eu',
|
||||
'getonemail.com',
|
||||
'giantmail.de',
|
||||
'girlsundertheinfluence.com',
|
||||
'gishpuppy.com',
|
||||
'gmial.com',
|
||||
'goemailgo.com',
|
||||
'gotmail.net',
|
||||
'gotmail.org',
|
||||
'gotti.otherinbox.com',
|
||||
'great-host.in',
|
||||
'greensloth.com',
|
||||
'grr.la',
|
||||
'gsrv.co.uk',
|
||||
'guerillamail.biz',
|
||||
'guerillamail.com',
|
||||
'guerrillamail.biz',
|
||||
'guerrillamail.com',
|
||||
'guerrillamail.de',
|
||||
'guerrillamail.info',
|
||||
'guerrillamail.net',
|
||||
'guerrillamail.org',
|
||||
'guerrillamailblock.com',
|
||||
'gustr.com',
|
||||
'harakirimail.com',
|
||||
'hat-geld.de',
|
||||
'hatespam.org',
|
||||
'herp.in',
|
||||
'hidemail.de',
|
||||
'hidzz.com',
|
||||
'hmamail.com',
|
||||
'hopemail.biz',
|
||||
'ieh-mail.de',
|
||||
'ikbenspamvrij.nl',
|
||||
'imails.info',
|
||||
'inbax.tk',
|
||||
'inbox.si',
|
||||
'inboxalias.com',
|
||||
'inboxclean.com',
|
||||
'inboxclean.org',
|
||||
'infocom.zp.ua',
|
||||
'instant-mail.de',
|
||||
'ip6.li',
|
||||
'irish2me.com',
|
||||
'iwi.net',
|
||||
'jetable.com',
|
||||
'jetable.fr.nf',
|
||||
'jetable.net',
|
||||
'jetable.org',
|
||||
'jnxjn.com',
|
||||
'jourrapide.com',
|
||||
'jsrsolutions.com',
|
||||
'kasmail.com',
|
||||
'kaspop.com',
|
||||
'killmail.com',
|
||||
'killmail.net',
|
||||
'klassmaster.com',
|
||||
'klzlk.com',
|
||||
'koszmail.pl',
|
||||
'kurzepost.de',
|
||||
'lawlita.com',
|
||||
'letthemeatspam.com',
|
||||
'lhsdv.com',
|
||||
'lifebyfood.com',
|
||||
'link2mail.net',
|
||||
'litedrop.com',
|
||||
'lol.ovpn.to',
|
||||
'lolfreak.net',
|
||||
'lookugly.com',
|
||||
'lortemail.dk',
|
||||
'lr78.com',
|
||||
'lroid.com',
|
||||
'lukop.dk',
|
||||
'm21.cc',
|
||||
'mail-filter.com',
|
||||
'mail-temporaire.fr',
|
||||
'mail.by',
|
||||
'mail.mezimages.net',
|
||||
'mail.zp.ua',
|
||||
'mail1a.de',
|
||||
'mail21.cc',
|
||||
'mail2rss.org',
|
||||
'mail333.com',
|
||||
'mailbidon.com',
|
||||
'mailbiz.biz',
|
||||
'mailblocks.com',
|
||||
'mailbucket.org',
|
||||
'mailcat.biz',
|
||||
'mailcatch.com',
|
||||
'mailde.de',
|
||||
'mailde.info',
|
||||
'maildrop.cc',
|
||||
'maileimer.de',
|
||||
'mailexpire.com',
|
||||
'mailfa.tk',
|
||||
'mailforspam.com',
|
||||
'mailfreeonline.com',
|
||||
'mailguard.me',
|
||||
'mailin8r.com',
|
||||
'mailinater.com',
|
||||
'mailinator.com',
|
||||
'mailinator.net',
|
||||
'mailinator.org',
|
||||
'mailinator2.com',
|
||||
'mailincubator.com',
|
||||
'mailismagic.com',
|
||||
'mailme.lv',
|
||||
'mailme24.com',
|
||||
'mailmetrash.com',
|
||||
'mailmoat.com',
|
||||
'mailms.com',
|
||||
'mailnesia.com',
|
||||
'mailnull.com',
|
||||
'mailorg.org',
|
||||
'mailpick.biz',
|
||||
'mailrock.biz',
|
||||
'mailscrap.com',
|
||||
'mailshell.com',
|
||||
'mailsiphon.com',
|
||||
'mailtemp.info',
|
||||
'mailtome.de',
|
||||
'mailtothis.com',
|
||||
'mailtrash.net',
|
||||
'mailtv.net',
|
||||
'mailtv.tv',
|
||||
'mailzilla.com',
|
||||
'makemetheking.com',
|
||||
'manybrain.com',
|
||||
'mbx.cc',
|
||||
'mega.zik.dj',
|
||||
'meinspamschutz.de',
|
||||
'meltmail.com',
|
||||
'messagebeamer.de',
|
||||
'mezimages.net',
|
||||
'ministry-of-silly-walks.de',
|
||||
'mintemail.com',
|
||||
'misterpinball.de',
|
||||
'moncourrier.fr.nf',
|
||||
'monemail.fr.nf',
|
||||
'monmail.fr.nf',
|
||||
'monumentmail.com',
|
||||
'mt2009.com',
|
||||
'mt2014.com',
|
||||
'mycard.net.ua',
|
||||
'mycleaninbox.net',
|
||||
'mymail-in.net',
|
||||
'mypacks.net',
|
||||
'mypartyclip.de',
|
||||
'myphantomemail.com',
|
||||
'mysamp.de',
|
||||
'mytempemail.com',
|
||||
'mytempmail.com',
|
||||
'mytrashmail.com',
|
||||
'nabuma.com',
|
||||
'neomailbox.com',
|
||||
'nepwk.com',
|
||||
'nervmich.net',
|
||||
'nervtmich.net',
|
||||
'netmails.com',
|
||||
'netmails.net',
|
||||
'neverbox.com',
|
||||
'nice-4u.com',
|
||||
'nincsmail.hu',
|
||||
'nnh.com',
|
||||
'no-spam.ws',
|
||||
'noblepioneer.com',
|
||||
'nomail.pw',
|
||||
'nomail.xl.cx',
|
||||
'nomail2me.com',
|
||||
'nomorespamemails.com',
|
||||
'nospam.ze.tc',
|
||||
'nospam4.us',
|
||||
'nospamfor.us',
|
||||
'nospammail.net',
|
||||
'notmailinator.com',
|
||||
'nowhere.org',
|
||||
'nowmymail.com',
|
||||
'nurfuerspam.de',
|
||||
'nus.edu.sg',
|
||||
'objectmail.com',
|
||||
'obobbo.com',
|
||||
'odnorazovoe.ru',
|
||||
'oneoffemail.com',
|
||||
'onewaymail.com',
|
||||
'onlatedotcom.info',
|
||||
'online.ms',
|
||||
'opayq.com',
|
||||
'ordinaryamerican.net',
|
||||
'otherinbox.com',
|
||||
'ovpn.to',
|
||||
'owlpic.com',
|
||||
'pancakemail.com',
|
||||
'pcusers.otherinbox.com',
|
||||
'pjjkp.com',
|
||||
'plexolan.de',
|
||||
'poczta.onet.pl',
|
||||
'politikerclub.de',
|
||||
'poofy.org',
|
||||
'pookmail.com',
|
||||
'privacy.net',
|
||||
'privatdemail.net',
|
||||
'proxymail.eu',
|
||||
'prtnx.com',
|
||||
'putthisinyourspamdatabase.com',
|
||||
'putthisinyourspamdatabase.com',
|
||||
'qq.com',
|
||||
'quickinbox.com',
|
||||
'rcpt.at',
|
||||
'reallymymail.com',
|
||||
'realtyalerts.ca',
|
||||
'recode.me',
|
||||
'recursor.net',
|
||||
'reliable-mail.com',
|
||||
'rhyta.com',
|
||||
'rmqkr.net',
|
||||
'royal.net',
|
||||
'rtrtr.com',
|
||||
's0ny.net',
|
||||
'safe-mail.net',
|
||||
'safersignup.de',
|
||||
'safetymail.info',
|
||||
'safetypost.de',
|
||||
'saynotospams.com',
|
||||
'schafmail.de',
|
||||
'schrott-email.de',
|
||||
'secretemail.de',
|
||||
'secure-mail.biz',
|
||||
'senseless-entertainment.com',
|
||||
'services391.com',
|
||||
'sharklasers.com',
|
||||
'shieldemail.com',
|
||||
'shiftmail.com',
|
||||
'shitmail.me',
|
||||
'shitware.nl',
|
||||
'shmeriously.com',
|
||||
'shortmail.net',
|
||||
'sibmail.com',
|
||||
'sinnlos-mail.de',
|
||||
'slapsfromlastnight.com',
|
||||
'slaskpost.se',
|
||||
'smashmail.de',
|
||||
'smellfear.com',
|
||||
'snakemail.com',
|
||||
'sneakemail.com',
|
||||
'sneakmail.de',
|
||||
'snkmail.com',
|
||||
'sofimail.com',
|
||||
'solvemail.info',
|
||||
'sogetthis.com',
|
||||
'soodonims.com',
|
||||
'spam4.me',
|
||||
'spamail.de',
|
||||
'spamarrest.com',
|
||||
'spambob.net',
|
||||
'spambog.ru',
|
||||
'spambox.us',
|
||||
'spamcannon.com',
|
||||
'spamcannon.net',
|
||||
'spamcon.org',
|
||||
'spamcorptastic.com',
|
||||
'spamcowboy.com',
|
||||
'spamcowboy.net',
|
||||
'spamcowboy.org',
|
||||
'spamday.com',
|
||||
'spamex.com',
|
||||
'spamfree.eu',
|
||||
'spamfree24.com',
|
||||
'spamfree24.de',
|
||||
'spamfree24.org',
|
||||
'spamgoes.in',
|
||||
'spamgourmet.com',
|
||||
'spamgourmet.net',
|
||||
'spamgourmet.org',
|
||||
'spamherelots.com',
|
||||
'spamherelots.com',
|
||||
'spamhereplease.com',
|
||||
'spamhereplease.com',
|
||||
'spamhole.com',
|
||||
'spamify.com',
|
||||
'spaml.de',
|
||||
'spammotel.com',
|
||||
'spamobox.com',
|
||||
'spamslicer.com',
|
||||
'spamspot.com',
|
||||
'spamthis.co.uk',
|
||||
'spamtroll.net',
|
||||
'speed.1s.fr',
|
||||
'spoofmail.de',
|
||||
'stuffmail.de',
|
||||
'super-auswahl.de',
|
||||
'supergreatmail.com',
|
||||
'supermailer.jp',
|
||||
'superrito.com',
|
||||
'superstachel.de',
|
||||
'suremail.info',
|
||||
'talkinator.com',
|
||||
'teewars.org',
|
||||
'teleworm.com',
|
||||
'teleworm.us',
|
||||
'temp-mail.org',
|
||||
'temp-mail.ru',
|
||||
'tempe-mail.com',
|
||||
'tempemail.co.za',
|
||||
'tempemail.com',
|
||||
'tempemail.net',
|
||||
'tempemail.net',
|
||||
'tempinbox.co.uk',
|
||||
'tempinbox.com',
|
||||
'tempmail.eu',
|
||||
'tempmaildemo.com',
|
||||
'tempmailer.com',
|
||||
'tempmailer.de',
|
||||
'tempomail.fr',
|
||||
'temporaryemail.net',
|
||||
'temporaryforwarding.com',
|
||||
'temporaryinbox.com',
|
||||
'temporarymailaddress.com',
|
||||
'tempthe.net',
|
||||
'thankyou2010.com',
|
||||
'thc.st',
|
||||
'thelimestones.com',
|
||||
'thisisnotmyrealemail.com',
|
||||
'thismail.net',
|
||||
'throwawayemailaddress.com',
|
||||
'tilien.com',
|
||||
'tittbit.in',
|
||||
'tizi.com',
|
||||
'tmailinator.com',
|
||||
'toomail.biz',
|
||||
'topranklist.de',
|
||||
'tradermail.info',
|
||||
'trash-mail.at',
|
||||
'trash-mail.com',
|
||||
'trash-mail.de',
|
||||
'trash2009.com',
|
||||
'trashdevil.com',
|
||||
'trashemail.de',
|
||||
'trashmail.at',
|
||||
'trashmail.com',
|
||||
'trashmail.de',
|
||||
'trashmail.me',
|
||||
'trashmail.net',
|
||||
'trashmail.org',
|
||||
'trashymail.com',
|
||||
'trialmail.de',
|
||||
'trillianpro.com',
|
||||
'twinmail.de',
|
||||
'tyldd.com',
|
||||
'uggsrock.com',
|
||||
'umail.net',
|
||||
'uroid.com',
|
||||
'us.af',
|
||||
'venompen.com',
|
||||
'veryrealemail.com',
|
||||
'viditag.com',
|
||||
'viralplays.com',
|
||||
'vpn.st',
|
||||
'vsimcard.com',
|
||||
'vubby.com',
|
||||
'wasteland.rfc822.org',
|
||||
'webemail.me',
|
||||
'weg-werf-email.de',
|
||||
'wegwerf-emails.de',
|
||||
'wegwerfadresse.de',
|
||||
'wegwerfemail.com',
|
||||
'wegwerfemail.de',
|
||||
'wegwerfmail.de',
|
||||
'wegwerfmail.info',
|
||||
'wegwerfmail.net',
|
||||
'wegwerfmail.org',
|
||||
'wh4f.org',
|
||||
'whyspam.me',
|
||||
'willhackforfood.biz',
|
||||
'willselfdestruct.com',
|
||||
'winemaven.info',
|
||||
'wronghead.com',
|
||||
'www.e4ward.com',
|
||||
'www.mailinator.com',
|
||||
'wwwnew.eu',
|
||||
'x.ip6.li',
|
||||
'xagloo.com',
|
||||
'xemaps.com',
|
||||
'xents.com',
|
||||
'xmaily.com',
|
||||
'xoxy.net',
|
||||
'yep.it',
|
||||
'yogamaven.com',
|
||||
'yopmail.com',
|
||||
'yopmail.fr',
|
||||
'yopmail.net',
|
||||
'yourdomain.com',
|
||||
'yuurok.com',
|
||||
'z1p.biz',
|
||||
'za.com',
|
||||
'zehnminuten.de',
|
||||
'zehnminutenmail.de',
|
||||
'zippymail.info',
|
||||
'zoemail.net',
|
||||
'zomg.info'
|
||||
];
|
||||
@@ -3,7 +3,7 @@
|
||||
{{-- Header --}}
|
||||
@slot('header')
|
||||
@component('mail::header', ['url' => url('/')])
|
||||
{{ get_setting('app_title') ?? 'VueFileManager' }}
|
||||
{{ get_settings('app_title') ?? 'VueFileManager' }}
|
||||
@endcomponent
|
||||
@endslot
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
{{-- Footer --}}
|
||||
@slot('footer')
|
||||
@component('mail::footer')
|
||||
© {{ date('Y') }} {{ get_setting('app_title') ?? 'VueFileManager' }}. @lang('All rights reserved.')
|
||||
© {{ date('Y') }} {{ get_settings('app_title') ?? 'VueFileManager' }}. @lang('All rights reserved.')
|
||||
@endcomponent
|
||||
@endslot
|
||||
@endcomponent
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{{-- Header --}}
|
||||
@slot('header')
|
||||
@component('mail::header', ['url' => url('/')])
|
||||
{{ get_setting('app_title') }}
|
||||
{{ get_settings('app_title') }}
|
||||
@endcomponent
|
||||
@endslot
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
{{-- Footer --}}
|
||||
@slot('footer')
|
||||
@component('mail::footer')
|
||||
© {{ date('Y') }} {{ get_setting('app_title') }}. @lang('All rights reserved.')
|
||||
© {{ date('Y') }} {{ get_settings('app_title') }}. @lang('All rights reserved.')
|
||||
@endcomponent
|
||||
@endslot
|
||||
@endcomponent
|
||||
|
||||
@@ -22,7 +22,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
public function boot()
|
||||
{
|
||||
try {
|
||||
$app_locale = get_setting('language') ?? 'en';
|
||||
$app_locale = get_settings('language') ?? 'en';
|
||||
} catch (\PDOException $exception) {
|
||||
$app_locale = 'en';
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class CheckStorageCapacityAction
|
||||
$user_storage_used = user_storage_percentage($user_id, $file_size);
|
||||
|
||||
// Check if user can upload
|
||||
if (get_setting('storage_limitation') && $user_storage_used >= 100) {
|
||||
if (get_settings('storage_limitation') && $user_storage_used >= 100) {
|
||||
// Delete file
|
||||
Storage::disk('local')
|
||||
->delete("chunks/$temp_filename");
|
||||
|
||||
@@ -2,76 +2,63 @@
|
||||
namespace App\Users\Actions;
|
||||
|
||||
use App\Users\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Validation\Rule;
|
||||
use App\Users\Requests\RegisterUserRequest;
|
||||
use App\Users\Models\UserSettings;
|
||||
use Domain\Settings\Models\Setting;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Contracts\Auth\StatefulGuard;
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Contracts\Routing\ResponseFactory;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class CreateNewUserAction extends Controller
|
||||
{
|
||||
use PasswordValidationRules;
|
||||
|
||||
public function __construct(
|
||||
protected StatefulGuard $guard
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Validate and create a new user.
|
||||
*/
|
||||
public function __invoke(
|
||||
Request $request
|
||||
): Response {
|
||||
$settings = Setting::whereIn('name', [
|
||||
'storage_default', 'registration',
|
||||
])
|
||||
->pluck('value', 'name');
|
||||
RegisterUserRequest $request
|
||||
): Application|ResponseFactory|Response
|
||||
{
|
||||
$settings = get_settings([
|
||||
'storage_default', 'registration', 'user_verification'
|
||||
]);
|
||||
|
||||
// Check if account registration is enabled
|
||||
if (! intval($settings['registration'])) {
|
||||
abort(401);
|
||||
}
|
||||
|
||||
Validator::make($request->all(), [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => [
|
||||
'required',
|
||||
'string',
|
||||
'email',
|
||||
'max:255',
|
||||
Rule::unique(User::class),
|
||||
],
|
||||
'password' => $this->passwordRules(),
|
||||
])->validate();
|
||||
|
||||
// Create user
|
||||
$user = User::create([
|
||||
'email' => $request->email,
|
||||
'password' => bcrypt($request->password),
|
||||
'password' => bcrypt($request->input('password')),
|
||||
'email' => $request->input('email'),
|
||||
]);
|
||||
|
||||
// Mark as verified if verification is disabled
|
||||
if (! intval($settings['user_verification'])) {
|
||||
$user->markEmailAsVerified();
|
||||
}
|
||||
|
||||
UserSettings::unguard();
|
||||
|
||||
$user
|
||||
->settings()
|
||||
->create([
|
||||
'name' => $request->name,
|
||||
'name' => $request->input('name'),
|
||||
'storage_capacity' => $settings['storage_default'],
|
||||
]);
|
||||
|
||||
if (! get_setting('user_verification')) {
|
||||
$user->markEmailAsVerified();
|
||||
}
|
||||
|
||||
UserSettings::reguard();
|
||||
|
||||
event(new Registered($user));
|
||||
|
||||
if (! get_setting('user_verification')) {
|
||||
// Log in if verification is disabled
|
||||
if (! intval($settings['user_verification'])) {
|
||||
$this->guard->login($user);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
* @method static sortable(string[] $array)
|
||||
* @method static forceCreate(array $array)
|
||||
* @method static where(string $string, string $string1, string $toDateString)
|
||||
* @method static create(array $array)
|
||||
*/
|
||||
class User extends Authenticatable implements MustVerifyEmail
|
||||
{
|
||||
@@ -91,7 +92,7 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
*/
|
||||
public function getStorageAttribute(): array
|
||||
{
|
||||
$is_storage_limit = get_setting('storage_limitation') ?? 1;
|
||||
$is_storage_limit = get_settings('storage_limitation') ?? 1;
|
||||
|
||||
if (! $is_storage_limit) {
|
||||
return [
|
||||
|
||||
@@ -41,7 +41,7 @@ class ResetPassword extends Notification
|
||||
public function toMail($notifiable)
|
||||
{
|
||||
$reset_url = url('/create-new-password?token=' . $this->token);
|
||||
$app_name = get_setting('app_title') ?? 'VueFileManager';
|
||||
$app_name = get_settings('app_title') ?? 'VueFileManager';
|
||||
|
||||
return (new MailMessage)
|
||||
->subject(__t('reset_password_subject') . $app_name)
|
||||
|
||||
36
src/App/Users/Requests/RegisterUserRequest.php
Normal file
36
src/App/Users/Requests/RegisterUserRequest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Users\Requests;
|
||||
|
||||
use App\Users\Rules\EmailProvider;
|
||||
use App\Users\Rules\PasswordValidationRules;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class RegisterUserRequest extends FormRequest
|
||||
{
|
||||
use PasswordValidationRules;
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users,email', new EmailProvider],
|
||||
'name' => 'required|string|max:255',
|
||||
'password' => $this->passwordRules(),
|
||||
];
|
||||
}
|
||||
}
|
||||
27
src/App/Users/Rules/EmailProvider.php
Normal file
27
src/App/Users/Rules/EmailProvider.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Users\Rules;
|
||||
|
||||
use Illuminate\Contracts\Validation\Rule;
|
||||
|
||||
class EmailProvider implements Rule
|
||||
{
|
||||
/**
|
||||
* Determine if the validation rule passes.
|
||||
*/
|
||||
public function passes($attribute, $value): bool
|
||||
{
|
||||
$providers = config('disposable-email-providers');
|
||||
$provider = get_email_provider($value);
|
||||
|
||||
return ! in_array($provider, $providers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation error message.
|
||||
*/
|
||||
public function message(): string
|
||||
{
|
||||
return 'This :attribute email provider is not accepted.';
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace App\Users\Actions;
|
||||
namespace App\Users\Rules;
|
||||
|
||||
use Laravel\Fortify\Rules\Password;
|
||||
|
||||
@@ -7,10 +7,8 @@ trait PasswordValidationRules
|
||||
{
|
||||
/**
|
||||
* Get the validation rules used to validate passwords.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function passwordRules()
|
||||
protected function passwordRules(): array
|
||||
{
|
||||
return ['required', 'string', new Password, 'confirmed'];
|
||||
}
|
||||
@@ -20,7 +20,7 @@ class GetWidgetsValuesController extends Controller
|
||||
)->format();
|
||||
|
||||
return [
|
||||
'license' => get_setting('license'),
|
||||
'license' => get_settings('license'),
|
||||
'app_version' => config('vuefilemanager.version'),
|
||||
'total_users' => User::count(),
|
||||
'total_used_space' => $storage_usage,
|
||||
|
||||
@@ -13,7 +13,7 @@ class DisabledMimetypes implements Rule
|
||||
*/
|
||||
public function passes($attribute, $value): bool
|
||||
{
|
||||
$mimetype_blacklist = explode(',', get_setting('mimetypes_blacklist'));
|
||||
$mimetype_blacklist = explode(',', get_settings('mimetypes_blacklist'));
|
||||
$file_mimetype = explode('/', $value->getMimeType());
|
||||
|
||||
return ! array_intersect($file_mimetype, $mimetype_blacklist);
|
||||
|
||||
@@ -44,7 +44,7 @@ class UploadFileAction
|
||||
$file_size = File::size($file_path);
|
||||
|
||||
// Size of limit
|
||||
$limit = get_setting('upload_limit');
|
||||
$limit = get_settings('upload_limit');
|
||||
|
||||
// File size handling
|
||||
if ($limit && $file_size > format_bytes($limit)) {
|
||||
|
||||
@@ -15,7 +15,7 @@ class SendContactMessageController extends Controller
|
||||
public function __invoke(
|
||||
SendContactMessageRequest $request
|
||||
): Response {
|
||||
$contactEmail = get_setting('contact_email');
|
||||
$contactEmail = get_settings('contact_email');
|
||||
|
||||
if ($contactEmail) {
|
||||
Mail::to($contactEmail)
|
||||
|
||||
@@ -33,7 +33,7 @@ class UpgradeLanguageTranslationsAction
|
||||
])->collapse(),
|
||||
];
|
||||
|
||||
$license = strtolower(get_setting('license'));
|
||||
$license = strtolower(get_settings('license'));
|
||||
|
||||
// Find new translations in default translations
|
||||
$newbies = $default_translations[$license]
|
||||
|
||||
@@ -89,7 +89,7 @@ class LanguageController extends Controller
|
||||
|
||||
// If user try to delete language used as default,
|
||||
// then set en language as default
|
||||
if ($language->locale === get_setting('language')) {
|
||||
if ($language->locale === get_settings('language')) {
|
||||
Setting::whereName('language')->first()
|
||||
->update(['value' => 'en']);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class Language extends Model
|
||||
$language->id = Str::uuid();
|
||||
|
||||
resolve(SeedDefaultLanguageTranslationsAction::class)(
|
||||
license: get_setting('license') ?? 'extended',
|
||||
license: get_settings('license') ?? 'extended',
|
||||
locale: $language->locale
|
||||
);
|
||||
});
|
||||
|
||||
@@ -17,7 +17,7 @@ class LanguageCollection extends ResourceCollection
|
||||
public function toArray($request)
|
||||
{
|
||||
$current_language = Language::with('languageTranslations')
|
||||
->whereLocale(get_setting('language') ?? 'en')
|
||||
->whereLocale(get_settings('language') ?? 'en')
|
||||
->first();
|
||||
|
||||
return [
|
||||
|
||||
@@ -18,7 +18,7 @@ class SetStripeController
|
||||
{
|
||||
// TODO: pridat validator do requestu
|
||||
// Check payment setup status
|
||||
if (get_setting('payments_configured')) {
|
||||
if (get_settings('payments_configured')) {
|
||||
abort(401, 'Gone');
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
* @method static where(string $string, mixed $get)
|
||||
* @method static whereIn(string $string, string[] $columns)
|
||||
* @method static create(string[] $array)
|
||||
* @method static find(array|string $setting)
|
||||
* @property string value
|
||||
* @property string name
|
||||
*/
|
||||
|
||||
@@ -48,7 +48,7 @@ class CreateAdminAccountController extends Controller
|
||||
$user
|
||||
->settings()
|
||||
->create([
|
||||
'storage_capacity' => get_setting('storage_default') ?? 5,
|
||||
'storage_capacity' => get_settings('storage_default') ?? 5,
|
||||
'avatar' => store_avatar($request, 'avatar'),
|
||||
'name' => $request->input('name'),
|
||||
]);
|
||||
|
||||
@@ -63,7 +63,7 @@ class StoreAppSettingsController extends Controller
|
||||
[
|
||||
'name' => 'storage_default',
|
||||
'value' => $request->input('defaultStorage') ?? 5,
|
||||
],
|
||||
]
|
||||
])->each(function ($col) {
|
||||
Setting::forceCreate([
|
||||
'name' => $col['name'],
|
||||
|
||||
@@ -45,7 +45,7 @@ class SharedSendViaEmail extends Notification
|
||||
->greeting(__t('shared_link_email_greeting'))
|
||||
->line(__t('shared_link_email_user', ['user' => $this->user->settings->name, 'email' => $this->user->email]))
|
||||
->action(__t('shared_link_email_link'), url('/share', ['token' => $this->token]))
|
||||
->salutation(__t('shared_link_email_salutation', ['app_name' => get_setting('app_title') ?? 'VueFileManager']));
|
||||
->salutation(__t('shared_link_email_salutation', ['app_name' => get_settings('app_title') ?? 'VueFileManager']));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,7 @@ class StripeWebhookController extends CashierController
|
||||
$user
|
||||
->settings()
|
||||
->update([
|
||||
'storage_capacity' => get_setting('storage_default'),
|
||||
'storage_capacity' => get_settings('storage_default'),
|
||||
]);
|
||||
|
||||
return $this->successMethod();
|
||||
|
||||
@@ -19,7 +19,7 @@ class ProtectSetupWizardRoutes
|
||||
DB::getPdo();
|
||||
|
||||
// Get setup_wizard status
|
||||
if (Schema::hasTable('settings') && get_setting('setup_wizard_success')) {
|
||||
if (Schema::hasTable('settings') && get_settings('setup_wizard_success')) {
|
||||
return response('Gone', 410);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,15 +33,29 @@ if (! function_exists('obfuscate_email')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('get_setting')) {
|
||||
if (! function_exists('get_email_provider')) {
|
||||
/**
|
||||
* Get single value from settings table
|
||||
*
|
||||
* @param $setting
|
||||
* @return |null
|
||||
* Get single or multiple values from settings table
|
||||
*/
|
||||
function get_setting($setting)
|
||||
function get_email_provider(string $email): string
|
||||
{
|
||||
$provider = explode('@', $email);
|
||||
|
||||
return end($provider);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('get_settings')) {
|
||||
/**
|
||||
* Get single or multiple values from settings table
|
||||
*/
|
||||
function get_settings(array|string $setting): Collection|string|null
|
||||
{
|
||||
if (is_array($setting)) {
|
||||
return Setting::whereIn('name', $setting)
|
||||
->pluck('value', 'name');
|
||||
}
|
||||
|
||||
return Setting::find($setting)->value ?? null;
|
||||
}
|
||||
}
|
||||
@@ -68,7 +82,7 @@ if (! function_exists('get_setup_status')) {
|
||||
*/
|
||||
function get_setup_status()
|
||||
{
|
||||
$setup_success = get_setting('setup_wizard_success');
|
||||
$setup_success = get_settings('setup_wizard_success');
|
||||
|
||||
return boolval($setup_success) ? 'setup-done' : 'setup-disclaimer';
|
||||
}
|
||||
@@ -943,7 +957,7 @@ if (! function_exists('__t')) {
|
||||
// Get current locale
|
||||
$locale = cache()->rememberForever('language', function () {
|
||||
try {
|
||||
return get_setting('language') ?? 'en';
|
||||
return get_settings('language') ?? 'en';
|
||||
} catch (QueryException $e) {
|
||||
return 'en';
|
||||
}
|
||||
|
||||
@@ -60,6 +60,47 @@ class SignFlowTest extends TestCase
|
||||
Notification::assertTimesSent(1, VerifyEmail::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_try_register_when_registration_is_disabled()
|
||||
{
|
||||
Setting::create([
|
||||
'name' => 'registration',
|
||||
'value' => 0,
|
||||
]);
|
||||
|
||||
$this->postJson('api/register', [
|
||||
'email' => 'john@doe.com',
|
||||
'password' => 'SecretPassword',
|
||||
'password_confirmation' => 'SecretPassword',
|
||||
'name' => 'John Doe',
|
||||
])->assertStatus(401);
|
||||
|
||||
$this->assertDatabaseMissing('users', [
|
||||
'email' => 'john@doe.com',
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_try_register_from_disabled_email_provider()
|
||||
{
|
||||
$this->postJson('api/register', [
|
||||
'email' => 'john@maildrop.cc',
|
||||
'password' => 'SecretPassword',
|
||||
'password_confirmation' => 'SecretPassword',
|
||||
'name' => 'John Doe',
|
||||
])->assertStatus(422);
|
||||
|
||||
$this->assertDatabaseMissing('users', [
|
||||
'email' => 'john@doe.com',
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
|
||||
@@ -117,7 +117,7 @@ class SettingsTest extends TestCase
|
||||
]);
|
||||
|
||||
Storage::assertExists(
|
||||
get_setting('app_logo')
|
||||
get_settings('app_logo')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ class SetupWizardTest extends TestCase
|
||||
|
||||
collect(['app_logo', 'app_logo_horizontal', 'app_favicon'])
|
||||
->each(function ($file) {
|
||||
$path = get_setting($file);
|
||||
$path = get_settings($file);
|
||||
|
||||
$this->assertNotNull($path);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user