<?php
include_once('ressources/class.users.menus.inc');
include_once ("ressources/class.templates.inc");
include_once ("ressources/class.user.inc");
include_once ("ressources/class.fetchmail.inc");
session_start();

if(isset($_GET["script"])){start_js();exit;}
if(isset($_GET["page-index"])){page_index();exit;}
if(isset($_GET["page-display"])){page_list();exit;}
if(isset($_GET["page-right-button"])){page_list_buttons();exit;}
if(isset($_GET["page-modify"])){page_modify_rule();exit;}
if(isset($_GET["fetchmail_rule_id"])){page_save();exit;}
if(isset($_GET["DeleteFetchAccount"])){page_del();exit;}
if(isset($_GET["page-fetchmail-aliases"])){page_fetchmail_aliases_index();exit;}
if(isset($_GET["page-fetchmail-aliases-list"])){echo page_fetchmail_aliases_list($_GET["page-fetchmail-aliases-list"]);exit;}
if(isset($_GET["FetchmailAddAliase"])){page_fetchmail_aliases_add();exit;}
if(isset($_GET["FetchmailDeleteAliase"])){page_fetchmail_aliases_del();exit;}


if(isset($_GET["enable-js-rule"])){page_list_js_enable();exit;}
if(isset($_GET["enable-fetch-rule"])){page_list_js_save();exit;}

if(isset($_GET["find-isp-popup"])){find_isp_popup();exit;}
if(isset($_GET["isp-choose-proto"])){find_isp_proto();exit;}
if(isset($_GET["isp-end"])){find_isp_end();exit;}


function start_js(){
	$page=CurrentPageName();
	if($_GET["uid"]){$uid=$_GET["uid"];}else{$uid=$_SESSION["uid"];}
    exit;
}
if (isset($_GET["page-modify"])) {
    page_modify_rule();
    exit;
}
if (isset($_GET["fetchmail_rule_id"])) {
    page_save();
    exit;
}
if (isset($_GET["DeleteFetchAccount"])) {
    page_del();
    exit;
}
if (isset($_GET["page-fetchmail-aliases"])) {
    page_fetchmail_aliases_index();
    exit;
}
if (isset($_GET["page-fetchmail-aliases-list"])) {
    echo page_fetchmail_aliases_list($_GET["page-fetchmail-aliases-list"]);
    exit;
}
if (isset($_GET["FetchmailAddAliase"])) {
    page_fetchmail_aliases_add();
    exit;
}
if (isset($_GET["FetchmailDeleteAliase"])) {
    page_fetchmail_aliases_del();
    exit;
}
if (isset($_GET["enable-js-rule"])) {