Daily Bandwidth limit per user level

webmaster4086

New Member
YetiShare User
Jul 5, 2014
2
0
0
Hello,

I would like to suggest adding ability to limit daily bandwidth for each user level.
I've already asked for it on a pre-sale ticket and told that i need to ask for it in this forum.

But now i see this piece of code on the script download file:

Code:
    // make sure the user is permitted to download files of this size
    if ((int) getMaxDailyDownloads() > 0)
    {
        // get total user downloads today
        $sQL            = "SELECT COUNT(id) AS total ";
        $sQL .= "FROM download_tracker ";
        $sQL .= "WHERE download_tracker.status='finished' AND download_tracker.ip_address = " . $db->quote(getUsersIPAddress()) . " ";
        $sQL .= "AND UNIX_TIMESTAMP(date_updated) >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 day))";
        $totalDownloads24Hour = (int) $db->getValue($sQL);
        if ((int) getMaxDailyDownloads() < $totalDownloads24Hour)
        {
            $errorMsg = t("error_you_have_reached_the_maximum_permitted_downloads_in_the_last_24_hours", "You have reached the maximum permitted downloads in the last 24 hours.");
            redirect(getCoreSitePath() . "/error." . SITE_CONFIG_PAGE_EXTENSION . "?e=" . urlencode($errorMsg));
        }
    }
This tell that the functionality is already exist, but from where can i control it?
 

neil3834

New Member
YetiShare User
Apr 10, 2014
57
0
0
Yes a daily restriction on bandwidth... will traffic is the correct terminology, would be very useful.

the only issue I see currently is that visitors from different timezones don't know when the day starts our ends (and when their allocation will be reset and able to resume downloads.

Can we display the server time somewhere? e.g. "You have exceeded your traffic allocation. You will be able to resume downloading in 6:32." (time until 00:00 is reached).

Can someone implement a module?

Thank you very much guys.