Merge branch 'g5'

This commit is contained in:
thisgun
2017-01-09 10:29:34 +09:00
41 changed files with 4605 additions and 238 deletions

View File

@ -7,6 +7,8 @@ auth_check($auth[$sub_menu], "w");
$html_title = 'FAQ';
$fm_id = preg_replace('/[^0-9]/', '', $fm_id);
if ($w == "u")
{
$html_title .= ' 수정';

View File

@ -5,11 +5,14 @@ include_once(G5_EDITOR_LIB);
auth_check($auth[$sub_menu], "w");
$nw_id = preg_replace('/[^0-9]/', '', $nw_id);
$html_title = "팝업레이어";
// 팝업레이어 테이블에 쇼핑몰, 커뮤니티 인지 구분하는 여부 필드 추가
$sql = " ALTER TABLE `{$g5['new_win_table']}` ADD `nw_division` VARCHAR(10) NOT NULL DEFAULT 'both' ";
sql_query($sql, false);
$html_title = "팝업레이어";
if ($w == "u")
{
$html_title .= " 수정";

View File

@ -4,8 +4,8 @@ include_once('./_common.php');
auth_check($auth[$sub_menu], 'r');
if (empty($fr_date)) $fr_date = G5_TIME_YMD;
if (empty($to_date)) $to_date = G5_TIME_YMD;
if (empty($fr_date) || ! preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/", $fr_date) ) $fr_date = G5_TIME_YMD;
if (empty($to_date) || ! preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/", $to_date) ) $to_date = G5_TIME_YMD;
$qstr = "fr_date={$fr_date}{&to_date}={$to_date}";

View File

@ -5,8 +5,8 @@ include_once(G5_LIB_PATH.'/visit.lib.php');
include_once('./admin.head.php');
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
if (empty($fr_date)) $fr_date = G5_TIME_YMD;
if (empty($to_date)) $to_date = G5_TIME_YMD;
if (empty($fr_date) || ! preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/", $fr_date) ) $fr_date = G5_TIME_YMD;
if (empty($to_date) || ! preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/", $to_date) ) $to_date = G5_TIME_YMD;
$qstr = "fr_date=".$fr_date."&to_date=".$to_date;
$query_string = $qstr ? '?'.$qstr : '';

View File

@ -0,0 +1,11 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
//플러그인 폴더 이름 및 스킨 폴더 이름
define('SMARTEDITOR_UPLOAD_IMG_CHECK', 1); // 이미지 파일을 썸네일 할수 있는지 여부를 체크합니다. ( 해당 파일이 이미지 파일인지 체크합니다. 1이면 사용, 0이면 사용 안함 )
define('SMARTEDITOR_UPLOAD_RESIZE', 0); // 스마트에디터 업로드 이미지파일 JPG, PNG 리사이즈 1이면 사용, 0이면 사용안함
define('SMARTEDITOR_UPLOAD_MAX_WIDTH', 1200); // 스마트에디터 업로드 이미지 리사이즈 제한 width
define('SMARTEDITOR_UPLOAD_MAX_HEIGHT', 2800); // 스마트에디터 업로드 이미지 리사이즈 제한 height
define('SMARTEDITOR_UPLOAD_SIZE_LIMIT', 20); // 스마트에디터 업로드 사이즈 제한 ( 기본 20MB )
define('SMARTEDITOR_UPLOAD_IMAGE_QUALITY', 98); // 썸네일 이미지 JPG, PNG 압축률
?>

View File

@ -13,16 +13,41 @@ function certify_win_open(type, url)
}
else if(type == 'kcp-hp')
{
var return_gubun;
var width = 410;
var height = 500;
if($("input[name=veri_up_hash]").size() < 1)
$("input[name=cert_no]").after('<input type="hidden" name="veri_up_hash" value="">');
var leftpos = screen.width / 2 - ( width / 2 );
var toppos = screen.height / 2 - ( height / 2 );
if( navigator.userAgent.indexOf("Android") > - 1 || navigator.userAgent.indexOf("iPhone") > - 1 )
{
var $frm = $(event.target.form);
if($("#kcp_cert").size() < 1) {
$frm.wrap('<div id="cert_info"></div>');
var winopts = "width=" + width + ", height=" + height + ", toolbar=no,status=no,statusbar=no,menubar=no,scrollbars=no,resizable=no";
var position = ",left=" + leftpos + ", top=" + toppos;
var AUTH_POP = window.open(url,'auth_popup', winopts + position);
$("#cert_info").append('<form name="form_temp" method="post">')
.after('<iframe id="kcp_cert" name="kcp_cert" width="100%" height="700" frameborder="0" scrolling="no" style="display:none"></iframe>');
}
var temp_form = document.form_temp;
temp_form.target = "kcp_cert";
temp_form.action = url;
document.getElementById( "cert_info" ).style.display = "none";
document.getElementById( "kcp_cert" ).style.display = "";
temp_form.submit();
}
else
{
var return_gubun;
var width = 410;
var height = 500;
var leftpos = screen.width / 2 - ( width / 2 );
var toppos = screen.height / 2 - ( height / 2 );
var winopts = "width=" + width + ", height=" + height + ", toolbar=no,status=no,statusbar=no,menubar=no,scrollbars=no,resizable=no";
var position = ",left=" + leftpos + ", top=" + toppos;
var AUTH_POP = window.open(url,'auth_popup', winopts + position);
}
}
else if(type == 'lg-hp')
{

View File

@ -8,7 +8,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<div class="mbskin">
<script src="<?php echo G5_JS_URL ?>/jquery.register_form.js"></script>
<?php if($config['cf_cert_use'] && ($config['cf_cert_ipin'] || $config['cf_cert_hp'])) { ?>
<script src="<?php echo G5_JS_URL ?>/certify.js"></script>
<script src="<?php echo G5_JS_URL ?>/certify.js?v=<?php echo G5_JS_VER; ?>"></script>
<?php } ?>
<form name="fregisterform" id="fregisterform" action="<?php echo $register_action_url ?>" onsubmit="return fregisterform_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off">
@ -122,7 +122,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
</tr>
<?php } ?>
<?php if ($config['cf_use_hp']) { ?>
<?php if ($config['cf_use_hp'] || $config['cf_cert_hp']) { ?>
<tr>
<th scope="row"><label for="reg_mb_hp">휴대폰번호<?php if ($config['cf_req_hp']) { ?><strong class="sound_only">필수</strong><?php } ?></label></th>
<td>

View File

@ -1 +1 @@
5.2.14
5.2.19

View File

@ -31,7 +31,7 @@ class PHPMailer
* The PHPMailer Version number.
* @var string
*/
public $Version = '5.2.14';
public $Version = '5.2.19';
/**
* Email priority.
@ -201,6 +201,9 @@ class PHPMailer
/**
* An ID to be used in the Message-ID header.
* If empty, a unique id will be generated.
* You can set your own, but it must be in the format "<id@domain>",
* as defined in RFC5322 section 3.6.4 or it will be ignored.
* @see https://tools.ietf.org/html/rfc5322#section-3.6.4
* @var string
*/
public $MessageID = '';
@ -285,7 +288,7 @@ class PHPMailer
/**
* SMTP auth type.
* Options are LOGIN (default), PLAIN, NTLM, CRAM-MD5
* Options are CRAM-MD5, LOGIN, PLAIN, NTLM, XOAUTH2, attempted in that order if not specified
* @var string
*/
public $AuthType = '';
@ -352,6 +355,7 @@ class PHPMailer
/**
* Whether to split multiple to addresses into multiple messages
* or send them all in one message.
* Only supported in `mail` and `sendmail` transports, not in SMTP.
* @var boolean
*/
public $SingleTo = false;
@ -394,7 +398,7 @@ class PHPMailer
/**
* DKIM Identity.
* Usually the email address used as the source of the email
* Usually the email address used as the source of the email.
* @var string
*/
public $DKIM_identity = '';
@ -419,6 +423,13 @@ class PHPMailer
*/
public $DKIM_private = '';
/**
* DKIM private key string.
* If set, takes precedence over `$DKIM_private`.
* @var string
*/
public $DKIM_private_string = '';
/**
* Callback Action function name.
*
@ -446,6 +457,15 @@ class PHPMailer
*/
public $XMailer = '';
/**
* Which validator to use by default when validating email addresses.
* May be a callable to inject your own validator, but there are several built-in validators.
* @see PHPMailer::validateAddress()
* @var string|callable
* @static
*/
public static $validator = 'auto';
/**
* An instance of the SMTP sender class.
* @var SMTP
@ -634,9 +654,11 @@ class PHPMailer
* Constructor.
* @param boolean $exceptions Should we throw external exceptions?
*/
public function __construct($exceptions = false)
public function __construct($exceptions = null)
{
$this->exceptions = (boolean)$exceptions;
if ($exceptions !== null) {
$this->exceptions = (boolean)$exceptions;
}
}
/**
@ -645,9 +667,7 @@ class PHPMailer
public function __destruct()
{
//Close any open SMTP connection nicely
if ($this->Mailer == 'smtp') {
$this->smtpClose();
}
$this->smtpClose();
}
/**
@ -671,14 +691,16 @@ class PHPMailer
} else {
$subject = $this->encodeHeader($this->secureHeader($subject));
}
if (ini_get('safe_mode') || !($this->UseSendmailOptions)) {
//Can't use additional_parameters in safe_mode, calling mail() with null params breaks
//@link http://php.net/manual/en/function.mail.php
if (ini_get('safe_mode') or !$this->UseSendmailOptions or is_null($params)) {
$result = @mail($to, $subject, $body, $header);
} else {
$result = @mail($to, $subject, $body, $header, $params);
}
return $result;
}
/**
* Output debugging info via user-defined method.
* Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug).
@ -713,7 +735,7 @@ class PHPMailer
case 'echo':
default:
//Normalize line breaks
$str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str);
$str = preg_replace('/\r\n?/ms', "\n", $str);
echo gmdate('Y-m-d H:i:s') . "\t" . str_replace(
"\n",
"\n \t ",
@ -850,7 +872,7 @@ class PHPMailer
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
if (($pos = strrpos($address, '@')) === false) {
// At-sign is misssing.
$error_message = $this->lang('invalid_address') . $address;
$error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address";
$this->setError($error_message);
$this->edebug($error_message);
if ($this->exceptions) {
@ -900,7 +922,7 @@ class PHPMailer
return false;
}
if (!$this->validateAddress($address)) {
$error_message = $this->lang('invalid_address') . $address;
$error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address";
$this->setError($error_message);
$this->edebug($error_message);
if ($this->exceptions) {
@ -994,7 +1016,7 @@ class PHPMailer
if (($pos = strrpos($address, '@')) === false or
(!$this->has8bitChars(substr($address, ++$pos)) or !$this->idnSupported()) and
!$this->validateAddress($address)) {
$error_message = $this->lang('invalid_address') . $address;
$error_message = $this->lang('invalid_address') . " (setFrom) $address";
$this->setError($error_message);
$this->edebug($error_message);
if ($this->exceptions) {
@ -1027,19 +1049,30 @@ class PHPMailer
/**
* Check that a string looks like an email address.
* @param string $address The email address to check
* @param string $patternselect A selector for the validation pattern to use :
* @param string|callable $patternselect A selector for the validation pattern to use :
* * `auto` Pick best pattern automatically;
* * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14;
* * `pcre` Use old PCRE implementation;
* * `php` Use PHP built-in FILTER_VALIDATE_EMAIL;
* * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.
* * `noregex` Don't use a regex: super fast, really dumb.
* Alternatively you may pass in a callable to inject your own validator, for example:
* PHPMailer::validateAddress('user@example.com', function($address) {
* return (strpos($address, '@') !== false);
* });
* You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator.
* @return boolean
* @static
* @access public
*/
public static function validateAddress($address, $patternselect = 'auto')
public static function validateAddress($address, $patternselect = null)
{
if (is_null($patternselect)) {
$patternselect = self::$validator;
}
if (is_callable($patternselect)) {
return call_user_func($patternselect, $address);
}
//Reject line breaks in addresses; it's valid RFC5322, but not RFC5321
if (strpos($address, "\n") !== false or strpos($address, "\r") !== false) {
return false;
@ -1216,7 +1249,7 @@ class PHPMailer
}
$this->$address_kind = $this->punyencodeAddress($this->$address_kind);
if (!$this->validateAddress($this->$address_kind)) {
$error_message = $this->lang('invalid_address') . $this->$address_kind;
$error_message = $this->lang('invalid_address') . ' (punyEncode) ' . $this->$address_kind;
$this->setError($error_message);
$this->edebug($error_message);
if ($this->exceptions) {
@ -1227,7 +1260,7 @@ class PHPMailer
}
// Set whether the message is multipart/alternative
if (!empty($this->AltBody)) {
if ($this->alternativeExists()) {
$this->ContentType = 'multipart/alternative';
}
@ -1261,9 +1294,11 @@ class PHPMailer
// Sign with DKIM if enabled
if (!empty($this->DKIM_domain)
&& !empty($this->DKIM_private)
&& !empty($this->DKIM_selector)
&& file_exists($this->DKIM_private)) {
&& (!empty($this->DKIM_private_string)
|| (!empty($this->DKIM_private) && file_exists($this->DKIM_private))
)
) {
$header_dkim = $this->DKIM_Add(
$this->MIMEHeader . $this->mailHeader,
$this->encodeHeader($this->secureHeader($this->Subject)),
@ -1329,7 +1364,7 @@ class PHPMailer
*/
protected function sendmailSend($header, $body)
{
if ($this->Sender != '') {
if (!empty($this->Sender)) {
if ($this->Mailer == 'qmail') {
$sendmail = sprintf('%s -f%s', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
} else {
@ -1404,17 +1439,17 @@ class PHPMailer
}
$to = implode(', ', $toArr);
if (empty($this->Sender)) {
$params = ' ';
} else {
$params = sprintf('-f%s', $this->Sender);
$params = null;
//This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
if (!empty($this->Sender) and $this->validateAddress($this->Sender)) {
$params = sprintf('-f%s', escapeshellarg($this->Sender));
}
if ($this->Sender != '' and !ini_get('safe_mode')) {
if (!empty($this->Sender) and !ini_get('safe_mode') and $this->validateAddress($this->Sender)) {
$old_from = ini_get('sendmail_from');
ini_set('sendmail_from', $this->Sender);
}
$result = false;
if ($this->SingleTo && count($toArr) > 1) {
if ($this->SingleTo and count($toArr) > 1) {
foreach ($toArr as $toAddr) {
$result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
$this->doCallback($result, array($toAddr), $this->cc, $this->bcc, $this->Subject, $body, $this->From);
@ -1463,10 +1498,10 @@ class PHPMailer
if (!$this->smtpConnect($this->SMTPOptions)) {
throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
}
if ('' == $this->Sender) {
$smtp_from = $this->From;
} else {
if (!empty($this->Sender) and $this->validateAddress($this->Sender)) {
$smtp_from = $this->Sender;
} else {
$smtp_from = $this->From;
}
if (!$this->smtp->mail($smtp_from)) {
$this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError()));
@ -1520,12 +1555,17 @@ class PHPMailer
* @throws phpmailerException
* @return boolean
*/
public function smtpConnect($options = array())
public function smtpConnect($options = null)
{
if (is_null($this->smtp)) {
$this->smtp = $this->getSMTPInstance();
}
//If no options are provided, use whatever is set in the instance
if (is_null($options)) {
$options = $this->SMTPOptions;
}
// Already connected?
if ($this->smtp->connected()) {
return true;
@ -1595,7 +1635,7 @@ class PHPMailer
if (!$this->smtp->startTLS()) {
throw new phpmailerException($this->lang('connect_host'));
}
// We must resend HELO after tls negotiation
// We must resend EHLO after TLS negotiation
$this->smtp->hello($hello);
}
if ($this->SMTPAuth) {
@ -1634,7 +1674,7 @@ class PHPMailer
*/
public function smtpClose()
{
if ($this->smtp !== null) {
if (is_a($this->smtp, 'SMTP')) {
if ($this->smtp->connected()) {
$this->smtp->quit();
$this->smtp->close();
@ -1653,6 +1693,19 @@ class PHPMailer
*/
public function setLanguage($langcode = 'en', $lang_path = '')
{
// Backwards compatibility for renamed language codes
$renamed_langcodes = array(
'br' => 'pt_br',
'cz' => 'cs',
'dk' => 'da',
'no' => 'nb',
'se' => 'sv',
);
if (isset($renamed_langcodes[$langcode])) {
$langcode = $renamed_langcodes[$langcode];
}
// Define full set of translatable strings in English
$PHPMAILER_LANG = array(
'authenticate' => 'SMTP Error: Could not authenticate.',
@ -1679,6 +1732,10 @@ class PHPMailer
// Calculate an absolute path so it can work if CWD is not here
$lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR;
}
//Validate $langcode
if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) {
$langcode = 'en';
}
$foundlang = true;
$lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php';
// There is no English translation file
@ -1972,7 +2029,9 @@ class PHPMailer
$result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject)));
}
if ($this->MessageID != '') {
// Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4
// https://tools.ietf.org/html/rfc5322#section-3.6.4
if ('' != $this->MessageID and preg_match('/^<.*@.*>$/', $this->MessageID)) {
$this->lastMessageID = $this->MessageID;
} else {
$this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname());
@ -2074,7 +2133,15 @@ class PHPMailer
*/
public function getSentMIMEMessage()
{
return $this->MIMEHeader . $this->mailHeader . self::CRLF . $this->MIMEBody;
return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . self::CRLF . self::CRLF . $this->MIMEBody;
}
/**
* Create unique ID
* @return string
*/
protected function generateId() {
return md5(uniqid(time()));
}
/**
@ -2088,7 +2155,7 @@ class PHPMailer
{
$body = '';
//Create unique IDs and preset boundaries
$this->uniqueid = md5(uniqid(time()));
$this->uniqueid = $this->generateId();
$this->boundary[1] = 'b1_' . $this->uniqueid;
$this->boundary[2] = 'b2_' . $this->uniqueid;
$this->boundary[3] = 'b3_' . $this->uniqueid;
@ -2104,12 +2171,12 @@ class PHPMailer
//Can we do a 7-bit downgrade?
if ($bodyEncoding == '8bit' and !$this->has8bitChars($this->Body)) {
$bodyEncoding = '7bit';
//All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit
$bodyCharSet = 'us-ascii';
}
//If lines are too long, and we're not already using an encoding that will shorten them,
//change to quoted-printable transfer encoding
//change to quoted-printable transfer encoding for the body part only
if ('base64' != $this->Encoding and self::hasLineLongerThanMax($this->Body)) {
$this->Encoding = 'quoted-printable';
$bodyEncoding = 'quoted-printable';
}
@ -2118,10 +2185,12 @@ class PHPMailer
//Can we do a 7-bit downgrade?
if ($altBodyEncoding == '8bit' and !$this->has8bitChars($this->AltBody)) {
$altBodyEncoding = '7bit';
//All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit
$altBodyCharSet = 'us-ascii';
}
//If lines are too long, change to quoted-printable transfer encoding
if (self::hasLineLongerThanMax($this->AltBody)) {
//If lines are too long, and we're not already using an encoding that will shorten them,
//change to quoted-printable transfer encoding for the alt body part only
if ('base64' != $altBodyEncoding and self::hasLineLongerThanMax($this->AltBody)) {
$altBodyEncoding = 'quoted-printable';
}
//Use this as a preamble in all multipart message types
@ -2224,8 +2293,10 @@ class PHPMailer
$body .= $this->attachAll('attachment', $this->boundary[1]);
break;
default:
// catch case 'plain' and case ''
$body .= $this->encodeString($this->Body, $bodyEncoding);
// Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types
//Reset the `Encoding` property in case we changed it for line length reasons
$this->Encoding = $bodyEncoding;
$body .= $this->encodeString($this->Body, $this->Encoding);
break;
}
@ -2331,8 +2402,7 @@ class PHPMailer
/**
* Set the message type.
* PHPMailer only supports some preset message types,
* not arbitrary MIME structures.
* PHPMailer only supports some preset message types, not arbitrary MIME structures.
* @access protected
* @return void
*/
@ -2350,6 +2420,7 @@ class PHPMailer
}
$this->message_type = implode('_', $type);
if ($this->message_type == '') {
//The 'plain' message_type refers to the message having a single body element, not that it is plain-text
$this->message_type = 'plain';
}
}
@ -3264,16 +3335,18 @@ class PHPMailer
}
/**
* Create a message from an HTML string.
* Automatically makes modifications for inline images and backgrounds
* and creates a plain-text version by converting the HTML.
* Overwrites any existing values in $this->Body and $this->AltBody
* Create a message body from an HTML string.
* Automatically inlines images and creates a plain-text version by converting the HTML,
* overwriting any existing values in Body and AltBody.
* $basedir is used when handling relative image paths, e.g. <img src="images/a.png">
* will look for an image file in $basedir/images/a.png and convert it to inline.
* If you don't want to apply these transformations to your HTML, just set Body and AltBody yourself.
* @access public
* @param string $message HTML message string
* @param string $basedir baseline directory for path
* @param string $basedir base directory for relative paths to images
* @param boolean|callable $advanced Whether to use the internal HTML to text converter
* or your own custom converter @see PHPMailer::html2text()
* @return string $message
* @return string $message The transformed message Body
*/
public function msgHTML($message, $basedir = '', $advanced = false)
{
@ -3296,7 +3369,7 @@ class PHPMailer
$message
);
}
} elseif (substr($url, 0, 4) !== 'cid:' && !preg_match('#^[A-z]+://#', $url)) {
} elseif (substr($url, 0, 4) !== 'cid:' && !preg_match('#^[a-z][a-z0-9+.-]*://#i', $url)) {
// Do not change urls for absolute images (thanks to corvuscorax)
// Do not change urls that are already inline images
$filename = basename($url);
@ -3332,7 +3405,7 @@ class PHPMailer
// Convert all message body line breaks to CRLF, makes quoted-printable encoding work much better
$this->Body = $this->normalizeBreaks($message);
$this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced));
if (empty($this->AltBody)) {
if (!$this->alternativeExists()) {
$this->AltBody = 'To view this email message, open it in a program that understands HTML!' .
self::CRLF . self::CRLF;
}
@ -3343,7 +3416,7 @@ class PHPMailer
* Convert an HTML string into plain text.
* This is used by msgHTML().
* Note - older versions of this function used a bundled advanced converter
* which was been removed for license reasons in #232
* which was been removed for license reasons in #232.
* Example usage:
* <code>
* // Use default conversion
@ -3643,7 +3716,7 @@ class PHPMailer
* @access public
* @param string $signHeader
* @throws phpmailerException
* @return string
* @return string The DKIM signature value
*/
public function DKIM_Sign($signHeader)
{
@ -3653,15 +3726,35 @@ class PHPMailer
}
return '';
}
$privKeyStr = file_get_contents($this->DKIM_private);
if ($this->DKIM_passphrase != '') {
$privKeyStr = !empty($this->DKIM_private_string) ? $this->DKIM_private_string : file_get_contents($this->DKIM_private);
if ('' != $this->DKIM_passphrase) {
$privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase);
} else {
$privKey = $privKeyStr;
$privKey = openssl_pkey_get_private($privKeyStr);
}
if (openssl_sign($signHeader, $signature, $privKey)) {
return base64_encode($signature);
//Workaround for missing digest algorithms in old PHP & OpenSSL versions
//@link http://stackoverflow.com/a/11117338/333340
if (version_compare(PHP_VERSION, '5.3.0') >= 0 and
in_array('sha256WithRSAEncryption', openssl_get_md_methods(true))) {
if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) {
openssl_pkey_free($privKey);
return base64_encode($signature);
}
} else {
$pinfo = openssl_pkey_get_details($privKey);
$hash = hash('sha256', $signHeader);
//'Magic' constant for SHA256 from RFC3447
//@link https://tools.ietf.org/html/rfc3447#page-43
$t = '3031300d060960864801650304020105000420' . $hash;
$pslen = $pinfo['bits'] / 8 - (strlen($t) / 2 + 3);
$eb = pack('H*', '0001' . str_repeat('FF', $pslen) . '00' . $t);
if (openssl_private_encrypt($eb, $signature, $privKey, OPENSSL_NO_PADDING)) {
openssl_pkey_free($privKey);
return base64_encode($signature);
}
}
openssl_pkey_free($privKey);
return '';
}
@ -3678,7 +3771,7 @@ class PHPMailer
foreach ($lines as $key => $line) {
list($heading, $value) = explode(':', $line, 2);
$heading = strtolower($heading);
$value = preg_replace('/\s+/', ' ', $value); // Compress useless spaces
$value = preg_replace('/\s{2,}/', ' ', $value); // Compress useless spaces
$lines[$key] = $heading . ':' . trim($value); // Don't forget to remove WSP around the value
}
$signHeader = implode("\r\n", $lines);
@ -3716,7 +3809,7 @@ class PHPMailer
*/
public function DKIM_Add($headers_line, $subject, $body)
{
$DKIMsignatureType = 'rsa-sha1'; // Signature & hash algorithms
$DKIMsignatureType = 'rsa-sha256'; // Signature & hash algorithms
$DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body
$DKIMquery = 'dns/txt'; // Query method
$DKIMtime = time(); // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone)
@ -3724,6 +3817,7 @@ class PHPMailer
$headers = explode($this->LE, $headers_line);
$from_header = '';
$to_header = '';
$date_header = '';
$current = '';
foreach ($headers as $header) {
if (strpos($header, 'From:') === 0) {
@ -3732,6 +3826,9 @@ class PHPMailer
} elseif (strpos($header, 'To:') === 0) {
$to_header = $header;
$current = 'to_header';
} elseif (strpos($header, 'Date:') === 0) {
$date_header = $header;
$current = 'date_header';
} else {
if (!empty($$current) && strpos($header, ' =?') === 0) {
$$current .= $header;
@ -3742,6 +3839,7 @@ class PHPMailer
}
$from = str_replace('|', '=7C', $this->DKIM_QP($from_header));
$to = str_replace('|', '=7C', $this->DKIM_QP($to_header));
$date = str_replace('|', '=7C', $this->DKIM_QP($date_header));
$subject = str_replace(
'|',
'=7C',
@ -3749,7 +3847,7 @@ class PHPMailer
); // Copied header fields (dkim-quoted-printable)
$body = $this->DKIM_BodyC($body);
$DKIMlen = strlen($body); // Length of body
$DKIMb64 = base64_encode(pack('H*', sha1($body))); // Base64 of packed binary SHA-1 hash of body
$DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); // Base64 of packed binary SHA-256 hash of body
if ('' == $this->DKIM_identity) {
$ident = '';
} else {
@ -3762,16 +3860,18 @@ class PHPMailer
$this->DKIM_selector .
";\r\n" .
"\tt=" . $DKIMtime . '; c=' . $DKIMcanonicalization . ";\r\n" .
"\th=From:To:Subject;\r\n" .
"\th=From:To:Date:Subject;\r\n" .
"\td=" . $this->DKIM_domain . ';' . $ident . "\r\n" .
"\tz=$from\r\n" .
"\t|$to\r\n" .
"\t|$date\r\n" .
"\t|$subject;\r\n" .
"\tbh=" . $DKIMb64 . ";\r\n" .
"\tb=";
$toSign = $this->DKIM_HeaderC(
$from_header . "\r\n" .
$to_header . "\r\n" .
$date_header . "\r\n" .
$subject_header . "\r\n" .
$dkimhdrs
);

View File

@ -80,6 +80,7 @@ class PHPMailerOAuth extends PHPMailer
* @uses SMTP
* @access public
* @return bool
* @throws phpmailerException
*/
public function smtpConnect($options = array())
{

View File

@ -49,7 +49,8 @@ class PHPMailerOAuthGoogle
$this->oauthUserEmail = $UserEmail;
}
private function getProvider() {
private function getProvider()
{
return new League\OAuth2\Client\Provider\Google([
'clientId' => $this->oauthClientId,
'clientSecret' => $this->oauthClientSecret

View File

@ -34,7 +34,7 @@ class POP3
* @var string
* @access public
*/
public $Version = '5.2.14';
public $Version = '5.2.19';
/**
* Default POP3 port number.

View File

@ -30,7 +30,7 @@ class SMTP
* The PHPMailer SMTP version number.
* @var string
*/
const VERSION = '5.2.14';
const VERSION = '5.2.19';
/**
* SMTP line break constant.
@ -81,7 +81,7 @@ class SMTP
* @deprecated Use the `VERSION` constant instead
* @see SMTP::VERSION
*/
public $Version = '5.2.14';
public $Version = '5.2.19';
/**
* SMTP server port number.
@ -150,6 +150,17 @@ class SMTP
*/
public $Timelimit = 300;
/**
* @var array patterns to extract smtp transaction id from smtp reply
* Only first capture group will be use, use non-capturing group to deal with it
* Extend this class to override this property to fulfil your needs.
*/
protected $smtp_transaction_id_patterns = array(
'exim' => '/[0-9]{3} OK id=(.*)/',
'sendmail' => '/[0-9]{3} 2.0.0 (.*) Message/',
'postfix' => '/[0-9]{3} 2.0.0 Ok: queued as (.*)/'
);
/**
* The socket for the server connection.
* @var resource
@ -206,7 +217,7 @@ class SMTP
}
//Avoid clash with built-in function names
if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
call_user_func($this->Debugoutput, $str, $this->do_debug);
call_user_func($this->Debugoutput, $str, $level);
return;
}
switch ($this->Debugoutput) {
@ -272,8 +283,8 @@ class SMTP
$errstr = '';
if ($streamok) {
$socket_context = stream_context_create($options);
//Suppress errors; connection failures are handled at a higher level
$this->smtp_conn = @stream_socket_client(
set_error_handler(array($this, 'errorHandler'));
$this->smtp_conn = stream_socket_client(
$host . ":" . $port,
$errno,
$errstr,
@ -281,12 +292,14 @@ class SMTP
STREAM_CLIENT_CONNECT,
$socket_context
);
restore_error_handler();
} else {
//Fall back to fsockopen which should work in more places, but is missing some features
$this->edebug(
"Connection: stream_socket_client not available, falling back to fsockopen",
self::DEBUG_CONNECTION
);
set_error_handler(array($this, 'errorHandler'));
$this->smtp_conn = fsockopen(
$host,
$port,
@ -294,6 +307,7 @@ class SMTP
$errstr,
$timeout
);
restore_error_handler();
}
// Verify we connected properly
if (!is_resource($this->smtp_conn)) {
@ -336,11 +350,22 @@ class SMTP
if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
return false;
}
//Allow the best TLS version(s) we can
$crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
//PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT
//so add them back in manually if we can
if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
}
// Begin encrypted connection
if (!stream_socket_enable_crypto(
$this->smtp_conn,
true,
STREAM_CRYPTO_METHOD_TLS_CLIENT
$crypto_method
)) {
return false;
}
@ -389,7 +414,7 @@ class SMTP
);
if (empty($authtype)) {
foreach (array('LOGIN', 'CRAM-MD5', 'NTLM', 'PLAIN', 'XOAUTH2') as $method) {
foreach (array('CRAM-MD5', 'LOGIN', 'PLAIN', 'NTLM', 'XOAUTH2') as $method) {
if (in_array($method, $this->server_caps['AUTH'])) {
$authtype = $method;
break;
@ -463,7 +488,7 @@ class SMTP
$temp = new stdClass;
$ntlm_client = new ntlm_sasl_client_class;
//Check that functions are available
if (!$ntlm_client->Initialize($temp)) {
if (!$ntlm_client->initialize($temp)) {
$this->setError($temp->error);
$this->edebug(
'You need to enable some modules in your php.ini file: '
@ -473,7 +498,7 @@ class SMTP
return false;
}
//msg1
$msg1 = $ntlm_client->TypeMsg1($realm, $workstation); //msg1
$msg1 = $ntlm_client->typeMsg1($realm, $workstation); //msg1
if (!$this->sendCommand(
'AUTH NTLM',
@ -492,7 +517,7 @@ class SMTP
$password
);
//msg3
$msg3 = $ntlm_client->TypeMsg3(
$msg3 = $ntlm_client->typeMsg3(
$ntlm_res,
$username,
$realm,
@ -736,7 +761,7 @@ class SMTP
protected function parseHelloFields($type)
{
$this->server_caps = array();
$lines = explode("\n", $this->last_reply);
$lines = explode("\n", $this->helo_rply);
foreach ($lines as $n => $s) {
//First 4 chars contain response code followed by - or space
@ -1178,4 +1203,47 @@ class SMTP
{
return $this->Timeout;
}
/**
* Reports an error number and string.
* @param integer $errno The error number returned by PHP.
* @param string $errmsg The error message returned by PHP.
*/
protected function errorHandler($errno, $errmsg)
{
$notice = 'Connection: Failed to connect to server.';
$this->setError(
$notice,
$errno,
$errmsg
);
$this->edebug(
$notice . ' Error number ' . $errno . '. "Error notice: ' . $errmsg,
self::DEBUG_CONNECTION
);
}
/**
* Will return the ID of the last smtp transaction based on a list of patterns provided
* in SMTP::$smtp_transaction_id_patterns.
* If no reply has been received yet, it will return null.
* If no pattern has been matched, it will return false.
* @return bool|null|string
*/
public function getLastTransactionID()
{
$reply = $this->getLastReply();
if (empty($reply)) {
return null;
}
foreach($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) {
if(preg_match($smtp_transaction_id_pattern, $reply, $matches)) {
return $matches[1];
}
}
return false;
}
}

View File

@ -0,0 +1,44 @@
{
"name": "phpmailer/phpmailer",
"type": "library",
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"authors": [
{
"name": "Marcus Bointon",
"email": "phpmailer@synchromedia.co.uk"
},
{
"name": "Jim Jagielski",
"email": "jimjag@gmail.com"
},
{
"name": "Andy Prevost",
"email": "codeworxtech@users.sourceforge.net"
},
{
"name": "Brent R. Matzelle"
}
],
"require": {
"php": ">=5.0.0"
},
"require-dev": {
"phpdocumentor/phpdocumentor": "*",
"phpunit/phpunit": "4.7.*"
},
"suggest": {
"league/oauth2-google": "Needed for Google XOAUTH2 authentication"
},
"autoload": {
"classmap": [
"class.phpmailer.php",
"class.phpmaileroauth.php",
"class.phpmaileroauthgoogle.php",
"class.smtp.php",
"class.pop3.php",
"extras/EasyPeasyICS.php",
"extras/ntlm_sasl_client.php"
]
},
"license": "LGPL-2.1"
}

3576
plugin/PHPMailer/composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,38 @@
<?php
/**
* This example shows how to use DKIM message authentication with PHPMailer.
* There's more to using DKIM than just this code - check out this article:
* @link https://yomotherboard.com/how-to-setup-email-server-dkim-keys/
* See also the DKIM code in the PHPMailer unit tests,
* which shows how to make a key pair from PHP.
*/
require '../PHPMailerAutoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer;
//Set who the message is to be sent from
$mail->setFrom('from@example.com', 'First Last');
//Set an alternative reply-to address
$mail->addReplyTo('replyto@example.com', 'First Last');
//Set who the message is to be sent to
$mail->addAddress('whoto@example.com', 'John Doe');
//Set the subject line
$mail->Subject = 'PHPMailer DKIM test';
//This should be the same as the domain of your From address
$mail->DKIM_domain = 'example.com';
//Path to your private key file
$mail->DKIM_private = 'dkim_private.pem';
//Set this to your own selector
$mail->DKIM_selector = 'phpmailer';
//If your private key has a passphrase, set it here
$mail->DKIM_passphrase = '';
//The identity you're signing as - usually your From address
$mail->DKIM_identity = $mail->From;
//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}

View File

@ -23,24 +23,23 @@ dp.SyntaxHighlighter = {
return match.value;
return null;
};
}
function defaultValue(value, def)
{
return value != null ? value : def;
};
}
function asString(value)
{
return value != null ? value.toString() : null;
};
}
var parts = input.split(':'),
brushName = parts[0],
options = {},
straight = { 'true' : true }
straight = { 'true' : true },
reverse = { 'true' : false },
result = null,
defaults = SyntaxHighlighter.defaults
;
@ -89,7 +88,7 @@ dp.SyntaxHighlighter = {
}
return null;
};
}
function findTagsByName(list, name, tagName)
{

View File

@ -12,7 +12,7 @@ if (array_key_exists('userfile', $_FILES)) {
// Upload handled successfully
// Now create a message
// This should be somewhere in your include_path
require 'PHPMailerAutoload.php';
require '../PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->setFrom('from@example.com', 'First Last');
$mail->addAddress('whoto@example.com', 'John Doe');
@ -21,19 +21,19 @@ if (array_key_exists('userfile', $_FILES)) {
// Attach the uploaded file
$mail->addAttachment($uploadfile, 'My uploaded file');
if (!$mail->send()) {
$msg = "Mailer Error: " . $mail->ErrorInfo;
$msg .= "Mailer Error: " . $mail->ErrorInfo;
} else {
$msg = "Message sent!";
$msg .= "Message sent!";
}
} else {
$msg = 'Failed to move file to ' . $uploadfile;
$msg .= 'Failed to move file to ' . $uploadfile;
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PHPMailer Upload</title>
</head>
<body>

View File

@ -0,0 +1,51 @@
<?php
/**
* PHPMailer multiple files upload and send example
*/
$msg = '';
if (array_key_exists('userfile', $_FILES)) {
// Create a message
// This should be somewhere in your include_path
require '../PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->setFrom('from@example.com', 'First Last');
$mail->addAddress('whoto@example.com', 'John Doe');
$mail->Subject = 'PHPMailer file sender';
$mail->msgHTML('My message body');
//Attach multiple files one by one
for ($ct = 0; $ct < count($_FILES['userfile']['tmp_name']); $ct++) {
$uploadfile = tempnam(sys_get_temp_dir(), sha1($_FILES['userfile']['name'][$ct]));
$filename = $_FILES['userfile']['name'][$ct];
if (move_uploaded_file($_FILES['userfile']['tmp_name'][$ct], $uploadfile)) {
$mail->addAttachment($uploadfile, $filename);
} else {
$msg .= 'Failed to move file to ' . $uploadfile;
}
}
if (!$mail->send()) {
$msg .= "Mailer Error: " . $mail->ErrorInfo;
} else {
$msg .= "Message sent!";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PHPMailer Upload</title>
</head>
<body>
<?php if (empty($msg)) { ?>
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
Select one or more files:
<input name="userfile[]" type="file" multiple="multiple">
<input type="submit" value="Send Files">
</form>
<?php } else {
echo $msg;
} ?>
</body>
</html>

View File

@ -17,24 +17,39 @@ $smtp = new SMTP;
$smtp->do_debug = SMTP::DEBUG_CONNECTION;
try {
//Connect to an SMTP server
if ($smtp->connect('mail.example.com', 25)) {
//Say hello
if ($smtp->hello('localhost')) { //Put your host name in here
//Authenticate
if ($smtp->authenticate('username', 'password')) {
echo "Connected ok!";
} else {
throw new Exception('Authentication failed: ' . $smtp->getLastReply());
}
} else {
throw new Exception('HELO failed: '. $smtp->getLastReply());
}
} else {
//Connect to an SMTP server
if (!$smtp->connect('mail.example.com', 25)) {
throw new Exception('Connect failed');
}
//Say hello
if (!$smtp->hello(gethostname())) {
throw new Exception('EHLO failed: ' . $smtp->getError()['error']);
}
//Get the list of ESMTP services the server offers
$e = $smtp->getServerExtList();
//If server can do TLS encryption, use it
if (is_array($e) && array_key_exists('STARTTLS', $e)) {
$tlsok = $smtp->startTLS();
if (!$tlsok) {
throw new Exception('Failed to start encryption: ' . $smtp->getError()['error']);
}
//Repeat EHLO after STARTTLS
if (!$smtp->hello(gethostname())) {
throw new Exception('EHLO (2) failed: ' . $smtp->getError()['error']);
}
//Get new capabilities list, which will usually now include AUTH if it didn't before
$e = $smtp->getServerExtList();
}
//If server supports authentication, do it (even if no encryption)
if (is_array($e) && array_key_exists('AUTH', $e)) {
if ($smtp->authenticate('username', 'password')) {
echo "Connected ok!";
} else {
throw new Exception('Authentication failed: ' . $smtp->getError()['error']);
}
}
} catch (Exception $e) {
echo 'SMTP error: '. $e->getMessage(), "\n";
echo 'SMTP error: ' . $e->getMessage(), "\n";
}
//Whatever happened, close the connection.
$smtp->quit(true);

View File

@ -461,7 +461,6 @@ function tln_deent(&$attvalue, $regex, $hex = false)
* checks on them.
*
* @param string $attvalue A string to run entity check against.
* @return Void, modifies a reference value.
*/
function tln_defang(&$attvalue)
{
@ -488,7 +487,6 @@ function tln_defang(&$attvalue)
* be funny to make "java[tab]script" be just as good as "javascript".
*
* @param string $attvalue The attribute value before extraneous spaces removed.
* @return Void, modifies a reference value.
*/
function tln_unspace(&$attvalue)
{
@ -511,7 +509,7 @@ function tln_unspace(&$attvalue)
* @param array $add_attr_to_tag See description for tln_sanitize
* @param string $trans_image_path
* @param boolean $block_external_images
* @return Array with modified attributes.
* @return array with modified attributes.
*/
function tln_fixatts(
$tagname,
@ -667,9 +665,7 @@ function tln_fixurl($attname, &$attvalue, $trans_image_path, $block_external_ima
function tln_fixstyle($body, $pos, $trans_image_path, $block_external_images)
{
$me = 'tln_fixstyle';
// workaround for </style> in between comments
$iCurrentPos = $pos;
$content = '';
$sToken = '';
$bSucces = false;
@ -740,8 +736,6 @@ function tln_fixstyle($body, $pos, $trans_image_path, $block_external_images)
*/
$content = preg_replace("|body(\s*\{.*?\})|si", ".bodyclass\\1", $content);
$trans_image_path = $trans_image_path;
/**
* Fix url('blah') declarations.
*/
@ -796,7 +790,6 @@ function tln_fixstyle($body, $pos, $trans_image_path, $block_external_images)
function tln_body2div($attary, $trans_image_path)
{
$me = 'tln_body2div';
$divattary = array('class' => "'bodyclass'");
$text = '#000000';
$has_bgc_stl = $has_txt_stl = false;
@ -901,7 +894,7 @@ function tln_sanitize(
}
$trusted .= tln_tagprint($tagname, $attary, $tagtype);
$trusted .= $free_content;
$trusted .= tln_tagprint($tagname, false, 2);
$trusted .= tln_tagprint($tagname, null, 2);
}
continue;
}

View File

@ -160,12 +160,12 @@ class ntlm_sasl_client_class
{
switch ($this->state) {
case SASL_NTLM_STATE_IDENTIFY_DOMAIN:
$message = $this->TypeMsg1($this->credentials["realm"], $this->credentials["workstation"]);
$message = $this->typeMsg1($this->credentials["realm"], $this->credentials["workstation"]);
$this->state = SASL_NTLM_STATE_RESPOND_CHALLENGE;
break;
case SASL_NTLM_STATE_RESPOND_CHALLENGE:
$ntlm_response = $this->NTLMResponse(substr($response, 24, 8), $this->credentials["password"]);
$message = $this->TypeMsg3(
$message = $this->typeMsg3(
$ntlm_response,
$this->credentials["user"],
$this->credentials["realm"],

View File

@ -13,8 +13,15 @@
* PHP Version 5.4
*/
namespace League\OAuth2\Client\Provider;
require 'vendor/autoload.php';
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Token\AccessToken;
use League\OAuth2\Client\Tool\BearerAuthorizationTrait;
use Psr\Http\Message\ResponseInterface;
session_start();
//If this automatic URL doesn't work, set it yourself manually
@ -25,14 +32,109 @@ $redirectUri = isset($_SERVER['HTTPS']) ? 'https://' : 'http://' . $_SERVER['HTT
$clientId = 'RANDOMCHARS-----duv1n2.apps.googleusercontent.com';
$clientSecret = 'RANDOMCHARS-----lGyjPcRtvP';
class Google extends AbstractProvider
{
use BearerAuthorizationTrait;
const ACCESS_TOKEN_RESOURCE_OWNER_ID = 'id';
/**
* @var string If set, this will be sent to google as the "access_type" parameter.
* @link https://developers.google.com/accounts/docs/OAuth2WebServer#offline
*/
protected $accessType;
/**
* @var string If set, this will be sent to google as the "hd" parameter.
* @link https://developers.google.com/accounts/docs/OAuth2Login#hd-param
*/
protected $hostedDomain;
/**
* @var string If set, this will be sent to google as the "scope" parameter.
* @link https://developers.google.com/gmail/api/auth/scopes
*/
protected $scope;
public function getBaseAuthorizationUrl()
{
return 'https://accounts.google.com/o/oauth2/auth';
}
public function getBaseAccessTokenUrl(array $params)
{
return 'https://accounts.google.com/o/oauth2/token';
}
public function getResourceOwnerDetailsUrl(AccessToken $token)
{
return ' ';
}
protected function getAuthorizationParameters(array $options)
{
if (is_array($this->scope)) {
$separator = $this->getScopeSeparator();
$this->scope = implode($separator, $this->scope);
}
$params = array_merge(
parent::getAuthorizationParameters($options),
array_filter([
'hd' => $this->hostedDomain,
'access_type' => $this->accessType,
'scope' => $this->scope,
// if the user is logged in with more than one account ask which one to use for the login!
'authuser' => '-1'
])
);
return $params;
}
protected function getDefaultScopes()
{
return [
'email',
'openid',
'profile',
];
}
protected function getScopeSeparator()
{
return ' ';
}
protected function checkResponse(ResponseInterface $response, $data)
{
if (!empty($data['error'])) {
$code = 0;
$error = $data['error'];
if (is_array($error)) {
$code = $error['code'];
$error = $error['message'];
}
throw new IdentityProviderException($error, $code, $data);
}
}
protected function createResourceOwner(array $response, AccessToken $token)
{
return new GoogleUser($response);
}
}
//Set Redirect URI in Developer Console as [https/http]://<yourdomain>/<folder>/get_oauth_token.php
$provider = new League\OAuth2\Client\Provider\Google(
$provider = new Google(
array(
'clientId' => $clientId,
'clientSecret' => $clientSecret,
'redirectUri' => $redirectUri,
'scopes' => array('https://mail.google.com/'),
'accessType' => 'offline'
'scope' => array('https://mail.google.com/'),
'accessType' => 'offline'
)
);

View File

@ -0,0 +1,25 @@
<?php
/**
* Czech PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
*/
$PHPMAILER_LANG['authenticate'] = 'Chyba SMTP: Autentizace selhala.';
$PHPMAILER_LANG['connect_host'] = 'Chyba SMTP: Nelze navázat spojení se SMTP serverem.';
$PHPMAILER_LANG['data_not_accepted'] = 'Chyba SMTP: Data nebyla přijata.';
$PHPMAILER_LANG['empty_message'] = 'Prázdné tělo zprávy';
$PHPMAILER_LANG['encoding'] = 'Neznámé kódování: ';
$PHPMAILER_LANG['execute'] = 'Nelze provést: ';
$PHPMAILER_LANG['file_access'] = 'Nelze získat přístup k souboru: ';
$PHPMAILER_LANG['file_open'] = 'Chyba souboru: Nelze otevřít soubor pro čtení: ';
$PHPMAILER_LANG['from_failed'] = 'Následující adresa odesílatele je nesprávná: ';
$PHPMAILER_LANG['instantiate'] = 'Nelze vytvořit instanci emailové funkce.';
$PHPMAILER_LANG['invalid_address'] = 'Neplatná adresa: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer není podporován.';
$PHPMAILER_LANG['provide_address'] = 'Musíte zadat alespoň jednu emailovou adresu příjemce.';
$PHPMAILER_LANG['recipients_failed'] = 'Chyba SMTP: Následující adresy příjemců nejsou správně: ';
$PHPMAILER_LANG['signing'] = 'Chyba přihlašování: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() selhal.';
$PHPMAILER_LANG['smtp_error'] = 'Chyba SMTP serveru: ';
$PHPMAILER_LANG['variable_set'] = 'Nelze nastavit nebo změnit proměnnou: ';
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';

View File

@ -0,0 +1,26 @@
<?php
/**
* Danish PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Mikael Stokkebro <info@stokkebro.dk>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Kunne ikke logge på.';
$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data kunne ikke accepteres.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: ';
$PHPMAILER_LANG['execute'] = 'Kunne ikke køre: ';
$PHPMAILER_LANG['file_access'] = 'Ingen adgang til fil: ';
$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: ';
$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: ';
$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere email funktionen.';
//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.';
$PHPMAILER_LANG['provide_address'] = 'Du skal indtaste mindst en modtagers emailadresse.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';

View File

@ -4,22 +4,22 @@
* @package PHPMailer
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP Fehler: Authentifizierung fehlgeschlagen.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Fehler: Konnte keine Verbindung zum SMTP-Host herstellen.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Fehler: Daten werden nicht akzeptiert.';
$PHPMAILER_LANG['empty_message'] = 'E-Mail Inhalt ist leer.';
$PHPMAILER_LANG['encoding'] = 'Unbekanntes Encoding-Format: ';
$PHPMAILER_LANG['authenticate'] = 'SMTP-Fehler: Authentifizierung fehlgeschlagen.';
$PHPMAILER_LANG['connect_host'] = 'SMTP-Fehler: Konnte keine Verbindung zum SMTP-Host herstellen.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-Fehler: Daten werden nicht akzeptiert.';
$PHPMAILER_LANG['empty_message'] = 'E-Mail-Inhalt ist leer.';
$PHPMAILER_LANG['encoding'] = 'Unbekannte Kodierung: ';
$PHPMAILER_LANG['execute'] = 'Konnte folgenden Befehl nicht ausführen: ';
$PHPMAILER_LANG['file_access'] = 'Zugriff auf folgende Datei fehlgeschlagen: ';
$PHPMAILER_LANG['file_open'] = 'Datei Fehler: konnte folgende Datei nicht öffnen: ';
$PHPMAILER_LANG['file_open'] = 'Dateifehler: Konnte folgende Datei nicht öffnen: ';
$PHPMAILER_LANG['from_failed'] = 'Die folgende Absenderadresse ist nicht korrekt: ';
$PHPMAILER_LANG['instantiate'] = 'Mail Funktion konnte nicht initialisiert werden.';
$PHPMAILER_LANG['invalid_address'] = 'E-Mail wird nicht gesendet, die Adresse ist ungültig: ';
$PHPMAILER_LANG['instantiate'] = 'Mail-Funktion konnte nicht initialisiert werden.';
$PHPMAILER_LANG['invalid_address'] = 'Die Adresse ist ungültig: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.';
$PHPMAILER_LANG['provide_address'] = 'Bitte geben Sie mindestens eine Empfänger E-Mailadresse an.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Fehler: Die folgenden Empfänger sind nicht korrekt: ';
$PHPMAILER_LANG['provide_address'] = 'Bitte geben Sie mindestens eine Empfängeradresse an.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP-Fehler: Die folgenden Empfänger sind nicht korrekt: ';
$PHPMAILER_LANG['signing'] = 'Fehler beim Signieren: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Verbindung zu SMTP Server fehlgeschlagen.';
$PHPMAILER_LANG['smtp_error'] = 'Fehler vom SMTP Server: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Verbindung zum SMTP-Server fehlgeschlagen.';
$PHPMAILER_LANG['smtp_error'] = 'Fehler vom SMTP-Server: ';
$PHPMAILER_LANG['variable_set'] = 'Kann Variable nicht setzen oder zurücksetzen: ';
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
$PHPMAILER_LANG['extension_missing'] = 'Fehlende Erweiterung: ';

View File

@ -23,4 +23,4 @@ $PHPMAILER_LANG['signing'] = 'Error al firmar: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.';
$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: ';
$PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: ';
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: ';

View File

@ -23,4 +23,4 @@ $PHPMAILER_LANG['signing'] = 'ხელმოწერის შე
$PHPMAILER_LANG['smtp_connect_failed'] = 'შეცდომა SMTP სერვერთან დაკავშირებისას';
$PHPMAILER_LANG['smtp_error'] = 'SMTP სერვერის შეცდომა: ';
$PHPMAILER_LANG['variable_set'] = 'შეუძლებელია შემდეგი ცვლადის შექმნა ან შეცვლა: ';
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
$PHPMAILER_LANG['extension_missing'] = 'ბიბლიოთეკა არ არსებობს: ';

View File

@ -0,0 +1,25 @@
<?php
/**
* Norwegian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP Feil: Kunne ikke autentisere.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Feil: Kunne ikke koble til SMTP tjener.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Feil: Data ble ikke akseptert.';
$PHPMAILER_LANG['empty_message'] = 'Meldingsinnholdet er tomt';
$PHPMAILER_LANG['encoding'] = 'Ukjent tegnkoding: ';
$PHPMAILER_LANG['execute'] = 'Kunne ikke utføre: ';
$PHPMAILER_LANG['file_access'] = 'Får ikke tilgang til filen: ';
$PHPMAILER_LANG['file_open'] = 'Fil feil: Kunne ikke åpne filen: ';
$PHPMAILER_LANG['from_failed'] = 'Følgende avsenderadresse feilet: ';
$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere mailfunksjonen.';
$PHPMAILER_LANG['invalid_address'] = 'Meldingen ble ikke sendt, følgende adresse er ugyldig: ';
$PHPMAILER_LANG['provide_address'] = 'Du må angi minst en mottakeradresse.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer er ikke supportert.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feil: Følgende mottagere feilet: ';
$PHPMAILER_LANG['signing'] = 'Signeringsfeil: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() feilet.';
$PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfeil: ';
$PHPMAILER_LANG['variable_set'] = 'Kan ikke sette eller resette variabelen: ';
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';

View File

@ -23,4 +23,4 @@ $PHPMAILER_LANG['signing'] = 'Błąd podpisywania wiadomości: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zakończone niepowodzeniem.';
$PHPMAILER_LANG['smtp_error'] = 'Błąd SMTP: ';
$PHPMAILER_LANG['variable_set'] = 'Nie można ustawić lub zmodyfikować zmiennej: ';
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
$PHPMAILER_LANG['extension_missing'] = 'Brakujące rozszerzenie: ';

View File

@ -0,0 +1,28 @@
<?php
/**
* Brazilian Portuguese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Paulo Henrique Garcia <paulo@controllerweb.com.br>
* @author Lucas Guimarães <lucas@lucasguimaraes.com>
* @author Phelipe Alves <phelipealvesdesouza@gmail.com>
*/
$PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.';
$PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar ao servidor SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados rejeitados.';
$PHPMAILER_LANG['empty_message'] = 'Mensagem vazia';
$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: ';
$PHPMAILER_LANG['execute'] = 'Não foi possível executar: ';
$PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: ';
$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: ';
$PHPMAILER_LANG['from_failed'] = 'Os seguintes remententes falharam: ';
$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.';
$PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.';
$PHPMAILER_LANG['provide_address'] = 'Você deve informar pelo menos um destinatário.';
$PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os seguintes destinatários falharam: ';
$PHPMAILER_LANG['signing'] = 'Erro de Assinatura: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.';
$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: ';
$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: ';
$PHPMAILER_LANG['extension_missing'] = 'Extensão ausente: ';

View File

@ -2,25 +2,25 @@
/**
* Romanian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Catalin Constantin <catalin@dazoot.ro>
* @author Alex Florea <alecz.fia@gmail.com>
*/
$PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Nu a functionat autentificarea.';
$PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Nu m-am putut conecta la adresa SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Continutul mailului nu a fost acceptat.';
$PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Autentificarea a eșuat.';
$PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Conectarea la serverul SMTP a eșuat.';
$PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Datele nu au fost acceptate.';
$PHPMAILER_LANG['empty_message'] = 'Mesajul este gol.';
$PHPMAILER_LANG['encoding'] = 'Encodare necunoscuta: ';
$PHPMAILER_LANG['execute'] = 'Nu pot executa: ';
$PHPMAILER_LANG['file_access'] = 'Nu pot accesa fisierul: ';
$PHPMAILER_LANG['file_open'] = 'Eroare de fisier: Nu pot deschide fisierul: ';
$PHPMAILER_LANG['from_failed'] = 'Urmatoarele adrese From au dat eroare: ';
$PHPMAILER_LANG['instantiate'] = 'Nu am putut instantia functia mail.';
$PHPMAILER_LANG['invalid_address'] = 'Adresa de email nu este valida: ';
$PHPMAILER_LANG['encoding'] = 'Encodare necunoscută: ';
$PHPMAILER_LANG['execute'] = 'Nu se poate executa următoarea comandă: ';
$PHPMAILER_LANG['file_access'] = 'Nu se poate accesa următorul fișier: ';
$PHPMAILER_LANG['file_open'] = 'Eroare fișier: Nu se poate deschide următorul fișier: ';
$PHPMAILER_LANG['from_failed'] = 'Următoarele adrese From au dat eroare: ';
$PHPMAILER_LANG['instantiate'] = 'Funcția mail nu a putut fi inițializată.';
$PHPMAILER_LANG['invalid_address'] = 'Adresa de email nu este validă: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.';
$PHPMAILER_LANG['provide_address'] = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).';
$PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: ';
$PHPMAILER_LANG['signing'] = 'A aparut o problema la semnarea emailului. ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Conectarea la serverul SMTP a esuat.';
$PHPMAILER_LANG['smtp_error'] = 'A aparut o eroare la serverul SMTP. ';
$PHPMAILER_LANG['provide_address'] = 'Trebuie să adăugați cel puțin o adresă de email.';
$PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Următoarele adrese de email au eșuat: ';
$PHPMAILER_LANG['signing'] = 'A aparut o problemă la semnarea emailului. ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Conectarea la serverul SMTP a eșuat.';
$PHPMAILER_LANG['smtp_error'] = 'Eroare server SMTP: ';
$PHPMAILER_LANG['variable_set'] = 'Nu se poate seta/reseta variabila. ';
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
$PHPMAILER_LANG['extension_missing'] = 'Lipsește extensia: ';

View File

@ -18,9 +18,9 @@ $PHPMAILER_LANG['instantiate'] = 'Невозможно запустит
$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один адрес e-mail получателя.';
$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.';
$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: отправка по следующим адресам получателей не удалась: ';
$PHPMAILER_LANG['empty_message'] = 'Пустое тело сообщения';
$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение';
$PHPMAILER_LANG['invalid_address'] = 'Не отослано, неправильный формат email адреса: ';
$PHPMAILER_LANG['signing'] = 'Ошибка подписывания: ';
$PHPMAILER_LANG['signing'] = 'Ошибка подписи: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером';
$PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: ';
$PHPMAILER_LANG['variable_set'] = 'Невозможно установить или переустановить переменную: ';

View File

@ -0,0 +1,26 @@
<?php
/**
* Swedish PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
* @author Johan Linnér <johan@linner.biz>
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.';
$PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMTP-server.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: ';
$PHPMAILER_LANG['execute'] = 'Kunde inte köra: ';
$PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: ';
$PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: ';
$PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: ';
$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.';
$PHPMAILER_LANG['invalid_address'] = 'Felaktig adress: ';
$PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: ';
$PHPMAILER_LANG['signing'] = 'Signerings fel: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() misslyckades.';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server fel: ';
$PHPMAILER_LANG['variable_set'] = 'Kunde inte definiera eller återställa variabel: ';
$PHPMAILER_LANG['extension_missing'] = 'Tillägg ej tillgängligt: ';

View File

@ -3,9 +3,15 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
function editor_html($id, $content, $is_dhtml_editor=true)
{
global $g5, $config;
global $g5, $config, $w, $board;
static $js = true;
if( $is_dhtml_editor && $content && !$w && (isset($board['bo_insert_content']) && !empty($board['bo_insert_content']) ) ){ //글쓰기 기본 내용 처리
if( preg_match('/\r|\n/', $content) && $content === strip_tags($content, '<a><strong><b>') ) { //textarea로 작성되고, html 내용이 없다면
$content = nl2br($content);
}
}
$editor_url = G5_EDITOR_URL.'/'.$config['cf_editor'];
$html = "";
@ -66,36 +72,17 @@ function chk_editor_js($id, $is_dhtml_editor=true)
}
/*
* Name: FT-NONCE-LIB
* Created By: Full Throttle Development, LLC (http://fullthrottledevelopment.com)
* Created On: July 2009
* Last Modified On: August 12, 2009
* Last Modified By: Glenn Ansley (glenn@fullthrottledevelopment.com)
* Version: 0.2
*/
/*
Copyright 2009 Full Throttle Development, LLC
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
https://github.com/timostamm/NonceUtil-PHP
*/
if (!defined('FT_NONCE_UNIQUE_KEY'))
define( 'FT_NONCE_UNIQUE_KEY' , sha1(G5_MYSQL_USER) );
define( 'FT_NONCE_UNIQUE_KEY' , sha1($_SERVER['SERVER_SOFTWARE'].G5_MYSQL_USER.session_id().G5_TABLE_PREFIX) );
if (!defined('FT_NONCE_SESSION_KEY'))
define( 'FT_NONCE_SESSION_KEY' , substr(md5(FT_NONCE_UNIQUE_KEY), 5) );
if (!defined('FT_NONCE_DURATION'))
define( 'FT_NONCE_DURATION' , 2160000 ); // 300 makes link or form good for 5 minutes from time of generation, 300은 5분간 유효, 2160000은 10시간동안 유효
define( 'FT_NONCE_DURATION' , 60 * 60 ); // 300 makes link or form good for 5 minutes from time of generation, 300은 5분간 유효, 60 * 60 은 1시간
if (!defined('FT_NONCE_KEY'))
define( 'FT_NONCE_KEY' , '_nonce' );
@ -107,29 +94,73 @@ if(!function_exists('ft_nonce_create_query_string')){
}
}
if(!function_exists('ft_get_secret_key')){
function ft_get_secret_key($secret){
return md5(FT_NONCE_UNIQUE_KEY.$secret);
}
}
// This method creates an nonce. It should be called by one of the previous two functions.
if(!function_exists('ft_nonce_create')){
function ft_nonce_create( $action = '' , $user='' ){
return substr( ft_nonce_generate_hash( $action . $user ), -12, 10);
function ft_nonce_create( $action = '',$user='', $timeoutSeconds=FT_NONCE_DURATION ){
$secret = ft_get_secret_key($action.$user);
set_session('token_'.FT_NONCE_SESSION_KEY, $secret);
$salt = ft_nonce_generate_hash();
$time = time();
$maxTime = $time + $timeoutSeconds;
$nonce = $salt . "|" . $maxTime . "|" . sha1( $salt . $secret . $maxTime );
return $nonce;
}
}
// This method validates an nonce
if(!function_exists('ft_nonce_is_valid')){
function ft_nonce_is_valid( $nonce , $action = '' , $user='' ){
// Nonce generated 0-12 hours ago
if ( substr(ft_nonce_generate_hash( $action . $user ), -12, 10) == $nonce ){
return true;
function ft_nonce_is_valid( $nonce, $action = '', $user='' ){
$secret = ft_get_secret_key($action.$user);
$token = get_session('token_'.FT_NONCE_SESSION_KEY);
if ($secret != $token){
return false;
}
return false;
if (is_string($nonce) == false) {
return false;
}
$a = explode('|', $nonce);
if (count($a) != 3) {
return false;
}
$salt = $a[0];
$maxTime = intval($a[1]);
$hash = $a[2];
$back = sha1( $salt . $secret . $maxTime );
if ($back != $hash) {
return false;
}
if (time() > $maxTime) {
return false;
}
return true;
}
}
// This method generates the nonce timestamp
if(!function_exists('ft_nonce_generate_hash')){
function ft_nonce_generate_hash( $action='' , $user='' ){
$i = ceil( time() / ( FT_NONCE_DURATION / 2 ) );
return md5( $i . $action . $user . $action );
function ft_nonce_generate_hash(){
$length = 10;
$chars='1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM';
$ll = strlen($chars)-1;
$o = '';
while (strlen($o) < $length) {
$o .= $chars[ rand(0, $ll) ];
}
return $o;
}
}
?>

View File

@ -8,39 +8,54 @@
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
* https://github.com/blueimp/jQuery-File-Upload/wiki/Security
* https://github.com/blueimp/jQuery-File-Upload/pull/148
*/
class UploadHandler
{
public $files = array();
protected $options;
// PHP File Upload error message codes:
// http://php.net/manual/en/features.file-upload.errors.php
protected $error_messages = array(
1 => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',
2 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
3 => 'The uploaded file was only partially uploaded',
4 => 'No file was uploaded',
6 => 'Missing a temporary folder',
7 => 'Failed to write file to disk',
8 => 'A PHP extension stopped the file upload',
'post_max_size' => 'The uploaded file exceeds the post_max_size directive in php.ini',
'max_file_size' => 'File is too big',
'min_file_size' => 'File is too small',
'accept_file_types' => 'Filetype not allowed',
'max_number_of_files' => 'Maximum number of files exceeded',
'max_width' => 'Image exceeds maximum width',
'min_width' => 'Image requires a minimum width',
'max_height' => 'Image exceeds maximum height',
'min_height' => 'Image requires a minimum height',
'abort' => 'File upload aborted',
'image_resize' => 'Failed to resize image'
);
protected $post_max_size;
protected $error_messages;
protected $image_objects = array();
function __construct($options = null, $initialize = true, $error_messages = null) {
private static $MIME_TYPES_PROCESSORS = array(
"image/gif" => array("imagecreatefromgif", "imagegif"),
"image/jpg" => array("imagecreatefromjpeg", "imagejpeg"),
"image/jpeg" => array("imagecreatefromjpeg", "imagejpeg"),
"image/png" => array("imagecreatefrompng", "imagepng"),
"image/bmp" => array("imagecreatefromwbmp", "imagewbmp")
);
public function __construct($options = null, $initialize = true, $error_messages = null) {
$this->post_max_size = (defined('SMARTEDITOR_UPLOAD_SIZE_LIMIT') && SMARTEDITOR_UPLOAD_SIZE_LIMIT) ? SMARTEDITOR_UPLOAD_SIZE_LIMIT.'M' : ini_get('post_max_size');
// PHP File Upload error message codes:
// http://php.net/manual/en/features.file-upload.errors.php
$this->error_messages = array(
1 => 'The uploaded file exceeds the upload_max_filesize',
2 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
3 => 'The uploaded file was only partially uploaded',
4 => 'No file was uploaded',
6 => 'Missing a temporary folder',
7 => 'Failed to write file to disk',
8 => 'A PHP extension stopped the file upload',
'post_max_size' => 'The uploaded file exceeds the post_max_size',
'max_file_size' => 'File is too big',
'min_file_size' => 'File is too small',
'accept_file_types' => 'Filetype not allowed',
'max_number_of_files' => 'Maximum number of files exceeded',
'max_width' => 'Image exceeds maximum width',
'min_width' => 'Image requires a minimum width',
'max_height' => 'Image exceeds maximum height',
'min_height' => 'Image requires a minimum height',
'abort' => 'File upload aborted',
'image_resize' => 'Failed to resize image'
);
$this->options = array(
'script_url' => $this->get_full_url().'/',
'upload_dir' => dirname($this->get_server_var('SCRIPT_FILENAME')).'/files/',
@ -90,6 +105,10 @@ class UploadHandler
'max_number_of_files' => null,
// Defines which files are handled as image files:
'image_file_types' => '/\.(gif|jpe?g|bmp|png)$/i',
'is_resize' => (defined('SMARTEDITOR_UPLOAD_RESIZE') && SMARTEDITOR_UPLOAD_RESIZE) ? true : false,
'resize_max_width' => (defined('SMARTEDITOR_UPLOAD_MAX_WIDTH') && SMARTEDITOR_UPLOAD_MAX_WIDTH) ? SMARTEDITOR_UPLOAD_MAX_WIDTH : 800,
'resize_max_height' => (defined('SMARTEDITOR_UPLOAD_MAX_HEIGHT') && SMARTEDITOR_UPLOAD_MAX_HEIGHT) ? SMARTEDITOR_UPLOAD_MAX_HEIGHT : 800,
'resize_jpeg_compress' => (defined('SMARTEDITOR_UPLOAD_IMAGE_QUALITY') && SMARTEDITOR_UPLOAD_IMAGE_QUALITY) ? SMARTEDITOR_UPLOAD_IMAGE_QUALITY : 800,
// Image resolution restrictions:
'max_width' => null,
'max_height' => null,
@ -362,7 +381,8 @@ class UploadHandler
$content_length = $this->fix_integer_overflow(intval(
$this->get_server_var('CONTENT_LENGTH')
));
$post_max_size = $this->get_config_bytes(ini_get('post_max_size'));
$post_max_size = $this->get_config_bytes($this->post_max_size);
if ($post_max_size && ($content_length > $post_max_size)) {
$file->error = $this->get_error_message('post_max_size');
return false;
@ -1038,6 +1058,48 @@ class UploadHandler
return $tmp_name;
}
protected function reprocessImage($file_path, $callback)
{
// Extracting mime type using getimagesize
try {
$image_info = getimagesize($file_path);
if ($image_info === null) {
//throw new Exception("Invalid image type");
return false;
}
$mime_type = $image_info["mime"];
if (!array_key_exists($mime_type, self::$MIME_TYPES_PROCESSORS)) {
//throw new Exception("Invalid image MIME type");
return false;
}
$image_from_file = self::$MIME_TYPES_PROCESSORS[$mime_type][0];
$image_to_file = self::$MIME_TYPES_PROCESSORS[$mime_type][1];
$reprocessed_image = @$image_from_file($file_path);
if (!$reprocessed_image) {
//throw new Exception("Unable to create reprocessed image from file");
return false;
}
// Calling callback(if set) with path of image as a parameter
if ($callback !== null) {
$callback($reprocessed_image);
}
// Freeing up memory
imagedestroy($reprocessed_image);
} catch (Exception $e) {
unlink($file_path);
return false;
}
return true;
}
protected function handle_file_upload($uploaded_file, $name, $size, $type, $error,
$index = null, $content_range = null) {
$file = new \stdClass();
@ -1050,6 +1112,12 @@ class UploadHandler
//$file->name = iconv('UTF-8', 'UTF-8//IGNORE', utf8_encode($file->name));
$file->size = $this->fix_integer_overflow(intval($size));
$file->type = $type;
if ( SMARTEDITOR_UPLOAD_IMG_CHECK && ! $this->reprocessImage($uploaded_file, null) ){
$file->error = $this->get_error_message('accept_file_types');
return $file;
}
if ($this->validate($uploaded_file, $file, $error, $index)) {
$this->handle_form_data($file, $index);
$upload_dir = $this->get_upload_path();
@ -1079,10 +1147,32 @@ class UploadHandler
);
}
$file_size = $this->get_file_size($file_path, $append_file);
try {
if(defined('G5_FILE_PERMISSION')) chmod($file_path, G5_FILE_PERMISSION);
} catch (Exception $e) {
}
if ($file_size === $file->size) {
$file->url = $this->get_download_url($file->name);
if ($this->is_valid_image_file($file_path)) {
$this->handle_image_file($file_path, $file);
$this->files[] = $file->name;
if( $this->options['is_resize'] ){
$resize_options = array(
'max_width'=>$this->options['resize_max_width'],
'max_height'=>$this->options['resize_max_height'],
'jpeg_quality'=>$this->options['resize_jpeg_compress'],
'auto_orient' => true,
);
if ($this->create_scaled_image($file->name, '', $resize_options)) {
$file->size = $this->get_file_size($file_path, true);
}
}
$image_width_height = $this->get_image_size($file_path);
$file->width = $image_width_height[0];
$file->height = $image_width_height[1];
@ -1099,6 +1189,7 @@ class UploadHandler
}
$this->set_additional_file_properties($file);
}
return $file;
}
@ -1365,4 +1456,4 @@ class UploadHandler
return $this->generate_response($response, $print_response);
}
}
}

View File

@ -41,7 +41,17 @@ $up_hash = $ct_cert->make_hash_data( $home_dir, $hash_data );
$ct_cert->mf_clear();
?>
<form name="form_auth" method="post" target="auth_popup" action="<?php echo $cert_url ?>">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<?php if(is_mobile()) { ?>
<meta name="viewport" content="user-scalable=yes, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width, target-densitydpi=medium-dpi" >
<?php } ?>
</head>
<body oncontextmenu="return false;" ondragstart="return false;" onselectstart="return false;">
<form name="form_auth" method="post" action="<?php echo $cert_url ?>">
<!-- 유저네임 -->
<input type="hidden" name="user_name" value="" />
<!-- 주문번호 -->
@ -67,6 +77,11 @@ $ct_cert->mf_clear();
<!-- cert_enc_use 필수 (고정값 : 메뉴얼 참고) -->
<input type="hidden" name="cert_enc_use" value="Y"/>
<?php if(is_mobile()) { ?>
<!-- cert_able_yn input 비활성화 설정 -->
<input type="hidden" name="cert_able_yn" value=""/>
<?php } ?>
<input type="hidden" name="res_cd" value=""/>
<input type="hidden" name="res_msg" value=""/>
@ -82,5 +97,53 @@ $ct_cert->mf_clear();
</form>
<script>
document.form_auth.submit();
</script>
window.onload = function() {
cert_page();
}
// 인증 요청 시 호출 함수
function cert_page()
{
var frm = document.form_auth;
if ( ( frm.req_tx.value == "auth" || frm.req_tx.value == "otp_auth" ) )
{
frm.action="./kcpcert_result.php";
// MOBILE
if( ( navigator.userAgent.indexOf("Android") > - 1 || navigator.userAgent.indexOf("iPhone") > - 1 ) )
{
self.name="kcp_cert";
}
// PC
else
{
frm.target="kcp_cert";
}
frm.submit();
window.close();
}
else if ( frm.req_tx.value == "cert" )
{
if( ( navigator.userAgent.indexOf("Android") > - 1 || navigator.userAgent.indexOf("iPhone") > - 1 ) ) // 스마트폰인 경우
{
window.parent.$("input[name=veri_up_hash]").val(frm.up_hash.value); // up_hash 데이터 검증을 위한 필드
self.name="auth_popup";
}
else // 스마트폰 아닐때
{
window.opener.$("input[name=veri_up_hash]").val(frm.up_hash.value); // up_hash 데이터 검증을 위한 필드
frm.target = "auth_popup";
}
frm.action="<?php echo $cert_url; ?>";
frm.submit();
}
}
</script>
</body>
</html>

View File

@ -180,9 +180,26 @@ else if( $cert_enc_use != "Y" )
$ct_cert->mf_clear();
?>
<form name="form_auth" method="post">
<?php echo $sbParam; ?>
</form>
<script>
$(function() {
var $opener = window.opener;
var $opener;
var is_mobile = false;
if( ( navigator.userAgent.indexOf("Android") > - 1 || navigator.userAgent.indexOf("iPhone") > - 1 ) ) { // 스마트폰인 경우
$opener = window.parent;
is_mobile = true;
} else {
$opener = window.opener;
}
// up_hash 검증
if( document.form_auth.up_hash.value != $opener.$("input[name=veri_up_hash]").val() ) {
alert("up_hash 변조 위험있음");
}
// 인증정보
$opener.$("input[name=cert_type]").val("<?php echo $cert_type; ?>");
@ -190,7 +207,13 @@ $(function() {
$opener.$("input[name=mb_hp]").val("<?php echo $phone_no; ?>").attr("readonly", true);
$opener.$("input[name=cert_no]").val("<?php echo $md5_cert_no; ?>");
if(is_mobile) {
$opener.$("#cert_info").css("display", "");
$opener.$("#kcp_cert" ).css("display", "none");
}
alert("본인의 휴대폰번호로 확인 되었습니다.");
window.close();
});
</script>

View File

@ -10,7 +10,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<script src="<?php echo G5_JS_URL ?>/jquery.register_form.js"></script>
<?php if($config['cf_cert_use'] && ($config['cf_cert_ipin'] || $config['cf_cert_hp'])) { ?>
<script src="<?php echo G5_JS_URL ?>/certify.js"></script>
<script src="<?php echo G5_JS_URL ?>/certify.js?v=<?php echo G5_JS_VER; ?>"></script>
<?php } ?>
<form id="fregisterform" name="fregisterform" action="<?php echo $register_action_url ?>" onsubmit="return fregisterform_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off">

View File

@ -8,7 +8,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<div class="mbskin">
<script src="<?php echo G5_JS_URL ?>/jquery.register_form.js"></script>
<?php if($config['cf_cert_use'] && ($config['cf_cert_ipin'] || $config['cf_cert_hp'])) { ?>
<script src="<?php echo G5_JS_URL ?>/certify.js"></script>
<script src="<?php echo G5_JS_URL ?>/certify.js?v=<?php echo G5_JS_VER; ?>"></script>
<?php } ?>
<form name="fregisterform" id="fregisterform" action="<?php echo $register_action_url ?>" onsubmit="return fregisterform_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off">
@ -122,7 +122,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
</tr>
<?php } ?>
<?php if ($config['cf_use_hp']) { ?>
<?php if ($config['cf_use_hp'] || $config['cf_cert_hp']) { ?>
<tr>
<th scope="row"><label for="reg_mb_hp">휴대폰번호<?php if ($config['cf_req_hp']) { ?><strong class="sound_only">필수</strong><?php } ?></label></th>
<td>

View File

@ -10,7 +10,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<script src="<?php echo G5_JS_URL ?>/jquery.register_form.js"></script>
<?php if($config['cf_cert_use'] && ($config['cf_cert_ipin'] || $config['cf_cert_hp'])) { ?>
<script src="<?php echo G5_JS_URL ?>/certify.js"></script>
<script src="<?php echo G5_JS_URL ?>/certify.js?v=<?php echo G5_JS_VER; ?>"></script>
<?php } ?>
<form id="fregisterform" name="fregisterform" action="<?php echo $register_action_url ?>" onsubmit="return fregisterform_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off">