예제 #1
0
/**
 * page code function
 */
function PageCompPageMainCode($iID, $sConfCode)
{
    global $site;
    $ID = (int) $iID;
    $ConfCode = clear_xss($sConfCode);
    $p_arr = getProfileInfo($ID);
    if (!$p_arr) {
        $_page['header'] = _t("_Error");
        $_page['header_text'] = _t("_Profile Not found");
        return MsgBox(_t('_Profile Not found Ex'));
    }
    $aCode = array('message_status' => '', 'message_info' => '', 'bx_if:form' => array('condition' => false, 'content' => array('form' => '')), 'bx_if:next' => array('condtion' => false, 'content' => array('next_url' => '')));
    if ($p_arr['Status'] == 'Unconfirmed') {
        $ConfCodeReal = base64_encode(base64_encode(crypt($p_arr[Email], CRYPT_EXT_DES ? "secret_co" : "se")));
        if (strcmp($ConfCode, $ConfCodeReal) != 0) {
            $aForm = array('form_attrs' => array('action' => BX_DOL_URL_ROOT . 'profile_activate.php', 'method' => 'post', 'name' => 'form_change_status'), 'inputs' => array('conf_id' => array('type' => 'hidden', 'name' => 'ConfID', 'value' => $ID), 'conf_code' => array('type' => 'text', 'name' => 'ConfCode', 'value' => '', 'caption' => _t("_Confirmation code")), 'submit' => array('type' => 'submit', 'name' => 'submit', 'value' => _t("_Submit"))));
            $oForm = new BxTemplFormView($aForm);
            $aCode['message_status'] = _t("_Profile activation failed");
            $aCode['message_info'] = _t("_EMAIL_CONF_FAILED_EX");
            $aCode['bx_if:form']['condition'] = true;
            $aCode['bx_if:form']['content']['form'] = $oForm->getCode();
        } else {
            $aCode['bx_if:next']['condition'] = true;
            $aCode['bx_if:next']['content']['next_url'] = BX_DOL_URL_ROOT . 'member.php';
            $send_act_mail = false;
            if (getParam('autoApproval_ifJoin') == 'on' && !(getParam('sys_dnsbl_enable') && 'approval' == getParam('sys_dnsbl_behaviour') && bx_is_ip_dns_blacklisted('', 'join'))) {
                $status = 'Active';
                $send_act_mail = true;
                $aCode['message_info'] = _t("_PROFILE_CONFIRM");
            } else {
                $status = 'Approval';
                $aCode['message_info'] = _t("_EMAIL_CONF_SUCCEEDED", $site['title']);
            }
            $update = bx_admin_profile_change_status($ID, $status, $send_act_mail);
            // Promotional membership
            if (getParam('enable_promotion_membership') == 'on') {
                $memership_days = getParam('promotion_membership_days');
                setMembership($p_arr['ID'], MEMBERSHIP_ID_PROMOTION, $memership_days, true);
            }
            // check couple profile;
            if ($p_arr['Couple']) {
                $update = bx_admin_profile_change_status($p_arr['Couple'], $status);
                //Promotional membership
                if (getParam('enable_promotion_membership') == 'on') {
                    $memership_days = getParam('promotion_membership_days');
                    setMembership($p_arr['Couple'], MEMBERSHIP_ID_PROMOTION, $memership_days, true);
                }
            }
            if (getParam('newusernotify')) {
                $oEmailTemplates = new BxDolEmailTemplates();
                $aTemplate = $oEmailTemplates->getTemplate('t_UserConfirmed', $p_arr['ID']);
                sendMail($site['email_notify'], $aTemplate['Subject'], $aTemplate['Body'], $p_arr['ID']);
            }
        }
    } else {
        $aCode['message_info'] = _t('_ALREADY_ACTIVATED');
    }
    return $GLOBALS['oSysTemplate']->parseHtmlByName('profile_activate.html', $aCode);
}
예제 #2
0
/**
 * page code function
 */
