4 // by Mischa Peters <mischa at high5 dot net>
5 // Copyright (c) 2002 - 2005 High5!
6 // License Info: http://www.postfixadmin.com/?file=LICENSE.TXT
10 // Template File: viewlog.tpl
12 // Template Variables:
17 // Form POST \ GET Variables:
21 require ("./variables.inc.php");
22 require ("./config.inc.php");
23 require ("./functions.inc.php");
24 include ("./languages/" . check_language () . ".lang");
26 $SESSID_USERNAME = check_session();
27 $list_domains = list_domains_for_admin ($SESSID_USERNAME);
29 if ($_SERVER['REQUEST_METHOD'] == "GET")
31 if ((is_array ($list_domains) and count ($list_domains) > 0)) $fDomain = $list_domains[0];
33 if (!check_owner ($SESSID_USERNAME, $fDomain))
36 $tMessage = $PALANG['pViewlog_result_error'];
41 $result = db_query ("SELECT * FROM log WHERE domain='$fDomain' ORDER BY timestamp DESC LIMIT 10");
42 if ($result['rows'] > 0)
44 while ($row = db_array ($result['result']))
51 include ("./templates/header.tpl");
52 include ("./templates/menu.tpl");
53 include ("./templates/viewlog.tpl");
54 include ("./templates/footer.tpl");
57 if ($_SERVER['REQUEST_METHOD'] == "POST")
59 $fDomain = escape_string ($_POST['fDomain']);
61 if (!check_owner ($SESSID_USERNAME, $fDomain))
64 $tMessage = $PALANG['pViewlog_error'];
69 $result = db_query ("SELECT * FROM log WHERE domain='$fDomain' ORDER BY timestamp DESC LIMIT 10");
70 if ($result['rows'] > 0)
72 while ($row = db_array ($result['result']))
79 include ("./templates/header.tpl");
80 include ("./templates/menu.tpl");
81 include ("./templates/viewlog.tpl");
82 include ("./templates/footer.tpl");