inc/header.inc.php
author rejo
Thu, 12 Jun 2008 22:00:46 +0000
changeset 180 e17c8536d718
parent 144 ad667d767a0a
child 194 df674d004508
permissions -rw-r--r--
[feladat @ 288] Fixed GRANT statement installer to give working example, even if web interface and database are on different server. Closes #67.
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
136
c795dd75a77e [feladat @ 242]
rejo
parents: 126
diff changeset
    22
global $iface_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";
136
c795dd75a77e [feladat @ 242]
rejo
parents: 126
diff changeset
    28
echo "  <link rel=stylesheet href=\"style/" . $iface_style . ".inc.php\" type=\"text/css\">\n";
82
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
144
ad667d767a0a [feladat @ 250]
rejo
parents: 136
diff changeset
    38
if (file_exists('install')) {
ad667d767a0a [feladat @ 250]
rejo
parents: 136
diff changeset
    39
	error(ERR_INSTALL_DIR_EXISTS);
ad667d767a0a [feladat @ 250]
rejo
parents: 136
diff changeset
    40
	include('inc/footer.inc.php');
ad667d767a0a [feladat @ 250]
rejo
parents: 136
diff changeset
    41
	exit;
ad667d767a0a [feladat @ 250]
rejo
parents: 136
diff changeset
    42
} elseif (isset($_SESSION["userid"])) {
126
cb06e3e29ed8 [feladat @ 230]
peter
parents: 119
diff changeset
    43
	verify_permission('search') ? $perm_search = "1" : $perm_search = "0" ;
cb06e3e29ed8 [feladat @ 230]
peter
parents: 119
diff changeset
    44
	verify_permission('zone_content_view_own') ? $perm_view_zone_own = "1" : $perm_view_zone_own = "0" ;
cb06e3e29ed8 [feladat @ 230]
peter
parents: 119
diff changeset
    45
	verify_permission('zone_content_view_other') ? $perm_view_zone_other = "1" : $perm_view_zone_other = "0" ;
cb06e3e29ed8 [feladat @ 230]
peter
parents: 119
diff changeset
    46
	verify_permission('supermaster_view') ? $perm_supermaster_view = "1" : $perm_supermaster_view = "0" ;
cb06e3e29ed8 [feladat @ 230]
peter
parents: 119
diff changeset
    47
	verify_permission('zone_master_add') ? $perm_zone_master_add = "1" : $perm_zone_master_add = "0" ;
cb06e3e29ed8 [feladat @ 230]
peter
parents: 119
diff changeset
    48
	verify_permission('zone_slave_add') ? $perm_zone_slave_add = "1" : $perm_zone_slave_add = "0" ;
cb06e3e29ed8 [feladat @ 230]
peter
parents: 119
diff changeset
    49
	verify_permission('supermaster_add') ? $perm_supermaster_add = "1" : $perm_supermaster_add = "0" ;
82
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    50
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    51
	echo "    <div class=\"menu\">\n";
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    52
	echo "    <span class=\"menuitem\"><a href=\"index.php\">" . _('Index') . "</a></span>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    53
	if ( $perm_search == "1" ) { 
111
0a2342a64b83 [feladat @ 211]
rejo
parents: 104
diff changeset
    54
		echo "    <span class=\"menuitem\"><a href=\"search.php\">" . _('Search zones and records') . "</a></span>\n"; 
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 4
diff changeset
    55
	}
82
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    56
	if ( $perm_view_zone_own == "1" || $perm_view_zone_other == "1" ) { 
111
0a2342a64b83 [feladat @ 211]
rejo
parents: 104
diff changeset
    57
		echo "    <span class=\"menuitem\"><a href=\"list_zones.php\">" . _('List zones') . "</a></span>\n"; 
82
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    58
	}
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    59
	if ( $perm_supermaster_view ) { 
111
0a2342a64b83 [feladat @ 211]
rejo
parents: 104
diff changeset
    60
		echo "    <span class=\"menuitem\"><a href=\"list_supermasters.php\">" . _('List supermasters') . "</a></span>\n"; 
82
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    61
	}
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    62
	if (  $perm_zone_master_add ) { 
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    63
		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
    64
	}
82
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    65
	if ( $perm_zone_slave_add ) { 
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    66
		echo "    <span class=\"menuitem\"><a href=\"add_zone_slave.php\">" . _('Add slave zone') . "</a></span>\n"; 
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    67
	}
104
7fef233c99df [feladat @ 204]
rejo
parents: 82
diff changeset
    68
	if ( $perm_supermaster_add ) { 
82
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    69
		echo "    <span class=\"menuitem\"><a href=\"add_supermaster.php\">" . _('Add supermaster') . "</a></span>\n"; 
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    70
	}
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    71
	echo "    <span class=\"menuitem\"><a href=\"change_password.php\">" . _('Change password') . "</a></span>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    72
	echo "    <span class=\"menuitem\"><a href=\"users.php\">" . _('User administration') . "</a></span>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    73
	echo "    <span class=\"menuitem\"><a href=\"index.php?logout\">" . _('Logout') . "</a></span>\n";
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    74
	echo "    </div> <!-- /menu -->\n";
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 4
diff changeset
    75
}
82
c255196bc447 [feladat @ 182]
rejo
parents: 71
diff changeset
    76
echo "    <div class=\"content\">\n";
13
2ff220cfde13 [feladat @ 60]
rejo
parents: 4
diff changeset
    77
2ff220cfde13 [feladat @ 60]
rejo
parents: 4
diff changeset
    78