tbrehm
2013-08-21 7b47c0aa0aeee6f059f00008e36cc210ca89ecb9
interface/web/dashboard/dashboard.php
@@ -157,8 +157,36 @@
/* Which dashlets in which column */
/******************************************************************************/
$leftcol_dashlets = array('modules','invoices','quota','mailquota');
$rightcol_dashlets = array('limits');
$default_leftcol_dashlets = array('modules','invoices','quota','mailquota');
$default_rightcol_dashlets = array('limits');
$app->uses('getconf');
$dashlets_config = $app->getconf->get_global_config('misc');
//* Client: If the logged in user is not admin and has no sub clients (no reseller)
if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid'])) {
   $role = 'client';
//* Reseller: If the logged in user is not admin and has sub clients (is a reseller)
} elseif ($_SESSION["s"]["user"]["typ"] != 'admin' && $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
   $role = 'reseller';
//* Admin: If the logged in user is admin
} else {
   $role = 'admin';
}
$dashlets_config[$role.'_dashlets_left'] = trim($dashlets_config[$role.'_dashlets_left']);
$dashlets_config[$role.'_dashlets_right'] = trim($dashlets_config[$role.'_dashlets_right']);
if($dashlets_config[$role.'_dashlets_left'] != ''){
   preg_match_all('@\[(.*?)\]@', $dashlets_config[$role.'_dashlets_left'], $matches);
   $leftcol_dashlets = $matches[1];
} else {
   $leftcol_dashlets = $default_leftcol_dashlets;
}
if($dashlets_config[$role.'_dashlets_right'] != ''){
   preg_match_all('@\[(.*?)\]@', $dashlets_config[$role.'_dashlets_right'], $matches);
   $rightcol_dashlets = $matches[1];
} else {
   $rightcol_dashlets = $default_rightcol_dashlets;
}
/******************************************************************************/