Files
TravianZ/Templates/Alliance/changepos.tpl
T
Pietro Fallanca 274d89bfa1 Fixed a lot of bugs/security issues in the alliance
+You can no longer kick people of other alliances
+You can no longer change the forum link with no permissions
+You can no longer make more than 3 total confederation and 3 total NAP
+You can no longer send a diplomacy pact to an alliance with already one
pact or one pending pact
+You can no longer handle diplomacy without permissions
+Fixed security bugs related to invites (sending, deleting etc.)
+You can no longer access to any alliance submenus without permissions
(kick menu, diplomacy menu, etc.)
+Errors are now shown correctly and better handling of them
+New forum link and alliance description are shown correctly after
editing them
+You can no longer access to other alliances informations without being
in it (attack reports, news, etc)
+Corrected some alliance news
+Added some language constants to en.php
+Fixed and changed some database.php functions alliance related
2018-04-15 16:11:43 +02:00

99 lines
3.3 KiB
Smarty

<?php
if($database->getUserField($_POST['a_user'], "alliance", 0) != $session->alliance)
{
$form->addError("perm", USER_NOT_IN_YOUR_ALLY);
}
elseif($_POST['a_user'] == $session->uid) $form->addError("perm", CANT_EDIT_YOUR_PERMISSIONS);
if($form->returnErrors() > 0)
{
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $_POST;
header("Location: allianz.php?s=5");
exit;
}
if(!isset($aid)) $aid = $session->alliance;
$playerData = $database->getAlliPermissions($_POST['a_user'], $aid);
$playername = $database->getUserField($_POST['a_user'],'username',0);
$allianceinfo = $database->getAlliance($aid);
echo "<h1>".$allianceinfo['tag']." - ".$allianceinfo['name']."</h1>";
include("alli_menu.tpl");
?>
<form method="post" action="allianz.php">
<table cellpadding="1" cellspacing="1" id="position" class="small_option">
<thead>
<tr>
<th colspan="2">Assign to position</th>
</tr>
</thead>
<tbody>
<tr>
<th>Name:</th>
<td> <?php echo $playername; ?> </td>
</tr>
<tr>
<th>Position:</th>
<td><input class="name text" type="text" name="a_titel" value="<?php echo $playerData['rank']; ?>" maxlength="50" /></td>
</tr>
</tbody>
</table>
<table cellpadding="1" cellspacing="1" id="rights" class="small_option">
<thead>
<tr>
<th colspan="2">Assign rights</th>
</tr>
</thead>
<tbody>
<tr>
<td class="sel"><input class="check" type="checkbox" name="e1" value="1" <?php if ($playerData['opt1']) { echo "checked=checked"; } ?> ></td>
<td>Assign to position</td>
</tr>
<tr>
<td class="sel"><input class="check" type="checkbox" name="e2" value="1" <?php if ($playerData['opt2']) { echo "checked=checked"; } ?> ></td>
<td>Kick player</td>
</tr>
<tr>
<td class="sel"><input class="check" type="checkbox" name="e3" value="1" <?php if ($playerData['opt3']) { echo "checked=checked"; } ?> ></td>
<td>Change alliance description</td>
</tr>
<tr>
<td class="sel"><input class="check" type="checkbox" name="e6" value="1"<?php if ($playerData['opt6']) { echo "checked=checked"; } ?> ></td>
<td>Alliance diplomacy</td>
</tr>
<tr>
<td class="sel"><input class="check" type="checkbox" name="e7" value="1" <?php if ($playerData['opt7']) { echo "checked=checked"; } ?> ></td>
<td>IGMs to every alliance member</td>
</tr>
<tr>
<td class="sel"><input class="check" type="checkbox" name="e4" value="1" <?php if ($playerData['opt4']) { echo "checked=checked"; } ?> ></td>
<td>Invite a player into the alliance</td>
</tr>
<tr>
<td class="sel"><input class="check" type="checkbox" name="e5" value="1" <?php if ($playerData['opt5']) { echo "checked=checked"; } ?> ></td>
<td>Manage forums</td>
</tr>
</tbody>
</table>
<p>
<input type="hidden" name="a" value="1">
<input type="hidden" name="o" value="1">
<input type="hidden" name="s" value="5">
<input type="hidden" name="a_user" value="<?php echo (isset($_POST['a_user']) ? $_POST['a_user'] : ''); ?>">
<input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" />
</p>
</form>