133 lines
4.2 KiB
PHTML
133 lines
4.2 KiB
PHTML
<?php use PHPCensor\Helper\Lang; ?>
|
|
|
|
<?php if (isset($_GET['saved']) && $_GET['saved'] == 1): ?>
|
|
<p class="alert alert-success" style="margin-bottom: 20px;">
|
|
<?php Lang::out('settings_saved'); ?>
|
|
</p>
|
|
<?php endif; ?>
|
|
|
|
<?php if (isset($_GET['saved']) && $_GET['saved'] == 2): ?>
|
|
<p class="alert alert-danger" style="margin-bottom: 20px;">
|
|
<?php Lang::out('settings_check_perms'); ?>
|
|
</p>
|
|
<?php endif; ?>
|
|
|
|
<?php if (!$isWriteable): ?>
|
|
<p class="alert alert-danger" style="margin-bottom: 20px;">
|
|
<?php Lang::out('settings_cannot_write'); ?>
|
|
</p>
|
|
<?php endif; ?>
|
|
|
|
<?php if (isset($_GET['linked']) && $_GET['linked'] == 1): ?>
|
|
<p class="alert alert-success" style="margin-bottom: 20px;">
|
|
<?php Lang::out('settings_github_linked'); ?>
|
|
</p>
|
|
<?php endif; ?>
|
|
|
|
<?php if (isset($_GET['linked']) && $_GET['linked'] == 2): ?>
|
|
<p class="alert alert-danger" style="margin-bottom: 20px;">
|
|
<?php Lang::out('settings_github_not_linked'); ?>
|
|
</p>
|
|
<?php endif; ?>
|
|
|
|
<div class="box">
|
|
<div class="box-body clearfix">
|
|
<?php print $basicSettings; ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="box">
|
|
<div class="box-header"><h3 class="box-title"><?php Lang::out('build_settings'); ?></h3></div>
|
|
<div class="box-body clearfix">
|
|
<?php print $buildSettings; ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="box">
|
|
<div class="box-header"><h3 class="box-title"><?php Lang::out('github_application'); ?></h3></div>
|
|
<div class="box-body clearfix">
|
|
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<?php
|
|
$id = null;
|
|
|
|
if (isset($settings['php-censor']['github']['id'])) {
|
|
$id = $settings['php-censor']['github']['id'];
|
|
}
|
|
|
|
$returnTo = APP_URL . 'settings/github-callback';
|
|
$githubUri = 'https://github.com/login/oauth/authorize?client_id='.$id.'&scope=repo&redirect_uri=' . $returnTo;
|
|
?>
|
|
<?php if (!empty($id)): ?>
|
|
<?php if (empty($githubUser['name']) || empty($settings['php-censor']['github']['token'])): ?>
|
|
<p class="alert alert-warning clearfix">
|
|
<?php Lang::out('github_sign_in', $githubUri); ?>
|
|
</p>
|
|
<?php else: ?>
|
|
<p class="alert alert-success">
|
|
<?php Lang::out('github_app_linked'); ?>
|
|
|
|
<strong>
|
|
<a href="<?php echo $githubUser['html_url']; ?>"><?php echo $githubUser['name']; ?></a>
|
|
</strong>
|
|
</p>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<div class="col-lg-8">
|
|
<?php print $github; ?>
|
|
</div>
|
|
|
|
<div class="col-lg-4">
|
|
<div class="box">
|
|
<div class="box-header">
|
|
<h3 class="box-title"><?php Lang::out('github_where_to_find'); ?></h3>
|
|
</div>
|
|
|
|
<div class="box-body">
|
|
<p>
|
|
<?php Lang::out('github_where_help'); ?>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="box">
|
|
<div class="box-header">
|
|
<h3 class="box-title"><?php Lang::out('email_settings'); ?></h3>
|
|
</div>
|
|
|
|
<div class="box-body clearfix">
|
|
<?php if (!isset($settings['php-censor']['email_settings'])): ?>
|
|
<p class="alert alert-warning clearfix">
|
|
<?php Lang::out('email_settings_help'); ?>
|
|
</p>
|
|
<?php endif; ?>
|
|
|
|
<?php print $emailSettings; ?>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="box">
|
|
<div class="box-header">
|
|
<h3 class="box-title">Authentication Settings</h3>
|
|
</div>
|
|
|
|
<div class="box-body clearfix">
|
|
<p class="alert alert-warning clearfix">
|
|
Be careful: This setting disables authentication and uses your current admin account for all actions within PHP Censor with admin rights.
|
|
</p>
|
|
|
|
<?php print $securitySettings; ?>
|
|
|
|
</div>
|
|
</div>
|