-<?php namespace BookStack\Auth\Access;
+<?php
+
+namespace BookStack\Auth\Access;
use BookStack\Auth\User;
use BookStack\Exceptions\ConfirmationEmailException;
/**
* Create new confirmation for a user,
* Also removes any existing old ones.
- * @param User $user
+ *
* @throws ConfirmationEmailException
*/
public function sendConfirmation(User $user)
$user->notify(new ConfirmEmail($token));
}
+ /**
+ * Check if confirmation is required in this instance.
+ */
+ public function confirmationRequired(): bool
+ {
+ return setting('registration-confirmation')
+ || setting('registration-restrict');
+ }
}