SMF® Unofficial Help Forum

2.0.* Support => Modifications => Topic started by: Illori on September 06, 2013, 10:56:28 AM

Title: download system download permission
Post by: Illori on September 06, 2013, 10:56:28 AM
all edits have to be done manually. no support will be provided.
Themes/Default/Download2.template.php
Code: (find) [Select]
$g_report = allowedTo('downloads_report');
Code: (add after) [Select]
$g_dl = allowedTo('downloads_dl');
Code: (find) [Select]
// Show the main download
Code: (replace) [Select]
if($g_dl){
// Show the main download

Code: (find) [Select]
echo '
</td>
</tr>';
Code: (add after) [Select]
}
Code: (find) [Select]
// Show linking codes
Code: (replace) [Select]
if($g_dl){
// Show linking codes

Code: (find) [Select]
echo '</table>';
Code: (add after) [Select]
}
Sources/Downloads2.php

Code: (find) [Select]
function Downloads_DownloadFile()
{
global $modSettings, $txt, $context, $smcFunc, $user_info;

// Check Permission
isAllowedTo('downloads_view');

Code: (replace) [Select]
function Downloads_DownloadFile()
{
global $modSettings, $txt, $context, $smcFunc, $user_info;

// Check Permission
isAllowedTo('downloads_dl');

Sources/ManagePermissions.php
Code: (find) [Select]
'downloads_view',
Code: (add after) [Select]
'downloads_dl',
Themes/Default/Languages/Modifications.<your language>.php
Code: (find) [Select]
$txt['permissionname_downloads_view'] = 'View Downloads';
$txt['permissionhelp_downloads_view'] = 'Allows the user to view the Downloads';
$txt['cannot_downloads_view'] = 'You are not allowed to view the Downloads';
Code: (add after) [Select]
$txt['permissionname_downloads_dl'] = 'Download';
$txt['permissionhelp_downloads_dl'] = 'Allows the user to download.';
$txt['cannot_downloads_dl'] = 'You are not allowed to download.';

after applying the edits each groups permissions need to be modified to allow downloading of files in the download system.

also please DO NOT post a link to this on simplemachines.org
Title: Re: download system download permission
Post by: Toxic__Waste on October 18, 2014, 08:34:47 PM
whats this actually do
Title: Re: download system download permission
Post by: Illori on October 19, 2014, 06:37:20 AM
did you read the title of the thread or the last few lines of the post above yours? i guess not.