Forum Activity for @ultrajam

SteveX
@ultrajam
02/14/14 03:17:02AM
2,589 posts

Can't Signup


Using Jamroom

there is a section about email not being sent in the jr4 faq
SteveX
@ultrajam
02/13/14 01:46:13PM
2,589 posts

Reading the $_post


Jamroom Developers

@Paul - that was the short answer again ;)

@Natedogg265 - I've borrowed the name of this thread for a docs article. More $_post detail than any man can stand here:
https://www.jamroom.net/ultrajam/documentation/code/1683/reading-the-post
updated by @ultrajam: 02/13/14 01:46:39PM
SteveX
@ultrajam
02/13/14 09:51:32AM
2,589 posts

Marketplace updates- Sometimes have to install twice


Installation and Configuration

If I global $_mods; fdebug($_mods); jrDeveloper shows as [module_version] => 1.1.1

After running the integrity check with clear caches it shows as 1.1.2. Revisiting the marketplace and jrDeveloper no longer shows as needing an update.

So whatever the problem is it is fixed by running the integrity check, no need to update again.
updated by @ultrajam: 02/13/14 09:51:55AM
SteveX
@ultrajam
02/13/14 09:43:05AM
2,589 posts

Marketplace updates- Sometimes have to install twice


Installation and Configuration

Ah, returning to the marketplace I see a core update.

Installed that, The module was successfully updated, and it shows jrDeveloper still in need of updating.
SteveX
@ultrajam
02/13/14 09:40:11AM
2,589 posts

Marketplace updates- Sometimes have to install twice


Installation and Configuration

When I click the changelog I do see the 1.1.2 version of the changelog:

Quote: Developer Tools module changelog
Version 1.1.2: - Bug Fix: Clone Skin returning error that skin name must be 3 characters or longer

And when looking at the jrDeveloper info tab, that shows as version: 1.1.2
SteveX
@ultrajam
02/13/14 09:13:49AM
2,589 posts

jrCore_validate_location_url


Jamroom Developers

That works perfectly. Thanks Brian!
SteveX
@ultrajam
02/13/14 09:07:59AM
2,589 posts

Marketplace updates- Sometimes have to install twice


Installation and Configuration

This has just happened to me again.

I installed 4 module updates earlier today using the Update All button, it worked perfectly.

I just noticed a jrDeveloper update appear so clicked the Update All button (although there was only the one). The update appeared to install successfully, and success was reported in the modal, but when the page refreshes on closing the modal the update is still in the list of available updates.

The log reports that the update was successful as well:
Quote: 02/13/14 04:57:24PM 127.0.0.1 [SteveX] : all marketplace updates successfully installed
02/13/14 04:57:23PM 127.0.0.1 [SteveX] : successfully updated module jrDeveloper from version 1.1.1 to 1.1.2
02/13/14 04:57:19PM 127.0.0.1 [SteveX] : installing all marketplace updates

I then tried emptying caches and returning to Marketplace system updates, the update still shows as unapplied. The jrDeveloper-release-1.1.2 dir has been downloaded to the site, and the alias jrDeveloper shows as updated at the time I clicked update all.

I haven't clicked the update all or the update button since, so if there is anything you want me to check out just let me know.
SteveX
@ultrajam
02/13/14 07:26:41AM
2,589 posts

Music Charts not showing properly and counter not counting accordinaly


Design and Skin Customization

Put this into your chart row template, look at it over the course of a few days, and how the chart is working will be much clearer:
{if jrUser_is_master()}
chart_count: {$item.chart_count}
chart_position: {$item.chart_position}
chart_new_entry: {$item.chart_new_entry}
chart_change: {$item.chart_change}
chart_direction: {$item.chart_direction}
{/if}

updated by @ultrajam: 02/13/14 07:27:06AM
SteveX
@ultrajam
02/13/14 05:28:38AM
2,589 posts

jrCore_validate_location_url


Jamroom Developers

I have a delete button which is not on a profile, it is in a module view.

The delete fails on jrCore_validate_location_url(); so I’ve temporarily copied that function to ujModule_validate_location_url(); whilst figuring out why. If I comment out the validate_location_url check everything works fine, but it looks like I need a check for CSRF purposes?

It fails because $_COOKIE['jr_location_url'] {1} doesn’t exist. $_COOKIE looks like this:
Quote: (2014-02-13T13:09:09+00:00 0.07493000)-(mem: 9699328)-(pid: 31410)-(uri: /mymodule/section_delete/id=14)
Array
(
[sessb00dfd089f00] => d1i2n3fop8tuvg675r821qv5g7
[autob00dfd089f00] => 1-d2128387086991cc3398b8310c732a9d
)
Is jr_location_url missing because I am not on a profile?

How do I get jr_location_url into the cookie? Or should I be looking at another way around?

Thanks!


The delete function and jrCore_validate_location_url functions pasted below, but they are standard.

//------------------------------
// section_delete
//------------------------------
function view_ujModule_section_delete($_post, $_user, $_conf)
{ // Must be logged in jrUser_session_require_login(); ujModule_validate_location_url(); jrUser_check_quota_access('ujModule'); // Make sure we get a good id if (!isset($_post['id']) || !jrCore_checktype($_post['id'], 'number_nz')) { jrCore_notice_page('error', 'Invalid ID'); jrCore_form_result('referrer'); } $_rt = jrCore_db_get_item('ujModule', $_post['id']); // Make sure the calling user has permission to delete this item if (!jrUser_can_edit_item($_rt)) { jrUser_not_authorized(); } jrCore_db_delete_item('ujModule', $_post['id']); jrProfile_reset_cache(); jrCore_form_result('delete_referrer'); }

/**
 * Validate a window.location redirect URL has been set for CSRF purposes
 * @return bool
 */
function ujModule_validate_location_url(){
fdebug($_COOKIE,$_SERVER);
    if (isset($_COOKIE['jr_location_url']{1})) {
        // Make sure we've come from the correct URL
        if (!strpos($_COOKIE['jr_location_url'], $_SERVER['REQUEST_URI'])) {
            // Check QUERY_STRING - normally this is not needed, but on some
            // redirects the params can get double encoded - QUERY_STRING will have it right
            // [QUERY_STRING] => _uri=networklicense/host_remove/aHR0cDovL3d3dy5wcm94aW1hY29yZS5jb20%253D
            if (isset($_SERVER['QUERY_STRING']) && strpos($_SERVER['QUERY_STRING'], '_uri=') === 0) {
                list(, $uri) = explode('=', $_SERVER['QUERY_STRING']);
                if (strpos($_COOKIE['jr_location_url'], $uri)) {
                    return true;
                }
            }
            jrCore_notice_page('error', 'invalid location redirect token received - please try again');
            return false;
        }
        return true;
    }
    jrCore_notice_page('error', 'invalid location redirect token received - please try again (2)');
    return false;
}

updated by @ultrajam: 03/19/14 02:33:05AM
SteveX
@ultrajam
02/13/14 04:23:37AM
2,589 posts

looking for a recommendation on how to implement this


Design and Skin Customization

Yes, UK time - I should be around later today.

I haven't needed to edit the htaccess file at all in JR5 (except to remove ExecCGI on servers which use ISPConfig control panel).

ujCategories will create all the pages for you if you need them within the categories section - /categories/mycat

You put the categories smarty function into a template if you need that to be jsut /mycat
  200