mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-26 22:02:13 +09:00
Merge #1344 이메일 호스트 제한/허용 기능에 대한 PR by misol
* pr/1344: fix for var $arg init. #1343 Email hosts of members can be allowed or not. Conflicts: modules/member/member.controller.php
This commit is contained in:
commit
ec11ccc4f5
12 changed files with 384 additions and 18 deletions
|
|
@ -207,6 +207,7 @@ class memberAdminController extends member
|
|||
$args = Context::gets(
|
||||
'limit_day',
|
||||
'limit_day_description',
|
||||
'emailhost_check',
|
||||
'agreement',
|
||||
'redirect_url',
|
||||
'profile_image', 'profile_image_max_width', 'profile_image_max_height',
|
||||
|
|
@ -220,6 +221,7 @@ class memberAdminController extends member
|
|||
$all_args = Context::getRequestVars();
|
||||
|
||||
$args->limit_day = (int)$args->limit_day;
|
||||
if($args->emailhost_check != 'allowed' && $args->emailhost_check != 'prohibited') $args->emailhost_check == 'allowed';
|
||||
if(!trim(strip_tags($args->agreement)))
|
||||
{
|
||||
$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
|
||||
|
|
@ -1026,6 +1028,44 @@ class memberAdminController extends member
|
|||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add allowed or denied email hostnames
|
||||
* @return void
|
||||
*/
|
||||
function procMemberAdminUpdateManagedEmailHosts()
|
||||
{
|
||||
$email_hosts = Context::get('email_hosts');
|
||||
|
||||
$mode = Context::get('mode');
|
||||
$mode = $mode ? $mode : 'insert';
|
||||
|
||||
if($mode == 'delete')
|
||||
{
|
||||
$output = $this->deleteManagedEmailHost($email_hosts);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
$msg_code = 'success_deleted';
|
||||
$this->setMessage($msg_code);
|
||||
}
|
||||
else
|
||||
{
|
||||
$email_hosts = preg_replace('/([^a-z0-9\.\-\_\n]*)/i','',$email_hosts);
|
||||
$email_hosts = array_unique(explode("\n",$email_hosts."\n"));
|
||||
$success_email_hosts = array();
|
||||
foreach($email_hosts as $val)
|
||||
{
|
||||
$val = trim($val);
|
||||
if(!$val) continue;
|
||||
$output = $this->insertManagedEmailHost($val, '');
|
||||
if($output->toBool()) $success_email_hosts[] = $val;
|
||||
}
|
||||
|
||||
$this->add('email_hosts', implode("\n",$success_email_hosts));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a denied nick name
|
||||
* @return void
|
||||
|
|
@ -1331,6 +1371,21 @@ class memberAdminController extends member
|
|||
return executeQuery('member.insertDeniedNickName', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register managed Email Hostname
|
||||
* @param string $email_host
|
||||
* @param string $description
|
||||
* @return Object
|
||||
*/
|
||||
function insertManagedEmailHost($email_host, $description = '')
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->email_host = trim(strtolower($email_host));
|
||||
$args->description = $description;
|
||||
|
||||
return executeQuery('member.insertManagedEmailHost', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* delete a denied id
|
||||
* @param string $user_id
|
||||
|
|
@ -1359,6 +1414,18 @@ class memberAdminController extends member
|
|||
return executeQuery('member.deleteDeniedNickName', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* delete a denied nick name
|
||||
* @param string $email_host
|
||||
* @return object
|
||||
*/
|
||||
function deleteManagedEmailHost($email_host)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->email_host = $email_host;
|
||||
return executeQuery('member.deleteManagedEmailHost', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a join form
|
||||
* @param int $member_join_form_srl
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue