Beispiel #1
0
					<?php 
            }
            ?>
				</div>

			<?php 
            $categories = JB_getCatStruct($_REQUEST['cat'], $_SESSION["LANG"], 2);
            JB_display_categories($categories, JB_CAT_COLS);
            break;
        }
    }
    ##############################################\
    $is_blocked = 'N';
    switch (JB_FIELD_BLOCK_SWITCH) {
        case 'YES':
            $subscr_block_status = JB_get_employer_view_block_status($_SESSION['JB_ID']);
            if ($subscr_block_status == 'N' && JB_SUBSCRIPTION_FEE_ENABLED == 'YES' && !$key_test_passed) {
                echo "<p>" . $label["resume_some_fields_blocked"] . "</p>";
                echo JBEmployer::JB_get_special_offer_msg();
                $is_blocked = 'Y';
            }
            break;
        case 'NO':
            break;
    }
    $REQUEST_FEATURE == false;
    switch (JB_RESUME_REQUEST_SWITCH) {
        case 'YES':
            //
            if (JB_NEED_SUBSCR_FOR_REQUEST == 'YES') {
                $subscr_status = JB_get_employer_subscription_status($_SESSION['JB_ID']);
Beispiel #2
0
function JB_process_field_restrictions(&$data, &$row, $mode = 'view', $admin = false, $viewer_user_id = false, $viewer_domain = false)
{
    if ($admin) {
        return false;
    }
    // not restricted for admin
    global $label;
    $is_restricted = false;
    if (!$viewer_user_id) {
        if (isset($_SESSION['JB_ID']) && $_SESSION['JB_ID']) {
            $viewer_user_id = $_SESSION['JB_ID'];
        }
    }
    if (!$viewer_domain) {
        if (isset($_SESSION['JB_Domain']) && $_SESSION['JB_Domain']) {
            $viewer_domain = $_SESSION['JB_Domain'];
        }
    }
    $DFM =& JB_get_DynamicFormMarkupObject($mode);
    //  HTML formatting
    // there is no need to restrict fields which are empty
    if (strlen(trim($data[$row['field_id']])) === 0) {
        return false;
    }
    ################################################################
    # Block Anonymous fields
    # These filds can be on the resume only.
    if (JB_RESUME_REQUEST_SWITCH == 'YES') {
        if ($data['anon'] == 'Y' && $mode == 'view' && $viewer_domain == 'EMPLOYER') {
            if ($row['is_anon'] == 'Y' && JB_is_request_granted($data['user_id'], $viewer_user_id) !== true) {
                // replace with a 'this field is anonymous' note
                if ($row['field_type'] == 'IMAGE') {
                    $data[$row['field_id']] = $DFM->get_image_anonymous_note($data['user_id']);
                } else {
                    $data[$row['field_id']] = $DFM->get_anonymous_note($data['user_id']);
                }
                $is_restricted = true;
                //return true;
            }
        }
    }
    #########################
    # Block Blocked fields
    # This is for the resume only, for the logged in employer
    if (JB_FIELD_BLOCK_SWITCH == 'YES' && $row['is_blocked'] == 'Y') {
        global $key_test_passed;
        if ($mode == 'view' && $viewer_domain == 'EMPLOYER' && !$key_test_passed) {
            $subscr_block_status = JB_get_employer_view_block_status($viewer_user_id);
            if ($subscr_block_status == 'N') {
                // replace with a 'this field is blocked' note
                $data[$row['field_id']] = $DFM->get_blocked_note($data['user_id']);
                $is_restricted = true;
                //return true;
            }
        }
    }
    #########################
    # fields that are marked "Member's Only"
    if (JB_MEMBER_FIELD_SWITCH == 'YES') {
        $member_view_status = JB_get_member_view_status($viewer_user_id, $viewer_domain);
        if ($row['is_member'] == 'Y' && $member_view_status == 'N') {
            if ($data['post_mode'] == 'premium' && JB_MEMBER_FIELD_IGNORE_PREMIUM == 'YES') {
                // ignore for premium posts
            } else {
                $data[$row['field_id']] = $DFM->get_membership_note();
                $is_restricted = true;
            }
        }
    }
    # For plugin authors: You can block / restrict your own fields by using a plugin
    # See the comments at the top of this function for a description of the parameters.
    #
    # The idea is that your plugin would modify the apropriate $data[$field_id] values with the
    # blocked message instead of the field data, depending on the settings in $row, $mode and $admin
    $original_value = $data[$row['field_id']];
    // store the original value to compare after return from the plugin
    JBPLUG_do_callback('process_field_restrictions', $data, $row, $mode, $admin);
    if (strcmp($original_value, $data[$row['field_id']]) !== 0) {
        $is_restricted = true;
        //return true; // return true if the value was changed (changed by a plugin in this case)
    }
    return $is_restricted;
}