<?
########## Confixx(R) 3.0 Professional ############
####### Copyright SWsoft, Inc. 2004-2005 ##########
#### http://www.sw-soft.com - info@sw-soft.com ####

include_once('auth.php');

$items_enabled['general']['business'] = $cbusiness?true:false;

$id = db_query("select * from admin");
$werte = db_fetch_array($id);

$items_enabled['setup']['mysql'] = $werte["mysql"]?true:false;
$items_enabled['setup']['quota'] = $werte["quota"]?true:false;
$items_enabled['setup']['dns'] = $werte["dns"]?true:false;

$items_enabled['setup']['checkupdates'] = $checkupdates?true:false;

$c_general = array(
	$gui->make_menu_item('overview', 
		ltext('m_overview'), 
		$gui->make_menu_target_int("allgemein_start.php")
	),
	$gui->make_menu_item('changepw', 
		ltext('ma_changepw'), 
		$gui->make_menu_target_int("allgemein_pwaendern.php", "alpw_descr1", "alpw_descr2")
	),
	$gui->make_menu_item('design_language', 
		ltext('ma_selectlanguage'), 
		$gui->make_menu_target_int("allgemein_sprache.php", "alsp_title1", "alsp_descr1")
	),
	$gui->make_menu_item('servermessages', 
		ltext('ma_servermessages'), 
		$gui->make_menu_target_int("allgemein_servermeldungen.php")
	),
/*	
	$gui->make_menu_item('reslogin',
		ltext("ma_reslogin"),
		$gui->make_menu_target_int("reslogin.php")
	),	
	$gui->make_menu_item('userlogin',
		ltext("ma_userlogin"),
		$gui->make_menu_target_int("userlogin.php")
	),	
*/
	$gui->make_menu_item('sessionlist',
		ltext("ma_sessionlist"),
		$gui->make_menu_target_int("sessionlist.php")
	),	
	$gui->make_menu_item('iprestriction',
		ltext("ma_iprestriction"),
		$gui->make_menu_target_int("iprestriction.php", 'ipr_help_head', 'ipr_help_text')
	),	
	$gui->make_menu_item('custommenu',
		ltext("ma_custommenu"),
		$gui->make_menu_target_int( "custommenu.php", "cm_help_head", "cm_help" )
	),
	$gui->make_menu_item('versions',
		ltext("ms_versions"),
		$gui->make_menu_target_int("versions.php"),
		$items_enabled['setup']['checkupdates']
	),
	$gui->make_menu_item('license',
		ltext("ma_license"),
		$gui->make_menu_target_top("../reg/")
	),
	$gui->make_menu_item('business',
		ltext("ma_server"),
		$gui->make_menu_target_int("business.php", 'alsr_title1', 'alsr_descr1'),
		$items_enabled['general']['business']
	),	
);


$c_reseller = array(
	$gui->make_menu_item('overview',
		ltext("m_overview"),
		$gui->make_menu_target_int("anbieter_start.php")
	),
	$gui->make_menu_item('mailsetup',
		ltext("man_mailsetup"),
		$gui->make_menu_target_int("anbieter_email.php", 'anem_descr1')
	),
	$gui->make_menu_item('indexsetup',
		ltext("man_indexsetup"),
		$gui->make_menu_target_int("anbieter_index.php", 'anin_descr1')
	),
	$gui->make_menu_item('mailing',
		ltext("man_mailing"),
		$gui->make_menu_target_int("anbieter_rundschreiben.php", 'anru_descr1', 'anru_descr2')
	),
	$gui->make_menu_item('createreseller',
		ltext("man_createreseller"),
		$gui->make_menu_target_int("anbieter_anlegen.php", 'anan_descr1', 'anan_descr2')
	),
	$gui->make_menu_item('editreseller',
		ltext("man_editreseller"),
		$gui->make_menu_target_int("anbieter_aendern.php", 'anae_title1')
	),
	$gui->make_menu_item('usersowner',
		ltext("man_usersowner"),
		$gui->make_menu_target_int("anbieter_kundenzuordnung.php", 'anku_descr1', 'anku_descr2')
	),
	$gui->make_menu_item('mysql',
		ltext("man_mysql"),
		$gui->make_menu_target_int("anbieter_mysql.php", 'anmy_descr1', 'anmy_descr2'),
		$items_enabled['setup']['mysql']
	),

);

