inc/header.inc.php
author rejo
Mon, 31 Mar 2008 21:10:19 +0000
changeset 120 982f722376b4
parent 119 f74e4f88b680
child 126 cb06e3e29ed8
permissions -rw-r--r--
[feladat @ 223] Bugfix. No domain id was provided when entering 'edit record' page from a search query. Changed code so 'edit record' does not rely on domain id provided by user but determines it from the record id that is about to be changed. This closes ticket:31.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
71
e1b918eaf69a [feladat @ 118]
peter
parents: 47
diff changeset
     1
<?php
47
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
     2
119
f74e4f88b680 [feladat @ 222]
rejo
parents: 111
diff changeset
     3
/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
47
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
     4
 *  See <https://rejo.zenger.nl/poweradmin> for more details.
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
     5
 *
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
     6
 *  Copyright 2007, 2008  Rejo Zenger <rejo@zenger.nl>
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
     7
 *
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
     8
 *  This program is free software: you can redistribute it and/or modify
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
     9
 *  it under the terms of the GNU General Public License as published by
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
    10
 *  the Free Software Foundation, either version 3 of the License, or
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
    11
 *  (at your option) any later version.
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
    12
 *
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
    13
 *  This program is distributed in the hope that it will be useful,
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
    14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
    15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
    16
 *  GNU General Public License for more details.
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
    17
 *
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
    18
 *  You should have received a copy of the GNU General Public License
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
    19
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
    20
 */
ae140472d97c [feladat @ 94]
rejo
parents: 13
diff changeset
    21
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 4
diff changeset
    22
global $STYLE;
82
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    23
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    24
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    25
echo "<html>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    26
echo " <head>\n";
119
f74e4f88b680 [feladat @ 222]
rejo
parents: 111
diff changeset
    27
echo "  <title>Poweradmin</title>\n";
82
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    28
echo "  <link rel=stylesheet href=\"style/" . $STYLE . ".inc.php\" type=\"text/css\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    29
echo " </head>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    30
echo " <body>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    31
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    32
if(file_exists('inc/custom_header.inc.php')) {
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 4
diff changeset
    33
	include('inc/custom_header.inc.php');
2ff220cfde13 [feladat @ 60]
rejo
parents: 4
diff changeset
    34
}
82
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    35
119
f74e4f88b680 [feladat @ 222]
rejo
parents: 111
diff changeset
    36
echo "  <h1>Poweradmin</h1>\n";
82
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    37
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    38
if (isset($_SESSION["userid"])) {
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    39
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    40
	verify_permission(search) ? $perm_search = "1" : $perm_search = "0" ;
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    41
	verify_permission(zone_content_view_own) ? $perm_view_zone_own = "1" : $perm_view_zone_own = "0" ;
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    42
	verify_permission(zone_content_view_other) ? $perm_view_zone_other = "1" : $perm_view_zone_other = "0" ;
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    43
	verify_permission(supermaster_view) ? $perm_supermaster_view = "1" : $perm_supermaster_view = "0" ;
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    44
	verify_permission(zone_master_add) ? $perm_zone_master_add = "1" : $perm_zone_master_add = "0" ;
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    45
	verify_permission(zone_slave_add) ? $perm_zone_slave_add = "1" : $perm_zone_slave_add = "0" ;
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    46
	verify_permission(supermaster_add) ? $perm_supermaster_add = "1" : $perm_supermaster_add = "0" ;
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    47
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    48
	echo "    <div class=\"menu\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    49
	echo "    <span class=\"menuitem\"><a href=\"index.php\">" . _('Index') . "</a></span>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    50
	if ( $perm_search == "1" ) { 
111
0a2342a64b83 [feladat @ 211]
rejo
parents: 104
diff changeset
    51
		echo "    <span class=\"menuitem\"><a href=\"search.php\">" . _('Search zones and records') . "</a></span>\n"; 
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 4
diff changeset
    52
	}
82
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    53
	if ( $perm_view_zone_own == "1" || $perm_view_zone_other == "1" ) { 
111
0a2342a64b83 [feladat @ 211]
rejo
parents: 104
diff changeset
    54
		echo "    <span class=\"menuitem\"><a href=\"list_zones.php\">" . _('List zones') . "</a></span>\n"; 
82
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    55
	}
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    56
	if ( $perm_supermaster_view ) { 
111
0a2342a64b83 [feladat @ 211]
rejo
parents: 104
diff changeset
    57
		echo "    <span class=\"menuitem\"><a href=\"list_supermasters.php\">" . _('List supermasters') . "</a></span>\n"; 
82
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    58
	}
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    59
	if (  $perm_zone_master_add ) { 
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    60
		echo "    <span class=\"menuitem\"><a href=\"add_zone_master.php\">" . _('Add master zone') . "</a></span>\n"; 
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 4
diff changeset
    61
	}
82
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    62
	if ( $perm_zone_slave_add ) { 
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    63
		echo "    <span class=\"menuitem\"><a href=\"add_zone_slave.php\">" . _('Add slave zone') . "</a></span>\n"; 
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    64
	}
104
7fef233c99df [feladat @ 204]
rejo
parents: 82
diff changeset
    65
	if ( $perm_supermaster_add ) { 
82
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    66
		echo "    <span class=\"menuitem\"><a href=\"add_supermaster.php\">" . _('Add supermaster') . "</a></span>\n"; 
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    67
	}
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    68
	echo "    <span class=\"menuitem\"><a href=\"change_password.php\">" . _('Change password') . "</a></span>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    69
	echo "    <span class=\"menuitem\"><a href=\"users.php\">" . _('User administration') . "</a></span>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    70
	echo "    <span class=\"menuitem\"><a href=\"index.php?logout\">" . _('Logout') . "</a></span>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    71
	echo "    </div> <!-- /menu -->\n";
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 4
diff changeset
    72
}
82
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    73
echo "    <div class=\"content\">\n";
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 4
diff changeset
    74
2ff220cfde13 [feladat @ 60]
rejo
parents: 4
diff changeset
    75
  
2ff220cfde13 [feladat @ 60]
rejo
parents: 4
diff changeset
    76