• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP loadEmailTemplate函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中loadEmailTemplate函数的典型用法代码示例。如果您正苦于以下问题:PHP loadEmailTemplate函数的具体用法?PHP loadEmailTemplate怎么用?PHP loadEmailTemplate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了loadEmailTemplate函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: action_activate

    /**
     * Verify the activation code, and activate the user if correct.
     * Accessed by ?action=activate
     */
    public function action_activate()
    {
        global $context, $txt, $modSettings, $scripturl, $language, $user_info;
        require_once SUBSDIR . '/Auth.subs.php';
        // Logged in users should not bother to activate their accounts
        if (!empty($user_info['id'])) {
            redirectexit();
        }
        loadLanguage('Login');
        loadTemplate('Login');
        loadJavascriptFile('sha256.js', array('defer' => true));
        if (empty($_REQUEST['u']) && empty($_POST['user'])) {
            if (empty($modSettings['registration_method']) || $modSettings['registration_method'] == '3') {
                fatal_lang_error('no_access', false);
            }
            $context['member_id'] = 0;
            $context['sub_template'] = 'resend';
            $context['page_title'] = $txt['invalid_activation_resend'];
            $context['can_activate'] = empty($modSettings['registration_method']) || $modSettings['registration_method'] == '1';
            $context['default_username'] = isset($_GET['user']) ? $_GET['user'] : '';
            return;
        }
        // Get the code from the database...
        $row = findUser(empty($_REQUEST['u']) ? '
			member_name = {string:email_address} OR email_address = {string:email_address}' : '
			id_member = {int:id_member}', array('id_member' => isset($_REQUEST['u']) ? (int) $_REQUEST['u'] : 0, 'email_address' => isset($_POST['user']) ? $_POST['user'] : ''), false);
        // Does this user exist at all?
        if (empty($row)) {
            $context['sub_template'] = 'retry_activate';
            $context['page_title'] = $txt['invalid_userid'];
            $context['member_id'] = 0;
            return;
        }
        // Change their email address? (they probably tried a fake one first :P.)
        require_once SUBSDIR . '/Auth.subs.php';
        if (isset($_POST['new_email'], $_REQUEST['passwd']) && validateLoginPassword($_REQUEST['passwd'], $row['passwd'], $row['member_name'], true) && ($row['is_activated'] == 0 || $row['is_activated'] == 2)) {
            if (empty($modSettings['registration_method']) || $modSettings['registration_method'] == 3) {
                fatal_lang_error('no_access', false);
            }
            // @todo Separate the sprintf?
            require_once SUBSDIR . '/DataValidator.class.php';
            if (!Data_Validator::is_valid($_POST, array('new_email' => 'valid_email|required|max_length[255]'), array('new_email' => 'trim'))) {
                fatal_error(sprintf($txt['valid_email_needed'], htmlspecialchars($_POST['new_email'], ENT_COMPAT, 'UTF-8')), false);
            }
            // Make sure their email isn't banned.
            isBannedEmail($_POST['new_email'], 'cannot_register', $txt['ban_register_prohibited']);
            // Ummm... don't even dare try to take someone else's email!!
            // @todo Separate the sprintf?
            if (userByEmail($_POST['new_email'])) {
                fatal_lang_error('email_in_use', false, array(htmlspecialchars($_POST['new_email'], ENT_COMPAT, 'UTF-8')));
            }
            updateMemberData($row['id_member'], array('email_address' => $_POST['new_email']));
            $row['email_address'] = $_POST['new_email'];
            $email_change = true;
        }
        // Resend the password, but only if the account wasn't activated yet.
        if (!empty($_REQUEST['sa']) && $_REQUEST['sa'] == 'resend' && ($row['is_activated'] == 0 || $row['is_activated'] == 2) && (!isset($_REQUEST['code']) || $_REQUEST['code'] == '')) {
            require_once SUBSDIR . '/Mail.subs.php';
            $replacements = array('REALNAME' => $row['real_name'], 'USERNAME' => $row['member_name'], 'ACTIVATIONLINK' => $scripturl . '?action=activate;u=' . $row['id_member'] . ';code=' . $row['validation_code'], 'ACTIVATIONLINKWITHOUTCODE' => $scripturl . '?action=activate;u=' . $row['id_member'], 'ACTIVATIONCODE' => $row['validation_code'], 'FORGOTPASSWORDLINK' => $scripturl . '?action=reminder');
            $emaildata = loadEmailTemplate('resend_activate_message', $replacements, empty($row['lngfile']) || empty($modSettings['userLanguage']) ? $language : $row['lngfile']);
            sendmail($row['email_address'], $emaildata['subject'], $emaildata['body'], null, null, false, 0);
            $context['page_title'] = $txt['invalid_activation_resend'];
            // This will ensure we don't actually get an error message if it works!
            $context['error_title'] = '';
            fatal_lang_error(!empty($email_change) ? 'change_email_success' : 'resend_email_success', false);
        }
        // Quit if this code is not right.
        if (empty($_REQUEST['code']) || $row['validation_code'] != $_REQUEST['code']) {
            if (!empty($row['is_activated'])) {
                fatal_lang_error('already_activated', false);
            } elseif ($row['validation_code'] == '') {
                loadLanguage('Profile');
                fatal_error($txt['registration_not_approved'] . ' <a href="' . $scripturl . '?action=activate;user=' . $row['member_name'] . '">' . $txt['here'] . '</a>.', false);
            }
            $context['sub_template'] = 'retry_activate';
            $context['page_title'] = $txt['invalid_activation_code'];
            $context['member_id'] = $row['id_member'];
            return;
        }
        // Let the integration know that they've been activated!
        call_integration_hook('integrate_activate', array($row['member_name']));
        // Validation complete - update the database!
        updateMemberData($row['id_member'], array('is_activated' => 1, 'validation_code' => ''));
        // Also do a proper member stat re-evaluation.
        updateStats('member', false);
        if (!isset($_POST['new_email'])) {
            require_once SUBSDIR . '/Notification.subs.php';
            sendAdminNotifications('activation', $row['id_member'], $row['member_name']);
        }
        $context += array('page_title' => $txt['registration_successful'], 'sub_template' => 'login', 'default_username' => $row['member_name'], 'default_password' => '', 'never_expire' => false, 'description' => $txt['activate_success']);
    }
开发者ID:Ralkage,项目名称:Elkarte,代码行数:95,代码来源:Register.controller.php


示例2: notifyMembersBoard

function notifyMembersBoard(&$topicData)
{
    global $txt, $scripturl, $language, $user_info;
    global $modSettings, $sourcedir, $board, $smcFunc, $context;
    require_once $sourcedir . '/Subs-Post.php';
    // Do we have one or lots of topics?
    if (isset($topicData['body'])) {
        $topicData = array($topicData);
    }
    // Find out what boards we have... and clear out any rubbish!
    $boards = array();
    foreach ($topicData as $key => $topic) {
        if (!empty($topic['board'])) {
            $boards[$topic['board']][] = $key;
        } else {
            unset($topic[$key]);
            continue;
        }
        // Censor the subject and body...
        censorText($topicData[$key]['subject']);
        censorText($topicData[$key]['body']);
        $topicData[$key]['subject'] = un_htmlspecialchars($topicData[$key]['subject']);
        $topicData[$key]['body'] = trim(un_htmlspecialchars(strip_tags(strtr(parse_bbc($topicData[$key]['body'], false), array('<br />' => "\n", '</div>' => "\n", '</li>' => "\n", '&#91;' => '[', '&#93;' => ']')))));
    }
    // Just the board numbers.
    $board_index = array_unique(array_keys($boards));
    if (empty($board_index)) {
        return;
    }
    // Yea, we need to add this to the digest queue.
    $digest_insert = array();
    foreach ($topicData as $id => $data) {
        $digest_insert[] = array($data['topic'], $data['msg'], 'topic', $user_info['id']);
    }
    $smcFunc['db_insert']('', '{db_prefix}log_digest', array('id_topic' => 'int', 'id_msg' => 'int', 'note_type' => 'string', 'exclude' => 'int'), $digest_insert, array());
    // Find the members with notification on for these boards.
    $members = $smcFunc['db_query']('', '
		SELECT
			mem.id_member, mem.email_address, mem.notify_regularity, mem.notify_send_body, mem.lngfile,
			ln.sent, ln.id_board, mem.id_group, mem.additional_groups, b.member_groups,
			mem.id_post_group
		FROM {db_prefix}log_notify AS ln
			INNER JOIN {db_prefix}boards AS b ON (b.id_board = ln.id_board)
			INNER JOIN {db_prefix}members AS mem ON (mem.id_member = ln.id_member)
		WHERE ln.id_board IN ({array_int:board_list})
			AND mem.id_member != {int:current_member}
			AND mem.is_activated = {int:is_activated}
			AND mem.notify_types != {int:notify_types}
			AND mem.notify_regularity < {int:notify_regularity}
		ORDER BY mem.lngfile', array('current_member' => $user_info['id'], 'board_list' => $board_index, 'is_activated' => 1, 'notify_types' => 4, 'notify_regularity' => 2));
    while ($rowmember = $smcFunc['db_fetch_assoc']($members)) {
        if ($rowmember['id_group'] != 1) {
            $allowed = explode(',', $rowmember['member_groups']);
            $rowmember['additional_groups'] = explode(',', $rowmember['additional_groups']);
            $rowmember['additional_groups'][] = $rowmember['id_group'];
            $rowmember['additional_groups'][] = $rowmember['id_post_group'];
            if (count(array_intersect($allowed, $rowmember['additional_groups'])) == 0) {
                continue;
            }
        }
        $langloaded = loadLanguage('EmailTemplates', empty($rowmember['lngfile']) || empty($modSettings['userLanguage']) ? $language : $rowmember['lngfile'], false);
        // Now loop through all the notifications to send for this board.
        if (empty($boards[$rowmember['id_board']])) {
            continue;
        }
        $sentOnceAlready = 0;
        foreach ($boards[$rowmember['id_board']] as $key) {
            // Don't notify the guy who started the topic!
            //!!! In this case actually send them a "it's approved hooray" email
            if ($topicData[$key]['poster'] == $rowmember['id_member']) {
                continue;
            }
            // Setup the string for adding the body to the message, if a user wants it.
            $send_body = empty($modSettings['disallow_sendBody']) && !empty($rowmember['notify_send_body']);
            $replacements = array('TOPICSUBJECT' => $topicData[$key]['subject'], 'TOPICLINK' => $scripturl . '?topic=' . $topicData[$key]['topic'] . '.new#new', 'MESSAGE' => $topicData[$key]['body'], 'UNSUBSCRIBELINK' => $scripturl . '?action=notifyboard;board=' . $topicData[$key]['board'] . '.0');
            if (!$send_body) {
                unset($replacements['MESSAGE']);
            }
            // Figure out which email to send off
            $emailtype = '';
            // Send only if once is off or it's on and it hasn't been sent.
            if (!empty($rowmember['notify_regularity']) && !$sentOnceAlready && empty($rowmember['sent'])) {
                $emailtype = 'notify_boards_once';
            } elseif (empty($rowmember['notify_regularity'])) {
                $emailtype = 'notify_boards';
            }
            if (!empty($emailtype)) {
                $emailtype .= $send_body ? '_body' : '';
                $emaildata = loadEmailTemplate($emailtype, $replacements, $langloaded);
                sendmail($rowmember['email_address'], $emaildata['subject'], $emaildata['body'], null, null, false, 3);
            }
            $sentOnceAlready = 1;
        }
    }
    $smcFunc['db_free_result']($members);
    // Sent!
    $smcFunc['db_query']('', '
		UPDATE {db_prefix}log_notify
		SET sent = {int:is_sent}
		WHERE id_board IN ({array_int:board_list})
//.........这里部分代码省略.........
开发者ID:valek0972,项目名称:hackits,代码行数:101,代码来源:Post.php


示例3: Activate

function Activate()
{
    global $context, $txt, $modSettings, $scripturl, $sourcedir, $language;
    loadLanguage('Login');
    //loadTemplate('Login');
    if (empty($_REQUEST['u']) && empty($_POST['user'])) {
        if (empty($modSettings['registration_method']) || $modSettings['registration_method'] == 3) {
            fatal_lang_error('no_access', false);
        }
        $context['member_id'] = 0;
        EoS_Smarty::loadTemplate('generic_skeleton');
        EoS_Smarty::getConfigInstance()->registerHookTemplate('generic_content_area', 'loginout/resend');
        $context['page_title'] = $txt['invalid_activation_resend'];
        $context['can_activate'] = empty($modSettings['registration_method']) || $modSettings['registration_method'] == 1;
        $context['default_username'] = isset($_GET['user']) ? $_GET['user'] : '';
        return;
    }
    // Get the code from the database...
    $request = smf_db_query('
		SELECT id_member, validation_code, member_name, real_name, email_address, is_activated, passwd, lngfile
		FROM {db_prefix}members' . (empty($_REQUEST['u']) ? '
		WHERE member_name = {string:email_address} OR email_address = {string:email_address}' : '
		WHERE id_member = {int:id_member}') . '
		LIMIT 1', array('id_member' => isset($_REQUEST['u']) ? (int) $_REQUEST['u'] : 0, 'email_address' => isset($_POST['user']) ? $_POST['user'] : ''));
    // Does this user exist at all?
    if (mysql_num_rows($request) == 0) {
        EoS_Smarty::loadTemplate('generic_skeleton');
        EoS_Smarty::getConfigInstance()->registerHookTemplate('generic_content_area', 'loginout/retry_activate');
        $context['page_title'] = $txt['invalid_userid'];
        $context['member_id'] = 0;
        return;
    }
    $row = mysql_fetch_assoc($request);
    mysql_free_result($request);
    // Change their email address? (they probably tried a fake one first :P.)
    if (isset($_POST['new_email'], $_REQUEST['passwd']) && sha1(strtolower($row['member_name']) . $_REQUEST['passwd']) == $row['passwd']) {
        if (empty($modSettings['registration_method']) || $modSettings['registration_method'] == 3) {
            fatal_lang_error('no_access', false);
        }
        // !!! Separate the sprintf?
        if (preg_match('~^[0-9A-Za-z=_+\\-/][0-9A-Za-z=_\'+\\-/\\.]*@[\\w\\-]+(\\.[\\w\\-]+)*(\\.[\\w]{2,6})$~', $_POST['new_email']) == 0) {
            fatal_error(sprintf($txt['valid_email_needed'], htmlspecialchars($_POST['new_email'])), false);
        }
        // Make sure their email isn't banned.
        isBannedEmail($_POST['new_email'], 'cannot_register', $txt['ban_register_prohibited']);
        // Ummm... don't even dare try to take someone else's email!!
        $request = smf_db_query('
			SELECT id_member
			FROM {db_prefix}members
			WHERE email_address = {string:email_address}
			LIMIT 1', array('email_address' => $_POST['new_email']));
        // !!! Separate the sprintf?
        if (mysql_num_rows($request) != 0) {
            fatal_lang_error('email_in_use', false, array(htmlspecialchars($_POST['new_email'])));
        }
        mysql_free_result($request);
        updateMemberData($row['id_member'], array('email_address' => $_POST['new_email']));
        $row['email_address'] = $_POST['new_email'];
        $email_change = true;
    }
    // Resend the password, but only if the account wasn't activated yet.
    if (!empty($_REQUEST['sa']) && $_REQUEST['sa'] == 'resend' && ($row['is_activated'] == 0 || $row['is_activated'] == 2) && (!isset($_REQUEST['code']) || $_REQUEST['code'] == '')) {
        require_once $sourcedir . '/lib/Subs-Post.php';
        $replacements = array('REALNAME' => $row['real_name'], 'USERNAME' => $row['member_name'], 'ACTIVATIONLINK' => $scripturl . '?action=activate;u=' . $row['id_member'] . ';code=' . $row['validation_code'], 'ACTIVATIONLINKWITHOUTCODE' => $scripturl . '?action=activate;u=' . $row['id_member'], 'ACTIVATIONCODE' => $row['validation_code'], 'FORGOTPASSWORDLINK' => $scripturl . '?action=reminder');
        $emaildata = loadEmailTemplate('resend_activate_message', $replacements, empty($row['lngfile']) || empty($modSettings['userLanguage']) ? $language : $row['lngfile']);
        sendmail($row['email_address'], $emaildata['subject'], $emaildata['body'], null, null, false, 0);
        $context['page_title'] = $txt['invalid_activation_resend'];
        // This will ensure we don't actually get an error message if it works!
        $context['error_title'] = '';
        fatal_lang_error(!empty($email_change) ? 'change_email_success' : 'resend_email_success', false);
    }
    // Quit if this code is not right.
    if (empty($_REQUEST['code']) || $row['validation_code'] != $_REQUEST['code']) {
        if (!empty($row['is_activated'])) {
            fatal_lang_error('already_activated', false);
        } elseif ($row['validation_code'] == '') {
            loadLanguage('Profile');
            fatal_error($txt['registration_not_approved'] . ' <a href="' . $scripturl . '?action=activate;user=' . $row['member_name'] . '">' . $txt['here'] . '</a>.', false);
        }
        EoS_Smarty::loadTemplate('generic_skeleton');
        EoS_Smarty::getConfigInstance()->registerHookTemplate('generic_content_area', 'loginout/retry_activate');
        $context['page_title'] = $txt['invalid_activation_code'];
        $context['member_id'] = $row['id_member'];
        return;
    }
    // Let the integration know that they've been activated!
    HookAPI::callHook('integrate_activate', array($row['member_name']));
    // Validation complete - update the database!
    updateMemberData($row['id_member'], array('is_activated' => 1, 'validation_code' => ''));
    // Also do a proper member stat re-evaluation.
    updateStats('member', false);
    if (!isset($_POST['new_email'])) {
        $actid = 0;
        require_once $sourcedir . '/lib/Subs-Post.php';
        // add to the activity stream
        if ($modSettings['astream_active']) {
            require_once $sourcedir . '/lib/Subs-Activities.php';
            $actid = aStreamAdd($row['id_member'], ACT_NEWMEMBER, array('member_name' => $row['member_name']), 0, 0, 0, $row['id_member']);
        }
        adminNotify('activation', $row['id_member'], $row['member_name'], $actid, ACT_NEWMEMBER);
//.........这里部分代码省略.........
开发者ID:norv,项目名称:EosAlpha,代码行数:101,代码来源:Register.php


示例4: ReportToModerator2


//.........这里部分代码省略.........
        $context['post_errors'] = array();
        foreach ($post_errors as $post_error) {
            $context['post_errors'][] = $txt['error_' . $post_error];
        }
        return ReportToModerator();
    }
    // Get the basic topic information, and make sure they can see it.
    $_POST['msg'] = (int) $_POST['msg'];
    $request = $smcFunc['db_query']('', '
		SELECT m.id_topic, m.id_board, m.subject, m.body, m.id_member AS id_poster, m.poster_name, mem.real_name
		FROM {db_prefix}messages AS m
			LEFT JOIN {db_prefix}members AS mem ON (m.id_member = mem.id_member)
		WHERE m.id_msg = {int:id_msg}
			AND m.id_topic = {int:current_topic}
		LIMIT 1', array('current_topic' => $topic, 'id_msg' => $_POST['msg']));
    if ($smcFunc['db_num_rows']($request) == 0) {
        fatal_lang_error('no_board', false);
    }
    $message = $smcFunc['db_fetch_assoc']($request);
    $smcFunc['db_free_result']($request);
    $poster_name = un_htmlspecialchars($message['real_name']) . ($message['real_name'] != $message['poster_name'] ? ' (' . $message['poster_name'] . ')' : '');
    $reporterName = un_htmlspecialchars($user_info['name']) . ($user_info['name'] != $user_info['username'] && $user_info['username'] != '' ? ' (' . $user_info['username'] . ')' : '');
    $subject = un_htmlspecialchars($message['subject']);
    // Get a list of members with the moderate_board permission.
    require_once $sourcedir . '/Subs-Members.php';
    $moderators = membersAllowedTo('moderate_board', $board);
    $request = $smcFunc['db_query']('', '
		SELECT id_member, email_address, lngfile, mod_prefs
		FROM {db_prefix}members
		WHERE id_member IN ({array_int:moderator_list})
			AND notify_types != {int:notify_types}
		ORDER BY lngfile', array('moderator_list' => $moderators, 'notify_types' => 4));
    // Check that moderators do exist!
    if ($smcFunc['db_num_rows']($request) == 0) {
        fatal_lang_error('no_mods', false);
    }
    // If we get here, I believe we should make a record of this, for historical significance, yabber.
    if (empty($modSettings['disable_log_report'])) {
        $request2 = $smcFunc['db_query']('', '
			SELECT id_report, ignore_all
			FROM {db_prefix}log_reported
			WHERE id_msg = {int:id_msg}
				AND (closed = {int:not_closed} OR ignore_all = {int:ignored})
			ORDER BY ignore_all DESC', array('id_msg' => $_POST['msg'], 'not_closed' => 0, 'ignored' => 1));
        if ($smcFunc['db_num_rows']($request2) != 0) {
            list($id_report, $ignore) = $smcFunc['db_fetch_row']($request2);
        }
        $smcFunc['db_free_result']($request2);
        // If we're just going to ignore these, then who gives a monkeys...
        if (!empty($ignore)) {
            redirectexit('topic=' . $topic . '.msg' . $_POST['msg'] . '#msg' . $_POST['msg']);
        }
        // Already reported? My god, we could be dealing with a real rogue here...
        if (!empty($id_report)) {
            $smcFunc['db_query']('', '
				UPDATE {db_prefix}log_reported
				SET num_reports = num_reports + 1, time_updated = {int:current_time}
				WHERE id_report = {int:id_report}', array('current_time' => time(), 'id_report' => $id_report));
        } else {
            if (empty($message['real_name'])) {
                $message['real_name'] = $message['poster_name'];
            }
            $smcFunc['db_insert']('', '{db_prefix}log_reported', array('id_msg' => 'int', 'id_topic' => 'int', 'id_board' => 'int', 'id_member' => 'int', 'membername' => 'string', 'subject' => 'string', 'body' => 'string', 'time_started' => 'int', 'time_updated' => 'int', 'num_reports' => 'int', 'closed' => 'int'), array($_POST['msg'], $message['id_topic'], $message['id_board'], $message['id_poster'], $message['real_name'], $message['subject'], $message['body'], time(), time(), 1, 0), array('id_report'));
            $id_report = $smcFunc['db_insert_id']('{db_prefix}log_reported', 'id_report');
        }
        // Now just add our report...
        if ($id_report) {
            $smcFunc['db_insert']('', '{db_prefix}log_reported_comments', array('id_report' => 'int', 'id_member' => 'int', 'membername' => 'string', 'email_address' => 'string', 'member_ip' => 'string', 'comment' => 'string', 'time_sent' => 'int'), array($id_report, $user_info['id'], $user_info['name'], $user_info['email'], $user_info['ip'], $poster_comment, time()), array('id_comment'));
        }
    }
    // Find out who the real moderators are - for mod preferences.
    $request2 = $smcFunc['db_query']('', '
		SELECT id_member
		FROM {db_prefix}moderators
		WHERE id_board = {int:current_board}', array('current_board' => $board));
    $real_mods = array();
    while ($row = $smcFunc['db_fetch_assoc']($request2)) {
        $real_mods[] = $row['id_member'];
    }
    $smcFunc['db_free_result']($request2);
    // Send every moderator an email.
    while ($row = $smcFunc['db_fetch_assoc']($request)) {
        // Maybe they don't want to know?!
        if (!empty($row['mod_prefs'])) {
            list(, , $pref_binary) = explode('|', $row['mod_prefs']);
            if (!($pref_binary & 1) && (!($pref_binary & 2) || !in_array($row['id_member'], $real_mods))) {
                continue;
            }
        }
        $replacements = array('TOPICSUBJECT' => $subject, 'POSTERNAME' => $poster_name, 'REPORTERNAME' => $reporterName, 'TOPICLINK' => $scripturl . '?topic=' . $topic . '.msg' . $_POST['msg'] . '#msg' . $_POST['msg'], 'REPORTLINK' => !empty($id_report) ? $scripturl . '?action=moderate;area=reports;report=' . $id_report : '', 'COMMENT' => $_POST['comment']);
        $emaildata = loadEmailTemplate('report_to_moderator', $replacements, empty($row['lngfile']) || empty($modSettings['userLanguage']) ? $language : $row['lngfile']);
        // Send it to the moderator.
        sendmail($row['email_address'], $emaildata['subject'], $emaildata['body'], $user_info['email'], null, false, 2);
    }
    $smcFunc['db_free_result']($request);
    // Keep track of when the mod reports get updated, that way we know when we need to look again.
    updateSettings(array('last_mod_report_action' => time()));
    // Back to the post we reported!
    redirectexit('reportsent;topic=' . $topic . '.msg' . $_POST['msg'] . '#msg' . $_POST['msg']);
}
开发者ID:valek0972,项目名称:hackits,代码行数:101,代码来源:SendTopic.php


示例5: action_requests

    /**
     * Show and manage all group requests.
     */
    public function action_requests()
    {
        global $txt, $context, $scripturl, $user_info, $modSettings;
        // Set up the template stuff...
        $context['page_title'] = $txt['mc_group_requests'];
        $context['sub_template'] = 'show_list';
        $context[$context['moderation_menu_name']]['tab_data'] = array('title' => $txt['mc_group_requests']);
        // Verify we can be here.
        if ($user_info['mod_cache']['gq'] == '0=1') {
            isAllowedTo('manage_membergroups');
        }
        // Normally, we act normally...
        $where = $user_info['mod_cache']['gq'] == '1=1' || $user_info['mod_cache']['gq'] == '0=1' ? $user_info['mod_cache']['gq'] : 'lgr.' . $user_info['mod_cache']['gq'];
        $where_parameters = array();
        // We've submitted?
        if (isset($_POST[$context['session_var']]) && !empty($_POST['groupr']) && !empty($_POST['req_action'])) {
            checkSession('post');
            validateToken('mod-gr');
            require_once SUBSDIR . '/Membergroups.subs.php';
            // Clean the values.
            foreach ($_POST['groupr'] as $k => $request) {
                $_POST['groupr'][$k] = (int) $request;
            }
            // If we are giving a reason (And why shouldn't we?), then we don't actually do much.
            if ($_POST['req_action'] == 'reason') {
                // Different sub template...
                $context['sub_template'] = 'group_request_reason';
                // And a limitation. We don't care that the page number bit makes no sense, as we don't need it!
                $where .= ' AND lgr.id_request IN ({array_int:request_ids})';
                $where_parameters['request_ids'] = $_POST['groupr'];
                $context['group_requests'] = list_getGroupRequests(0, $modSettings['defaultMaxMessages'], 'lgr.id_request', $where, $where_parameters);
                createToken('mod-gr');
                // Let obExit etc sort things out.
                obExit();
            } else {
                // Get the details of all the members concerned...
                require_once SUBSDIR . '/Members.subs.php';
                $concerned = getConcernedMembers($_POST['groupr'], $where);
                // Cleanup old group requests..
                deleteGroupRequests($_POST['groupr']);
                // Ensure everyone who is online gets their changes right away.
                updateSettings(array('settings_updated' => time()));
                if (!empty($concerned['email_details'])) {
                    require_once SUBSDIR . '/Mail.subs.php';
                    // They are being approved?
                    if ($_POST['req_action'] == 'approve') {
                        // Make the group changes.
                        foreach ($concerned['group_changes'] as $id => $groups) {
                            // Sanity check!
                            foreach ($groups['add'] as $key => $value) {
                                if ($value == 0 || trim($value) == '') {
                                    unset($groups['add'][$key]);
                                }
                            }
                            assignGroupsToMember($id, $groups['primary'], $groups['add']);
                        }
                        foreach ($concerned['email_details'] as $email) {
                            $replacements = array('USERNAME' => $email['member_name'], 'GROUPNAME' => $email['group_name']);
                            $emaildata = loadEmailTemplate('mc_group_approve', $replacements, $email['language']);
                            sendmail($email['email'], $emaildata['subject'], $emaildata['body'], null, null, false, 2);
                        }
                    } else {
                        // Same as for approving, kind of.
                        foreach ($concerned['email_details'] as $email) {
                            $custom_reason = isset($_POST['groupreason']) && isset($_POST['groupreason'][$email['rid']]) ? $_POST['groupreason'][$email['rid']] : '';
                            $replacements = array('USERNAME' => $email['member_name'], 'GROUPNAME' => $email['group_name']);
                            if (!empty($custom_reason)) {
                                $replacements['REASON'] = $custom_reason;
                            }
                            $emaildata = loadEmailTemplate(empty($custom_reason) ? 'mc_group_reject' : 'mc_group_reject_reason', $replacements, $email['language']);
                            sendmail($email['email'], $emaildata['subject'], $emaildata['body'], null, null, false, 2);
                        }
                    }
                }
                // Restore the current language.
                loadLanguage('ModerationCenter');
            }
        }
        // We're going to want this for making our list.
        require_once SUBSDIR . '/GenericList.class.php';
        require_once SUBSDIR . '/Membergroups.subs.php';
        // This is all the information required for a group listing.
        $listOptions = array('id' => 'group_request_list', 'width' => '100%', 'items_per_page' => $modSettings['defaultMaxMessages'], 'no_items_label' => $txt['mc_groupr_none_found'], 'base_href' => $scripturl . '?action=groups;sa=requests', 'default_sort_col' => 'member', 'get_items' => array('function' => 'list_getGroupRequests', 'params' => array($where, $where_parameters)), 'get_count' => array('function' => 'list_getGroupRequestCount', 'params' => array($where, $where_parameters)), 'columns' => array('member' => array('header' => array('value' => $txt['mc_groupr_member']), 'data' => array('db' => 'member_link'), 'sort' => array('default' => 'mem.member_name', 'reverse' => 'mem.member_name DESC')), 'group' => array('header' => array('value' => $txt['mc_groupr_group']), 'data' => array('db' => 'group_link'), 'sort' => array('default' => 'mg.group_name', 'reverse' => 'mg.group_name DESC')), 'reason' => array('header' => array('value' => $txt['mc_groupr_reason']), 'data' => array('db' => 'reason')), 'date' => array('header' => array('value' => $txt['date'], 'style' => 'width: 18%; white-space:nowrap;'), 'data' => array('db' => 'time_submitted')), 'action' => array('header' => array('value' => '<input type="checkbox" class="input_check" onclick="invertAll(this, this.form);" />', 'style' => 'width: 4%;text-align: center;'), 'data' => array('sprintf' => array('format' => '<input type="checkbox" name="groupr[]" value="%1$d" class="input_check" />', 'params' => array('id' => false)), 'class' => 'centertext'))), 'form' => array('href' => $scripturl . '?action=groups;sa=requests', 'include_sort' => true, 'include_start' => true, 'hidden_fields' => array($context['session_var'] => $context['session_id']), 'token' => 'mod-gr'), 'additional_rows' => array(array('position' => 'bottom_of_list', 'value' => '
						<select name="req_action" onchange="if (this.value != 0 &amp;&amp; (this.value == \'reason\' || confirm(\'' . $txt['mc_groupr_warning'] . '\'))) this.form.submit();">
							<option value="0">' . $txt['with_selected'] . ':</option>
							<option value="0" disabled="disabled">' . str_repeat('&#8212;', strlen($txt['mc_groupr_approve'])) . '</option>
							<option value="approve">' . (isBrowser('ie8') ? '&#187;' : '&#10148;') . '&nbsp;' . $txt['mc_groupr_approve'] . '</option>
							<option value="reject">' . (isBrowser('ie8') ? '&#187;' : '&#10148;') . '&nbsp;' . $txt['mc_groupr_reject'] . '</option>
							<option value="reason">' . (isBrowser('ie8') ? '&#187;' : '&#10148;') . '&nbsp;' . $txt['mc_groupr_reject_w_reason'] . '</option>
						</select>
						<input type="submit" name="go" value="' . $txt['go'] . '" onclick="var sel = document.getElementById(\'req_action\'); if (sel.value != 0 &amp;&amp; sel.value != \'reason\' &amp;&amp; !confirm(\'' . $txt['mc_groupr_warning'] . '\')) return false;" class="right_submit" />', 'class' => 'floatright')));
        // Create the request list.
        createToken('mod-gr');
        createList($listOptions);
        $context['default_list'] = 'group_request_list';
    }
开发者ID:KeiroD,项目名称:Elkarte,代码行数:99,代码来源:Groups.controller.php


示例6: resetPassword

/**
 * Generates a random password for a user and emails it to them.
 * - called by Profile.php when changing someone's username.
 * - checks the validity of the new username.
 * - generates and sets a new password for the given user.
 * - mails the new password to the email address of the user.
 * - if username is not set, only a new password is generated and sent.
 *
 * @param int $memID
 * @param string $username = null
 */
function resetPassword($memID, $username = null)
{
    global $scripturl, $context, $txt, $sourcedir, $modSettings, $smcFunc, $language;
    // Language... and a required file.
    loadLanguage('Login');
    require_once $sourcedir . '/Subs-Post.php';
    // Get some important details.
    $request = $smcFunc['db_query']('', '
		SELECT member_name, email_address, lngfile
		FROM {db_prefix}members
		WHERE id_member = {int:id_member}', array('id_member' => $memID));
    list($user, $email, $lngfile) = $smcFunc['db_fetch_row']($request);
    $smcFunc['db_free_result']($request);
    if ($username !== null) {
        $old_user = $user;
        $user = trim($username);
    }
    // Generate a random password.
    $newPassword = substr(preg_replace('/\\W/', '', md5(mt_rand())), 0, 10);
    $newPassword_sha1 = sha1(strtolower($user) . $newPassword);
    // Do some checks on the username if needed.
    if ($username !== null) {
        validateUsername($memID, $user);
        // Update the database...
        updateMemberData($memID, array('member_name' => $user, 'passwd' => $newPassword_sha1));
    } else {
        updateMemberData($memID, array('passwd' => $newPassword_sha1));
    }
    call_integration_hook('integrate_reset_pass', array($old_user, $user, $newPassword));
    $replacements = array('USERNAME' => $user, 'PASSWORD' => $newPassword);
    $emaildata = loadEmailTemplate('change_password', $replacements, empty($lngfile) || empty($modSettings['userLanguage']) ? $language : $lngfile);
    // Send them the email informing them of the change - then we're done!
    sendmail($email, $emaildata['subject'], $emaildata['body'], null, null, false, 0);
}
开发者ID:albertlast,项目名称:SMF2.1,代码行数:45,代码来源:Subs-Auth.php


示例7: AdminApprove

function AdminApprove()
{
    global $txt, $context, $scripturl, $modSettings, $sourcedir, $language, $user_info, $smcFunc;
    // First, check our session.
    checkSession();
    require_once $sourcedir . '/Subs-Post.php';
    // We also need to the login languages here - for emails.
    loadLanguage('Login');
    // Sort out where we are going...
    $browse_type = isset($_REQUEST['type']) ? $_REQUEST['type'] : (!empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1 ? 'activate' : 'approve');
    $current_filter = (int) $_REQUEST['orig_filter'];
    // If we are applying a filter do just that - then redirect.
    if (isset($_REQUEST['filter']) && $_REQUEST['filter'] != $_REQUEST['orig_filter']) {
        redirectexit('action=admin;area=viewmembers;sa=browse;type=' . $_REQUEST['type'] . ';sort=' . $_REQUEST['sort'] . ';filter=' . $_REQUEST['filter'] . ';start=' . $_REQUEST['start']);
    }
    // Nothing to do?
    if (!isset($_POST['todoAction']) && !isset($_POST['time_passed'])) {
        redirectexit('action=admin;area=viewmembers;sa=browse;type=' . $_REQUEST['type'] . ';sort=' . $_REQUEST['sort'] . ';filter=' . $current_filter . ';start=' . $_REQUEST['start']);
    }
    // Are we dealing with members who have been waiting for > set amount of time?
    if (isset($_POST['time_passed'])) {
        $timeBefore = time() - 86400 * (int) $_POST['time_passed'];
        $condition = '
			AND date_registered < {int:time_before}';
    } else {
        $members = array();
        foreach ($_POST['todoAction'] as $id) {
            $members[] = (int) $id;
        }
        $condition = '
			AND id_member IN ({array_int:members})';
    }
    // Get information on each of the members, things that are important to us, like email address...
    $request = $smcFunc['db_query']('', '
		SELECT id_member, member_name, real_name, email_address, validation_code, lngfile
		FROM {db_prefix}members
		WHERE is_activated = {int:activated_status}' . $condition . '
		ORDER BY lngfile', array('activated_status' => $current_filter, 'time_before' => empty($timeBefore) ? 0 : $timeBefore, 'members' => empty($members) ? array() : $members));
    $member_count = $smcFunc['db_num_rows']($request);
    // If no results then just return!
    if ($member_count == 0) {
        redirectexit('action=admin;area=viewmembers;sa=browse;type=' . $_REQUEST['type'] . ';sort=' . $_REQUEST['sort'] . ';filter=' . $current_filter . ';start=' . $_REQUEST['start']);
    }
    $member_info = array();
    $members = array();
    // Fill the info array.
    while ($row = $smcFunc['db_fetch_assoc']($request)) {
        $members[] = $row['id_member'];
        $member_info[] = array('id' => $row['id_member'], 'username' => $row['member_name'], 'name' => $row['real_name'], 'email' => $row['email_address'], 'language' => empty($row['lngfile']) || empty($modSettings['userLanguage']) ? $language : $row['lngfile'], 'code' => $row['validation_code']);
    }
    $smcFunc['db_free_result']($request);
    // Are we activating or approving the members?
    if ($_POST['todo'] == 'ok' || $_POST['todo'] == 'okemail') {
        // Approve/activate this member.
        $smcFunc['db_query']('', '
			UPDATE {db_prefix}members
			SET validation_code = {string:blank_string}, is_activated = {int:is_activated}
			WHERE is_activated = {int:activated_status}' . $condition, array('is_activated' => 1, 'time_before' => empty($timeBefore) ? 0 : $timeBefore, 'members' => empty($members) ? array() : $members, 'activated_status' => $current_filter, 'blank_string' => ''));
        // Do we have to let the integration code know about the activations?
        if (!empty($modSettings['integrate_activate'])) {
            foreach ($member_info as $member) {
                call_integration_hook('integrate_activate', array($member['username']));
            }
        }
        // Check for email.
        if ($_POST['todo'] == 'okemail') {
            foreach ($member_info as $member) {
                $replacements = array('NAME' => $member['name'], 'USERNAME' => $member['username'], 'PROFILELINK' => $scripturl . '?action=profile;u=' . $member['id'], 'FORGOTPASSWORDLINK' => $scripturl . '?action=reminder');
                $emaildata = loadEmailTemplate('admin_approve_accept', $replacements, $member['language']);
                sendmail($member['email'], $emaildata['subject'], $emaildata['body'], null, null, false, 0);
            }
        }
    } elseif ($_POST['todo'] == 'require_activation') {
        require_once $sourcedir . '/Subs-Members.php';
        // We have to do this for each member I'm afraid.
        foreach ($member_info as $member) {
            // Generate a random activation code.
            $validation_code = generateValidationCode();
            // Set these members for activation - I know this includes two id_member checks but it's safer than bodging $condition ;).
            $smcFunc['db_query']('', '
				UPDATE {db_prefix}members
				SET validation_code = {string:validation_code}, is_activated = {int:not_activated}
				WHERE is_activated = {int:activated_status}
					' . $condition . '
					AND id_member = {int:selected_member}', array('not_activated' => 0, 'activated_status' => $current_filter, 'selected_member' => $member['id'], 'validation_code' => $validation_code, 'time_before' => empty($timeBefore) ? 0 : $timeBefore, 'members' => empty($members) ? array() : $members));
            $replacements = array('USERNAME' => $member['name'], 'ACTIVATIONLINK' => $scripturl . '?action=activate;u=' . $member['id'] . ';code=' . $validation_code, 'ACTIVATIONLINKWITHOUTCODE' => $scripturl . '?action=activate;u=' . $member['id'], 'ACTIVATIONCODE' => $validation_code);
            $emaildata = loadEmailTemplate('admin_approve_activation', $replacements, $member['language']);
            sendmail($member['email'], $emaildata['subject'], $emaildata['body'], null, null, false, 0);
        }
    } elseif ($_POST['todo'] == 'reject' || $_POST['todo'] == 'rejectemail') {
        require_once $sourcedir . '/Subs-Members.php';
        deleteMembers($members);
        // Send email telling them they aren't welcome?
        if ($_POST['todo'] == 'rejectemail') {
            foreach ($member_info as $member) {
                $replacements = array('USERNAME' => $member['name']);
                $emaildata = loadEmailTemplate('admin_approve_reject', $replacements, $member['language']);
                sendmail($member['email'], $emaildata['subject'], $emaildata['body'], null, null, false, 1);
            }
        }
//.........这里部分代码省略.........
开发者ID:sk8rdude461,项目名称:moparscape.org-smf,代码行数:101,代码来源:ManageMembers.php


示例8: RemindPick

function RemindPick()
{
    global $context, $txt, $scripturl, $sourcedir, $user_info, $webmaster_email, $smcFunc, $language, $modSettings;
    checkSession();
    // Coming with a known ID?
    if (!empty($_REQUEST['uid'])) {
        $where = 'id_member = {int:id_member}';
        $where_params['id_member'] = (int) $_REQUEST['uid'];
    } elseif (isset($_POST['user']) && $_POST['user'] != '') {
        $where = 'member_name = {string:member_name}';
        $where_params['member_name'] = $_POST['user'];
        $where_params['email_address'] = $_POST['user'];
    }
    // You must enter a username/email address.
    if (empty($where)) {
        fatal_lang_error('username_no_exist', false);
    }
    // Find the user!
    $request = $smcFunc['db_query']('', '
		SELECT id_member, real_name, member_name, email_address, is_activated, validation_code, lngfile, openid_uri, secret_question
		FROM {db_prefix}members
		WHERE ' . $where . '
		LIMIT 1', array_merge($where_params, array()));
    // Maybe email?
    if ($smcFunc['db_num_rows']($request) == 0 && empty($_REQUEST['uid'])) {
        $smcFunc['db_free_result']($request);
        $request = $smcFunc['db_query']('', '
			SELECT id_member, real_name, member_name, email_address, is_activated, validation_code, lngfile, openid_uri, secret_question
			FROM {db_prefix}members
			WHERE email_address = {string:email_address}
			LIMIT 1', array_merge($where_params, array()));
        if ($smcFunc['db_num_rows']($request) == 0) {
            fatal_lang_error('no_user_with_email', false);
        }
    }
    $row = $smcFunc['db_fetch_assoc']($request);
    $smcFunc['db_free_result']($request);
    $context['account_type'] = !empty($row['openid_uri']) ? 'openid' : 'password';
    // If the user isn't activated/approved, give them some feedback on what to do next.
    if ($row['is_activated'] != 1) {
        // Awaiting approval...
        if (trim($row['validation_code']) == '') {
            fatal_error($txt['registration_not_approved'] . ' <a href="' . $scripturl . '?action=activate;user=' . $_POST['user'] . '">' . $txt['here'] . '</a>.', false);
        } else {
            fatal_error($txt['registration_not_activated'] . ' <a href="' . $scripturl . '?action=activate;user=' . $_POST['user'] . '">' . $txt['here'] . '</a>.', false);
        }
    }
    // You can't get emailed if you have no email address.
    $row['email_address'] = trim($row['email_address']);
    if ($row['email_address'] == '') {
        fatal_error($txt['no_reminder_email'] . '<br />' . $txt['send_email'] . ' <a href="mailto:' . $webmaster_email . '">webmaster</a> ' . $txt['to_ask_password'] . '.');
    }
    // If they have no secret question then they can only get emailed the item, or they are requesting the email, send them an email.
    if (empty($row['secret_question']) || isset($_POST['reminder_type']) && $_POST['reminder_type'] == 'email') {
        // Randomly generate a new password, with only alpha numeric characters that is a max length of 10 chars.
        require_once $sourcedir . '/Subs-Members.php';
        $password = generateValidationCode();
        require_once $sourcedir . '/Subs-Post.php';
        $replacements = array('REALNAME' => $row['real_name'], 'REMINDLINK' => $scripturl . '?action=reminder;sa=setpassword;u=' . $row['id_member'] . ';code=' . $password, 'IP' => $user_info['ip'], 'MEMBERNAME' => $row['member_name'], 'OPENID' => $row['openid_uri']);
        $emaildata = loadEmailTemplate('forgot_' . $context['account_type'], $replacements, empty($row['lngfile']) || empty($modSettings['userLanguage']) ? $language : $row['lngfile']);
        $context['description'] = $txt['reminder_' . (!empty($row['openid_uri']) ? 'openid_' : '') . 'sent'];
        // If they were using OpenID simply email them their OpenID identity.
        sendmail($row['email_address'], $emaildata['subject'], $emaildata['body'], null, null, false, 0);
        if (empty($row['openid_uri'])) {
            // Set the password in the database.
            updateMemberData($row['id_member'], array('validation_code' => substr(md5($password), 0, 10)));
        }
        // Set up the template.
        $context['sub_template'] = 'sent';
        // Dont really.
        return;
    } elseif (isset($_POST['reminder_type']) && $_POST['reminder_type'] == 'secret') {
        return SecretAnswerInput();
    }
    // No we're here setup the context for template number 2!
    $context['sub_template'] = 'reminder_pick';
    $context['current_member'] = array('id' => $row['id_member'], 'name' => $row['member_name']);
}
开发者ID:chenhao6593,项目名称:smf,代码行数:78,代码来源:Reminder.php


示例9: action_approve

 /**
  * This function handles the approval, rejection, activation or deletion of members.
  *
  * What it does:
  * - Called by ?action=admin;area=viewmembers;sa=approve.
  * - Requires the moderate_forum permission.
  * - Redirects to ?action=admin;area=viewmembers;sa=browse
  * with the same parameters as the calling page.
  */
 public function action_approve()
 {
     global $scripturl, $modSettings;
     // First, check our session.
     checkSession();
     require_once SUBSDIR . '/Mail.subs.php';
     require_once SUBSDIR . '/Members.subs.php';
     // We also need to the login languages here - for emails.
     loadLanguage('Login');
     // Start off clean
     $conditions = array();
     // Sort out where we are going...
     $current_filter = $conditions['activated_status'] = (int) $_REQUEST['orig_filter'];
     // If we are applying a filter do just that - then redirect.
     if (isset($_REQUEST['filter']) && $_REQUEST['filter'] != $_REQUEST['orig_filter']) {
         redirectexit('action=admin;area=viewmembers;sa=browse;type=' . $_REQUEST['type'] . ';sort=' . $_REQUEST['sort'] . ';filter=' . $_REQUEST['filter'] . ';start=' . $_REQUEST['start']);
     }
     // Nothing to do?
     if (!isset($_POST['todoAction']) && !isset($_POST['time_passed'])) {
         redirectexit('action=admin;area=viewmembers;sa=browse;type=' . $_REQUEST['type'] . ';sort=' . $_REQUEST['sort'] . ';filter=' . $current_filter . ';start=' . $_REQUEST['start']);
     }
     // Are we dealing with members who have been waiting for > set amount of time?
     if (isset($_POST['time_passed'])) {
         $conditions['time_before'] = time() - 86400 * (int) $_POST['time_passed'];
     } else {
         $conditions['members'] = array();
         foreach ($_POST['todoAction'] as $id) {
             $conditions['members'][] = (int) $id;
         }
     }
     $data = retrieveMemberData($conditions);
     if ($data['member_count'] == 0) {
         redirectexit('action=admin;area=viewmembers;sa=browse;type=' . $_REQUEST['type'] . ';sort=' . $_REQUEST['sort'] . ';filter=' . $current_filter . ';start=' . $_REQUEST['start']);
     }
     $member_info = $data['member_info'];
     $conditions['members'] = $data['members'];
     // Are we activating or approving the members?
     if ($_POST['todo'] == 'ok' || $_POST['todo'] == 'okemail') {
         // Approve / activate this member.
         approveMembers($conditions);
         // Check for email.
         if ($_POST['todo'] == 'okemail') {
             foreach ($member_info as $member) {
                 $replacements = array('NAME' => $member['name'], 'USERNAME' => $member['username'], 'PROFILELINK' => $scripturl . '?action=profile;u=' . $member['id'], 'FORGOTPASSWORDLINK' => $scripturl . '?action=reminder');
                 $emaildata = loadEmailTemplate('admin_approve_accept', $replacements, $member['language']);
                 sendmail($member['email'], $emaildata['subject'], $emaildata['body'], null, null, false, 0);
             }
         }
         // Update the menu action cache so its forced to refresh
         cache_put_data('num_menu_errors', null, 900);
     } elseif ($_POST['todo'] == 'require_activation') {
         require_once SUBSDIR . '/Auth.subs.php';
         // We have to do this for each member I'm afraid.
         foreach ($member_info as $member) {
             $conditions['selected_member'] = $member['id'];
             // Generate a random activation code.
             $conditions['validation_code'] = generateValidationCode();
             // Set these members for activation - I know this includes two id_member checks but it's safer than bodging $condition ;).
             enforceReactivation($conditions);
             $replacements = array('USERNAME' => $member['name'], 'ACTIVATIONLINK' => $scripturl . '?action=activate;u=' . $member['id'] . ';code=' . $conditions['validation_code'], 'ACTIVATIONLINKWITHOUTCODE' => $scripturl . '?action=activate;u=' . $member['id'], 'ACTIVATIONCODE' => $conditions['validation_code']);
             $emaildata = loadEmailTemplate('admin_approve_activation', $replacements, $member['language']);
    

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP loadFile函数代码示例发布时间:2022-05-15
下一篇:
PHP loadDatabase函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap