11dcac87eSGreg Roach<?php 21dcac87eSGreg Roach 30c0910bfSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel; 41dcac87eSGreg Roachuse Fisharebest\Webtrees\I18N; 51dcac87eSGreg Roachuse Fisharebest\Webtrees\View; 61dcac87eSGreg Roach 71dcac87eSGreg Roach/** 81dcac87eSGreg Roach * @var string $DKIM_DOMAIN 91dcac87eSGreg Roach * @var string $DKIM_KEY 101dcac87eSGreg Roach * @var string $DKIM_SELECTOR 111dcac87eSGreg Roach * @var string $SMTP_ACTIVE 121dcac87eSGreg Roach * @var string $SMTP_AUTH 131dcac87eSGreg Roach * @var string $SMTP_AUTH_USER 141dcac87eSGreg Roach * @var string $SMTP_FROM_NAME 151dcac87eSGreg Roach * @var string $SMTP_HELO 161dcac87eSGreg Roach * @var string $SMTP_HOST 171dcac87eSGreg Roach * @var string $SMTP_PORT 181dcac87eSGreg Roach * @var string $SMTP_SSL 191dcac87eSGreg Roach * @var string[] $mail_ssl_options 201dcac87eSGreg Roach * @var string[] $mail_transport_options 211dcac87eSGreg Roach * @var bool $smtp_helo_valid 221dcac87eSGreg Roach * @var bool $smtp_from_name_valid 231dcac87eSGreg Roach * @var string $title 241dcac87eSGreg Roach */ 251dcac87eSGreg Roach?> 26dd6b2bfcSGreg Roach 270c0910bfSGreg Roach<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), $title]]) ?> 28dd6b2bfcSGreg Roach 29dd6b2bfcSGreg Roach<h1><?= $title ?></h1> 30dd6b2bfcSGreg Roach 31*dbc19611SGreg Roach<div class="alert alert-info"> 32*dbc19611SGreg Roach <a class="alert-link" data-toggle="collapse" href="#gmail-instructions" role="button" aria-expanded="false" aria-controls="gmail-instructions"> 33*dbc19611SGreg Roach <?= I18N::translate('Instructions for Google mail') ?> 34*dbc19611SGreg Roach </a> 35*dbc19611SGreg Roach 36*dbc19611SGreg Roach <dl class="collapse" id="gmail-instructions"> 37*dbc19611SGreg Roach <dt><?= I18N::translate('Server name') ?></dt> 38*dbc19611SGreg Roach <dd>smtp.gmail.com</dd> 39*dbc19611SGreg Roach <dt><?= I18N::translate('Port number') ?></dt> 40*dbc19611SGreg Roach <dd>587</dd> 41*dbc19611SGreg Roach <dt><?= I18N::translate('Secure connection') ?></dt> 42*dbc19611SGreg Roach <dd><?= I18N::translate('tls') ?></dd> 43*dbc19611SGreg Roach <dt><?= I18N::translate('Username') ?></dt> 44*dbc19611SGreg Roach <dd>xxxxx@gmail.com</dd> 45*dbc19611SGreg Roach <dt><?= I18N::translate('Password') ?></dt> 46*dbc19611SGreg Roach <dd> 47*dbc19611SGreg Roach <?= I18N::translate('If you use two-factor authentication, create an <a href="https://myaccount.google.com/apppasswords">app password</a>.') ?> 48*dbc19611SGreg Roach <br> 49*dbc19611SGreg Roach <?= I18N::translate('If you do not use two-factor authentication, enable <a href="https://www.google.com/settings/security/lesssecureapps">less secure applications</a> and use your Google password.') ?> 50*dbc19611SGreg Roach </dd> 51*dbc19611SGreg Roach </dl> 52*dbc19611SGreg Roach</div> 53dd6b2bfcSGreg Roach 5483615acfSGreg Roach<form method="post" action="<?= e(route('admin-site-mail-update')) ?>" class="form-horizontal"> 55dd6b2bfcSGreg Roach <?= csrf_field() ?> 56dd6b2bfcSGreg Roach 57dd6b2bfcSGreg Roach <div class="row form-group"> 58dd6b2bfcSGreg Roach <label for="SMTP_ACTIVE" class="col-sm-3 col-form-label"> 591dcac87eSGreg Roach <?= /* I18N: A configuration setting */ 601dcac87eSGreg Roach I18N::translate('Messages') ?> 61dd6b2bfcSGreg Roach </label> 62dd6b2bfcSGreg Roach <div class="col-sm-9"> 631dcac87eSGreg Roach <?= view('components/select', ['name' => 'SMTP_ACTIVE', 'selected' => $SMTP_ACTIVE, 'options' => $mail_transport_options]) ?> 64dd6b2bfcSGreg Roach <p class="small text-muted"> 651dcac87eSGreg Roach <?= /* I18N: Help text for the “Messages” site configuration setting */ 661dcac87eSGreg Roach I18N::translate('webtrees needs to send emails, such as password reminders and website notifications.') ?> 67dd6b2bfcSGreg Roach </p> 68dd6b2bfcSGreg Roach </div> 69dd6b2bfcSGreg Roach </div> 70dd6b2bfcSGreg Roach 71dd6b2bfcSGreg Roach <div class="row form-group"> 72dd6b2bfcSGreg Roach <label for="SMTP_FROM_NAME" class="col-sm-3 col-form-label"> 731dcac87eSGreg Roach <?= /* I18N: A configuration setting */ 741dcac87eSGreg Roach I18N::translate('Sender name') ?> 75dd6b2bfcSGreg Roach </label> 76dd6b2bfcSGreg Roach <div class="col-sm-9"> 771dcac87eSGreg Roach <input type="email" class="form-control" id="SMTP_FROM_NAME" name="SMTP_FROM_NAME" value="<?= e($SMTP_FROM_NAME) ?>" maxlength="255"> 78dd6b2bfcSGreg Roach <p class="small text-muted"> 791dcac87eSGreg Roach <?= /* I18N: Help text for the “Sender name” site configuration setting */ 801dcac87eSGreg Roach I18N::translate('This name is used in the “From” field, when sending automatic emails from this server.') ?> 81dd6b2bfcSGreg Roach </p> 821dcac87eSGreg Roach 831dcac87eSGreg Roach <?php if (!$smtp_from_name_valid) : ?> 841dcac87eSGreg Roach <p class="alert alert-warning"> 851dcac87eSGreg Roach <?= I18N::translate('Most mail servers require a valid email address.') ?> 861dcac87eSGreg Roach </p> 871dcac87eSGreg Roach <?php endif ?> 88dd6b2bfcSGreg Roach </div> 89dd6b2bfcSGreg Roach </div> 90dd6b2bfcSGreg Roach 91dd6b2bfcSGreg Roach <h2><?= I18N::translate('SMTP mail server') ?></h2> 92dd6b2bfcSGreg Roach 93dd6b2bfcSGreg Roach <div class="row form-group"> 94dd6b2bfcSGreg Roach <label for="SMTP_HOST" class="col-sm-3 col-form-label"> 951dcac87eSGreg Roach <?= /* I18N: A configuration setting */ 961dcac87eSGreg Roach I18N::translate('Server name') ?> 97dd6b2bfcSGreg Roach </label> 98dd6b2bfcSGreg Roach <div class="col-sm-9"> 991dcac87eSGreg Roach <input type="text" class="form-control" id="SMTP_HOST" name="SMTP_HOST" value="<?= e($SMTP_HOST) ?>" placeholder="smtp.example.com" maxlength="255" pattern="[a-z0-9-]+(\.[a-z0-9-]+)*"> 100dd6b2bfcSGreg Roach <p class="small text-muted"> 1011dcac87eSGreg Roach <?= /* I18N: Help text for the “Server name” site configuration setting */ 1021dcac87eSGreg Roach I18N::translate('This is the name of the SMTP server. “localhost” means that the mail service is running on the same computer as your web server.') ?> 103dd6b2bfcSGreg Roach </p> 104dd6b2bfcSGreg Roach </div> 105dd6b2bfcSGreg Roach </div> 106dd6b2bfcSGreg Roach 107dd6b2bfcSGreg Roach <div class="row form-group"> 108dd6b2bfcSGreg Roach <label for="SMTP_PORT" class="col-sm-3 col-form-label"> 1091dcac87eSGreg Roach <?= /* I18N: A configuration setting */ 1101dcac87eSGreg Roach I18N::translate('Port number') ?> 111dd6b2bfcSGreg Roach </label> 112dd6b2bfcSGreg Roach <div class="col-sm-9"> 1131dcac87eSGreg Roach <input type="text" class="form-control" id="SMTP_PORT" name="SMTP_PORT" value="<?= e($SMTP_PORT) ?>" pattern="[0-9]*" placeholder="25" maxlength="5"> 114dd6b2bfcSGreg Roach <p class="small text-muted"> 1151dcac87eSGreg Roach <?= /* I18N: Help text for the "Port number" site configuration setting */ 1161dcac87eSGreg Roach I18N::translate('By default, SMTP works on port 25.') ?> 117dd6b2bfcSGreg Roach </p> 118dd6b2bfcSGreg Roach </div> 119dd6b2bfcSGreg Roach </div> 120dd6b2bfcSGreg Roach 121dd6b2bfcSGreg Roach <fieldset class="form-group"> 122dd6b2bfcSGreg Roach <div class="row"> 123dd6b2bfcSGreg Roach <legend class="col-form-label col-sm-3"> 1241dcac87eSGreg Roach <?= /* I18N: A configuration setting */ 1251dcac87eSGreg Roach I18N::translate('Use password') ?> 126dd6b2bfcSGreg Roach </legend> 127dd6b2bfcSGreg Roach <div class="col-sm-9"> 1281dcac87eSGreg Roach <?= view('components/radios-inline', ['name' => 'SMTP_AUTH', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $SMTP_AUTH]) ?> 129dd6b2bfcSGreg Roach <p class="small text-muted"> 1301dcac87eSGreg Roach <?= /* I18N: Help text for the “Use password” site configuration setting */ 1311dcac87eSGreg Roach I18N::translate('Most SMTP servers require a password.') ?> 132dd6b2bfcSGreg Roach </p> 133dd6b2bfcSGreg Roach </div> 134dd6b2bfcSGreg Roach </div> 135dd6b2bfcSGreg Roach </fieldset> 136dd6b2bfcSGreg Roach 137dd6b2bfcSGreg Roach <div class="row form-group"> 138dd6b2bfcSGreg Roach <label for="SMTP_AUTH_USER" class="col-sm-3 col-form-label"> 1391dcac87eSGreg Roach <?= /* I18N: A configuration setting */ 1401dcac87eSGreg Roach I18N::translate('Username') ?> 141dd6b2bfcSGreg Roach </label> 142dd6b2bfcSGreg Roach <div class="col-sm-9"> 1431dcac87eSGreg Roach <input type="text" class="form-control" id="SMTP_AUTH_USER" name="SMTP_AUTH_USER" value="<?= e($SMTP_AUTH_USER) ?>" maxlength="255"> 144dd6b2bfcSGreg Roach <p class="small text-muted"> 1451dcac87eSGreg Roach <?= /* I18N: Help text for the "Username" site configuration setting */ 1461dcac87eSGreg Roach I18N::translate('The username required for authentication with the SMTP server.') ?> 147dd6b2bfcSGreg Roach </p> 148dd6b2bfcSGreg Roach </div> 149dd6b2bfcSGreg Roach </div> 150dd6b2bfcSGreg Roach 151dd6b2bfcSGreg Roach <div class="row form-group"> 152dd6b2bfcSGreg Roach <label for="SMTP_AUTH_PASS" class="col-sm-3 col-form-label"> 1531dcac87eSGreg Roach <?= /* I18N: A configuration setting */ 1541dcac87eSGreg Roach I18N::translate('Password') ?> 155dd6b2bfcSGreg Roach </label> 156dd6b2bfcSGreg Roach <div class="col-sm-9"> 1571f1ffa65SGreg Roach <input type="password" class="form-control" id="SMTP_AUTH_PASS" name="SMTP_AUTH_PASS" value="" autocomplete="off"> 158dd6b2bfcSGreg Roach <p class="small text-muted"> 1591dcac87eSGreg Roach <?= /* I18N: Help text for the "Password" site configuration setting */ 1601dcac87eSGreg Roach I18N::translate('The password required for authentication with the SMTP server.') ?> 161dd6b2bfcSGreg Roach </p> 162dd6b2bfcSGreg Roach </div> 163dd6b2bfcSGreg Roach </div> 164dd6b2bfcSGreg Roach 165dd6b2bfcSGreg Roach <div class="row form-group"> 166dd6b2bfcSGreg Roach <label for="SMTP_SSL" class="col-sm-3 col-form-label"> 1671dcac87eSGreg Roach <?= /* I18N: A configuration setting */ 1681dcac87eSGreg Roach I18N::translate('Secure connection') ?> 169dd6b2bfcSGreg Roach </label> 170dd6b2bfcSGreg Roach <div class="col-sm-9"> 1711dcac87eSGreg Roach <?= view('components/select', ['name' => 'SMTP_SSL', 'selected' => $SMTP_SSL, 'options' => $mail_ssl_options]) ?> 172dd6b2bfcSGreg Roach <p class="small text-muted"> 1731dcac87eSGreg Roach <?= /* I18N: Help text for the “Secure connection” site configuration setting */ 1741dcac87eSGreg Roach I18N::translate('Most servers do not use secure connections.') ?> 175dd6b2bfcSGreg Roach </p> 176dd6b2bfcSGreg Roach </div> 177dd6b2bfcSGreg Roach </div> 178dd6b2bfcSGreg Roach 179dd6b2bfcSGreg Roach <div class="row form-group"> 180dd6b2bfcSGreg Roach <label for="SMTP_HELO" class="col-sm-3 col-form-label"> 1811dcac87eSGreg Roach <?= /* I18N: A configuration setting */ 1821dcac87eSGreg Roach I18N::translate('Sending server name') ?> 183dd6b2bfcSGreg Roach </label> 184dd6b2bfcSGreg Roach <div class="col-sm-9"> 1851dcac87eSGreg Roach <input type="text" class="form-control" id="SMTP_HELO" name="SMTP_HELO" value="<?= e($SMTP_HELO) ?>" maxlength="255" pattern="[a-z0-9-]+(\.[a-z0-9-]+)*"> 186dd6b2bfcSGreg Roach <p class="small text-muted"> 1871dcac87eSGreg Roach <?= /* I18N: Help text for the "Sending server name" site configuration setting */ 1881dcac87eSGreg Roach I18N::translate('Most mail servers require that the sending server identifies itself correctly, using a valid domain name.') ?> 189dd6b2bfcSGreg Roach </p> 1901dcac87eSGreg Roach 1911dcac87eSGreg Roach <?php if (!$smtp_helo_valid) : ?> 1921dcac87eSGreg Roach <p class="alert alert-warning"> 1931dcac87eSGreg Roach <?= I18N::translate('Most mail servers require a valid domain name.') ?> 1941dcac87eSGreg Roach </p> 1951dcac87eSGreg Roach <?php endif ?> 196dd6b2bfcSGreg Roach </div> 197dd6b2bfcSGreg Roach </div> 198dd6b2bfcSGreg Roach 1994d99955eSGreg Roach <h2> 2001dcac87eSGreg Roach <?= /* I18N: https://en.wikipedia.org/wiki/DomainKeys_Identified_Mail */ 2011dcac87eSGreg Roach I18N::translate('DKIM digital signature') ?> 2024d99955eSGreg Roach </h2> 2034d99955eSGreg Roach 2044d99955eSGreg Roach <div class="row form-group"> 2054d99955eSGreg Roach <label for="DKIM_DOMAIN" class="col-sm-3 col-form-label"> 2064d99955eSGreg Roach <?= I18N::translate('Domain name') ?> 2074d99955eSGreg Roach </label> 2084d99955eSGreg Roach <div class="col-sm-9"> 2091dcac87eSGreg Roach <input type="text" class="form-control" id="DKIM_DOMAIN" name="DKIM_DOMAIN" value="<?= e($DKIM_DOMAIN) ?>" maxlength="255"> 2104d99955eSGreg Roach </div> 2114d99955eSGreg Roach </div> 2124d99955eSGreg Roach 2134d99955eSGreg Roach <div class="row form-group"> 2144d99955eSGreg Roach <label for="DKIM_SELECTOR" class="col-sm-3 col-form-label"> 2154d99955eSGreg Roach <?= I18N::translate('Selector') ?> 2164d99955eSGreg Roach </label> 2174d99955eSGreg Roach <div class="col-sm-9"> 2181dcac87eSGreg Roach <input type="text" class="form-control" id="DKIM_SELECTOR" name="DKIM_SELECTOR" value="<?= e($DKIM_SELECTOR) ?>" maxlength="255"> 2194d99955eSGreg Roach </div> 2204d99955eSGreg Roach </div> 2214d99955eSGreg Roach 2224d99955eSGreg Roach <div class="row form-group"> 2234d99955eSGreg Roach <label for="DKIM_KEY" class="col-sm-3 col-form-label"> 2244d99955eSGreg Roach <?= I18N::translate('Private key') ?> 2254d99955eSGreg Roach </label> 2264d99955eSGreg Roach <div class="col-sm-9"> 2271dcac87eSGreg Roach <textarea class="form-control" id="DKIM_KEY" name="DKIM_KEY"><?= e($DKIM_KEY) ?></textarea> 2284d99955eSGreg Roach </div> 2294d99955eSGreg Roach </div> 2304d99955eSGreg Roach 2311dcac87eSGreg Roach <hr> 2321dcac87eSGreg Roach 233dd6b2bfcSGreg Roach <div class="row form-group"> 234dd6b2bfcSGreg Roach <div class="offset-sm-3 col-sm-9"> 235dd6b2bfcSGreg Roach <button type="submit" class="btn btn-primary"> 236dd6b2bfcSGreg Roach <?= view('icons/save') ?> 237dd6b2bfcSGreg Roach <?= I18N::translate('save') ?> 238dd6b2bfcSGreg Roach </button> 239dd6b2bfcSGreg Roach 2400c0910bfSGreg Roach <a href="<?= e(route(ControlPanel::class)) ?>" class="btn btn-secondary"> 241dd6b2bfcSGreg Roach <?= view('icons/cancel') ?> 242dd6b2bfcSGreg Roach <?= I18N::translate('cancel') ?> 243dd6b2bfcSGreg Roach </a> 244dd6b2bfcSGreg Roach </div> 245dd6b2bfcSGreg Roach </div> 246dd6b2bfcSGreg Roach</form> 247510d3f2fSGreg Roach 248510d3f2fSGreg Roach<?php View::push('javascript') ?> 249510d3f2fSGreg Roach<script> 2501dcac87eSGreg Roach $("#SMTP_AUTH_PASS").hideShowPassword("infer", true); 251510d3f2fSGreg Roach</script> 252510d3f2fSGreg Roach<?php View::endpush() ?> 253