$c_setup = array(
	$gui->make_menu_item('overview',
		ltext("m_overview"),
		$gui->make_menu_target_int("einstellungen_start.php")
	),
	$gui->make_menu_item('db',
		ltext("me_db"),
		$gui->make_menu_target_int("einstellungen_db.php", 'eidb_title1', 'eidb_descr1'),
		$items_enabled['setup']['mysql']
	),
	$gui->make_menu_item('ip',
		ltext("me_ip"),
		$gui->make_menu_target_int("einstellungen_ip.php", 'eiip_title1', 'eiip_descr1')
	),
	$gui->make_menu_item('blacklist',
		ltext("me_blacklist"),
		$gui->make_menu_target_int("einstellungen_blacklist.php", 'eibl_title1', 'eibl_descr1')
	),
	$gui->make_menu_item('interval',
		ltext("me_interval"),
		$gui->make_menu_target_int("einstellungen_intervalle.php", 'eiin_descr1', 'eiin_descr2')
	),
	$gui->make_menu_item('quota',
		ltext("me_quota"),
		$gui->make_menu_target_int("einstellungen_quota.php", 'eiqu_title1', 'eiqu_descr1'),
		$items_enabled['setup']['quota']
	),
	$gui->make_menu_item('httpd',
		ltext("me_httpd"),
		$gui->make_menu_target_int("einstellungen_httpd.php", 'eiht_title1', 'eiht_warning')
	),
	$gui->make_menu_item('dnstemplate',
		ltext("me_dnstemplate"),
		$gui->make_menu_target_int("einstellungen_dnstemplate.php", 'eiqu_title1', 'eiqu_descr1'),
		$items_enabled['setup']['dns']
	),
	$gui->make_menu_item('dnsspezial',
		ltext("me_dnsspezial"),
		$gui->make_menu_target_int("einstellungen_dnsspezial.php", 'eiqu_title1', 'eiqu_descr1'),
		$items_enabled['setup']['dns']
	),
	$gui->make_menu_item('stddomain',
		ltext("me_stddomain"),
		$gui->make_menu_target_int("einstellungen_stddomain.php", 'eisd_descr1', 'eisd_descr2')
	),
);

$c_stats = array(
	$gui->make_menu_item('resellerstats',
		ltext("ms_resellerstats"),
		$gui->make_menu_target_int("statistik_start.php")
	),
	$gui->make_menu_item('userstats',
		ltext("ms_userstats"),
		$gui->make_menu_target_int("statistik_kunden.php")
	),
	$gui->make_menu_item('traffic',
		ltext("ms_traffic"),
		$gui->make_menu_target_int("statistik_transfer.php")
	),
);

$nav_tree = $gui->make_navigation_container(array(
	$gui->make_menu_block('general',   
		ltext('m_general'),	'overview',	$c_general, true),	//opened
	$gui->make_menu_block('reseller',        
		ltext('m_reseller'),      'overview', $c_reseller),
	$gui->make_menu_block('setup',        
		ltext('m_setup'),      'overview', $c_setup),
	$gui->make_menu_block('stats',     
		ltext('m_stats'),   'overview', $c_stats)
));


$menu = array($nav_tree);

$def_user = $user_prefix . '0';
$users = $PHP_AUTH_USER . "," . $def_user . ",res0";
$menu[] = $gui->make_action_button('logout', ltext('m_logout'), $gui->make_menu_target_top('/logout.php?user=' . $users));
//$shortcuts_items = array($gui->make_shortcut_item('link_logout', ltext('m_logout'), '/logout.php?user=' . $PHP_AUTH_USER));

$id = db_query("SELECT COUNT(*) AS cnt FROM kunden WHERE kunde='$def_user'");
$res = db_fetch_array($id);

if($res['cnt'])
{
	$shortcuts_items = array($gui->make_shortcut_item('link_domains', ltext('sh_domains'), $gui->make_menu_target_top('resredirect.php?type=' . USERTYPE_RESELLER . '&reseller=res0')),
							$gui->make_shortcut_item('link_services', ltext('sh_services'), $gui->make_menu_target_top('resredirect.php?type=' . USERTYPE_USER . '&reseller=' . $def_user)));
	$menu[] = $gui->make_shortcuts_block($shortcuts_items); 
}


$op_block = 'general';
$op_item = 'overview';

if(array_key_exists('op_block', $_GET) && array_key_exists('op_item', $_GET))
{
	$op_block = $_GET['op_block'];
	$op_item = $_GET['op_item'];
}

$page = $gui->make_left_menu($menu);
$page->set_height(93);        // height="93%" - 7% for SWsoft-logo
$page->set_default($op_block, $op_item);				// active
$page->draw();

?>
