1
Modifications / download system download permission
« 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
Sources/Downloads2.php
Sources/ManagePermissions.php
Themes/Default/Languages/Modifications.<your language>.php
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
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