Ejemplo n.º 1
0
/**
 * page code function
 */
function getMainCode()
{
    global $_page;
    $member['ID'] = getLoggedId();
    $member['Password'] = getLoggedPassword;
    if (false != bx_get('ConfCode') && false != bx_get('sendto')) {
        $recipientID = (int) bx_get('sendto');
    } else {
        //check post value
        $recipientID = isset($_POST['sendto']) ? $_POST['sendto'] : -1;
    }
    $recipient = getProfileInfo($recipientID);
    $isCheckVisitorGreeting = true;
    if (!$recipient || $recipientID == $member['ID']) {
        return MsgBox(_t('_Error Occured'));
    }
    ob_start();
    ?>
    <table width="100%" cellpadding="4" cellspacing="4" border="0">
        <tr>
            <td align="center" class="text2">__content__<br /></td>
        </tr>
    </table>
    <?php 
    $sResTmpl = ob_get_clean();
    $ret = '';
    $sKissKey = '_Send virtual kiss';
    $sJQueryJS = genAjaxyPopupJS($recipientID);
    $_page['header'] = _t($sKissKey);
    if ($_GET['ConfCode'] && $_GET['from'] && strcmp($_GET['ConfCode'], base64_encode(base64_encode(crypt($_GET['from'], CRYPT_EXT_DES ? "vkiss_sec" : "vk")))) === 0) {
        $member['ID'] = (int) $_GET['from'];
        $isCheckVisitorGreeting = false;
    }
    //
    // Check if member can send messages
    $check_res = checkAction($member['ID'], ACTION_ID_SEND_VKISS);
    if ($check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED) {
        $_page['header_text'] = _t($sKissKey . '3');
        $ret = $GLOBALS['oSysTemplate']->parseHtmlByContent($sResTmpl, array('content' => $check_res[CHECK_ACTION_MESSAGE]));
        return $ret . $sJQueryJS;
    }
    $action_result = "";
    // Perform sending
    $send_result = MemberSendVKiss($member, $recipient, $isCheckVisitorGreeting);
    switch ($send_result) {
        case 1:
            $action_result .= _t_err("_VKISS_BAD");
            break;
        case 7:
            $action_result .= _t_err("_VKISS_BAD_COUSE_B");
            break;
        case 10:
            $action_result .= _t_err("_VKISS_BAD_COUSE_C");
            break;
        case 13:
            $action_result .= _t_err("_VKISS_BAD_COUSE_A3");
            break;
        case 23:
            $action_result .= _t_err("_VKISS_BAD_COUSE_X");
            break;
        case 24:
            $action_result .= _t_err("_VKISS_BAD_COUSE_Y");
            break;
        default:
            $action_result .= _t("_VKISS_OK");
            break;
    }
    if ($send_result == 0) {
        $_page['header_text'] = _t($sKissKey . '2');
    } else {
        $_page['header_text'] = _t($sKissKey . '3');
    }
    $ret = $GLOBALS['oSysTemplate']->parseHtmlByContent($sResTmpl, array('content' => $action_result));
    return $ret . $sJQueryJS;
}
Ejemplo n.º 2
0
 function actionAlbumDelete($sAlbumUri)
 {
     $sLangPref = '_' . $this->_oConfig->getMainPrefix();
     $aAlbumInfo = $this->oAlbums->getAlbumInfo(array('fileUri' => $sAlbumUri));
     if (!$this->isAllowedDeleteAlbum($aAlbumInfo['ID'], $aAlbumInfo)) {
         $sMessage = _t($sLangPref . '_access_denied');
     } else {
         $iCount = $this->_deleteAlbumUnits($aAlbumInfo['ID']);
         if ($iCount > 0) {
             $sMessage = _t($sLangPref . '_album_delete_error', $iCount);
         } else {
             $sMessage = _t($sLangPref . '_album_delete_success');
             $this->oAlbums->removeAlbum($aAlbumInfo['ID']);
             $sRedirect = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'albums/';
             if ($this->_iProfileId != $aAlbumInfo['Owner']) {
                 $sRedirect .= 'browse/all/';
             } else {
                 $sRedirect .= 'my/main/';
             }
             $sJQueryJS = genAjaxyPopupJS($aAlbumInfo['ID'], 'ajaxy_popup_result_div', $sRedirect);
         }
     }
     header('Content-Type: text/html; charset=UTF-8');
     echo MsgBox($sMessage) . $sJQueryJS;
     exit;
 }
