Location: PHPKode > projects > XMail PHP Admin Interface (XPAI) > xpai/main.php
<?php
  error_reporting(E_ALL);
  session_start();
  $in_xpai = TRUE;
  require_once('./config.php');

  $do_menu_update = FALSE;

  require_once('./includes/functions.php');
  require_once('./includes/xmail.class.php');
  $mail_server = new XMail();
?>

<html>
<head>
	<link rel="stylesheet" href="css/main.css" type="text/css">
</head>
<body bgcolor='#FFFFFF' text='#000000' link='#FF9900' alink='#FF9900' vlink='#FF9900' leftmargin='0' topmargin='0' marginheight='0' marginwidth='0'>
<div class='content'>
<?php	
echo "
<script language=\"JavaScript\">
<!--
<!--hide this script from non-javascript-enabled browsers
function help (datei,breite,hoehe)
{
  var helpwindow =  window.open(\"help/\"+datei,\"Help\",\"width=\"+breite+\",height=\"+hoehe+\",scrollbars=yes,screenX=0,screenY=0\");
  helpwindow.moveTo(0,0);
  if (navigator.appVersion.substring(1,0)>=\"3\") {
    helpwindow.focus();
  }
}
//-->
</script>
";
?>

<?php
if (!isset($_REQUEST['action']) || !isset($_SESSION['loginstatus']))
  $action = 'logout';
else
  $action = $_REQUEST['action'];

switch ($action) {
	case 'login': // login to server
		include('./includes/login.php');
		break;
	case 'logout': // logout from server
		include('./includes/login.php');
    $do_menu_update = true;
		break;

    // Functions at superuser status only ($_SESSION['loginstatus'] = 3)

	case 'domainlist': // list domains
    if ($_SESSION['loginstatus'] >= $login_level['LoginSpecialPostmaster'])
		  include('./includes/domainlist.php');
		break;
	case 'domainadd': // create new domain
    if ($_SESSION['loginstatus']==$login_level['LoginSuperuser'])
		  include('./includes/domainadd.php');
    $do_menu_update = true;
		break;
	case 'domaindel': // delete domain
    if (isset($_REQUEST['sel_domain']))
      $_SESSION['edit_domain'] = $_REQUEST['sel_domain'];
    if (($_SESSION['loginstatus']==$login_level['LoginSuperuser']) && ($_SESSION['edit_domain'] != "*"))
      include('./includes/domaindel.php');
    $do_menu_update = true;
		break;
	case 'domainsel': // select domain
		if ($_SESSION['loginstatus'] >= $login_level['LoginSpecialPostmaster'])
    {
      if (isset($_REQUEST['sel_domain']))
        $_SESSION['edit_domain'] = $_REQUEST['sel_domain'];
        if ($_SESSION['loginstatus']>=$login_level['LoginPostmaster'])
    		  include('./includes/userlist.php');
        $_SESSION['edit_user'] = "*";
    }
    $do_menu_update = true;
		break;
	case 'aliasdomainlist': // list domains alias
    if (($_SESSION['loginstatus']>=$login_level['LoginPostmaster']) && ($_SESSION['edit_domain'] != "*"))
		  include('./includes/aliasdomainlist.php');
		break;
	case 'aliasdomainadd': // create new domain alias
    if (($_SESSION['loginstatus']==$login_level['LoginSuperuser']) && ($_SESSION['edit_domain'] != "*"))
		  include('./includes/aliasdomainadd.php');
		break;
	case 'aliasdomaindel': // delete domain alias
    if (($_SESSION['loginstatus']==$login_level['LoginSuperuser']) && ($_SESSION['edit_domain'] != "*"))
		  include('./includes/aliasdomaindel.php');
		break;
	case 'custdomadd': // create new custom domain
    if ($_SESSION['loginstatus']==$login_level['LoginSuperuser'])
		  include('./includes/custdomadd.php');
		break;
	case 'custdomdel': // delete custom domain
    if (($_SESSION['loginstatus']==$login_level['LoginSuperuser']) && ($_REQUEST['sel_domain'] != ""))
      include('./includes/custdomdel.php');
		break;
	case 'custdomedit': // edit custom domain
    if (($_SESSION['loginstatus']==$login_level['LoginSuperuser']) && ($_REQUEST['sel_domain'] != ""))
      include('./includes/custdomedit.php');
		break;
	case 'servervars': // list server config
		include('./includes/servervars.php');
		break;
	case 'servercfg': // configure server
		include('./includes/servercfg.php');
		break;
	case 'frozlist': // list frozen msgs
        if ($_SESSION['loginstatus']==$login_level['LoginSuperuser'])
		  include('./includes/frozlist.php');
		break;
	case 'frozdel': // delete frozen msgs
        if ($_SESSION['loginstatus']==$login_level['LoginSuperuser'])
		  include('./includes/frozdel.php');
		break;
	case 'frozsubmit': // resubmit frozen msgs
        if ($_SESSION['loginstatus']==$login_level['LoginSuperuser'])
		  include('./includes/frozsubmit.php');
		break;
	case 'frozgetlog': // get frozen msg log
        if ($_SESSION['loginstatus']==$login_level['LoginSuperuser'])
		  include('./includes/frozgetlog.php');
		break;
	case 'frozgetmsg': // get frozen msg
    if ($_SESSION['loginstatus']==$login_level['LoginSuperuser'])
		  include('./includes/frozgetmsg.php');
		break;

    // Functions at postmaster status ($_SESSION['loginstatus'] = 2 or 3)

	case 'userlist': // list users
    if (($_SESSION['loginstatus']>=$login_level['LoginPostmaster']) && ($_SESSION['edit_domain'] != "*"))
		  include('./includes/userlist.php');
 		  if ($_SESSION['edit_user'] == "*")
				$do_menu_update = true;
		break;
	case 'useradd': // add user / maillist
    if (($_SESSION['loginstatus']>=$login_level['LoginPostmaster']) && ($_SESSION['edit_domain'] != "*"))
		  include('./includes/useradd.php');
    $do_menu_update = true;
		break;
	case 'userdel': // delete user / maillist
    if (isset($_REQUEST['sel_user']))
      $_SESSION['edit_user'] = $_REQUEST['sel_user'];
    if (($_SESSION['loginstatus']>=$login_level['LoginPostmaster']) && ($_SESSION['edit_domain'] != "*") && ($_SESSION['edit_user'] != "*"))
		  include('./includes/userdel.php');
    $do_menu_update = true;
		break;
	case 'usersel': // select user / mailinglist
    if (($_SESSION['loginstatus']>=$login_level['LoginPostmaster']) && ($_SESSION['edit_domain'] != "*"))
    {
      if (isset($_REQUEST['sel_user']))
      {
        $_SESSION['edit_user'] = $_REQUEST['sel_user'];
        $_SESSION['edit_user_type'] = $_REQUEST['sel_user_type'];
      }
      include('./includes/usersel.php');
    }
    $do_menu_update = true;
		break;
  case 'aliaslist':
        if (($_SESSION['loginstatus']>=$login_level['LoginPostmaster']) && ($_SESSION['edit_domain'] != "*") && ($_SESSION['edit_user'] != "*"))
		  include('./includes/aliaslist.php');
		break;
  case 'aliasadd':
        if (($_SESSION['loginstatus']>=$login_level['LoginPostmaster']) && ($_SESSION['edit_domain'] != "*") && ($_SESSION['edit_user'] != "*"))
		  include('./includes/aliasadd.php');
		break;
  case 'aliasdel':
        if (($_SESSION['loginstatus']>=$login_level['LoginPostmaster']) && ($_SESSION['edit_domain'] != "*") && ($_SESSION['edit_user'] != "*"))
		  include('./includes/aliasdel.php');
		break;
	case 'mluserlist': // list mailing list users
        if (($_SESSION['loginstatus']>=$login_level['LoginPostmaster']) && ($_SESSION['edit_domain'] != "*"))
		  include('./includes/mluserlist.php');
		break;
	case 'mluseradd': // add user to maillist
    if (($_SESSION['loginstatus']>=$login_level['LoginPostmaster']) && ($_SESSION['edit_domain'] != "*"))
		  include('./includes/mluseradd.php');
		break;
	case 'mluserdel': // delete user from maillist
    if (isset($_REQUEST['sel_listuser']))
      $_SESSION['edit_listuser'] = $_REQUEST['sel_listuser'];
    if (($_SESSION['loginstatus']>=$login_level['LoginPostmaster']) && ($_SESSION['edit_domain'] != "*") && ($_SESSION['edit_user'] != "*"))
		  include('./includes/mluserdel.php');
		break;
	case 'mlusermod': // add user to maillist
    if (isset($_REQUEST['sel_listuser']))
      $_SESSION['edit_listuser'] = $_REQUEST['sel_listuser'];
    if (($_SESSION['loginstatus']>=$login_level['LoginPostmaster']) && ($_SESSION['edit_domain'] != "*") && ($_SESSION['edit_user'] != "*"))
		  include('./includes/mlusermod.php');
		break;
	case 'globfunc': // global user functions
        if (($_SESSION['loginstatus']>=$login_level['LoginPostmaster']) && ($_SESSION['edit_domain'] != "*"))
		  include('./includes/globfunc.php');
 		  if ($_SESSION['edit_user'] == "*")
				$do_menu_update = true;
		break;

		
    // Functions at user status ($_SESSION['loginstatus'] = 1 or 2 or 3)

	case 'userpwd': // change user password
		include('./includes/userpwd.php');
		break;
	case 'uservars': // show user info
		include('./includes/uservars.php');
		break;
  case 'poplnklist': // list external POP3 link
		include('./includes/poplnklist.php');
		break;
  case 'poplnkadd': // add external POP3 link
		include('./includes/poplnkadd.php');
		break;
  case 'poplnkdel': // delete external POP3 link
		include('./includes/poplnkdel.php');
		break;
  case 'poplnkenable': // enable/disable external POP3 link
		include('./includes/poplnkenable.php');
		include('./includes/poplnklist.php');
		break;
  case 'usermproc':
	  include('./includes/usermproc.php');
    break;

/*
	case 'serverlist': // list servers
		include('./includes/serverlist.php');
		break;
	case 'serveradd': // add server
		include('./includes/serveradd.php');
		break;
	case 'serverdel': // remove server
		include('./includes/serverdel.php');
		break;
*/
}

if (isset($is_old_php) && $is_old_php)
  foreach ($_SESSION as $var_name=>$var_value) $HTTP_SESSION_VARS[$var_name]=$var_value;

if ($do_menu_update)
{
  echo "<script language=\"JavaScript\" type=\"text/javascript\">\n";
  echo "<!--\n";
	echo "parent.menu.location.reload()\n";
  echo "//-->\n";
	echo "</script>\n";
}	
?>

</div>

</body>
</html>
Return current item: XMail PHP Admin Interface (XPAI)