mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Fixed #128: Download Plugin - can't activate "limits"; minor additional
cleanup
This commit is contained in:
@@ -44,14 +44,10 @@ require_once(e_HANDLER."userclass_class.php");
|
|||||||
require_once(e_HANDLER."file_class.php");
|
require_once(e_HANDLER."file_class.php");
|
||||||
|
|
||||||
$fl = new e_file;
|
$fl = new e_file;
|
||||||
|
$pref = e107::getPref(); // legacy, remove all globals
|
||||||
$download = new download();
|
$download = new download();
|
||||||
// $adminDownload = new adminDownload();
|
// $adminDownload = new adminDownload();
|
||||||
|
|
||||||
new plugin_download_admin();
|
|
||||||
require_once(e_ADMIN."auth.php");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
@@ -189,12 +185,16 @@ if (isset($_POST['addlimit']))
|
|||||||
|
|
||||||
if (isset($_POST['updatelimits']))
|
if (isset($_POST['updatelimits']))
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($pref['download_limits'] != $_POST['download_limits'])
|
//if ($pref['download_limits'] != $_POST['download_limits'])
|
||||||
{
|
{
|
||||||
$pref['download_limits'] = ($_POST['download_limits'] == 'on') ? 1 : 0;
|
$tmp = ($_POST['download_limits'] == 'on') ? 1 : 0;
|
||||||
save_prefs();
|
if ($pref['download_limits'] != $tmp)
|
||||||
$message .= DOWLAN_126."<br/>";
|
{
|
||||||
|
$pref['download_limits'] = $tmp;
|
||||||
|
e107::getConfig()->set('download_limits', $tmp)->save(false);
|
||||||
|
$message .= DOWLAN_126."<br/>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach(array_keys($_POST['count_num']) as $idLim)
|
foreach(array_keys($_POST['count_num']) as $idLim)
|
||||||
{
|
{
|
||||||
@@ -228,7 +228,8 @@ if (isset($_POST['updatelimits']))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
new plugin_download_admin();
|
||||||
|
require_once(e_ADMIN."auth.php");
|
||||||
//download/includes/admin.php is auto-loaded.
|
//download/includes/admin.php is auto-loaded.
|
||||||
e107::getAdminUI()->runPage();
|
e107::getAdminUI()->runPage();
|
||||||
require_once(e_ADMIN."footer.php");
|
require_once(e_ADMIN."footer.php");
|
||||||
|
@@ -496,8 +496,9 @@ $columnInfo = array(
|
|||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$ns = e107::getRender();
|
$ns = e107::getRender();
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
$pref = e107::getPref();
|
||||||
|
|
||||||
global $pref;
|
//global $pref;
|
||||||
|
|
||||||
if ($sql->db_Select('userclass_classes','userclass_id, userclass_name'))
|
if ($sql->db_Select('userclass_classes','userclass_id, userclass_name'))
|
||||||
{
|
{
|
||||||
@@ -518,7 +519,7 @@ $columnInfo = array(
|
|||||||
";
|
";
|
||||||
if(vartrue($pref['download_limits']) == 1)
|
if(vartrue($pref['download_limits']) == 1)
|
||||||
{
|
{
|
||||||
$chk = "checked = 'checked'";
|
$chk = " checked = 'checked'";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -526,7 +527,7 @@ $columnInfo = array(
|
|||||||
}
|
}
|
||||||
|
|
||||||
$txt .= "
|
$txt .= "
|
||||||
<input type='checkbox' name='download_limits' {$chk}/> ".DOWLAN_125."
|
<input type='checkbox' name='download_limits' value='on'{$chk}/> ".DOWLAN_125."
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
Reference in New Issue
Block a user