Ejemplo n.º 3
0
function showAjaxModeResult($sMessage, $iId)
{
    header('Content-Type: text/html; charset=utf-8');
    echo MsgBox($sMessage) . genAjaxyPopupJS($iId);
    exit;
}
Ejemplo n.º 4
0
 function actionFeatured($iSiteId)
 {
     $iSiteId = (int) $iSiteId;
     if (!($aSite = $this->_oDb->getSiteById($iSiteId))) {
         $this->_oTemplate->displayPageNotFound(_t('_bx_sites_featured_top_menu_sitem'));
         return;
     }
     header('Content-Type: text/html; charset=utf-8');
     if (!$this->isAllowedMarkAsFeatured($aSite)) {
         echo MsgBox(_t('_bx_events_msg_access_denied')) . genAjaxyPopupJS($iSiteId, 'ajaxy_popup_result_div');
         exit;
     }
     if ($this->_oDb->markFeatured($iSiteId)) {
         $this->isAllowedMarkAsFeatured($aSite, true);
         $sRedirect = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aSite['entryUri'];
         $sJQueryJS = genAjaxyPopupJS($iSiteId, 'ajaxy_popup_result_div', $sRedirect);
         echo MsgBox($aSite['featured'] ? _t('_bx_sites_msg_removed_from_featured') : _t('_bx_sites_msg_added_to_featured')) . $sJQueryJS;
         exit;
     }
     echo MsgBox(_t('_bx_sites_error_occured')) . genAjaxyPopupJS($iSiteId, 'ajaxy_popup_result_div');
     exit;
 }
Ejemplo n.º 5
0
 function actionSetAvatar($iPhotoID)
 {
     if ($this->serviceSetAvatar($iPhotoID)) {
         $aInfo = $this->_oDb->getFileInfo(array('fileId' => $iPhotoID));
         $sRedirect = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aInfo['medUri'];
         $sJQueryJS = genAjaxyPopupJS($iPhotoID, 'ajaxy_popup_result_div', $sRedirect);
         $sLangKey = '_Success';
     } else {
         $sJQueryJS = genAjaxyPopupJS($iPhotoID, 'ajaxy_popup_result_div');
         $sLangKey = '_Error occured';
     }
     header('Content-Type: text/html; charset=UTF-8');
     echo MsgBox(_t($sLangKey)) . $sJQueryJS;
     exit;
 }
Ejemplo n.º 6
0
 function _actionJoin($iEntryId, $iProfileId, $sMsgAlreadyJoined, $sMsgAlreadyJoinedPending, $sMsgJoinSuccess, $sMsgJoinSuccessPending, $sMsgLeaveSuccess)
 {
     header('Content-type:text/html;charset=utf-8');
     $iEntryId = (int) $iEntryId;
     if (!($aDataEntry = $this->_oDb->getEntryByIdAndOwner($iEntryId, 0, true))) {
         echo MsgBox(_t('_sys_request_page_not_found_cpt')) . genAjaxyPopupJS($iEntryId, 'ajaxy_popup_result_div');
         exit;
     }
     if (!$this->isAllowedJoin($aDataEntry) || 0 != strcasecmp($_SERVER['REQUEST_METHOD'], 'POST')) {
         echo MsgBox(_t('_Access denied')) . genAjaxyPopupJS($iEntryId, 'ajaxy_popup_result_div');
         exit;
     }
     $isFan = $this->_oDb->isFan($iEntryId, $this->_iProfileId, true) || $this->_oDb->isFan($iEntryId, $this->_iProfileId, false);
     if ($isFan) {
         if ($this->_oDb->leaveEntry($iEntryId, $this->_iProfileId)) {
             $sRedirect = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aDataEntry[$this->_oDb->_sFieldUri];
             echo MsgBox($sMsgLeaveSuccess) . genAjaxyPopupJS($iEntryId, 'ajaxy_popup_result_div', $sRedirect);
             exit;
         }
     } else {
         $isConfirmed = $this->isEntryAdmin($aDataEntry) || !$aDataEntry[$this->_oDb->_sFieldJoinConfirmation] ? true : false;
         if ($this->_oDb->joinEntry($iEntryId, $this->_iProfileId, $isConfirmed)) {
             if ($isConfirmed) {
                 $this->onEventJoin($iEntryId, $this->_iProfileId, $aDataEntry);
                 $sRedirect = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aDataEntry[$this->_oDb->_sFieldUri];
             } else {
                 $this->onEventJoinRequest($iEntryId, $this->_iProfileId, $aDataEntry);
                 $sRedirect = '';
             }
             echo MsgBox($isConfirmed ? $sMsgJoinSuccess : $sMsgJoinSuccessPending) . genAjaxyPopupJS($iEntryId, 'ajaxy_popup_result_div', $sRedirect);
             exit;
         }
     }
     echo MsgBox(_t('_Error Occured')) . genAjaxyPopupJS($iEntryId, 'ajaxy_popup_result_div');
     exit;
 }