function PageCompPageMainCode($iLoggedID)
{
    $member['ID'] = (int) $iLoggedID;
    $p_arr = getProfileInfo($member['ID']);
    if ($_POST['CHANGE_STATUS']) {
        $sStatus = "";
        switch ($_POST['CHANGE_STATUS']) {
            case 'SUSPEND':
                if ($p_arr['Status'] == 'Active') {
                    $sStatus = "Suspended";
                }
                break;
            case 'ACTIVATE':
                if ($p_arr['Status'] == 'Suspended') {
                    $sStatus = "Active";
                }
                break;
        }
        if (!empty($sStatus)) {
            bx_admin_profile_change_status($member['ID'], $sStatus);
        }
        $p_arr = getProfileInfo($member['ID']);
    }
    $aData = array('profile_status_caption' => _t("_Profile status"), 'status' => $p_arr['Status'], 'status_lang_key' => _t('__' . $p_arr['Status']));
    $aForm = array('form_attrs' => array('action' => BX_DOL_URL_ROOT . 'change_status.php', 'method' => 'post', 'name' => 'form_change_status'), 'inputs' => array('status' => array('type' => 'hidden', 'name' => 'CHANGE_STATUS', 'value' => ''), 'subscribe' => array('type' => 'submit', 'name' => 'subscribe', 'value' => '')));
    switch ($p_arr['Status']) {
        case 'Active':
            $aForm['inputs']['status']['value'] = 'SUSPEND';
            $aForm['inputs']['subscribe']['value'] = _t('_Suspend account');
            $oForm = new BxTemplFormView($aForm);
            $aData['form'] = $oForm->getCode();
            $aData['message'] = _t("_PROFILE_CAN_SUSPEND");
            break;
        case 'Suspended':
            $aForm['inputs']['status']['value'] = 'ACTIVATE';
            $aForm['inputs']['subscribe']['value'] = _t('_Activate account');
            $oForm = new BxTemplFormView($aForm);
            $aData['form'] = $oForm->getCode();
            $aData['message'] = _t("_PROFILE_CAN_ACTIVATE");
            break;
        default:
            $aData['message'] = _t("_PROFILE_CANT_ACTIVATE/SUSPEND");
            $aData['form'] = '';
            break;
    }
    return $GLOBALS['oSysTemplate']->parseHtmlByName('change_status.html', $aData);
}
예제 #3
0
define('BX_DOL_ADM_MP_VIEW', 'simple');
define('BX_DOL_ADM_MP_JS_NAME', 'oMP');
define('BX_DOL_ADM_MP_PER_PAGE', 50);
define('BX_DOL_ADM_MP_PER_PAGE_STEP', 16);
$logged['admin'] = member_auth(1, true, true);
$sCtlType = isset($_POST['adm-mp-members-ctl-type']) && in_array($_POST['adm-mp-members-ctl-type'], array('qlinks', 'browse', 'calendar', 'tags', 'search')) ? $_POST['adm-mp-members-ctl-type'] : BX_DOL_ADM_MP_CTL;
$aCtlType = array();
$sViewType = isset($_POST['adm-mp-members-view-type']) && in_array($_POST['adm-mp-members-view-type'], array('geeky', 'simple', 'extended')) ? $_POST['adm-mp-members-view-type'] : BX_DOL_ADM_MP_VIEW;
//--- Process Actions ---//
if (isset($_POST['adm-mp-activate']) && (bool) $_POST['members']) {
    bx_admin_profile_change_status($_POST['members'], 'Active', TRUE);
    echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>";
    exit;
} else {
    if (isset($_POST['adm-mp-deactivate']) && (bool) $_POST['members']) {
        bx_admin_profile_change_status($_POST['members'], 'Approval');
        echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>";
        exit;
    } else {
        if (isset($_POST['adm-mp-ban']) && (bool) $_POST['members']) {
            $iBanDuration = isset($_POST['adm-mp-members-ban-duration']) ? (int) $_POST['adm-mp-members-ban-duration'] : 0;
            foreach ($_POST['members'] as $iId) {
                bx_admin_profile_ban_control($iId, true, $iBanDuration);
            }
            echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>";
            exit;
        } else {
            if (isset($_POST['adm-mp-unban']) && (bool) $_POST['members']) {
                bx_import('BxDolForm');
                $oChecker = new BxDolFormCheckerHelper();
                $GLOBALS['MySQL']->query("DELETE FROM `sys_admin_ban_list` WHERE `ProfID` IN ('" . implode("','", $oChecker->passInt($_POST['members'])) . "')");
예제 #4
0
/**
 * Change profile status
 *
 * @param $iTargetId integer
 * @param $sAction string
 * @return HTML - code for ajax popup
 */
function _setStatus($iTargetId, $sAction)
{
    $sStatus = 'Approval';
    $bSendActMail = FALSE;
    $sMsg = '_Error';
    if ($sAction == 'activate') {
        $sStatus = 'Active';
        $bSendActMail = TRUE;
    }
    if (bx_admin_profile_change_status($iTargetId, $sStatus, $bSendActMail)) {
        $sMsg = '_Success';
    }
    return MsgBox(_t($sMsg));
}