bug fix: quota summary was inserted directly on main page without calling the appropriate hook.
This commit is contained in:
parent
79097f48da
commit
1c049f6bc6
|
@ -106,12 +106,17 @@ if($admin->enabled) {
|
|||
echo "</p>";
|
||||
} // if $admin->enabled
|
||||
|
||||
$c = $admin->get($cuid);
|
||||
|
||||
define("QUOTASONE","1");
|
||||
echo "<hr/>";
|
||||
require_once("quotas_oneuser.php");
|
||||
|
||||
$blocks=$hooks->invoke("hook_homepageblock");
|
||||
uasort($blocks, function($a, $b) {return $a->order<$b->order ? -1 : 1;});
|
||||
foreach ($blocks as $v) {
|
||||
if (property_exists($v, "call")) {
|
||||
$func=$v->call;
|
||||
$func();
|
||||
}
|
||||
if (property_exists($v, "include")) {
|
||||
include $v->include;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<?php include_once("foot.php"); ?>
|
||||
|
|
|
@ -151,7 +151,7 @@ if (!isset($mode)) { # when included from adm_login, mode is not set
|
|||
<!-- Mailing lists -->
|
||||
|
||||
<?php
|
||||
$totallist = $quota->get_size_mailman_sum_user($c["uid"]);
|
||||
$totallist = $quota->get_size_mailman_sum_user($mem->user["uid"]);
|
||||
if ($totallist) {
|
||||
// $totalweb is in KB, so we call get_size_unit() with it in Bytes
|
||||
$t=$quota->get_size_unit($totallist * 1024);
|
||||
|
|
|
@ -80,9 +80,21 @@ class m_quota {
|
|||
$obj['links'][] = array('txt' => 'progressbar', 'total' => $q[$key]["t"], 'used' => $q[$key]["u"]);
|
||||
}
|
||||
|
||||
// do not return menu item if there is no quota
|
||||
if (!count($obj['links'])) return false;
|
||||
return $obj;
|
||||
}
|
||||
|
||||
function hook_homepageblock() {
|
||||
return (object)Array(
|
||||
'pos' => 20,
|
||||
'call'=> function() {
|
||||
define("QUOTASONE","1");
|
||||
},
|
||||
'include' => "quotas_oneuser.php"
|
||||
);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- */
|
||||
|
||||
/** Check if a user can use a ressource.
|
||||
|
|
Loading…
Reference in New Issue