mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-26 04:51:08 -05:00
Merge branch 'spamadmin' into dev
This commit is contained in:
commit
4cf85b1a21
@ -3,6 +3,9 @@ RewriteEngine on
|
|||||||
RewriteCond $1 !^(index\.php|static|favicon\.ico|robots\.txt|sitemap.xml|google(.+)\.html)
|
RewriteCond $1 !^(index\.php|static|favicon\.ico|robots\.txt|sitemap.xml|google(.+)\.html)
|
||||||
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
|
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
|
||||||
|
|
||||||
|
# basic auth for PHP with fastcgi
|
||||||
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
|
||||||
|
|
||||||
SetOutputFilter DEFLATE
|
SetOutputFilter DEFLATE
|
||||||
FileETag MTime Size
|
FileETag MTime Size
|
||||||
|
|
||||||
@ -32,3 +35,5 @@ FileETag MTime Size
|
|||||||
#AuthName "Backend"
|
#AuthName "Backend"
|
||||||
#AuthUserFile /path/to/.htpasswd #create one with htpasswd -c .htpasswd username
|
#AuthUserFile /path/to/.htpasswd #create one with htpasswd -c .htpasswd username
|
||||||
#Require user username
|
#Require user username
|
||||||
|
|
||||||
|
AddHandler php5-fastcgi .php .php5
|
||||||
|
@ -21,6 +21,9 @@ class Spamadmin extends CI_Controller
|
|||||||
//protection
|
//protection
|
||||||
$user = $this->config->item('spamadmin_user');
|
$user = $this->config->item('spamadmin_user');
|
||||||
$pass = $this->config->item('spamadmin_pass');
|
$pass = $this->config->item('spamadmin_pass');
|
||||||
|
|
||||||
|
// basic auth for fastcgi
|
||||||
|
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));
|
||||||
|
|
||||||
if ($user == '' || $pass == '' || !isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER'] != $user || $_SERVER['PHP_AUTH_PW'] != $pass)
|
if ($user == '' || $pass == '' || !isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER'] != $user || $_SERVER['PHP_AUTH_PW'] != $pass)
|
||||||
{
|
{
|
||||||
@ -33,6 +36,19 @@ class Spamadmin extends CI_Controller
|
|||||||
function index()
|
function index()
|
||||||
{
|
{
|
||||||
$this->load->model('pastes');
|
$this->load->model('pastes');
|
||||||
|
$pastes_to_delete = $this->input->post('pastes_to_delete');
|
||||||
|
|
||||||
|
if ($pastes_to_delete)
|
||||||
|
{
|
||||||
|
foreach (explode(' ', $pastes_to_delete) as $pid)
|
||||||
|
{
|
||||||
|
$this->db->where('pid', $pid);
|
||||||
|
$this->db->delete('pastes');
|
||||||
|
}
|
||||||
|
redirect(site_url('spamadmin/' . $this->uri->segment(2)));
|
||||||
|
}
|
||||||
|
|
||||||
|
//render view
|
||||||
$data = $this->pastes->getSpamLists();
|
$data = $this->pastes->getSpamLists();
|
||||||
$this->load->view('list_ips', $data);
|
$this->load->view('list_ips', $data);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.hidden {
|
.hidden, .inv {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,3 +127,11 @@ table.table thead .sorting_desc_disabled { background: url('../images/sort_desc_
|
|||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ui-selectable>.ui-selected { background-color: #a6c9e2; }
|
||||||
|
.ui-selectable>.ui-selecting { background: #FECA40; }
|
||||||
|
|
||||||
|
.ui-selectable-helper {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 100;
|
||||||
|
border:1px dotted black;
|
||||||
|
}
|
6
htdocs/themes/bootstrap/js/jquery-ui-selectable-combined.min.js
vendored
Normal file
6
htdocs/themes/bootstrap/js/jquery-ui-selectable-combined.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -16,6 +16,48 @@ ST.show_embed = function() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ST.spamadmin = function() {
|
||||||
|
if ($('.content h1').text() == 'Spamadmin') {
|
||||||
|
$('.content .hidden').show();
|
||||||
|
$('.content .quick_remove').live('click', function(ev) {
|
||||||
|
var ip = $(ev.target).data('ip');
|
||||||
|
if (confirm('Delete all pastes belonging to ' + ip + '?')) {
|
||||||
|
$.post(base_url + 'spamadmin/' + ip, {
|
||||||
|
'confirm_remove': 'yes',
|
||||||
|
'block_ip': 1
|
||||||
|
}, function() {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// needed by .selectable
|
||||||
|
$.fn.addBack = function(selector) {
|
||||||
|
return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.selectable>tbody').selectable({
|
||||||
|
filter: 'tr',
|
||||||
|
cancel: 'a',
|
||||||
|
stop: function() {
|
||||||
|
var $deletestack = $(".paste_deletestack");
|
||||||
|
var $input = $("input[name=pastes_to_delete]");
|
||||||
|
$('.inv').show();
|
||||||
|
$deletestack.empty();
|
||||||
|
$input.empty();
|
||||||
|
var res = [];
|
||||||
|
$(".ui-selected").each(function(i, el) {
|
||||||
|
var id = $('a', el).attr('href').split('view/')[1];
|
||||||
|
res.push(id);
|
||||||
|
});
|
||||||
|
$deletestack.text(res.join(' '));
|
||||||
|
$input.val(res.join(' '));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
ST.line_highlighter = function() {
|
ST.line_highlighter = function() {
|
||||||
var org_href = window.location.href.replace(/(.*?)#(.*)/, '$1');
|
var org_href = window.location.href.replace(/(.*?)#(.*)/, '$1');
|
||||||
var first_line = false;
|
var first_line = false;
|
||||||
@ -293,6 +335,7 @@ ST.clickable_urls = function() {
|
|||||||
|
|
||||||
ST.init = function() {
|
ST.init = function() {
|
||||||
ST.show_embed();
|
ST.show_embed();
|
||||||
|
ST.spamadmin();
|
||||||
ST.line_highlighter();
|
ST.line_highlighter();
|
||||||
ST.crypto();
|
ST.crypto();
|
||||||
ST.dragdrop();
|
ST.dragdrop();
|
||||||
|
@ -18,6 +18,7 @@ if(isset($ace_modes)){
|
|||||||
//Javascript
|
//Javascript
|
||||||
$this->carabiner->js('jquery.js');
|
$this->carabiner->js('jquery.js');
|
||||||
$this->carabiner->js('jquery.timers.js');
|
$this->carabiner->js('jquery.timers.js');
|
||||||
|
$this->carabiner->js('jquery-ui-selectable-combined.min.js');
|
||||||
$this->carabiner->js('bootstrap.min.js');
|
$this->carabiner->js('bootstrap.min.js');
|
||||||
$this->carabiner->js('crypto-js/rollups/aes.js');
|
$this->carabiner->js('crypto-js/rollups/aes.js');
|
||||||
$this->carabiner->js('lz-string-1.3.3-min.js');
|
$this->carabiner->js('lz-string-1.3.3-min.js');
|
||||||
|
@ -9,10 +9,8 @@
|
|||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<?php echo $page['title']; ?>
|
<?php echo $page['title']; ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
<form action="<?php echo base_url(); ?>" method="post" class="form-vertical well">
|
<form action="<?php echo base_url(); ?>" method="post" class="form-vertical well">
|
||||||
@ -20,19 +18,15 @@
|
|||||||
<div class="span3">
|
<div class="span3">
|
||||||
<label for="name"><?php echo lang('paste_author'); ?>
|
<label for="name"><?php echo lang('paste_author'); ?>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<?php $set = array('name' => 'name', 'id' => 'name', 'class' => 'span3', 'value' => $name_set, 'maxlength' => '32', 'tabindex' => '1');
|
<?php $set = array('name' => 'name', 'id' => 'name', 'class' => 'span3', 'value' => $name_set, 'maxlength' => '32', 'tabindex' => '1');
|
||||||
echo form_input($set);?>
|
echo form_input($set);?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="span3">
|
<div class="span3">
|
||||||
<label for="title">
|
<label for="title">
|
||||||
<?php echo lang('paste_title'); ?>
|
<?php echo lang('paste_title'); ?>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<input value="<?php if(isset($title_set)){ echo $title_set; }?>" class="span3" type="text" id="title" name="title" tabindex="2" maxlength="50" />
|
<input value="<?php if(isset($title_set)){ echo $title_set; }?>" class="span3" type="text" id="title" name="title" tabindex="2" maxlength="50" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="span3">
|
<div class="span3">
|
||||||
<label for="lang">
|
<label for="lang">
|
||||||
<?php echo lang('paste_lang'); ?>
|
<?php echo lang('paste_lang'); ?>
|
||||||
@ -40,7 +34,6 @@
|
|||||||
<?php $lang_extra = 'id="lang" class="select span3" tabindex="3"'; echo form_dropdown('lang', $languages, $lang_set, $lang_extra); ?>
|
<?php $lang_extra = 'id="lang" class="select span3" tabindex="3"'; echo form_dropdown('lang', $languages, $lang_set, $lang_extra); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
<label for="code"><?php echo lang('paste_yourpaste'); ?>
|
<label for="code"><?php echo lang('paste_yourpaste'); ?>
|
||||||
@ -109,11 +102,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if($reply){ ?>
|
<?php if($reply){ ?>
|
||||||
<input type="hidden" value="<?php echo $reply; ?>" name="reply" />
|
<input type="hidden" value="<?php echo $reply; ?>" name="reply" />
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php if($this->config->item('enable_captcha') && $this->session->userdata('is_human') === null){ ?>
|
<?php if($this->config->item('enable_captcha') && $this->session->userdata('is_human') === null){ ?>
|
||||||
<div class="item_group">
|
<div class="item_group">
|
||||||
<div class="item item_captcha">
|
<div class="item item_captcha">
|
||||||
|
@ -172,7 +172,7 @@ h4 {
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hidden, .email, .url {
|
.hidden, .email, .url, .inv {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -565,3 +565,11 @@ h4 {
|
|||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ui-selectable>.ui-selected { background-color: #a6c9e2; }
|
||||||
|
.ui-selectable>.ui-selecting { background: #FECA40; }
|
||||||
|
|
||||||
|
.ui-selectable-helper {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 100;
|
||||||
|
border:1px dotted black;
|
||||||
|
}
|
||||||
|
6
htdocs/themes/default/js/jquery-ui-selectable-combined.min.js
vendored
Normal file
6
htdocs/themes/default/js/jquery-ui-selectable-combined.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -51,6 +51,30 @@ ST.spamadmin = function() {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// needed by .selectable
|
||||||
|
$.fn.addBack = function(selector) {
|
||||||
|
return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.selectable>tbody').selectable({
|
||||||
|
filter: 'tr',
|
||||||
|
cancel: 'a',
|
||||||
|
stop: function() {
|
||||||
|
var $deletestack = $(".paste_deletestack");
|
||||||
|
var $input = $("input[name=pastes_to_delete]");
|
||||||
|
$('.inv').show();
|
||||||
|
$deletestack.empty();
|
||||||
|
$input.empty();
|
||||||
|
var res = [];
|
||||||
|
$(".ui-selected").each(function(i, el) {
|
||||||
|
var id = $('a', el).attr('href').split('view/')[1];
|
||||||
|
res.push(id);
|
||||||
|
});
|
||||||
|
$deletestack.text(res.join(' '));
|
||||||
|
$input.val(res.join(' '));
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
ST.line_highlighter = function() {
|
ST.line_highlighter = function() {
|
||||||
|
@ -18,6 +18,7 @@ if(isset($ace_modes)){
|
|||||||
//Javascript
|
//Javascript
|
||||||
$this->carabiner->js('jquery.js');
|
$this->carabiner->js('jquery.js');
|
||||||
$this->carabiner->js('jquery.timers.js');
|
$this->carabiner->js('jquery.timers.js');
|
||||||
|
$this->carabiner->js('jquery-ui-selectable-combined.min.js');
|
||||||
$this->carabiner->js('crypto-js/rollups/aes.js');
|
$this->carabiner->js('crypto-js/rollups/aes.js');
|
||||||
$this->carabiner->js('lz-string-1.3.3-min.js');
|
$this->carabiner->js('lz-string-1.3.3-min.js');
|
||||||
$this->carabiner->js('filereader.js');
|
$this->carabiner->js('filereader.js');
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
<?php echo validation_errors(); ?>
|
<?php echo validation_errors(); ?>
|
||||||
|
|
||||||
<div class="form_wrapper margin">
|
<div class="form_wrapper margin">
|
||||||
@ -13,7 +12,7 @@
|
|||||||
<?php echo lang('paste_create_new_desc'); ?>
|
<?php echo lang('paste_create_new_desc'); ?>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<?php echo $page['instructions']; ?>
|
<?php echo $page['instructions']; ?>
|
||||||
<?php } ?></p>
|
<?php } ?></p>
|
||||||
|
|
||||||
<div class="item_group">
|
<div class="item_group">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
@ -85,7 +84,7 @@
|
|||||||
<label for="expire"><?php echo lang('paste_delete'); ?>
|
<label for="expire"><?php echo lang('paste_delete'); ?>
|
||||||
<span class="instruction"><?php echo lang('paste_delete_desc'); ?></span>
|
<span class="instruction"><?php echo lang('paste_delete_desc'); ?></span>
|
||||||
</label>
|
</label>
|
||||||
<?php
|
<?php
|
||||||
$expire_extra = 'id="expire" class="select" tabindex="7"';
|
$expire_extra = 'id="expire" class="select" tabindex="7"';
|
||||||
$default_expiration = config_item('default_expiration');
|
$default_expiration = config_item('default_expiration');
|
||||||
$options = array(
|
$options = array(
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
}
|
}
|
||||||
$n = 0;
|
$n = 0;
|
||||||
if(!empty($pastes)){ ?>
|
if(!empty($pastes)){ ?>
|
||||||
<table class="recent">
|
<table class="recent selectable">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="title">Title</th>
|
<th class="title">Title</th>
|
||||||
<th class="name">Name</th>
|
<th class="name">Name</th>
|
||||||
<th class="time">When</th>
|
<th class="time">When</th>
|
||||||
<th class="time">IP</th>
|
<th class="time">IP</th>
|
||||||
<th title="Quick remove" class="qr hidden">X</th>
|
<th title="Quick remove" class="hidden">X</th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php foreach($pastes as $paste) {
|
<?php foreach($pastes as $paste) {
|
||||||
if(checkNum($n) == TRUE) {
|
if(checkNum($n) == TRUE) {
|
||||||
@ -37,6 +37,15 @@
|
|||||||
<?php }?>
|
<?php }?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<form action="" method="post">
|
||||||
|
<h2 class="confirm_title inv">Confirm deletion of the following pastes:</h2>
|
||||||
|
<div class="paste_deletestack"></div>
|
||||||
|
<input type="hidden" name="pastes_to_delete" />
|
||||||
|
|
||||||
|
<input type="submit" name="delete_pastes" value="Delete selected pastes" class="inv" />
|
||||||
|
</form>
|
||||||
|
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<p><?php echo lang('paste_missing'); ?> :(</p>
|
<p><?php echo lang('paste_missing'); ?> :(</p>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user