#5: Added settings UI to configure Facebook login

This commit is contained in:
Andy Heathershaw 2018-08-14 09:12:28 +01:00
parent 52473f846e
commit 8af88c56aa
5 changed files with 57 additions and 0 deletions

View File

@ -104,6 +104,8 @@ class ConfigHelper
'date_format' => $this->allowedDateFormats()[0], 'date_format' => $this->allowedDateFormats()[0],
'default_album_view' => $this->allowedAlbumViews()[0], 'default_album_view' => $this->allowedAlbumViews()[0],
'enable_visitor_hits' => false, 'enable_visitor_hits' => false,
'facebook_app_id' => '',
'facebook_app_secret' => '',
'hotlink_protection' => false, 'hotlink_protection' => false,
'items_per_page' => 12, 'items_per_page' => 12,
'items_per_page_admin' => 10, 'items_per_page_admin' => 10,
@ -120,6 +122,7 @@ class ConfigHelper
'smtp_password' => '', 'smtp_password' => '',
'smtp_port' => 25, 'smtp_port' => 25,
'smtp_username' => '', 'smtp_username' => '',
'social_facebook_login' => false,
'social_user_profiles' => false, 'social_user_profiles' => false,
'theme' => 'default' 'theme' => 'default'
); );

View File

@ -224,12 +224,15 @@ class DefaultController extends Controller
'require_email_verification', 'require_email_verification',
'restrict_original_download', 'restrict_original_download',
'smtp_encryption', 'smtp_encryption',
'social_facebook_login',
'social_user_profiles' 'social_user_profiles'
]; ];
$updateKeys = [ $updateKeys = [
'albums_menu_number_items', 'albums_menu_number_items',
'app_name', 'app_name',
'date_format', 'date_format',
'facebook_app_id',
'facebook_app_secret',
'sender_address', 'sender_address',
'sender_name', 'sender_name',
'smtp_server', 'smtp_server',

View File

@ -211,6 +211,7 @@ return [
'analytics_tab' => 'Analytics', 'analytics_tab' => 'Analytics',
'security_allow_self_registration' => 'Allow self-registration', 'security_allow_self_registration' => 'Allow self-registration',
'security_allow_self_registration_description' => 'With this option enabled, users can sign up for their own accounts. You can grant permissions to accounts to allow users to upload their own photos or manage yours.', 'security_allow_self_registration_description' => 'With this option enabled, users can sign up for their own accounts. You can grant permissions to accounts to allow users to upload their own photos or manage yours.',
'social_facebook' => 'Facebook',
'social_tab' => 'Social' 'social_tab' => 'Social'
], ],
'select_all_action' => 'Select all', 'select_all_action' => 'Select all',

View File

@ -45,6 +45,10 @@ return [
'settings_hotlink_protection_help' => 'With this option enabled, direct linking to images is not allowed. Photos can only be viewed through Blue Twilight.', 'settings_hotlink_protection_help' => 'With this option enabled, direct linking to images is not allowed. Photos can only be viewed through Blue Twilight.',
'settings_restrict_originals_download' => 'Restrict access to original images', 'settings_restrict_originals_download' => 'Restrict access to original images',
'settings_restrict_originals_download_help' => 'With this option enabled, only the photo\'s owner can download the original high-resolution images.', 'settings_restrict_originals_download_help' => 'With this option enabled, only the photo\'s owner can download the original high-resolution images.',
'settings_social_facebook_app_id' => 'Facebook App ID:',
'settings_social_facebook_app_secret' => 'Facebook App Secret:',
'settings_social_facebook_login' => 'Allow login/registration with a Facebook account.',
'settings_social_facebook_login_help' => 'With this option enabled, users can register (if enabled) and login with their Facebook account.',
'settings_social_user_profiles' => 'Enable public user profiles', 'settings_social_user_profiles' => 'Enable public user profiles',
'settings_social_user_profiles_help' => 'Display public pages for users showing their albums, cameras used and activity.', 'settings_social_user_profiles_help' => 'Display public pages for users showing their albums, cameras used and activity.',
'storage_access_key_label' => 'Access key:', 'storage_access_key_label' => 'Access key:',

View File

@ -324,6 +324,52 @@
@lang('forms.settings_social_user_profiles_help') @lang('forms.settings_social_user_profiles_help')
</label> </label>
</div> </div>
<hr class="mt-4 mb-4"/>
<div class="row">
<div class="col-2 col-sm-1">
<i class="fa fa-facebook fa-fw" style="font-size: xx-large;"></i>
</div>
<div class="col-10 col-sm-11">
<fieldset>
<legend class="mb-3">
@lang('admin.settings.social_facebook')
</legend>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="social-facebook-login" name="social_facebook_login" @if (old('social_facebook_login', UserConfig::get('social_facebook_login')))checked="checked"@endif>
<label class="form-check-label" for="social-facebook-login">
<strong>@lang('forms.settings_social_facebook_login')</strong><br/>
@lang('forms.settings_social_facebook_login_help')
</label>
</div>
<div class="form-group mt-3">
<label class="form-control-label" for="facebook-app-id">@lang('forms.settings_social_facebook_app_id')</label>
<input type="text" class="form-control{{ $errors->has('facebook_app_id') ? ' is-invalid' : '' }}" id="facebook-app-id" name="facebook_app_id" value="{{ old('facebook_app_id', $config['facebook_app_id']) }}">
@if ($errors->has('facebook_app_id'))
<div class="invalid-feedback">
<strong>{{ $errors->first('facebook_app_id') }}</strong>
</div>
@endif
</div>
<div class="form-group mt-3">
<label class="form-control-label" for="facebook-app-id">@lang('forms.settings_social_facebook_app_secret')</label>
<input type="text" class="form-control{{ $errors->has('facebook_app_secret') ? ' is-invalid' : '' }}" id="facebook-app-secret" name="facebook_app_secret" value="{{ old('facebook_app_secret', $config['facebook_app_secret']) }}">
@if ($errors->has('facebook_app_secret'))
<div class="invalid-feedback">
<strong>{{ $errors->first('facebook_app_secret') }}</strong>
</div>
@endif
</div>
</fieldset>
</div>
</div>
</div> </div>
</div> </div>