Location: PHPKode > projects > web-cp - Web Hosting Control Panel > webcp/web/server/controlpanel.phps
<?
if ($action AND $confirm == "true" && $userdata['type'] != "demo") {

	if ($save == "true") {
		if ($action == "template") {
			
			// enregistrement template
			if(empty($template)) { print "ERROR\n";	return false; }
			
			if ($service == "named")
			$file = fopen($cfg['basedir']."/headers/".$file.".".$service.".tpl","w");
			if(!($file))
			{
				print("Impossible d\'ouvrir $service");
				return;
			}
			fputs($file,$template);
		}
	}
} elseif ($action && $confirm == "true" && $userdata['type'] == "demo") {
	echo "<center>".$T['err']['demo user']."</center>";
}

if ($action AND $confirm != "true") {
	if ($save == "true" ) {?>
		<blockquote>
		<form action="<?=$current_url;?>" method="post">
		&nbsp;&nbsp;&bull; <?=$T['really '.$action];?><b><?=$file;?>.<?=$service;?></b><br>
		&nbsp;&nbsp;&nbsp;<input type="submit" value="<?=$T['yes'];?>">
		<input type="hidden" name="action" value="<?=$action;?>">
		<input type="hidden" name="service" value="<?=$service;?>">
		<textarea name="template" rows="30" cols="80"><?=stripslashes($template);?></textarea><br>
		<input type="hidden" name="file" value="<?=$file;?>">
		<input type="hidden" name="save" value="true">
		<input type="hidden" name="confirm" value="true">
		</form>
		</blockquote>
	<?}
	elseif ($action =="template") {
		if ($service == "named") {
			if ($file == "domain") {
				// domain.named.tpl
				$file = fopen($cfg['basedir']."/headers/domain.".$service.".tpl","r");
				if(!($file))
				{
					print $T['err']['template']['file'];
					return;
				}
				while(!feof($file))
				{
					$line = fgets($file, 255);
					$tpl .= stripslashes($line);
				}
				
				print "<b>domain.".$service."</b>".$T['named']['title file']; 
				//echo "<br><font color=\"red\">".$T['named']['header added']."</font>"; ?>
				<br><br>
				<table>
					<tr>
						<td>
							<form action="<?=$current_url;?>&service=named&action=template" METHOD="POST">
								<input type="HIDDEN" name="file" value="domain">
								<input type="HIDDEN" name="save" value="true">
								<textarea name="template" rows="30" cols="80"><?=$tpl;?></textarea><br>
								<input type="submit" value=<?=$T['save'];?>>
							</form>
						</td>
					</tr>
					<tr>
				</table>

				<b><u><?=$T['named']['title tag'];?></u></b><br>
			
				<br><?=$T['named']['info'];?><br><br>

				<DIV align="left">
				<b>{HEADER}</b> <?=$T['named']['header'];?> <br>
				<b>{SERVER}</b> <?=$T['named']['server'];?> <br>
				<b>{DOMAIN}</b> <?=$T['named']['domain'];?> <br>
				<b>{IP}</b> <?=$T['named']['ip'];?> <br>
				<b>{ADMMAIL}</b> <?=$T['named']['adminmail'];?> <br>
				<b>{SERIAL}</b> <?=$T['named']['serial'];?> <br>
				<b>{REFRESH}</b> <?=$T['named']['refresh'];?> <br>
				<b>{RETRY}</b> <?= $T['named']['retry'];?> <br>
				<b>{EXPRIRE}</b> <?=$T['named']['expire'];?> <br>
				<b>{TTL}</b> <?=$T['named']['ttl'];?> <br>
				<b>{NS1}-{$NS4}</b> <?=$T['named']['ns'];?> <br>
				<b>{GPOS}</b> <?=$T['named']['gpos'];?> <br>
				<b>{HINFO}</b> <?=$T['named']['hinfo'];?> <br>
				<b>{NOHOST}</b> <?=$T['named']['nohost'];?> <br>
				<b>{SUBDOMAINS}</b> <?=$T['named']['subdomains'];?> <br>
				<b>{ALIAS}</b> <?=$T['named']['alias'];?> <br>
				<b>{CATCHALL}</b> <?=$T['named']['catchall'];?> <br>
				</DIV><br><br>

			<? } ?>
			
	 <? } } else { ?>
		<blockquote>
		<form action="<?=$current_url;?>" method="post">
		&nbsp;&nbsp;&bull; <?=$T['really '.$action];?><b><?=$service;?></b><br>
		&nbsp;&nbsp;&nbsp;<input type="submit" value="<?=$T['yes'];?>">
		<input type="hidden" name="action" value="<?=$action;?>">
		<input type="hidden" name="service" value="<?=$service;?>">
		<input type="hidden" name="confirm" value="true">
		</form>
		</blockquote>
	<? }
} ?>

<div align="center">
<table border="1" cellspacing="1">
	<tr>
		<td class="row1" width="500">
			&nbsp;<b>dns</b>
			<?
				if ( $cfg['dns_tpl'] == true )
					echo "( template ".$T['activated']." )";
				else
					echo "( template ".$T['not activated']." )";
			?>
			<ul>
				<li><a href="./?url=controlpanel&cp=server&number=<?=$number;?>&user=<?=$user;?>&service=named&action=template&file=domain"><img src="icon/document16.gif" border="0" width="16" height="16" alt="edit template"> domain.named.tpl</a>
			</ul>
		</td>
		<td class="row2" width="75">&nbsp;</td>
	</tr>
</table><br>
</div>
Return current item: web-cp - Web Hosting Control Panel