Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDAP auth #207

Open
wants to merge 911 commits into
base: skin-neverland
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
911 commits
Select commit Hold shift + click to select a range
74fd45e
Add view checksum
sayakb Jan 19, 2014
aae14ab
Redirect to non-html pages
sayakb Jan 19, 2014
de29ab8
Merge branch 'skin-bootstrap'
sayakb Jan 19, 2014
03c0715
Merge branch 'skin-neverland'
sayakb Jan 19, 2014
01b7292
Performance improvements
sayakb Jan 19, 2014
584eaf7
Update dependencies
sayakb Jan 19, 2014
0e3c7cd
Fix php 5.3 incompatibilities
sayakb Jan 19, 2014
c3d3101
getRemote has been removed from laravel - use Requests instead
sayakb Jan 19, 2014
34fab78
Cancel previous timers when initializing
sayakb Jan 20, 2014
061904f
Merge branch 'skin-bootstrap'
sayakb Jan 20, 2014
b45b4b4
Merge branch 'skin-neverland'
sayakb Jan 20, 2014
30bcf46
Change timed event interval to 5s from 1s
sayakb Jan 20, 2014
2dfbb14
Merge branches 'skin-bootstrap' and 'skin-neverland'
sayakb Jan 20, 2014
c04e78a
Run repeat timers once first
sayakb Jan 20, 2014
fcb7483
Merge branches 'skin-bootstrap' and 'skin-neverland'
sayakb Jan 20, 2014
76b549a
Append the query string to the url in response header
sayakb Jan 25, 2014
450762d
Dont replace document with response
sayakb Jan 25, 2014
8f5d2e6
Merge branch 'skin-bootstrap'
sayakb Jan 25, 2014
cdeff8a
Merge branch 'skin-neverland'
sayakb Jan 25, 2014
178fdc4
Check for support before using AJAX nav
sayakb Jan 26, 2014
e68c7e2
Merge branch 'skin-bootstrap'
sayakb Jan 26, 2014
45b63c1
Merge branch 'skin-neverland'
sayakb Jan 26, 2014
f73ed13
Send current url instead of fqdn
sayakb Jan 26, 2014
f180093
Release v1.4
sayakb Jan 26, 2014
5ae170d
Merging #82: Fix owner check for a paste
sayakb Feb 1, 2014
f032f89
Trim trailing slash from href
sayakb Feb 9, 2014
9c4a3c2
Merge branch 'skin-neverland'
sayakb Feb 9, 2014
92224e4
Merge branch 'skin-bootstrap'
sayakb Feb 9, 2014
bac19be
Wishlist #83: allow sharing pastes via email
sayakb Feb 9, 2014
b57bd33
Add email share button
sayakb Feb 9, 2014
fbeab9d
Merge branch 'skin-bootstrap'
sayakb Feb 9, 2014
52104aa
Merge branch 'skin-neverland'
sayakb Feb 9, 2014
d97c3f9
Change project detection logic
sayakb Feb 9, 2014
e7adbc9
Merge branch 'skin-neverland'
sayakb Feb 9, 2014
105092e
Update dependencies
sayakb Feb 9, 2014
85344bd
Make content sharing configurable
sayakb Feb 9, 2014
2e44b40
Merge branch 'skin-bootstrap'
sayakb Feb 9, 2014
4ec5437
Merge branch 'skin-neverland'
sayakb Feb 9, 2014
47da215
Make content sharing configurable
sayakb Feb 9, 2014
dc6d098
Apply share restriction
sayakb Feb 9, 2014
ff70766
Merge branch 'skin-bootstrap'
sayakb Feb 9, 2014
f228662
Merge branch 'skin-neverland'
sayakb Feb 9, 2014
ddb216c
Merge branch 'skin-neverland'
sayakb Feb 9, 2014
4958d6f
Dont count user query for debug info
sayakb Feb 9, 2014
962715e
Merge branch 'skin-bootstrap'
sayakb Feb 9, 2014
92e075f
Merge branch 'skin-neverland'
sayakb Feb 9, 2014
7bda961
Merge branch 'skin-neverland'
sayakb Feb 9, 2014
9057a70
Smooth scroll for anchors
sayakb Feb 10, 2014
28893ae
Merge branch 'skin-bootstrap'
sayakb Feb 10, 2014
e50aeb0
Merge branch 'skin-neverland'
sayakb Feb 10, 2014
afe2eb7
Trim slash from currentUrl
sayakb Feb 10, 2014
f50276f
Merge branch 'skin-bootstrap'
sayakb Feb 10, 2014
730d2c7
Merge branch 'skin-neverland'
sayakb Feb 10, 2014
a51a361
Fix issue #92: Perform validation in retrieve rather than validate
sayakb Mar 2, 2014
d0a555a
Release v1.5
sayakb Mar 2, 2014
1d8f9fc
Update dependencies
sayakb Apr 7, 2014
5d44b7c
Update bootstrap
sayakb Apr 7, 2014
bc69add
Update bootstrap
sayakb Apr 7, 2014
e7d9a9a
Fix issue #94: Add viewport instructions
sayakb Apr 7, 2014
47663e4
Merge branch 'skin-bootstrap'
sayakb Apr 7, 2014
2c2b0bd
Merge branch 'skin-neverland'
sayakb Apr 7, 2014
992931b
Fix issue #95: Handle HTTP errors when offline
sayakb Apr 7, 2014
412085f
Hide broken gravatar images
sayakb Apr 7, 2014
0cfacc8
Merge branch 'skin-bootstrap'
sayakb Apr 7, 2014
7651782
Merge branch 'skin-neverland'
sayakb Apr 7, 2014
5d2302e
Adjust skin chooser for responsive design
sayakb Apr 7, 2014
b24306a
Merge branch 'skin-bootstrap'
sayakb Apr 7, 2014
f76de10
Re-run update script
sayakb Apr 7, 2014
5cc23dc
Wishlist #96: Add support for ads
sayakb Apr 12, 2014
35eed62
Wishlist #96: Add support for ads
sayakb Apr 12, 2014
743000a
Merge branch 'skin-bootstrap'
sayakb Apr 12, 2014
4772bb1
Merge branch 'skin-neverland'
sayakb Apr 12, 2014
0f49bea
Wishlist #103: rtrim paste data instead of trim
sayakb Apr 12, 2014
02bd813
Wishlist #102: Allow admins to view user pastes
sayakb Apr 13, 2014
675b920
Wishlist #102: Allow admins to view user pastes
sayakb Apr 13, 2014
def5c8d
Merge branch 'skin-bootstrap'
sayakb Apr 13, 2014
5089a43
Merge branch 'skin-neverland'
sayakb Apr 13, 2014
70fdf30
Turn off debugging
sayakb Apr 13, 2014
65d01f8
Remove ajax indicator from url when redirecting to intended URL
sayakb Apr 13, 2014
12b01f7
Update dependencies
sayakb Apr 13, 2014
9a51a6e
Wishlist #102: Option to specify max paste size
sayakb Apr 13, 2014
381ca2f
Wishlist #102: Option to specify max paste size
sayakb Apr 13, 2014
eddafcb
Merge branch 'skin-bootstrap'
sayakb Apr 13, 2014
a44a7c5
Merge branch 'skin-neverland'
sayakb Apr 13, 2014
a032a30
Add paste size limit to API posts
sayakb Apr 13, 2014
11597dc
Donot use array walk - it iz evil >:-(
sayakb Apr 13, 2014
ba5998b
Wishlist #102: Admins now have access to private archives
sayakb Apr 13, 2014
b14562f
Wishlist #102: Admins can select any expiration time
sayakb Apr 13, 2014
fb54308
Upgrade to jQuery 2.1
sayakb Apr 14, 2014
38925ee
Merge branches 'skin-bootstrap' and 'skin-neverland'
sayakb Apr 14, 2014
b14ad0d
Release v1.6
sayakb Apr 20, 2014
891da1f
Release v1.6
sayakb Apr 20, 2014
3054f7b
Update dependencies
sayakb Apr 20, 2014
f3c93c6
Revert "Update dependencies"
sayakb Apr 20, 2014
09891e7
Update dependencies
sayakb Apr 20, 2014
cd76fe4
Add remember token implementations
sayakb Apr 20, 2014
201f9e7
Trim abstract size to 680 chars max
sayakb Apr 22, 2014
d25ec46
Wishlist #112: Allow users to delete their own pastes
sayakb May 17, 2014
7608dab
Allow users to delete their own pastes
sayakb May 17, 2014
1e8528c
Merge branches 'skin-neverland' and 'skin-bootstrap'
sayakb May 17, 2014
6288e7f
Issue #110: Add missing space in allowedTags
sayakb May 17, 2014
035d012
Issue #109: Include nginx config
sayakb May 17, 2014
6895a5f
Update dependencies
sayakb May 18, 2014
17f6c5d
Add utility to get/set config data from command line
sayakb May 18, 2014
a0ba69e
Wishlist #105: Allow users to flag pastes
sayakb May 18, 2014
b132480
Allow users to flag pastes
sayakb May 18, 2014
c37b96a
Merge branch 'skin-bootstrap'
sayakb May 18, 2014
a7a7468
Merge branch 'skin-neverland'
sayakb May 18, 2014
f93530e
Wishlist #107: Allow attachments to a paste
sayakb May 24, 2014
c9d239a
Template changes to accommodate attachments
sayakb May 24, 2014
8eff5ff
Merge branch 'skin-bootstrap'
sayakb May 24, 2014
f2d3eb2
Merge branch 'skin-neverland'
sayakb May 24, 2014
4e4a18f
Disable AJAX submit for create form
sayakb May 24, 2014
93bbcd2
Merge branch 'skin-bootstrap'
sayakb May 24, 2014
9411d24
Merge branch 'skin-neverland'
sayakb May 24, 2014
25dfbfe
Exclude ajax nav for attachment links
sayakb May 24, 2014
4e789b6
Merge branch 'skin-bootstrap'
sayakb May 24, 2014
ea76186
Merge branch 'skin-neverland'
sayakb May 24, 2014
329d52b
Reorganize global message logic to avoid version conflicts
sayakb May 24, 2014
b55c551
Update checksum
sayakb May 24, 2014
e11a637
Update dependencies
sayakb May 24, 2014
e21e803
Check for attachment flag when saving as well
sayakb May 24, 2014
56b7be7
Fix return type
sayakb May 24, 2014
6de8ff4
Add unit test base
sayakb May 25, 2014
3e52c48
Add global context
sayakb May 25, 2014
ad2ef0f
Merge branch 'skin-bootstrap'
sayakb May 25, 2014
11e4dc6
Merge branch 'skin-neverland'
sayakb May 25, 2014
5c29bb0
Update dependencies
sayakb May 31, 2014
70d7fce
Release v1.7
sayakb May 31, 2014
48f9acd
Config option to control paste flagging
sayakb May 31, 2014
61de4f4
Skin changes to control paste flagging
sayakb May 31, 2014
aa5ef00
Merge branch 'skin-bootstrap'
sayakb May 31, 2014
71b144e
Merge branch 'skin-neverland'
sayakb May 31, 2014
d3dd630
Fix author links
sayakb May 31, 2014
a3959f0
Merge branch 'skin-bootstrap'
sayakb May 31, 2014
4d2c51d
Merge branch 'skin-neverland'
sayakb May 31, 2014
b42d70c
Add proxy for cookie class
sayakb Jun 8, 2014
e481266
Add unit test cases for show and create controllers. Also package tes…
sayakb Jun 8, 2014
778b7e3
Compatibility for php 5.3
sayakb Jun 8, 2014
a56bfd6
Revert "Compatibility for php 5.3"
sayakb Jun 8, 2014
26c0971
Compatibility for php 5.3
sayakb Jun 8, 2014
1082439
Unit tests for show and create
sayakb Jun 8, 2014
43f58c7
Add default attachment key
sayakb Jun 8, 2014
f8fcb15
Unit tests for comments
sayakb Jun 8, 2014
d852bda
Add test cases for list controller
sayakb Jun 8, 2014
405dab4
Add default value to remember_token
sayakb Jun 8, 2014
d6c2794
Some fixes here and there, add user test cases
sayakb Jun 8, 2014
ad9cdb9
Global fixes and admin controller unit tests
sayakb Jun 8, 2014
8e16007
Add API test cases
sayakb Jun 9, 2014
27fa2ff
Add AJAX, feed and setup tests
sayakb Jun 9, 2014
455d491
Update dependencies
sayakb Jun 9, 2014
58f9417
Bump up composer version
sayakb Jun 9, 2014
33eceea
Upgrade to Laravel 4.2
sayakb Jun 9, 2014
45a17bf
Set minimum supported php version to 5.4
sayakb Jun 9, 2014
de6a4e5
Regenerate the application key
sayakb Jun 11, 2014
1b4fcbe
Update dependencies
sayakb Jun 13, 2014
1842a5b
Compile for PHP 5.6 as well
sayakb Jun 13, 2014
cd5070a
Add link to privacy notice to readme
sayakb Jun 14, 2014
d5bafd9
Wishlist #117: Add test button to mail settings
sayakb Jun 14, 2014
4400f18
Add test button to mail settings
sayakb Jun 14, 2014
cdc0dd3
Merge branch 'skin-bootstrap'
sayakb Jun 14, 2014
90730ab
Merge branch 'skin-neverland'
sayakb Jun 14, 2014
faa2734
Issue #119: reload cached data upon updating users
sayakb Jun 14, 2014
fc24490
Move session messages out of mail::test
sayakb Jun 14, 2014
79b6743
Add more assertions
sayakb Jun 14, 2014
d362097
Cache GeSHi language list
sayakb Jun 14, 2014
796cb88
Use mail queue while sending emails
sayakb Jun 14, 2014
97be423
Fall back to username for emails if dispname isn't available
sayakb Jun 15, 2014
b021aac
Update dependencies
sayakb Jun 19, 2014
db2ab1a
Wishlist #123: Add option to enforce public pastes
sayakb Jun 28, 2014
8ba6930
Update unit testing DB with v1.8 schema
sayakb Jun 28, 2014
68af4b3
Add changes for visibility flag
sayakb Jun 29, 2014
e83683e
Merge branch 'skin-neverland'
sayakb Jun 29, 2014
e71a3b7
Merge branch 'skin-bootstrap'
sayakb Jun 29, 2014
38cc2ab
Update dependencies
sayakb Jun 29, 2014
bfc3633
Update to bootstrap 3.2
sayakb Jun 29, 2014
2e1c5f3
Merge branch 'skin-bootstrap'
sayakb Jun 29, 2014
b51738d
Update dependencies
sayakb Jul 10, 2014
874d041
Update dependencies
sayakb Jul 15, 2014
6c3c88f
Update dependencies
sayakb Jul 17, 2014
b72abe5
Update dependencies
sayakb Jul 18, 2014
00f0e29
Issue #134: Attachments are now removed if paste is deleted
sayakb Jul 19, 2014
eb7bd33
Add reference to file
sayakb Jul 19, 2014
1a77024
Add rem attachment button
sayakb Jul 19, 2014
54d4edb
Merge branch 'skin-bootstrap'
sayakb Jul 19, 2014
e498c9e
Merge branch 'skin-neverland'
sayakb Jul 19, 2014
1b80fed
Wishlist #131: Allow admins to remove attachments
sayakb Jul 19, 2014
5ea6d07
Confirm attachment deletion
sayakb Jul 19, 2014
dd5bd85
Merge branch 'skin-bootstrap'
sayakb Jul 19, 2014
a7715c8
Merge branch 'skin-neverland'
sayakb Jul 19, 2014
9150485
Merge branch 'skin-neverland'
sayakb Jul 19, 2014
edc51c1
Update dependencies
sayakb Jul 22, 2014
6b9416f
Add test cases for new functionality
sayakb Jul 22, 2014
43b7dd3
Issue #137: Hide attachment box for revisions
sayakb Jul 23, 2014
4bdb78f
Hide attachment box for revisions
sayakb Jul 23, 2014
f93f7ae
Merge branch 'skin-bootstrap'
sayakb Jul 23, 2014
4c9fbe0
Merge branch 'skin-neverland'
sayakb Jul 23, 2014
96dea05
Remove attachment from revision data array
sayakb Jul 23, 2014
55c0128
Release v1.8
sayakb Jul 26, 2014
78c696c
Update dependencies
sayakb Jul 29, 2014
eba5bbe
Update dependencies
sayakb Jul 30, 2014
0b99824
Update dependencies
sayakb Aug 4, 2014
95c765d
Wishlist #142: Always return paste hashes for API posts
sayakb Aug 5, 2014
ae955eb
Issue #168: Remove set_time_limit as it is causing issues with many h…
sayakb Oct 26, 2014
9faea36
Update dependencies
sayakb Oct 26, 2014
2715736
Translation french and theme bootstrap black
Oct 27, 2014
4ffea8a
rm modif
Oct 30, 2014
12a029f
add translation french
Oct 30, 2014
2190f62
add theme black
Oct 30, 2014
8155263
Merge pull request #173 from EdzeronK/skin-bootstrap-black
sayakb Oct 31, 2014
4a4430b
Merge pull request #172 from EdzeronK/translation
sayakb Oct 31, 2014
428c817
Remove from master
sayakb Oct 31, 2014
dd0f04a
Add bootstrap-black by EdzeronK
sayakb Oct 31, 2014
daf59e9
Change permissions
sayakb Oct 31, 2014
849b287
Merge branch 'skin-bootstrap-black'
sayakb Oct 31, 2014
0019e73
Remove theme
sayakb Oct 31, 2014
65e17ea
Add theme
sayakb Oct 31, 2014
c6d2262
Merge branch 'skin-bootstrap'
sayakb Oct 31, 2014
128ccfb
Adding bootstrap theme back
sayakb Oct 31, 2014
e7772b8
Merge branch 'skin-bootstrap'
sayakb Oct 31, 2014
391a356
Theme info changes
sayakb Oct 31, 2014
3a68655
Remove travis.yml
sayakb Oct 31, 2014
4db3163
Merge
sayakb Oct 31, 2014
462657a
Merge branches 'skin-bootstrap-black' and 'skin-neverland'
sayakb Oct 31, 2014
94e0801
Add travis.yml
sayakb Oct 31, 2014
b59628d
Add travis.yml
sayakb Oct 31, 2014
ad1d99a
Add travis.yml
sayakb Oct 31, 2014
4d9697c
Merge branches 'skin-bootstrap', 'skin-bootstrap-black' and 'skin-nev…
sayakb Oct 31, 2014
24dce7a
Wishlist #165: Redirect to login screen from create when guest posts …
sayakb Oct 31, 2014
ad5bc3d
Sync with GeSHi
sayakb Nov 1, 2014
bad1c1f
Update permissions
sayakb Nov 1, 2014
e2b91b7
Update dependencies
sayakb Nov 1, 2014
e52dfe7
Moving third party plugins to separate repo
sayakb Nov 1, 2014
fef132e
Update README.md
sayakb Nov 1, 2014
19f97e9
Wishlist #162: Expiration for guests and users
sayakb Nov 1, 2014
a66192c
Expiration for guests and users
sayakb Nov 1, 2014
9d189ec
Merge branches 'skin-neverland' and 'skin-bootstrap'
sayakb Nov 1, 2014
8468a8a
Test cases for expiration option
sayakb Nov 1, 2014
b8efc56
Test cases for expiration option
sayakb Nov 1, 2014
fbced1b
Remediate installer
sayakb Nov 1, 2014
be667c3
Add updated test database
sayakb Nov 1, 2014
636850c
Release v1.9
sayakb Nov 2, 2014
92955f5
Run Akismet on paste content by default
sayakb Nov 7, 2014
92e03f7
Revert last commit
sayakb Dec 2, 2014
246b3a8
Update dependencies
sayakb Dec 11, 2014
cea789f
Update README.md
sayakb Dec 14, 2014
7299a74
Update README.md
sayakb Dec 14, 2014
38df84c
Escape special chars from create box
sayakb Dec 15, 2014
502e277
Issue #177: Escape special chars from create box
sayakb Dec 15, 2014
d743d78
Update README.md
sayakb Feb 1, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
app/config/database.php
23 changes: 23 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Copyright (c) 2014, Sayak Banerjee <mail@sayakbanerjee.com>
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15 changes: 15 additions & 0 deletions PRIVACY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Sticky Notes Privacy Notice

Sticky Notes sends out statistical information to an external server that
includes **only** the following data:

* Your site's URL
* Sticky Notes version
* Action type: install / update

You can choose to not send your site's URL by setting the fullStats option
to FALSE in `app/config/app.php`.

Please note that your site's URL will never be published and is purely used
for statistical purposes. It is stored securely and is encrypted with a
strong hash.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# [Sticky Notes v1.9](http://sayakbanerjee.com/sticky-notes) [![Build Status](http://goo.gl/om3X8j)](http://goo.gl/DRaaX0) ![](http://goo.gl/5EXdK5)

**Sticky Notes is currently not being maintained. The project may come back to life in future but there are no plans for development at the moment**

Sticky notes is a powerful open-source pastebin application. [See it in action](http://paste.kde.org).

License: [BSD 2-clause license](http://www.opensource.org/licenses/bsd-license.php).

<table>
<tr>
<td>
<a href="http://goo.gl/IsOmmD">Download</a>
</td>
<td>
<a href="http://goo.gl/iWpHzb">Installation guide</a>
</td>
<td>
<a href="http://goo.gl/uJlgH4">Update guide</a>
</td>
<td>
<a href="http://goo.gl/7KmAFP">API reference</a>
</td>
<td>
<a href="http://goo.gl/TKyj4D">Services</a>
</td>
<td>
<a href="http://goo.gl/SZTE2T">Plugins</a>
</td>
</tr>
</table>

&copy; 2014 [Sayak Banerjee](http://sayakbanerjee.com). All rights reserved. [Privacy notice](http://goo.gl/Ba15QZ)

[![](https://pledgie.com/campaigns/20549.png?skin_name=chrome)](http://goo.gl/oWyEG)
Empty file added app/commands/.gitkeep
Empty file.
90 changes: 90 additions & 0 deletions app/commands/ConfigReader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?php

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;

class ConfigReader extends Command {

/**
* The console command name.
*
* @var string
*/
protected $name = 'snconfig:get';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Gets a Sticky Notes configruation value';

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}

/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
{
// Get the config group and key
$group = $this->option('group');

$key = $this->option('key');

// Both group and key are mandatory options
if ( ! empty($group) AND ! empty($key))
{
$values = Site::config($group);

if (isset($values->$key))
{
$this->info($values->$key);
}
else
{
$this->error('No config data exists for given key.');
}
}
else
{
$this->error('Insufficient arguments specified.');

$this->error('Usage: snconfig:get --group="..." --key="..."');
}
}

/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return array();
}

/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return array(
array('group', NULL, InputOption::VALUE_REQUIRED, 'Configuration group.', NULL),
array('key', NULL, InputOption::VALUE_REQUIRED, 'Configuration key.', NULL),
);
}

}
86 changes: 86 additions & 0 deletions app/commands/ConfigWriter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;

class ConfigWriter extends Command {

/**
* The console command name.
*
* @var string
*/
protected $name = 'snconfig:set';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Sets a Sticky Notes configruation value';

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}

/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
{
// Get the config group, key and value
$group = $this->option('group');

$key = $this->option('key');

$value = $this->option('value');

// Group, key and value are mandatory options
if ( ! empty($group) AND ! empty($key) AND ! empty($value))
{
Site::config($group, array($key => $value));

$this->info('Configuration data saved successfully. Please delete the contents of `app/storage/cache` folder for your changes to take effect.');
}
else
{
$this->error('Insufficient arguments specified.');

$this->error('Usage: snconfig:get --group="..." --key="..." --value="..."');
}
}

/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return array();
}

/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return array(
array('group', NULL, InputOption::VALUE_REQUIRED, 'Configuration group.', NULL),
array('key', NULL, InputOption::VALUE_REQUIRED, 'Configuration key.', NULL),
array('value', NULL, InputOption::VALUE_REQUIRED, 'Configuration data.', NULL),
);
}

}
41 changes: 41 additions & 0 deletions app/config/antispam.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

return array(

/*
|--------------------------------------------------------------------------
| Immutable antispam services
|--------------------------------------------------------------------------
|
| Antispam configuration is managed from the database. This option allows
| developers to add service configurations that are not editable by the
| pastebin admins.
|
| Immutable services are always run, even if they are not set by the admin
|
*/

'immutable' => array('ipban'),

/*
|--------------------------------------------------------------------------
| Scope declaration
|--------------------------------------------------------------------------
|
| This value defines the scope of the antispam plugins.
|
*/

'scopes' => array(

'paste' => array('ipban', 'censor', 'noflood', 'php', 'stealth'),

'comment' => array('ipban', 'censor', 'noflood', 'php', 'akismet'),

'search' => array('ipban', 'noflood'),

'api_call' => array('ipban', 'censor', 'noflood', 'php'),

),

);
Loading