Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4200
Latest: [chrisB]
New This Month: 4
New This Week: 1
New Today: 1
Stats
Total Posts: 42606
Total Topics: 7433
Most Online Today: 103
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 43
Total: 43

Recent Posts

Pages: [1] 2 3 ... 10
1
Modifications Talk / Re: Errors with SMF2WPBridge
« Last post by [chrisB] on Today at 04:30:26 pm »
Yes, logging in via WordPress seems broken as well as signing out.
2
Glad that solved the issue.
3
Support / Re: Permissions query
« Last post by SMFHacks on Today at 01:15:30 pm »
This is experimental but if it looks good will update the permissions code in all my mods to use this same logic.

Quick overview on permissions and how it works in this setup.
download admins always have full access.
The global permissions under admin -> permissions must be set to allowed in order for users to get access via category level permissions.

If no category level permission is setup access is assumed allowed!  If any category permissions setup in the category then you must grant each group access via category level permissions. An allowed in any membergroup overrides a deny


Open
Sources\Downloads2.php around line(6030):
Replace the whole function ending in }
Code: [Select]
function Downloads_GetCatPermission($cat, $perm, $return = false, $checkpostGroup = false, $checkAdditonal = true, $groupID = 0)

with
Code: [Select]

function Downloads_GetCatPermission($cat, $perm, $return = false, $checkpostGroup = false, $checkAdditonal = true, $groupID = 0)
{
global $smcFunc, $txt, $user_info;

$manage = allowedTo('downloads_manage');
// They can manage the downloads so let them have access to everything
if ($manage == true)
return true;
$cat = (int) $cat;
    $groupList = array();

if ($user_info['is_guest'] == 1)
{
$groupList[] = -1;
}
else
{
$request = $smcFunc['db_query']('', '
SELECT id_group,additional_groups
FROM {db_prefix}members
WHERE id_member = ' . $user_info['id'],
);

while ($row = $smcFunc['db_fetch_assoc']($request))
{

if (empty($row['additional_groups']))
$groupList = array($row['id_group']);
else
$groupList = array_merge(
array($row['id_group']),
explode(',', $row['additional_groups'])
);

}
}

// Handle case if no permissions set
    $request = $smcFunc['db_query']('', "
SELECT
count(*) as total
FROM {db_prefix}down_catperm as c
WHERE c.ID_CAT = $cat ");
    $row = $smcFunc['db_fetch_assoc']($request);
if ($row['total'] == 0)
return true;

// check for permissions
$request = $smcFunc['db_query']('', "
SELECT
count(*) as total
FROM {db_prefix}down_catperm as c
WHERE c.ID_GROUP IN(" . implode(',',$groupList ) . ") AND c.ID_CAT = $cat AND c." . $perm . " = 1");
$row = $smcFunc['db_fetch_assoc']($request);
if ($row['total'] > 0)
return true;
else
{

if ($perm == 'view')
{
if ($return == false)
fatal_error($txt['downloads_perm_no_view'],false);
else
return false;

}
else if ($perm == 'download')
{
if ($return == false)
fatal_error($txt['downloads_perm_no_download'],false);
else
return false;

}
else if ($perm == 'addfile')
{
if ($return == false)
fatal_error($txt['downloads_perm_no_add'],false);
else
return false;

}
else if ($perm == 'editfile')
{
if ($return == false)
fatal_error($txt['downloads_perm_no_edit'],false);
else
return false;

}
else if ($perm == 'delfile')
{
if ($return == false)
fatal_error($txt['downloads_perm_no_delete'],false);
else
return false;

}
else if ($perm == 'ratefile')
{
if ($return == false)
fatal_error($txt['downloads_perm_no_ratefile'],false);
else
return false;

}
else if ($perm == 'addcomment')
{
if ($return == false)
fatal_error($txt['downloads_perm_no_addcomment'],false);
else
return false;

}
else if ($perm == 'editcomment')
{
if ($return == false)
fatal_error($txt['downloads_perm_no_editcomment'],false);
else
return false;

}
else if ($perm == 'report')
{
if ($return == false)
fatal_error($txt['downloads_perm_no_report'],false);
else
return false;

}

}

}
4
Modifications Talk / Re: Errors with SMF2WPBridge
« Last post by SMFHacks on Today at 12:21:25 pm »
I doubt it from the error. Because that is more of an SMF thing than wordpress.
5
Modifications Talk / Re: Errors with SMF2WPBridge
« Last post by [chrisB] on Today at 12:18:32 pm »
Reading the Github page, this is the first time I read:
[qoute]Uncheck "Enable local storage of cookies" and "Use subdomain independent cookie" in SMF. You can turn it off from Admin -> Configuration -> Server Settings -> Cookies and Sessions[/quote]

Could this be the reason? I enabled use subdomain indiependent cookie but messed up being able to login at all.
6
Support / Re: Undefined index: id
« Last post by Shades on Today at 12:15:20 pm »
Thanks, working good now! 8)
7
Modifications Talk / Re: Errors with SMF2WPBridge
« Last post by [chrisB] on Today at 10:16:59 am »
I can appreciate that, if you happen to have any time would you be willing to look into it? I can provide you access to my test site (in case you don't use WordPress).

It's a real shame about the WordPress author.
8
Modifications Talk / Re: Errors with SMF2WPBridge
« Last post by SMFHacks on Today at 10:07:54 am »
Guess it didn't work.
The original guy who made is at  https://github.com/xchwarze/WP2SMFBridge but he no longer updates it.
I just updated it to with some SMF fixes.
9
Modifications Talk / Re: Errors with SMF2WPBridge
« Last post by [chrisB] on Today at 10:05:10 am »
Same error;

Code: [Select]
Your PHP code changes were rolled back due to an error on line 34 of file wp-includes/rest-api.php. Please fix and try saving again.

Cannot redeclare register_rest_route() (previously declared in wp-includes/rest-api.php:34)
10
Modifications Talk / Re: Errors with SMF2WPBridge
« Last post by SMFHacks on Today at 10:00:23 am »
Replace the old code I gave you to add
Code: [Select]
class_WP_SMFBridge (

Before it add
Pages: [1] 2 3 ... 10

+- Recent Topics

Errors with SMF2WPBridge by [chrisB]
Today at 04:30:26 pm

"Notify all store admins of item purchase" Not Working in SMF 2.1.2 or 2.1.3 by SMFHacks
Today at 01:15:50 pm

Permissions query by SMFHacks
Today at 01:15:30 pm

Undefined index: id by Shades
Today at 12:15:20 pm

Additional Recommendations for SMF Store by Michael Vail
November 26, 2022, 12:49:58 pm

SMF Store 5.0 Beta Errors - Trying to access array offset on value of type null by Michael Vail
November 26, 2022, 12:07:42 pm

Modification: Subcategories total in main gallery view by VisiGod
November 26, 2022, 11:27:34 am

Change log for Downloads Pro 6.13 and 6.14 by Nicole
November 20, 2022, 08:24:34 am

Release date? by SMFHacks
November 20, 2022, 08:09:10 am

Can't install due to missing file? by SMFHacks
November 18, 2022, 06:55:45 pm

Powered by EzPortal