Ejemplo n.º 7
0
 function actionAlbumDelete($sAlbumUri)
 {
     $aAlbumInfo = $this->oAlbums->getAlbumInfo(array('fileUri' => $sAlbumUri), array('ID', 'Owner'));
     if ((int) $aAlbumInfo['Owner'] != $this->_iProfileId) {
         $sMessage = _t('_' . $this->_oConfig->getMainPrefix() . '_access_denied');
     } else {
         $iCount = $this->_deleteAlbumUnits((int) $aAlbumInfo['ID']);
         if ($iCount > 0) {
             $sMessage = _t('_' . $this->_oConfig->getMainPrefix() . '_album_delete_error', $iCount);
         } else {
             $sMessage = _t('_' . $this->_oConfig->getMainPrefix() . '_album_delete_success');
             $this->oAlbums->removeAlbum((int) $aAlbumInfo['ID']);
             $sRedirect = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'albums/my/';
             $sJQueryJS = genAjaxyPopupJS(1, 'ajaxy_popup_result_div', $sRedirect);
         }
     }
     echo MsgBox($sMessage, 1) . $sJQueryJS;
     exit;
 }
Ejemplo n.º 8
0
 function actionActivate($iEntryId)
 {
     header('Content-type:text/html;charset=utf-8');
     $iEntryId = (int) $iEntryId;
     if (!($aDataEntry = $this->_oDb->getEntryByIdAndOwner($iEntryId, 0, true))) {
         echo MsgBox(_t('_sys_request_page_not_found_cpt')) . genAjaxyPopupJS($iEntryId, 'ajaxy_popup_result_div');
         exit;
     }
     if (!$this->isAllowedActivate($aDataEntry) || 0 != strcasecmp($_SERVER['REQUEST_METHOD'], 'POST')) {
         echo MsgBox(_t('_Access denied')) . genAjaxyPopupJS($iEntryId, 'ajaxy_popup_result_div');
         exit;
     }
     if ($this->_oDb->activateEntry($iEntryId)) {
         $this->isAllowedActivate($aDataEntry, true);
         $sRedirect = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aDataEntry[$this->_oDb->_sFieldUri];
         echo MsgBox(_t('_Success')) . genAjaxyPopupJS($iEntryId, 'ajaxy_popup_result_div', $sRedirect);
         exit;
     }
     echo MsgBox(_t('_Error Occured')) . genAjaxyPopupJS($iEntryId, 'ajaxy_popup_result_div');
     exit;
 }
Ejemplo n.º 9
0
 /**
  * Method for ajax approval / disaproval from action button ;
  *
  * @return : (text) - Html response ;
  */
 function actionApprove($iPollId, $iApprove = 1)
 {
     $iPollId = (int) $iPollId;
     if ($iPollId) {
         $iActionerId = getLoggedId();
         $iApprove = (int) $iApprove;
         $sJQueryJS = genAjaxyPopupJS($iPollId);
         if (isAdmin($iActionerId) || isModerator($iActionerId)) {
             if (!$this->_oDb->setStatus($iPollId, $iApprove)) {
                 $sMsg = '_Error';
             } else {
                 $sMsg = '_Saved';
             }
         } else {
             $sMsg = '_Access denied';
         }
         header('Content-Type: text/html; charset=UTF-8');
         echo MsgBox(_t($sMsg)) . $sJQueryJS;
         exit;
     }
 }
Ejemplo n.º 10
0
/**
 * Perform admin or moderator actions
 *
 * @param $sAction string
 * @param $iViewerId integer
 * @param $iTargetId integer
 * @return mixed - HTML code or FALSE
 */
