Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add the confidential mode and the 10s mode
  • Loading branch information
Julien Stuyck committed Oct 1, 2014
commit 2e3d64f31f477866cb26c6fd5bac42c68af704eb
17 changes: 16 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ function deletePaste($pasteid)
if (!empty($_POST['expire']))
{
$expire=$_POST['expire'];
if ($expire=='5min') $meta['expire_date']=time()+5*60;
if ($expire=='10sec') $meta['expire_date']=time()+10;
elseif ($expire=='5min') $meta['expire_date']=time()+5*60;
elseif ($expire=='10min') $meta['expire_date']=time()+10*60;
elseif ($expire=='1hour') $meta['expire_date']=time()+60*60;
elseif ($expire=='1day') $meta['expire_date']=time()+24*60*60;
Expand Down Expand Up @@ -209,9 +210,23 @@ function deletePaste($pasteid)
if ($syntaxcoloring!='0') { $meta['syntaxcoloring']=true; }
}

// If confidential mode, we cannot change anything
if (!empty($_POST['confidential']))
{
$confidential = $_POST['confidential'];
if ($confidential!='0' && $confidential!='1') { $error=true; }
if ($confidential!='0') { $meta['confidential']=true; }
}

// You can't have an open discussion on a "Burn after reading" paste:
if (isset($meta['burnafterreading'])) unset($meta['opendiscussion']);

// Everything is disable on confidential mode
if (isset($meta['confidential']))
{
unset($meta['opendiscussion']);
}

// Optional nickname for comments
if (!empty($_POST['nickname']))
{
Expand Down
5 changes: 5 additions & 0 deletions tpl/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ <h3>{$VERSION}</h3>
<button id="rawtextbutton" onclick="rawText();return false;" style="display:none; "><img src="img/icon_raw.png#" width="15" height="15" style="padding:1px 0px 1px 0px;"/>Raw text</button>
<div id="expiration" style="display:none;">Expires:
<select id="pasteExpiration" name="pasteExpiration">
<option value="10sec">10 seconds</option>
<option value="5min">5 minutes</option>
<option value="10min">10 minutes</option>
<option value="1hour">1 hour</option>
Expand All @@ -72,6 +73,10 @@ <h3>{$VERSION}</h3>
<input type="checkbox" id="syntaxcoloring" name="syntaxcoloring" />
<label for="syntaxcoloring">Syntax coloring</label>
</div>
<div id="syntaxcoloringoption" class="button" style="display:none;">
<input type="checkbox" id="Confidential" name="Confidential" />
<label for="Confidential">Confidential</label>
</div>
</div>
<div id="pasteresult" style="display:none;">
<div id="deletelink"></div>
Expand Down