From b17cc67ee9cf6f83c2360da16fb53231203ada8a Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Wed, 23 May 2012 12:41:54 -0400
Subject: [PATCH] - Added group (we call groups "circles" so that users don't mix them up with user groups) feature to client messaging section so that messages can be sent to either all clients/resellers or to groups of clients/resellers. TODO: add circle access control so that 1) a reseller can create circles that contain only his clients, not all clients, and 2) a reseller can send messages only to his own circles instead of all circles.

---
 interface/web/sites/lib/module.conf.php |  199 +++++++++++++++++++++++++++++++++----------------
 1 files changed, 133 insertions(+), 66 deletions(-)

diff --git a/interface/web/sites/lib/module.conf.php b/interface/web/sites/lib/module.conf.php
index aec90f0..cbcc62b 100644
--- a/interface/web/sites/lib/module.conf.php
+++ b/interface/web/sites/lib/module.conf.php
@@ -1,7 +1,9 @@
 <?php
 
+$userid=$app->auth->get_user_id();
+
 $module["name"] 		= "sites";
-$module["title"] 		= "Sites";
+$module["title"] 		= "top_menu_sites";
 $module["template"] 	= "module.tpl.htm";
 $module["startpage"] 	= "sites/web_domain_list.php";
 $module["tab_width"]    = '';
@@ -9,102 +11,167 @@
 /*
 	Websites menu
 */
+$items=array();
 
-$items[] = array( 'title' 	=> "Website",
-				  'target' 	=> 'content',
-				  'link'	=> 'sites/web_domain_list.php');
+if($app->auth->get_client_limit($userid,'web_domain') != 0)
+{
+	$items[] = array( 'title' 	=> "Website",
+			'target' 	=> 'content',
+			'link'	=> 'sites/web_domain_list.php',
+			'html_id' => 'domain_list');
+}
 
+if($app->auth->get_client_limit($userid,'web_subdomain') != 0)
+{
+	$items[] = array( 'title' 	=> "Subdomain",
+			'target' 	=> 'content',
+			'link'	=> 'sites/web_subdomain_list.php',
+			'html_id' => 'subdomain_list');
+}
 
-$items[] = array( 'title' 	=> "Subdomain",
-				  'target' 	=> 'content',
-				  'link'	=> 'sites/web_subdomain_list.php');
+if($app->auth->get_client_limit($userid,'web_aliasdomain') != 0)
+{
+	$items[] = array( 'title'   => "Aliasdomain",
+			'target'  => 'content',
+			'link'    => 'sites/web_aliasdomain_list.php',
+			'html_id' => 'aliasdomain_list');
+}
 
+if(count($items))
+{
+	$module["nav"][] = array(	'title'	=> 'Websites',
+								'open' 	=> 1,
+								'items'	=> $items);
+}
 
-$items[] = array( 'title'   => "Aliasdomain",
-                  'target'  => 'content',
-                  'link'    => 'sites/web_aliasdomain_list.php');
-
-$module["nav"][] = array(	'title'	=> 'Websites',
-							'open' 	=> 1,
-							'items'	=> $items);
-
-// clean up
-unset($items);
 
 /*
 	FTP User menu
 */
-
-$items[] = array( 'title' 	=> "FTP-User",
-				  'target' 	=> 'content',
-				  'link'	=> 'sites/ftp_user_list.php');
-
-
-$module["nav"][] = array(	'title'	=> 'FTP',
-							'open' 	=> 1,
-							'items'	=> $items);
-
-// clean up
-unset($items);
+if($app->auth->get_client_limit($userid,'ftp_user') != 0)
+{
+	$items=array();
+	
+	$items[] = array( 'title' 	=> "FTP-User",
+					  'target' 	=> 'content',
+					  'link'	=> 'sites/ftp_user_list.php',
+					  'html_id' => 'ftp_user_list');
+	
+	
+	$module["nav"][] = array(	'title'	=> 'FTP',
+								'open' 	=> 1,
+								'items'	=> $items);
+}
 
 /*
-	FTP User menu
+	Shell User menu
 */
-
-$items[] = array( 'title' 	=> "Shell-User",
-				  'target' 	=> 'content',
-				  'link'	=> 'sites/shell_user_list.php');
-
-
-$module["nav"][] = array(	'title'	=> 'Shell',
-							'open' 	=> 1,
-							'items'	=> $items);
-
-// clean up
-unset($items);
+if($app->auth->get_client_limit($userid,'shell_user') != 0)
+{
+	$items=array();
+	
+	$items[] = array( 'title' 	=> "Shell-User",
+					  'target' 	=> 'content',
+					  'link'	=> 'sites/shell_user_list.php',
+					  'html_id' => 'shell_user_list');	
+	
+	$module["nav"][] = array(	'title'	=> 'Shell',
+								'open' 	=> 1,
+								'items'	=> $items);
+}
 
 /*
 	Databases menu
 */
+if($app->auth->get_client_limit($userid,'database') != 0)
+{
+	$items=array();
+	
+	$items[] = array( 'title' 	=> "Database",
+					  'target' 	=> 'content',
+					  'link'	=> 'sites/database_list.php',
+					  'html_id' => 'database_list'
+					  );	
+	
+	$module["nav"][] = array(	'title'	=> 'Database',
+								'open' 	=> 1,
+								'items'	=> $items);
+}
 
-$items[] = array( 'title' 	=> "Database",
-				  'target' 	=> 'content',
-				  'link'	=> 'sites/database_list.php');
+/*
+ *	Webdav User menu
+ */
+if($app->auth->get_client_limit($userid,'webdav_user') != 0)
+{
+	$items=array();
+	
+	$items[] = array( 'title' 	=> "Webdav-User",
+			'target' 	=> 'content',
+			'link'	=> 'sites/webdav_user_list.php',
+			'html_id' => 'webdav_user_list');
+	
+	
+	$module["nav"][] = array(	'title'	=> 'Webdav',
+			'open' 	=> 1,
+			'items'	=> $items);
+}
 
-
-$module["nav"][] = array(	'title'	=> 'Database',
-							'open' 	=> 1,
-							'items'	=> $items);
+/*
+ *	Web folder menu
+ */
+	$items=array();
+	
+	$items[] = array( 'title' 	=> "Folder",
+			'target' 	=> 'content',
+			'link'	=> 'sites/web_folder_list.php',
+			'html_id' => 'web_folder_list');
+	
+	$items[] = array( 'title' 	=> "Folder users",
+			'target' 	=> 'content',
+			'link'	=> 'sites/web_folder_user_list.php',
+			'html_id' => 'web_folder_user_list');
+	
+	$module["nav"][] = array(	'title'	=> 'Folder protection',
+			'open' 	=> 1,
+			'items'	=> $items);
 
 
 /*
     Cron menu
 */
-$items = array();
-
-$items[] = array( 'title'   => "Cron Jobs",
-                  'target'  => 'content',
-                  'link'    => 'sites/cron_list.php');
-
-
-$module["nav"][] = array(   'title' => 'Cron',
-                            'open'  => 1,
-                            'items' => $items);
-
+if($app->auth->get_client_limit($userid,'cron') != 0)
+{
+	$items = array();	
+	
+	$items[] = array( 'title'   => "Cron Jobs",
+	                  'target'  => 'content',
+	                  'link'    => 'sites/cron_list.php',
+					  'html_id' => 'cron_list');	
+	
+	$module["nav"][] = array(   'title' => 'Cron',
+	                            'open'  => 1,
+	                            'items' => $items);
+}
 
 //**** Statistics menu
 $items = array();
 
 $items[] = array( 'title'   => 'Web traffic',
-                  'target'  => 'content',
-                  'link'    => 'sites/web_sites_stats.php');
+		'target'  => 'content',
+		'link'    => 'sites/web_sites_stats.php',
+		'html_id' => 'websites_stats');
+
+$items[] = array( 'title'   => 'Website quota (Harddisk)',
+		'target'  => 'content',
+		'link'    => 'sites/user_quota_stats.php',
+		'html_id' => 'user_quota_stats');
 
 
 $module['nav'][] = array(   'title' => 'Statistics',
-                            'open'  => 1,
-                            'items' => $items);
-                            
-                            
+		'open'  => 1,
+		'items' => $items);
+
+
 
 // clean up
 unset($items);

--
Gitblit v1.9.1