function PageListControl($sAction, $iViewerId, $iTargetId)
{
    $sAction = clear_xss($sAction);
    $iViewerId = (int) $iViewerId;
    $iTargetId = (int) $iTargetId;
    $mixedRes = FALSE;
    $sMsg = '_Error';
    if (isAdmin($iViewerId) or isModerator($iViewerId) and $iViewerId != $iTargetId) {
        switch ($sAction) {
            case 'activate':
            case 'deactivate':
                $mixedRes = _setStatus($iTargetId, $sAction);
                break;
            case 'ban':
                if (bx_admin_profile_ban_control($iTargetId)) {
                    $sMsg = '_Success';
                }
                $mixedRes = MsgBox(_t($sMsg));
                break;
            case 'unban':
                if (bx_admin_profile_ban_control($iTargetId, FALSE)) {
                    $sMsg = '_Success';
                }
                $mixedRes = MsgBox(_t($sMsg));
                break;
            case 'featured':
            case 'unfeatured':
                $mixedRes = _setFeature($iTargetId, $sAction);
                break;
            case 'delete':
                profile_delete($iTargetId);
                $mixedRes = MsgBox(_t('_Success')) . genAjaxyPopupJS($iTargetId, 'ajaxy_popup_result_div', BX_DOL_URL_ROOT . 'browse.php');
                break;
            case 'delete_spam':
                profile_delete($iTargetId, TRUE);
                $mixedRes = MsgBox(_t('_Success')) . genAjaxyPopupJS($iTargetId, 'ajaxy_popup_result_div', BX_DOL_URL_ROOT . 'browse.php');
                break;
            default:
        }
    }
    return $mixedRes;
}
Ejemplo n.º 11
0
function showAjaxModeResult($sMessage, $iId)
{
    $sJQueryJS = genAjaxyPopupJS($iId);
    echo MsgBox($sMessage) . $sJQueryJS;
    exit;
}
Ejemplo n.º 12
0
require_once BX_DIRECTORY_PATH_INC . 'profiles.inc.php';
require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolEmailTemplates.php';
$_page['name_index'] = 44;
$_ni = $_page['name_index'];
// check logged
$logged['member'] = member_auth(0);
//get logged profile's id
$iProfileId = getLoggedId();
//-- process some internal vars --//
$iTargetId = isset($_POST['ID']) ? (int) $_POST['ID'] : 0;
$sTargetsId = isset($_POST['list_id']) ? $_POST['list_id'] : '';
$sAction = false != bx_get('action') ? bx_get('action') : '';
//--
//define ajax mode
$bAjxMod = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' ? true : false;
$sJQueryJS = $bAjxMod ? genAjaxyPopupJS($iTargetId) : '';
//-- process actions --//
switch ($sAction) {
    //generate member menu position settings
    case 'extra_menu':
        $sPageCaption = _t('_Member menu position');
        $_page['header'] = $sPageCaption;
        $GLOBALS['_page_cont'][$_ni]['page_main_code'] = DesignBoxContent($sPageCaption, PageListMemberMenuSettings($iProfileId, $sAction), $oTemplConfig->PageListPop_db_num);
        break;
        //block profile
    //block profile
    case 'block':
        if ($bAjxMod) {
            echo PageListBlock($iProfileId, $iTargetId) . $sJQueryJS;
            exit;
        }
Ejemplo n.º 13
0
$_page['name_index'] = 44;
$_ni = $_page['name_index'];
// check logged
$logged['member'] = member_auth(0);
//get logged profile's id
$iProfileId = getLoggedId();
//-- process some internal vars --//
$iTargetId = isset($_POST['ID']) ? (int) $_POST['ID'] : 0;
$sTargetsId = isset($_POST['list_id']) ? $_POST['list_id'] : '';
$sAction = false != bx_get('action') ? bx_get('action') : '';
//--
//define ajax mode
$bAjxMod = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' ? true : false;
$sJQueryJS = '';
if ($bAjxMod) {
    $sJQueryJS = genAjaxyPopupJS($iTargetId);
    header('Content-Type: text/html; charset=utf-8');
}
//-- process actions --//
switch ($sAction) {
    //generate member menu position settings
    case 'extra_menu':
        $sPageCaption = _t('_Member menu position');
        $_page['header'] = $sPageCaption;
        $GLOBALS['_page_cont'][$_ni]['page_main_code'] = DesignBoxContent($sPageCaption, PageListMemberMenuSettings($iProfileId, $sAction), $oTemplConfig->PageListPop_db_num);
        break;
        //block profile
    //block profile
    case 'block':
        if ($bAjxMod) {
            echo PageListBlock($iProfileId, $iTargetId) . $sJQueryJS;