예제 #1
0
 function getProfileViewActions($iProfileId, $bDynamic = false)
 {
     global $oTemplConfig;
     $iProfileId = (int) $iProfileId;
     if (!$iProfileId) {
         return '';
     }
     $aProfileInfo = getProfileInfo($iProfileId);
     if (empty($aProfileInfo)) {
         return '';
     }
     $iViewerId = getLoggedId();
     // prepare all needed keys
     $aConfig = array('url' => BX_DOL_URL_ROOT, 'anonym_mode' => '', 'member_id' => $iViewerId, 'member_pass' => getPassword($iViewerId));
     $aMainKeys = array('cpt_edit', 'cpt_send_letter', 'cpt_fave', 'cpt_befriend', 'cpt_remove_friend', 'cpt_get_mail', 'cpt_share', 'cpt_report', 'cpt_block', 'cpt_unblock', 'cpt_activate', 'cpt_ban', 'cpt_delete', 'cpt_delete_spam', 'cpt_feature', 'act_activate', 'act_ban', 'act_feature');
     $aMain = array_fill_keys($aMainKeys, '');
     if (isMember($iViewerId)) {
         $aMain['cpt_edit'] = _t('_EditProfile');
         $aMain['cpt_send_letter'] = _t('_SendLetter');
         $aMain['cpt_fave'] = _t('_Fave');
         $aMain['cpt_remove_fave'] = _t('_Remove Fave');
         $aMain['cpt_befriend'] = _t('_Befriend');
         $aMain['cpt_remove_friend'] = _t('_Remove friend');
         $aMain['cpt_get_mail'] = _t('_Get E-mail');
         $aMain['cpt_share'] = $this->isAllowedShare($this->_aProfile) ? _t('_Share') : '';
         $aMain['cpt_report'] = _t('_Report Spam');
         $aMain['cpt_block'] = _t('_Block');
         $aMain['cpt_unblock'] = _t('_Unblock');
     }
     if (isAdmin($iViewerId) || isModerator($iViewerId) and $iViewerId != $iProfileId) {
         $sMsgKeyStart = '_adm_btn_mp_';
         // delete
         $aMain['cpt_delete'] = _t($sMsgKeyStart . 'delete');
         // delete spam
         $aMain['cpt_delete_spam'] = _t($sMsgKeyStart . 'delete_spammer');
         // activate / deactivate
         $sTypeActiv = 'activate';
         if ($aProfileInfo['Status'] == 'Active') {
             $sTypeActiv = 'de' . $sTypeActiv;
         }
         $aMain['cpt_activate'] = _t($sMsgKeyStart . $sTypeActiv);
         $aMain['act_activate'] = $sTypeActiv;
         // ban / unban
         $sTypeBan = 'ban';
         if (isLoggedBanned($aProfileInfo['ID'])) {
             $sTypeBan = 'un' . $sTypeBan;
         }
         $aMain['cpt_ban'] = _t($sMsgKeyStart . $sTypeBan);
         $aMain['act_ban'] = $sTypeBan;
         // feature / unfeature
         $sTypeFeat = 'featured';
         $aMain['cpt_feature'] = _t('_Feature it');
         if ((int) $aProfileInfo['Featured']) {
             $sTypeFeat = 'un' . $sTypeFeat;
             $aMain['cpt_feature'] = _t('_De-Feature it');
         }
         $aMain['act_feature'] = $sTypeFeat;
     }
     //--- Subscription integration ---//
     $oSubscription = BxDolSubscription::getInstance();
     $sAddon = $oSubscription->getData($bDynamic);
     $aButton = $oSubscription->getButton($iViewerId, 'profile', '', $iProfileId);
     $aMain['sbs_profile_title'] = $aButton['title'];
     $aMain['sbs_profile_script'] = $aButton['script'];
     //--- Subscription integration ---//
     $aCheckGreet = checkAction(getLoggedId(), ACTION_ID_SEND_VKISS);
     $aMain['cpt_greet'] = $aCheckGreet[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED ? _t('_Greet') : '';
     $aMain = array_merge($aProfileInfo, $aConfig, $aMain);
     return $sAddon . $this->genObjectsActions($aMain, 'Profile');
 }
    ?>
			</td>
			
			<td align="center">Photos</td>
			<td align="center">Audio</td>
			<td align="center">BGs</td>
			<td align="center" <?php 
    echo $sMemLevelShow;
    ?>
 style="display:none;">Membership</td>
		</tr>
	<?php 
    while ($p_arr = mysql_fetch_array($result)) {
        $col = "table";
        $sEmail = $p_arr['Status'] == 'Unconfirmed' ? '<span style="background-color: #FF6666;">' . $p_arr['Email'] . '</span>' : '<span style="background-color:' . $sActEmColor . ';">' . $p_arr['Email'] . '</span>';
        $sBannedColor = isLoggedBanned($p_arr['ID']) == true ? '#F99' : '#fff';
        ?>

		<tr class=<?php 
        echo $col;
        ?>
 style="background-color: <?php 
        echo $sBannedColor;
        ?>
;">
			<td align="center">
				<input type=checkbox name="<?php 
        echo $p_arr[ID];
        ?>
" />
			</td>
function make_check_ban()
{
    //Make automatically logout for Banned members
    if (isLoggedBanned((int) $_COOKIE['memberID'])) {
        setcookie('memberID', $_COOKIE['memberID'], time() - 48 * 3600, '/');
        setcookie('memberPassword', $_COOKIE['memberPassword'], time() - 48 * 3600, '/');
    }
}
예제 #4
0
function check_login($ID, $passwd, $iRole = BX_DOL_ROLE_MEMBER, $error_handle = true)
{
    $ID = (int) $ID;
    if (!$ID) {
        if ($error_handle) {
            login_form(_t("_PROFILE_ERR"), $member);
        }
        return false;
    }
    switch ($iRole) {
        case BX_DOL_ROLE_MEMBER:
            $member = 0;
            break;
        case BX_DOL_ROLE_ADMIN:
            $member = 1;
            break;
    }
    $aProfile = getProfileInfo($ID);
    // If no such members
    if (!$aProfile) {
        if ($error_handle) {
            login_form(_t("_PROFILE_ERR"), $member);
        }
        return false;
    }
    // If password is incorrect
    if (strcmp($aProfile['Password'], $passwd) != 0) {
        if ($error_handle) {
            login_form(_t("_INVALID_PASSWD"), $member);
        }
        return false;
    }
    if (!((int) $aProfile['Role'] & $iRole)) {
        if ($error_handle) {
            login_form(_t("_INVALID_ROLE"), $member);
        }
        return false;
    }
    if ((int) $aProfile['Role'] & BX_DOL_ROLE_ADMIN || (int) $aProfile['Role'] & BX_DOL_ROLE_MODERATOR) {
        if ('on' != getParam('ext_nav_menu_enabled')) {
            update_date_lastnav($ID);
        }
        return true;
    }
    // if IP is banned
    if (2 == getParam('ipBlacklistMode') && bx_is_ip_blocked() || 'on' == getParam('sys_dnsbl_enable') && 'block' == getParam('sys_dnsbl_behaviour') && bx_is_ip_dns_blacklisted('', 'login')) {
        if ($error_handle) {
            $GLOBALS['_page']['name_index'] = 55;
            $GLOBALS['_page']['css_name'] = '';
            $GLOBALS['_ni'] = $GLOBALS['_page']['name_index'];
            $GLOBALS['_page_cont'][$GLOBALS['_ni']]['page_main_code'] = MsgBox(_t('_Sorry, your IP been banned'));
            PageCode();
        }
        return false;
    }
    // if profile is banned
    if (isLoggedBanned($aProfile['ID'])) {
        if ($error_handle) {
            $GLOBALS['_page']['name_index'] = 55;
            $GLOBALS['_page']['css_name'] = '';
            $GLOBALS['_ni'] = $GLOBALS['_page']['name_index'];
            $GLOBALS['_page_cont'][$GLOBALS['_ni']]['page_main_code'] = MsgBox(_t('_member_banned'));
            PageCode();
        }
        return false;
    }
    if ('on' != getParam('ext_nav_menu_enabled')) {
        update_date_lastnav($ID);
    }
    return true;
}
예제 #5
0
$member['ID'] = $_POST['ID'];
$member['Password'] = md5(process_pass_data($_POST['Password']));
$bAjxMode = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) and $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') ? true : false;
if (!($_POST['ID'] && $_POST['Password']) && ($_COOKIE['memberID'] && $_COOKIE['memberPassword'])) {
    if (!($logged['member'] = member_auth(0, false))) {
        login_form(_t("_LOGIN_OBSOLETE"), 0, $bAjxMode);
    }
} else {
    if (!$_POST['ID'] && !$_POST['Password']) {
        // this is dynamic page -  send headers to do not cache this page
        send_headers_page_changed();
        $bAjxMode = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) and $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') ? true : false;
        login_form('', 0, $bAjxMode);
    } else {
        $member['ID'] = getID($member['ID']);
        if (isLoggedBanned($member['ID'])) {
            $_page['name_index'] = 55;
            $_page['css_name'] = '';
            $_ni = $_page['name_index'];
            $_page_cont[$_ni]['page_main_code'] = MsgBox(_t('_member_banned'));
            PageCode();
            exit;
        }
        // Check if ID and Password are correct (addslashes already inside)
        if (check_login($member['ID'], $member['Password'])) {
            $iCookieTime = 0;
            if (isset($_POST['rememberMe']) && $_POST['rememberMe']) {
                $iCookieTime = time() + 24 * 60 * 60 * 30;
            }
            setcookie("memberID", $_COOKIE['memberID'], time() - 24 * 60 * 60, '/');
            setcookie("memberPassword", $_COOKIE['memberPassword'], time() - 24 * 60 * 60, '/');