92 lines
4.5 KiB
PHP
92 lines
4.5 KiB
PHP
<?php
|
|
if (!defined('_GNUBOARD_')) exit;
|
|
|
|
$g5['title'] = $smtp ? 'SMTP 설정 수정' : 'SMTP 설정 추가';
|
|
include_once(G5_ADMIN_PATH.'/admin.head.php');
|
|
|
|
$row = $smtp ?? [
|
|
'id' => 0,
|
|
'name' => '',
|
|
'host' => '',
|
|
'username' => '',
|
|
'password' => '',
|
|
'port' => 465,
|
|
'encryption' => 'ssl',
|
|
'from_email' => '',
|
|
'from_name' => '',
|
|
'is_use' => 1,
|
|
];
|
|
?>
|
|
|
|
<form name="fsmtpconfig" id="fsmtpconfig" method="post" action="./smtp_config.php">
|
|
<input type="hidden" name="action" value="<?php echo $row['id'] ? 'update' : 'create'; ?>">
|
|
<input type="hidden" name="id" value="<?php echo (int)$row['id']; ?>">
|
|
<input type="hidden" name="token" value="<?php echo get_admin_token(); ?>">
|
|
|
|
<div class="tbl_frm01 tbl_wrap">
|
|
<table>
|
|
<caption><?php echo $g5['title']; ?></caption>
|
|
<colgroup>
|
|
<col class="grid_4">
|
|
<col>
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<th scope="row"><label for="name">이름(용도)</label></th>
|
|
<td><input type="text" name="name" id="name" required class="required frm_input" size="40" value="<?php echo get_text($row['name']); ?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="host">SMTP 호스트</label></th>
|
|
<td><input type="text" name="host" id="host" required class="required frm_input" size="40" value="<?php echo get_text($row['host']); ?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="username">계정(아이디)</label></th>
|
|
<td><input type="text" name="username" id="username" required class="required frm_input" size="40" value="<?php echo get_text($row['username']); ?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="password">비밀번호</label></th>
|
|
<td>
|
|
<input type="password" name="password" id="password" class="frm_input" size="40" <?php if (!$row['id']) echo 'required'; ?>>
|
|
<?php if ($row['id']) { ?>
|
|
<span class="frm_info">비밀번호를 변경할 경우에만 입력하세요.</span>
|
|
<?php } ?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="port">포트</label></th>
|
|
<td><input type="number" name="port" id="port" required class="required frm_input" size="10" value="<?php echo get_text($row['port']); ?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="encryption">암호화 방식</label></th>
|
|
<td>
|
|
<select name="encryption" id="encryption" required>
|
|
<option value="none" <?php echo ($row['encryption']=='none')?'selected':''; ?>>none</option>
|
|
<option value="ssl" <?php echo ($row['encryption']=='ssl')?'selected':''; ?>>SSL</option>
|
|
<option value="tls" <?php echo ($row['encryption']=='tls')?'selected':''; ?>>TLS</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="from_email">발신자 이메일</label></th>
|
|
<td><input type="email" name="from_email" id="from_email" required class="required frm_input" size="40" value="<?php echo get_text($row['from_email']); ?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="from_name">발신자 이름</label></th>
|
|
<td><input type="text" name="from_name" id="from_name" required class="required frm_input" size="40" value="<?php echo get_text($row['from_name']); ?>"></td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="is_use">사용 여부</label></th>
|
|
<td><input type="checkbox" name="is_use" id="is_use" value="1" <?php echo $row['is_use'] ? 'checked' : ''; ?>></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="btn_confirm01 btn_confirm">
|
|
<a href="./smtp_config.php" class="btn_cancel btn">목록으로</a>
|
|
<input type="submit" value="확인" class="btn_submit btn" accesskey="s">
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<?php include_once(G5_ADMIN_PATH.'/admin.tail.php'); ?>
|