Disable statistics for free users

elitefine5074

New Member
YetiShare User
May 11, 2015
3
0
0
How can i disable statistics pages that are created with ~i or ~s at the end of the URL - so its not public and only admin can see it?

Thanks in advance!
 

ysmods

New Member
Jan 29, 2013
860
1
0
UK
www.ysmods.com
You would have to edit the template files to remove the generated links for everyone except admin users, and restrict access to stats.html

Some code like:

Code:
if($Auth->level_id == 20)
{
//Code only admins can see
}
else
{
// some kind of error message
}
 

elitefine5074

New Member
YetiShare User
May 11, 2015
3
0
0
Thank you ysmods

Found this lines in stats.html:
Code:
"// make sure user is permitted to view stats
if ($file->canViewStats() == false)
{
    $errorMsg = t("stats_error_file_statistics_are_private", "Statistics for this file are not publicly viewable.");
    coreFunctions::redirect(coreFunctions::getCoreSitePath() . "/error." . SITE_CONFIG_PAGE_EXTENSION . "?e=" . urlencode($errorMsg));
}"
Can i just restrict free-non users stats access from there, without editing templates?
 

elitefine5074

New Member
YetiShare User
May 11, 2015
3
0
0
I renamed stats.html to statsOLD.html so now all the pages created with ~s at the end of url are redirected to Download Page.
Now there is only ~i Information pages remaining and i dont know how to remove that ...oh well,back to mining :)