|
|
@ -44,29 +44,33 @@ class SettingsController extends Controller
|
|
|
|
$user = Auth::user();
|
|
|
|
$user = Auth::user();
|
|
|
|
$profile = $user->profile;
|
|
|
|
$profile = $user->profile;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$validate = config('pixelfed.enforce_email_verification');
|
|
|
|
|
|
|
|
|
|
|
|
if($user->email != $email) {
|
|
|
|
if($user->email != $email) {
|
|
|
|
$changes = true;
|
|
|
|
$changes = true;
|
|
|
|
$user->email = $email;
|
|
|
|
$user->email = $email;
|
|
|
|
$user->email_verified_at = null;
|
|
|
|
|
|
|
|
// Prevent old verifications from working
|
|
|
|
if($validate) {
|
|
|
|
EmailVerification::whereUserId($user->id)->delete();
|
|
|
|
$user->email_verified_at = null;
|
|
|
|
|
|
|
|
// Prevent old verifications from working
|
|
|
|
|
|
|
|
EmailVerification::whereUserId($user->id)->delete();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Only allow email to be updated if not yet verified
|
|
|
|
// Only allow email to be updated if not yet verified
|
|
|
|
if(!$changes && $user->email_verified_at) {
|
|
|
|
if(!$validate || !$changes && $user->email_verified_at) {
|
|
|
|
if($profile->name != $name) {
|
|
|
|
if($profile->name != $name) {
|
|
|
|
$changes = true;
|
|
|
|
$changes = true;
|
|
|
|
$user->name = $name;
|
|
|
|
$user->name = $name;
|
|
|
|
$profile->name = $name;
|
|
|
|
$profile->name = $name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if($profile->website != $website) {
|
|
|
|
if(!$profile->website || $profile->website != $website) {
|
|
|
|
$changes = true;
|
|
|
|
$changes = true;
|
|
|
|
$profile->website = $website;
|
|
|
|
$profile->website = $website;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if($profile->bio != $bio) {
|
|
|
|
if(!$profile->bio || !$profile->bio != $bio) {
|
|
|
|
$changes = true;
|
|
|
|
$changes = true;
|
|
|
|
$profile->bio = $bio;
|
|
|
|
$profile->bio = $bio;
|
|
|
|
}
|
|
|
|
}
|
|
|
|