The logout link put the CSRF token in the URL, which goes into logs and the browser history.
51 lines
4.1 KiB
PHP
51 lines
4.1 KiB
PHP
<aside id="sidebar">
|
|
<div class="logo">
|
|
<a <?php
|
|
// Match files that use the main x.x.x logo
|
|
if (preg_match("#^(/$|/index|/article)#", $_SERVER['REQUEST_URI'])) {
|
|
echo 'class="mono" ';
|
|
} else {
|
|
echo 'class="fancy" ';
|
|
}
|
|
?>href="/">x·x·x</a>
|
|
</div>
|
|
<input class="mobile menu-toggle" type="checkbox" />
|
|
<div class="mobile menu-toggle">
|
|
<div class="background"></div>
|
|
<div class="menu">
|
|
<span class="icon"><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22"><path d="m 1.5714287,5.6000003 h 18.8571433 c 0.867427,0 1.571428,-0.8064003 1.571428,-1.8000004 0,-0.9936 -0.704001,-1.7999999 -1.571428,-1.7999999 h -18.8571433 c -0.86742866,0 -1.5714287,0.8063999 -1.5714287,1.7999999 0,0.9936001 0.70400004,1.8000004 1.5714287,1.8000004 z m 18.8571433,3.6000007 h -18.8571433 c -0.86742866,0 -1.5714287,0.806399 -1.5714287,1.800001 0,0.993599 0.70400004,1.8 1.5714287,1.8 h 18.8571433 c 0.867427,0 1.571428,-0.806401 1.571428,-1.8 0,-0.993602 -0.704001,-1.800001 -1.571428,-1.800001 z m 0,7.199999 h -18.8571433 c -0.86742866,0 -1.5714287,0.806402 -1.5714287,1.800003 0,0.993597 0.70400004,1.799997 1.5714287,1.799997 h 18.8571433 c 0.867427,0 1.571428,-0.8064 1.571428,-1.799997 0,-0.993601 -0.704001,-1.800003 -1.571428,-1.800003 Z" /></svg></span>
|
|
<span class="text">Menu</span>
|
|
</div>
|
|
<div class="close">
|
|
<span class="icon"><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22"><path d="m 1.8031641,0.00412447 a 1.7995035,1.7995035 0 0 0 -1.25379006,3.08974763 l 7.90611906,7.9061189 -7.90611906,7.906119 a 1.7995035,1.7995035 0 1 0 2.54449806,2.544498 l 7.9061189,-7.906118 7.906119,7.906118 a 1.7995035,1.7995035 0 1 0 2.544498,-2.544498 l -7.906118,-7.906119 7.906118,-7.9061189 a 1.7995035,1.7995035 0 1 0 -2.544498,-2.54449806 l -7.906119,7.90611906 -7.9061189,-7.90611906 a 1.7995035,1.7995035 0 0 0 -1.290708,-0.54524957 z" /></svg></span>
|
|
<span class="text">Menu</span>
|
|
</div>
|
|
</div>
|
|
<nav class="links">
|
|
<ul id="navigation-menu">
|
|
<li><a href="/">Front page</a></li>
|
|
<li><a href="/about">About <span class="xxx">x·x·x</span></a></li>
|
|
<li><a href="/article?start=5">Archive</a></li>
|
|
<li><a href="/publish">Add</a>/<a href="/publish/edit" class="sidelink">Edit</a></li>
|
|
<?php if (isset($is_admin) && $is_admin) {
|
|
echo ' <li><a href="/publish/addeditor">Add editor</a></li>'."\n";
|
|
// A form, so that the token stays out of the URL
|
|
echo ' <li><form action="/publish/logout" method="post">'.csrf_field().'<button type="submit">Logout</button></form></li>'."\n";
|
|
}
|
|
//echo ' <li><a href="/policy">Publishing policy</a></li>';
|
|
?>
|
|
</ul>
|
|
|
|
<div class="sideinput">
|
|
<form action="/article" method="get">
|
|
<input id="search" name="search" type="text" class="inputtext" maxlength="40" placeholder="Search …" />
|
|
<!--input type="submit" value="Search" class="inputbutton" /-->
|
|
<button type="submit" value="Search" class="inputbutton">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22"><path d="M38.710696,48.0601792 L43,52.3494831 L41.3494831,54 L37.0601792,49.710696 C35.2632422,51.1481185 32.9839107,52.0076499 30.5038249,52.0076499 C24.7027226,52.0076499 20,47.3049272 20,41.5038249 C20,35.7027226 24.7027226,31 30.5038249,31 C36.3049272,31 41.0076499,35.7027226 41.0076499,41.5038249 C41.0076499,43.9839107 40.1481185,46.2632422 38.710696,48.0601792 Z M36.3875844,47.1716785 C37.8030221,45.7026647 38.6734666,43.7048964 38.6734666,41.5038249 C38.6734666,36.9918565 35.0157934,33.3341833 30.5038249,33.3341833 C25.9918565,33.3341833 22.3341833,36.9918565 22.3341833,41.5038249 C22.3341833,46.0157934 25.9918565,49.6734666 30.5038249,49.6734666 C32.7048964,49.6734666 34.7026647,48.8030221 36.1716785,47.3875844 C36.2023931,47.347638 36.2360451,47.3092237 36.2726343,47.2726343 C36.3092237,47.2360451 36.347638,47.2023931 36.3875844,47.1716785 Z" transform="translate(-20 -31)"/></svg>
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</nav>
|
|
</aside>
|
|
|