Fixed Broken Shit

This commit is contained in:
2022-10-30 14:32:20 -07:00
parent 7335796263
commit 4dabf5a6bf
635 changed files with 74885 additions and 17688 deletions

View File

@ -0,0 +1,23 @@
302-instead
===========
YOURLS plugin to send a 302 (temporary) redirect instead of 301 (permanent) for sites where shortlinks may change. This is a fork of the original 302-instead plugin by BrettR, hosted on GitHub at the following URL:
https://github.com/EpicPilgrim/302-instead
The plugin adds a menu option to allow you to select the mode you want to use:
- 302 redirects for every URL (some clients may have old 301 redirects cached, you can't do much about that)
- 301 redirects for every URL (this is the default YOURLS behaviour)
- 302 redirects only for URLs that are not short URLs for the current YOURLS installation
Requirements
YOURLS 1.5+
Installation
Create a user/plugins/302-instead directory in YOURLS
Place the plugin.php file in above directory
Activate plugin in YOURLS
You can also clone the git repository into your plugins directory. This will allow you to update the plugin more easily.

View File

@ -0,0 +1,99 @@
<?php
/*
Plugin Name: 302 Instead + 301 for YOURLS URLs
Plugin URI: https://github.com/timcrockford/302-instead
Description: Send a 302 (temporary) redirects that do not redirect to other short URLs and a 301 for YOURLS URLs
Version: 1.2
Author: BrettR / Tim Crockford
Author URI: http://codearoundcorners.com/
*/
if( !defined( 'YOURLS_ABSPATH' ) ) die();
yourls_add_filter('redirect_code', 'temp_instead_function');
yourls_add_action( 'plugins_loaded', 'temp_instead_admin_page_add' );
// This function will check the URL and the HTTP status code of the passed
// in arguments. If the URL happens to be an existing short URL on the same
// YOURLS installation, it does nothing. Otherwise it will send a 302
// redirect. Useful when you want to change the short URLs that end users
// might be using but you can't change.
function temp_instead_function($code, $url) {
$match = strpos($url, yourls_site_url(false));
$mode = intval(yourls_get_option( 'temp_instead_mode', 1 ));
// We check here if the url contains the YOURLS installation address,
// and if it doesn't we'll return a 302 redirect if it isn't getting
// one already.
if ( $code != 302 && ($mode == 1 || ($match === false && $mode == 3))) {
return 302;
}
// We check here if the url contains the YOURLS installation address,
// and if it does we'll return a 301 redirect if it isn't getting
// one already.
if ( $code != 301 && ($mode == 2 || ($match !== false && $mode == 3))) {
return 301;
}
return $code;
}
// Register our plugin admin page
function temp_instead_admin_page_add() {
yourls_register_plugin_page( 'temp_instead', 'Redirect Rules', 'temp_instead_admin_page_do' );
}
// Display admin page
function temp_instead_admin_page_do() {
if( isset( $_POST['temp_instead_mode'] ) ) {
yourls_verify_nonce( 'temp_instead' );
temp_instead_admin_page_update();
}
$mode = intval(yourls_get_option( 'temp_instead_mode', 1 ));
$nonce = yourls_create_nonce( 'temp_instead' );
// If the option hasn't been added previously, we add the default value of everything using
// 302 redirects.
echo '<h2>302-Redirect Redirection Rules</h2>';
echo '<p>This plugin allows you to configure how the 302-redirect plugin operates.</p>';
echo '<form method="post">';
echo '<input type="hidden" name="nonce" value="' . $nonce . '" />';
echo '<label for="temp_instead_mode">Select Redirect Mode:</label>';
echo '<select id="temp_instead_mode" name="temp_instead_mode">';
$opt1 = ( $mode == 1 ? ' selected' : '');
$opt2 = ( $mode == 2 ? ' selected' : '');
$opt3 = ( $mode == 3 ? ' selected' : '');
echo '<option value=1' . $opt1 . '>Redirect all using 302 temporary redirect</option>';
echo '<option value=2' . $opt2 . '>Redirect all using 301 permanent redirect</option>';
echo '<option value=3' . $opt3 . '>Redirect full URLs using 302 and short URLs using 301</option>';
echo '<p><input type="submit" value="Update Redirect Mode" /></p>';
echo '</select>';
echo '</form>';
}
// Update option in database
function temp_instead_admin_page_update() {
$mode = $_POST['temp_instead_mode'];
if( $mode ) {
$mode = intval($mode);
if ( yourls_get_option( 'temp_instead_mode' ) !== false ) {
echo '<b>Redirect mode was updated successfully.</b>';
yourls_update_option( 'temp_instead_mode', $mode );
} else {
echo '<b>Redirect mode was stored successfully.</b>';
yourls_add_option( 'temp_instead_mode', $mode );
}
}
}
?>

View File

@ -0,0 +1,35 @@
YourlsBlacklistIPs
Plugin for Yourls allowing to blacklist IPs
This plugin is intended to be used with YOURLS (cf. http://yourls.org)
It has been tested on YOURLS v1.5 and v1.5.1
Current version is 1.3, updated on 18/09/2012
Contact : Ludo at Ludo.Boggio+GitHub@GMail.com
INSTALL :
- In /user/plugins, create a new folder named BlackListIP
- In this new directory, copy the plugin.php and ludo_blacklist_ip_Check_IP_Module.php files from this repository
- Go to the Plugins administration page and activate the plugin
You will see in the admin section a new admin page where you can add the IP addresses you want to blacklist.
Please enter one IP address per line. Other syntax should provide unexpected behaviours.
v1.0 : initialization
v1.1 : Add admin page
v1.2 : Add some checks on IP format and some warnings for use
v1.3 : Add several possibilities to provide IP ranges :
- A.B.C.D-X.Y.Z.T range : all IPs from A.B.C.D to X.Y.Z.T are blacklisted
- A.B.C.0 range : all IPs from A.B.C.0 to A.B.C.255 are blacklisted
- A.B.0.0 range : all IPs from A.B.0.0 to A.B.255.255 are blacklisted
- A.0.0.0 range : all IPs from A.0.0.0 to A.255.255.255 are blacklisted
- A.B.C.D/X.Y.Z.T : A.B.C.D is an IP address, X.Y.Z.T is a subnet mask, all IPs addresses corresponding to that IP and mask are blacklisted
- A.B.C.D/T, T between 0 TO 32 : CIDR notation.
For explanations, feel free to check http://en.wikipedia.org/wiki/IP_address .
Actual roadmap is empty, but I'm open to suggestions. Feel free to contact me.

View File

@ -0,0 +1,141 @@
<?php
function ludo_blacklist_ip_Analyze_IP ( $Input ) {
if ( strpos ( $Input , "/" ) !== FALSE ) { // Case input contain "/"
$Inputs = array_map ("trim", explode ( "/" , $Input ) );
if (ludo_blacklist_ip_Check_IP ( $Inputs[0] ) && ctype_digit ($Inputs[1]) && $Inputs[1] > 0 && $Inputs[1] <= 32) { // Cas CIDR
$Cible = ludo_blacklist_ip_CalculIPMask ( $Inputs[0] , ludo_blacklist_ip_MaskType2Mask ( $Inputs[1] ) ) ;
} elseif (ludo_blacklist_ip_Check_IP ( $Inputs[0] ) && ludo_blacklist_ip_Check_IP ($Inputs[1]) && ludo_blacklist_ip_Check_Mask ($Inputs[1]) ){ // Case IP/Mask
$Cible = ludo_blacklist_ip_CalculIPMask ( $Inputs[0] , $Inputs[1] ) ;
} else { // Contains "/" but invalid
$Cible="NULL";
}
}
elseif ( strpos ( $Input , "-" ) !== FALSE ) { // Case input contains "-"
$Inputs = array_map ("trim", explode ( "-" , $Input ) );
if ( ludo_blacklist_ip_Check_IP ( $Inputs[0] ) && ludo_blacklist_ip_Check_IP ( $Inputs[1] ) ) {
if ( $Inputs[0] < $Inputs[1] ) { // Check IP orders
$Cible = $Inputs[0] . "-" . $Inputs[1] ;
}
else { // If wrong order, reverse it
$Cible = $Inputs[1] . "-" . $Inputs[0] ;
}
} else { // Contains "-" but invalid
$Cible="NULL";
}
}
elseif (ludo_blacklist_ip_Check_IP ( $Input )) { // Case input is a single IP
$Inputs = array_map ("trim", explode ( "." , $Input ) );
if ( $Inputs[0] == 0 && $Inputs[1] == 0 && $Inputs[2] == 0 && $Inputs[3] == 0 ) { // Case 0.0.0.0
$Cible = "0.0.0.0-255.255.255.255" ;
}
elseif ( $Inputs[1] == 0 && $Inputs[2] == 0 && $Inputs[3] == 0 ) { // Case A.0.0.0
$Cible = $Inputs[0] . ".0.0.0-" . $Inputs[0] . ".255.255.255";
}
elseif ( $Inputs[2] == 0 && $Inputs[3] == 0 ) { // Case A.B.0.0
$Cible = $Inputs[0] . "." . $Inputs[1] . ".0.0-" . $Inputs[0] . "." . $Inputs[1] . ".255.255";
}
elseif ( $Inputs[3] == 0 ) { // Case A.B.C.0
$Cible = $Inputs[0] . "." . $Inputs[1] . "." . $Inputs[2] . ".0-" . $Inputs[0] . "." . $Inputs[1] . "." . $Inputs[2] . ".255";
}
else { // Case of a single IP address
$Cible = $Input . "-" . $Input ;
}
}
else { // Invalid IP address
$Cible="NULL";
}
return $Cible;
}
function ludo_blacklist_ip_Check_IP ( &$IP ) {
// Input : String of IP address
// Output : TRUE if string is a valid IP address
$IPs = array_map("ludo_blacklist_ip_IP_trim", explode ( "." , $IP ) ) ;
if (count ($IPs) != 4 ) return false ;
foreach ( $IPs as $value ) {
if ( $value < 0 || $value > 255 ) {
return false ;
}
}
$IP = implode ( ".", $IPs );
return true;
}
function ludo_blacklist_ip_IP_Trim ( $IP ) {
// Input : array of IP address with strings
// Output : array of the IP address with integer
return (int) ltrim ( trim ( $IP ) , "0" ) ;
}
function ludo_blacklist_ip_Check_Mask ( $Mask ) {
// Input : Mask to be checked, string
// Return OK if the Mask string is correct
$Masks = array_map("ludo_blacklist_ip_IP_trim", explode ( "." , $Mask ) ) ;
if (count ($Masks) != 4 ) return false ;
$OctetSignificatif = -1;
foreach ( $Masks as $key => $value ) {
if ( $value == 255 and $OctetSignificatif == -1 ) {
continue;
}
if ( $value == 255 and $OctetSignificatif != -1 ) {
return false ;
}
if ( $value >0 and $OctetSignificatif == -1 ) {
$OctetSignificatif = $key ;
continue;
}
if ( $value >0 and $OctetSignificatif != -1 ) {
return false ;
}
if ( $value == 0 and $OctetSignificatif == -1 and $Masks[$key-1] != 255) {
return false ;
}
if ( $value == 0 and $OctetSignificatif == -1 and $Masks[$key-1] == 255) {
$OctetSignificatif = $key;
continue ;
}
if ( $value == 0 and $OctetSignificatif != -1 ) {
continue ;
}
}
return (($OctetSignificatif != -1) and in_array ($Masks[$OctetSignificatif],array ("255","254","252","248","240","224","192","128","0")));
}
function ludo_blacklist_ip_MaskType2Mask ( $MaskType ) {
// Input : Integer value
// Output : Mask with $MaskType bit at 1, others at 0, string
for ($boucle = 0; $boucle < 4 ; $boucle++ ) {
if ( $MaskType > 8 ) $Masks[$boucle] = 255;
elseif ($MaskType <= 0 ) $Masks[$boucle] = 0;
else $Masks[$boucle] = bindec (str_repeat ( "1" , $MaskType ) . str_repeat ("0" , 8-$MaskType ) );
$MaskType -= 8;
}
return implode ( "." , $Masks);
}
function ludo_blacklist_ip_CalculIPMask ( $IP , $Mask ) {
// Input : IP address and Mask, strings
// Output a string $IPStart."-".$IPEnd for those IP and mask
$IPs = explode ( "." , $IP ) ;
$Masks = explode ( "." , $Mask ) ;
$OctetSignificatif = -1;
for ($boucle = 0 ; $boucle < sizeof ( $IPs ) ; $boucle++ ) {
$IP_Starts[$boucle] = (0+$IPs[$boucle]) & (0+$Masks[$boucle]) ;
if (($Masks[$boucle] < 255) && ( $OctetSignificatif == -1 ) ) {
$OctetSignificatif = $boucle;
}
}
for ($boucle = 0 ; $boucle < sizeof ( $IPs ) ; $boucle++ ) {
if ($boucle < $OctetSignificatif )
$IP_Ends[$boucle] = 0+$IPs[$boucle] ;
elseif ($boucle == $OctetSignificatif )
$IP_Ends[$boucle] = (0+$IPs[$boucle]) | ( 255-$Masks[$boucle] ) ;
else
$IP_Ends[$boucle] = 255;
}
return implode ( "." , $IP_Starts)."-".implode ( "." , $IP_Ends);
}
?>

View File

@ -0,0 +1,118 @@
<?php
/*
Plugin Name: BlackListIP
Plugin URI: https://github.com/LudoBoggio/YourlsBlackListIPs
Description: Plugin which block blacklisted IPs
Version: 1.3
Author: Ludo
Author URI: http://ludovic.boggio.fr
*/
// No direct call
if( !defined( 'YOURLS_ABSPATH' ) ) die();
include "ludo_blacklist_ip_Check_IP_Module.php";
// Hook the custom function into the 'pre_check_ip_flood' event
yourls_add_action( 'pre_check_ip_flood', 'ludo_blacklist_ip_root' );
// Hook the admin page into the 'plugins_loaded' event
yourls_add_action( 'plugins_loaded', 'ludo_blacklist_ip_add_page' );
// Get blacklisted IPs from YOURLS options feature and compare with current IP address
function ludo_blacklist_ip_root ( $args ) {
$IP = $args[0];
$Intervalle_IP = yourls_get_option ('ludo_blacklist_ip_liste');
$Intervalle_IP = ( $Intervalle_IP ) ? ( unserialize ( $Intervalle_IP ) ):((array)NULL);
foreach ( $Intervalle_IP as $value ) {
$IPs = explode ( "-" , $value );
if ( $IP >= $IPs[0] AND $IP <= $IPs[1]) {
// yourls_die ( "Your IP has been blacklisted.", "Black list",403);
echo "<center>Your IP has been blacklisted.</center>";
die();
}
}
}
// Add admin page
function ludo_blacklist_ip_add_page () {
yourls_register_plugin_page( 'ludo_blacklist_ip', 'Blacklist IPs', 'ludo_blacklist_ip_do_page' );
}
// Display admin page
function ludo_blacklist_ip_do_page () {
if( isset( $_POST['action'] ) && $_POST['action'] == 'blacklist_ip' ) {
ludo_blacklist_ip_process ();
} else {
ludo_blacklist_ip_form ();
}
}
// Display form to administrate blacklisted IPs list
function ludo_blacklist_ip_form () {
$nonce = yourls_create_nonce( 'blacklist_ip' ) ;
$liste_ip = yourls_get_option ('ludo_blacklist_ip_liste','Enter IP addresses here, one entry per line');
if ($liste_ip != 'Enter IP addresses here, one entry per line' )
$liste_ip_display = implode ( "\r\n" , unserialize ( $liste_ip ) );
else
$liste_ip_display=$liste_ip;
echo <<<HTML
<h2>BlackList IPs</h2>
<form method="post">
<input type="hidden" name="action" value="blacklist_ip" />
<input type="hidden" name="nonce" value="$nonce" />
<p>Blacklist following IPs (one range or IP per line, no wildcards allowed) :</p>
<p><textarea cols="50" rows="10" name="blacklist_form">$liste_ip_display</textarea></p>
<p><input type="submit" value="Save" /></p>
<p>I suggest to add here IPs that you saw adding bulk URL. It is your own responsibility to check the use of the IPs you block. WARNING : erroneous entries may create unexpected behaviours, please double-check before validation.</p>
<p>Examples :
<ul>
<li>10.0.0.1/24 : blacklist from 10.0.0.0 to 10.0.0.255 (CIDR notation).</li>
<li>192.168.1.2/255.255.255.128 : blacklist from 192.168.1.0 to 192.168.0.128.</li>
<li>192.168.1.12-192.168.1.59 : blacklist from 192.168.1.12 to 192.168.1.59.</li>
<li>192.168.0.0 : blacklist from 192.168.0.0 to 192.168.255.255</li>
<li>10.0.0.58 : blacklist only 10.0.0.58 IP address.</li>
</ul>
</p>
</form>
HTML;
}
// Update blacklisted IPs list
function ludo_blacklist_ip_process () {
// Check nonce
yourls_verify_nonce( 'blacklist_ip' ) ;
// Check if the answer is correct.
$IP_Form = explode ( "\r\n" , $_POST['blacklist_form'] ) ;
if (! is_array ($IP_Form) ) {
echo "Bad answer, Blacklist not updated";
die ();
}
$boucle = 0;
foreach ($IP_Form as $value) {
$Retour = ludo_blacklist_ip_Analyze_IP ( $value ) ;
if ( $Retour != "NULL" ) {
$IPList[$boucle++] = $Retour ;
}
}
// Update list
yourls_update_option ( 'ludo_blacklist_ip_liste', serialize ( $IPList ) );
echo "Black list updated. New blacklist is " ;
if ( count ( $IPList ) == 0 )
echo "empty.";
else {
echo ":<BR />";
foreach ($IPList as $value) echo $value."<BR />";
}
}

View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 William Bargent
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,22 @@
Allow Forward Slashes in Short URLs
---------------------------------------------
- Plugin Name: Allow Forward Slashes in Short URLs
- Plugin URI: http://williambargent.co.uk
- Description: Allow Forward Slashes in Short URLs
- Version: 1.0
- Author: William Bargent
This plugin will allow forward slashes `/` in keywords when shortening URLS with YOURLS.
*NOTE This plugin will not work with URL Forwarding plugins active. Deactivate before activating this plugin.
###Installation
1. Download these file as a .zip.
2. Extract the three files and copy them into a `New Folder` called `forward-slash-in-urls`.
3. Copy this folder.
4. Paste this folder in your YOURLs directory under `users/plugins/`.
5. Go to your plugin manager and click `Activate`.

View File

@ -0,0 +1,22 @@
<?php
/*
Plugin Name: Allow Forward Slashes in Short URLs
Plugin URI: http://williambargent.co.uk
Description: Allow Forward Slashes in Short URLs
Version: 1.0
Author: William Bargent
Author URI: http://williambargent.co.uk
*/
if( !defined( 'YOURLS_ABSPATH' ) ) die();
yourls_add_filter( 'get_shorturl_charset', 'slash_in_charset' );
function slash_in_charset( $in ) {
return $in.'/';
}
//This plugin will not work with URL forwarding plugins active

View File

@ -0,0 +1,69 @@
YourlsBlackListDomains
======================
Plugin for Yourls that disallows blacklisted domains. Further, if YourlsBlacklistIPs is installed it also blacklists the submitter's IP address.
This plugin is intended to be used with YOURLS (cf. http://yourls.org)
It has been tested on YOURLS v1.5.1 and YourlsBlacklistIPs v1.3
Current version is 0.03
Contact : *apelly[ at ]len[ dot ]io*
**INSTALL :**
- In user/plugins, `git clone https://github.com/apelly/YourlsBlacklistDomains.git`
- Go to the plugins administration page and activate the plugin.
**UPDATE :**
- In user/plugins/YourlsBlacklistDomains, `git pull https://github.com/apelly/YourlsBlacklistDomains.git`
**USAGE :**
You will see in the admin section a new admin page where you can manage the blacklist.
Enter one domain on each line, the blacklisting relies on simple substring matching within the whole URL.
If you have [YourlsBlacklistIPs](https://github.com/LudoBoggio/YourlsBlacklistIPs) installed and activated then any IP that attempts to shorten a blacklisted URL will automatically be blacklisted by that plugin too.
Credits
-------
Thanks to [Panthro](https://github.com/Panthro) for [YourlsWhiteListDomains](https://github.com/Panthro/YourlsWhitelistDomains) which was basically all of the code for this, and for kindly giving permission to puplish under GPL.
> You are free to fork whatever you want, that's what code is for!
Also thanks to [LudoBoggio](https://github.com/LudoBoggio) for the [YourlsBlacklistIPs](https://github.com/LudoBoggio/YourlsBlacklistIPs) plugin which was the base for YourlsWhiteListDomains.
>I've written this plugin for the community, to help Yourls users, to help Yourls author, to help to spread this software, to pay my free use of it, and to learn a bit more of programming. I didn't provide any license informations because I never tried to understand them. Therefore, I leave you all rights to use my plugin in any way you want, the fact that it help to bring more Yourls user is just enough from my point of view.
Changelog
---------
v0.03 Fix some crap code (of mine)
v0.02 Cosmetic changes
v0.01 Initial code
---
Notice
------
Neither YourlsWhiteListDomains, nor YourlsBlacklistIPs are distributed with licensing or copyright details but both [Panthro](https://github.com/Panthro) and [LudoBoggio](https://github.com/LudoBoggio) have given explicit permission to use and distribute their code.
**Copyright&copy; (2012) Aaron Pelly**
**License**
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -0,0 +1,130 @@
<?php
/*
Plugin Name: YourlsBlackListDomains
Plugin URI: https://github.com/apelly/YourlsBlacklistDomains
Description: Plugin which disallows blacklisted domains and bans the submitters IP address. GPL v3
Version: 0.03
Author: apelly
Author URI: http://len.io
*/
/*
Copyright(c) (2012) Aaron Pelly
License:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// No direct call
if( !defined( 'YOURLS_ABSPATH' ) ) die();
// Hook the custom function into the 'shunt_add_new_link' event
yourls_add_filter( 'shunt_add_new_link', 'apelly_blacklist_domain_root' );
// Hook the admin page into the 'plugins_loaded' event
yourls_add_action( 'plugins_loaded', 'apelly_blacklist_domain_add_page' );
// Get blacklisted domains from YOURLS options feature and compare with current domain address
function apelly_blacklist_domain_root ( $bol, $url ) {
$return = false;
$domain_list = yourls_get_option ('apelly_blacklist_domain_list');
if ( $domain_list ) {
$domain_list = unserialize ( $domain_list );
foreach($domain_list as $blacklisted_domain) {
if (strpos($url,$blacklisted_domain)) {
// Check if a YourlsBlacklistIPs is installed and active
if (yourls_is_active_plugin( YOURLS_PLUGINDIR .'/BlackListIP/plugin.php' )) {
$IP = yourls_get_IP();
// IP blacklisted already?
ludo_blacklist_ip_root( array( $IP ) ); // <---- dies if ip is blacklisted
// fetch the blacklisted IP addresses
$IP_List = yourls_get_option ('ludo_blacklist_ip_liste');
$IP_List = ( $IP_List ) ? ( unserialize ( $IP_List ) ):((array)NULL);
// add this IP
$Parsed_IP = ludo_blacklist_ip_Analyze_IP ( $IP ) ;
if ( $Parsed_IP != "NULL" ) {
$IP_List[] = $Parsed_IP ;
}
// Update the blacklist
yourls_update_option ( 'ludo_blacklist_ip_liste', serialize ( $IP_List ) );
}
// stop
//yourls_die( 'Blacklisted domain', 'Forbidden', 403 );
"<center>Blacklisted domain.</center>";
die();
}
}
}
return $return;
}
// Add admin page
function apelly_blacklist_domain_add_page () {
yourls_register_plugin_page( 'apelly_blacklist_domain', 'Blacklist domains', 'apelly_blacklist_domain_do_page' );
}
// Display admin page
function apelly_blacklist_domain_do_page () {
if( isset( $_POST['action'] ) && $_POST['action'] == 'blacklist_domain' ) {
apelly_blacklist_domain_process ();
} else {
apelly_blacklist_domain_form ();
}
}
// Display form to administrate blacklisted domains list
function apelly_blacklist_domain_form () {
$nonce = yourls_create_nonce( 'blacklist_domain' ) ;
$domain_list = yourls_get_option ('apelly_blacklist_domain_list','Enter domain addresses here, one per line');
if ($domain_list != 'Enter domain addresses here, one per line' ){
$domain_list_display = implode ( "\r\n" , unserialize ( $domain_list ) );
}else{
$domain_list_display = $domain_list;
}
echo <<<HTML
<h2>BlackList domains</h2>
<form method="post">
<input type="hidden" name="action" value="blacklist_domain" />
<input type="hidden" name="nonce" value="$nonce" />
<p>Blacklist following domains</p>
<p><textarea cols="60" rows="15" name="blacklist_form">$domain_list_display</textarea></p>
<p><input type="submit" value="Save" /></p>
</form>
HTML;
}
// Update blacklisted domains list
function apelly_blacklist_domain_process () {
// Check nonce
yourls_verify_nonce( 'blacklist_domain' ) ;
// Update list
$blacklist_form = explode ( "\r\n" , $_POST['blacklist_form'] ) ;
yourls_update_option ( 'apelly_blacklist_domain_list', serialize($blacklist_form) );
echo "Black list updated. New blacklist is " ;
if ( count ( $blacklist_form ) == 0 )
echo "empty.";
else {
echo ":<BR />";
foreach ($blacklist_form as $value) echo $value."<BR />";
}
}
?>

View File

@ -0,0 +1,104 @@
<?php
/*
Plugin Name: Anti spam
Plugin URI: http://yourls.org/
Description: Absolute anti-spam plugin. Checks URL against major black lists and removes all crap. Might OR MIGHT NOT work for you. Read the readme.
Version: 1.0.4
Author: Ozh
Author URI: http://ozh.org/
*/
// Check for spam when someone adds a new link
yourls_add_filter( 'shunt_add_new_link', 'ozh_yourls_antispam_check_add' );
function ozh_yourls_antispam_check_add( $false, $url ) {
// Sanitize URL and make sure there's a protocol
$url = yourls_sanitize_url( $url );
// only check for 'http(s)'
if( !in_array( yourls_get_protocol( $url ), array( 'http://', 'https://' ) ) )
return $false;
if ( ozh_yourls_antispam_is_blacklisted( $url ) === yourls_apply_filter( 'ozh_yourls_antispam_malformed', 'malformed' ) ) {
return array(
'status' => 'fail',
'code' => 'error:nourl',
'message' => yourls__( 'Missing or malformed URL' ),
'errorCode' => '400',
);
}
if ( ozh_yourls_antispam_is_blacklisted( $url ) != false ) {
return array(
'status' => 'fail',
'code' => 'error:spam',
'message' => 'This domain is blacklisted',
'errorCode' => '403',
);
}
// All clear, not interrupting the normal flow of events
return $false;
}
// Has the remote link become compromised lately? Check on redirection
yourls_add_action( 'redirect_shorturl', 'ozh_yourls_antispam_check_redirect' );
function ozh_yourls_antispam_check_redirect( $url, $keyword = false ) {
if( is_array( $url ) && $keyword == false ) {
$keyword = $url[1];
$url = $url[0];
}
// Check when the link was added
// If shorturl is fresh (ie probably clicked more often?) check once every 15 times, otherwise once every 5 times
// Define fresh = 3 days = 259200 secondes
// TODO: when there's a shorturl_meta table, store last check date to allow checking every 2 or 3 days
$now = date( 'U' );
$then = date( 'U', strtotime( yourls_get_keyword_timestamp( $keyword ) ) );
$chances = ( ( $now - $then ) > 259200 ? 15 : 5 );
if( $chances == mt_rand( 1, $chances ) ) {
if( ozh_yourls_antispam_is_blacklisted( $url ) != false ) {
// Delete link & die
yourls_delete_link_by_keyword( $keyword );
yourls_die( 'This domain has been blacklisted. This short URL has been deleted from our record.', 'Domain blacklisted', '403' );
}
}
// Nothing, move along
}
// Is the link spam? true for "yes it's shit", false for "nope, safe"
function ozh_yourls_antispam_is_blacklisted( $url ) {
$parsed = parse_url( $url );
if( !isset( $parsed['host'] ) )
return yourls_apply_filter( 'ozh_yourls_antispam_malformed', 'malformed' );
// Remove www. from domain (but not from www.com)
$parsed['host'] = preg_replace( '/^www\.(.+\.)/i', '$1', $parsed['host'] );
// Major blacklists. There's a filter if you want to manipulate this.
$blacklists = yourls_apply_filter( 'ozh_yourls_antispam_list',
array(
'dbl.spamhaus.org',
'multi.surbl.org',
)
);
// Check against each blacklist, exit if blacklisted
foreach( $blacklists as $blacklist ) {
$domain = $parsed['host'] . '.' . $blacklist . '.';
$record = @dns_get_record( $domain );
if( $record && count( $record ) > 0 )
return yourls_apply_filter( 'ozh_yourls_antispam_blacklisted', true );
}
// All clear, probably not spam
return yourls_apply_filter( 'ozh_yourls_antispam_clean', false );
}

View File

@ -0,0 +1,19 @@
Plugin for YOURLS 1.5+: Antispam
# What for
This is a __merciless__ __antispam__ plugin that uses the three major blacklists (<a href="http://spamhaus.org">Spamhaus</a>, <a href="http://uribl.com/">URIBL</a> and <a href="http://surbl.org/">SURBL</a>).
URL are checked against the blacklist when short urls are created. They are also randomly checked when someone follows a short
URL and if the link has been compromised recently, the short URL is deleted.
# How to
* In `/user/plugins`, create a new folder named `antispam`
* Drop these files in that directory
* Go to the Plugins administration page and activate the plugin
* Have fun
# Disclaimer
Checking against blacklists may or may not work for you, this may depend on the type of spam you are getting and on other factors such as your server IP, your server ISP, the DNS you are using. It may even result in all domains being blacklisted from your server. Try and see.

View File

@ -0,0 +1,686 @@
<?php
/*
Plugin Name: Auth Manager Plus
Plugin URI: https://github.com/joshp23/YOURLS-AuthMgrPlus
Description: Role Based Access Controlls with seperated user data for authenticated users
Version: 2.3.1
Author: Josh Panter, nicwaller, Ian Barber <ian.barber@gmail.com>
Author URI: https://unfettered.net
*/
// No direct call
if( !defined( 'YOURLS_ABSPATH' ) ) die();
/****************** SET UP CONSTANTS ******************/
class ampRoles {
const Administrator = 'Administrator';
const Editor = 'Editor';
const Contributor = 'Contributor';
}
class ampCap {
const ShowAdmin = 'ShowAdmin';
const AddURL = 'AddURL';
const DeleteURL = 'DeleteURL';
const EditURL = 'EditURL';
const ShareURL = 'ShareURL';
const Traceless = 'Traceless';
const ManageAnonURL = 'ManageAnonURL';
const ManageUsrsURL = 'ManageUsrsURL';
const ManagePlugins = 'ManagePlugins';
const API = 'API';
const APIu = 'APIu';
const ViewStats = 'ViewStats';
const ViewAll = 'ViewAll';
}
/********** Add hooks to intercept functionality in CORE **********/
yourls_add_action( 'load_template_infos', 'amp_intercept_stats' );
function amp_intercept_stats() {
if ( 'YOURLS_PRIVATE_INFOS' === true ) {
amp_require_capability( ampCap::ViewStats );
}
}
yourls_add_action( 'api', 'amp_intercept_api' );
function amp_intercept_api() {
if ( 'YOURLS_PRIVATE_API' === true ) {
if ( isset( $_REQUEST['shorturl'] ) || isset( $_REQUEST['stats'] ) ) {
amp_require_capability( ampCap::APIu );
} else {
amp_require_capability( ampCap::API );
}
}
}
yourls_add_action( 'auth_successful', function() {
if( yourls_is_admin() ) amp_intercept_admin();
} );
/**
* YOURLS processes most actions in the admin page. It would be ideal
* to add a unique hook for each action, but unfortunately we need to
* hook the admin page load itself, and try to figure out what action
* is intended.
*
* TODO: look for these hooks
*
* At this point, reasonably assume that the current request is for
* a rendering of the admin page.
*/
function amp_intercept_admin() {
amp_require_capability( ampCap::ShowAdmin );
// we use this GET param to send up a feedback notice to user
if ( isset( $_GET['access'] ) && $_GET['access']=='denied' ) {
yourls_add_notice('Access Denied');
}
// allow manipulation of this list ( be mindfull of extending Auth mp Capability class if needed )
$action_capability_map = yourls_apply_filter( 'amp_action_capability_map',
array( 'add' => ampCap::AddURL,
'delete' => ampCap::DeleteURL,
'edit_display' => ampCap::EditURL,
'edit_save' => ampCap::EditURL,
'activate' => ampCap::ManagePlugins,
'deactivate' => ampCap::ManagePlugins,
) );
// Key actions like Add/Edit/Delete are AJAX requests
if ( yourls_is_Ajax() ) {
// Define some boundaries for ownership
// Allow some flexability with those boundaries
$restricted_actions = yourls_apply_filter( 'amp_restricted_ajax_actions',
array( 'edit_display',
'edit_save',
'delete'
) );
$action_keyword = $_REQUEST['action'];
$cap_needed = $action_capability_map[$action_keyword];
// Check the action against those boundaries
if ( in_array( $action_keyword, $restricted_actions) ) {
$keyword = $_REQUEST['keyword'];
$do = amp_manage_keyword( $keyword, $cap_needed );
} else {
$do = amp_have_capability( $cap_needed );
}
if ( $do !== true ) {
$err = array();
$err['status'] = 'fail';
$err['code'] = 'error:authorization';
$err['message'] = 'Access Denied';
$err['errorCode'] = '403';
echo json_encode( $err );
die();
}
}
// Intercept requests for plugin management
if( isset( $_SERVER['REQUEST_URI'] ) && preg_match('/\/admin\/plugins\.php.*/', $_SERVER['REQUEST_URI'] ) ) {
// Is this a plugin page request?
if ( isset( $_REQUEST['page'] ) ) {
// Is this an allowed plugin?
global $amp_allowed_plugin_pages;
if ( amp_have_capability( ampCap::ManagePlugins ) !== true) {
$r = $_REQUEST['page'];
if(!in_array($r, $amp_allowed_plugin_pages ) ) {
yourls_redirect( yourls_admin_url( '?access=denied' ), 302 );
}
}
} else {
// Should this user touch plugins?
if ( amp_have_capability( ampCap::ManagePlugins ) !== true) {
yourls_redirect( yourls_admin_url( '?access=denied' ), 302 );
}
}
// intercept requests for global plugin management actions
if (isset( $_REQUEST['plugin'] ) ) {
$action_keyword = $_REQUEST['action'];
$cap_needed = $action_capability_map[$action_keyword];
if ( $cap_needed !== NULL && amp_have_capability( $cap_needed ) !== true) {
yourls_redirect( yourls_admin_url( '?access=denied' ), 302 );
}
}
}
}
/*
* Cosmetic filter: removes disallowed buttons from link list per short link
*/
yourls_add_filter( 'table_add_row_action_array', 'amp_ajax_button_check' );
function amp_ajax_button_check( $actions, $keyword ) {
// define the amp capabilities that map to the buttons
$button_cap_map = array('stats' => ampCap::ViewStats,
'share' => ampCap::ShareURL,
'edit' => ampCap::EditURL,
'delete' => ampCap::DeleteURL,
);
$button_cap_map = yourls_apply_filter( 'amp_button_capability_map', $button_cap_map );
// define restricted buttons
$restricted_buttons = array('delete', 'edit');
if ( 'YOURLS_PRIVATE_INFOS' === true )
$restricted_buttons += ['stats'];
$restricted_buttons = yourls_apply_filter( 'amp_restricted_buttons', $restricted_buttons );
// unset any disallowed buttons
foreach ( $actions as $action => $vars ) {
$cap_needed = $button_cap_map[$action];
if ( in_array( $action, $restricted_buttons) )
$show = amp_manage_keyword( $keyword, $cap_needed );
else
$show = amp_have_capability( $cap_needed );
if (!$show)
unset( $actions[$action] );
}
return $actions;
}
/*
* Cosmetic filter: removes disallowed plugins from link list
*/
yourls_add_filter( 'admin_sublinks', 'amp_admin_sublinks' );
function amp_admin_sublinks( $links ) {
global $amp_allowed_plugin_pages;
if( empty( $links['plugins'] ) ) {
unset($links['plugins']);
} else {
if ( amp_have_capability( ampCap::ManagePlugins ) !== true) {
foreach( $links['plugins'] as $link => $ar ) {
if(!in_array($link, $amp_allowed_plugin_pages) )
unset($links['plugins'][$link]);
}
}
sort($links['plugins']);
}
return $links;
}
/*
* Cosmetic filter: displays currently available roles
* by hovering mouse over the username in logout link.
*/
yourls_add_filter( 'logout_link', 'amp_html_append_roles' );
function amp_html_append_roles( $original ) {
if ( amp_is_valid_user() ) {
$listcaps = implode(', ', amp_current_capabilities());
return '<div title="'.$listcaps.'">'.$original.'</div>';
} else {
return $original;
}
}
/**************** CAPABILITY TESTING ****************/
/*
* If capability is not permitted in current context, then abort.
* This is the most basic way to intercept unauthorized usage.
*/
// TODO: API responses!
function amp_require_capability( $capability ) {
if ( !amp_have_capability( $capability ) ) {
// If the user can't view admin interface, return a plain error.
if ( !amp_have_capability( ampCap::ShowAdmin ) ) {
// header("HTTP/1.0 403 Forbidden");
die('Require permissions to show admin interface.');
}
// Otherwise, render errors in admin interface
yourls_redirect( yourls_admin_url( '?access=denied' ), 302 );
die();
}
}
// Heart of system - Can the user do "X"?
function amp_have_capability( $capability ) {
global $amp_anon_capabilities;
global $amp_role_capabilities;
global $amp_admin_ipranges;
global $amp_default_role;
// Make sure the environment has been setup
amp_env_check();
// Check anon capabilities
$return = in_array( $capability, $amp_anon_capabilities );
// Check user-role based auth
if( !$return ) {
// Only users have roles
if ( !amp_is_valid_user() ) //XXX
return false;
// List capabilities of particular user role
$user = defined('YOURLS_USER') ? YOURLS_USER : NULL;
$user_caps = array();
if ( amp_user_is_assigned ( $user ) )
foreach ( $amp_role_capabilities as $rolename => $rolecaps )
if ( amp_user_has_role( $user, $rolename ) )
$user_caps = array_merge( $user_caps, $rolecaps );
elseif ( isset( $amp_default_role ) && in_array ($amp_default_role, array_keys( $amp_role_capabilities ) ) )
$user_caps = $amp_role_capabilities [ $amp_default_role ];
$user_caps = array_unique( $user_caps );
// Is the requested capability in this list?
$return = in_array( $capability, $user_caps );
}
// Is user connecting from an admin designated IP?
if( !$return ) {
// the array of ranges: '127.0.0.0/8' will always be admin
foreach ($amp_admin_ipranges as $range) {
$return = amp_cidr_match( $_SERVER['REMOTE_ADDR'], $range );
if( $return )
break;
}
}
return $return;
}
// Determine if a user has been assigned a role
function amp_user_is_assigned ( $username ) {
global $amp_role_assignment;
if ( empty( $amp_role_assignment ) )
return false;
$return = false;
foreach ( $amp_role_assignment as $role )
if ( in_array( $username, $role ) ) {
$return = true;
break;
}
return $return;
}
// Determine whether a specific user has a role.
function amp_user_has_role( $username, $rolename ) {
global $amp_role_assignment;
// if no role assignments are created, grant everything FIXME: Make 'admin'
// so the site still works even if stuff is configured wrong
if ( empty( $amp_role_assignment ) )
return true;
// do this the case-insensitive way
// the entire array was made lowercase in environment check
$username = strtolower($username);
$rolename = strtolower($rolename);
// if the role doesn't exist, give up now.
if ( !in_array( $rolename, array_keys( $amp_role_assignment ) ) )
return false;
$users_in_role = $amp_role_assignment[$rolename];
return in_array( $username, $users_in_role );
}
/********************* KEYWORD OWNERSHIP ************************/
// Filter out restricted access to keyword data in...
// Admin list
yourls_add_filter( 'admin_list_where', 'amp_admin_list_where' );
function amp_admin_list_where($where) {
if ( amp_have_capability( ampCap::ViewAll ) )
return $where; // Allow admin/editor users to see the lot.
$user = defined('YOURLS_USER') ? YOURLS_USER : NULL;
$where['sql'] = $where['sql'] . " AND (`user` = :user OR `user` IS NULL) ";
$where['binds']['user'] = $user;
return $where;
}
// API stats
yourls_add_filter( 'api_url_stats', 'amp_api_url_stats' );
function amp_api_url_stats( $return, $shorturl ) {
$keyword = str_replace( YOURLS_SITE . '/' , '', $shorturl ); // accept either 'http://ozh.in/abc' or 'abc'
$keyword = yourls_sanitize_string( $keyword );
$keyword = addslashes($keyword);
if( ( !defined('YOURLS_PRIVATE_INFOS') || YOURLS_PRIVATE_INFOS !== false )
&& !amp_access_keyword($keyword) )
return array('simple' => "URL is owned by another user", 'message' => 'URL is owned by another user', 'errorCode' => 403);
else
return $return;
}
// Info pages
yourls_add_action( 'pre_yourls_infos', 'amp_pre_yourls_infos' );
function amp_pre_yourls_infos( $keyword ) {
if( yourls_is_private() && !amp_access_keyword($keyword) ) {
if ( !amp_is_valid_user() )
yourls_redirect( yourls_admin_url( '?access=denied' ), 302 );
else
yourls_redirect( YOURLS_SITE, 302 );
}
}
// DB stats
yourls_add_filter( 'get_db_stats', 'amp_get_db_stats' );
function amp_get_db_stats( $return, $where ) {
if ( amp_have_capability( ampCap::ViewAll ) )
return $return; // Allow admin/editor users to see the lot.
// or... filter results
global $ydb;
$table_url = YOURLS_DB_TABLE_URL;
$user = defined('YOURLS_USER') ? YOURLS_USER : NULL;
$where['sql'] = $where['sql'] . " AND (`user` = :user OR `user` IS NULL) ";
$where['binds']['user'] = $user;
$sql = "SELECT COUNT(keyword) as count, SUM(clicks) as sum FROM `$table_url` WHERE 1=1 " . $where['sql'];
$binds = $where['binds'];
$totals = $ydb->fetchObject($sql, $binds);
$return = array( 'total_links' => $totals->count, 'total_clicks' => $totals->sum );
return $return;
}
// Fine tune track-me-not
yourls_add_action('redirect_shorturl', 'amp_tracking');
function amp_tracking( $u, $k = false ) {
if( amp_is_valid_user() && ( amp_keyword_owner($k) || amp_have_capability( ampCap::Traceless ) ) ) {
// No logging
yourls_add_filter( 'shunt_update_clicks', function( ) { return true; } );
yourls_add_filter( 'shunt_log_redirect', function( ) { return true; } );
}
}
/********************* HOUSEKEEPING ************************/
// Validate environment setup
function amp_env_check() {
global $amp_anon_capabilities;
global $amp_role_capabilities;
global $amp_role_assignment;
global $amp_admin_ipranges;
global $amp_allowed_plugin_pages;
if ( !isset( $amp_anon_capabilities) ) {
$amp_anon_capabilities = array();
}
if ( !isset( $amp_role_capabilities) ) {
$amp_role_capabilities = array(
ampRoles::Administrator => array(
ampCap::ShowAdmin,
ampCap::AddURL,
ampCap::EditURL,
ampCap::DeleteURL,
ampCap::ShareURL,
ampCap::Traceless,
ampCap::ManageAnonURL,
ampCap::ManageUsrsURL,
ampCap::ManagePlugins,
ampCap::API,
ampCap::APIu,
ampCap::ViewStats,
ampCap::ViewAll,
),
ampRoles::Editor => array(
ampCap::ShowAdmin,
ampCap::AddURL,
ampCap::EditURL,
ampCap::DeleteURL,
ampCap::ShareURL,
ampCap::Traceless,
ampCap::ManageAnonURL,
ampCap::APIu,
ampCap::ViewStats,
ampCap::ViewAll,
),
ampRoles::Contributor => array(
ampCap::ShowAdmin,
ampCap::AddURL,
ampCap::EditURL,
ampCap::DeleteURL,
ampCap::ShareURL,
ampCap::APIu,
ampCap::ViewStats,
),
);
}
if ( !isset( $amp_role_assignment ) ) {
$amp_role_assignment = array();
}
if ( !isset( $amp_admin_ipranges ) ) {
$amp_admin_ipranges = array(
'127.0.0.0/8',
);
}
if ( !isset( $amp_allowed_plugin_pages ) ) {
$amp_allowed_plugin_pages = array(
);
}
// convert role assignment table to lower case if it hasn't been done already
// this makes searches much easier!
$amp_role_assignment_lower = array();
foreach ( $amp_role_assignment as $key => $value ) {
$t_key = strtolower( $key );
$t_value = array_map('strtolower', $value);
$amp_role_assignment_lower[$t_key] = $t_value;
}
$amp_role_assignment = $amp_role_assignment_lower;
unset($amp_role_assignment_lower);
return true;
}
// Activation: add the user column to the URL table if not added
yourls_add_action('activated_plugin', 'amp_activated');
function amp_activated() {
global $ydb;
$table = YOURLS_DB_TABLE_URL;
$sql = "DESCRIBE `".$table."`";
$results = $ydb->fetchObjects($sql);
$activated = false;
foreach($results as $r) {
if($r->Field == 'user') {
$activated = true;
}
}
if(!$activated) {
if ($version) {
$sql = "ALTER TABLE `".$table."` ADD `user` VARCHAR(255) NULL";
$insert = $ydb->fetchAffected($sql);
} else {
$ydb->query("ALTER TABLE `".$table."` ADD `user` VARCHAR(255) NULL");
}
}
}
/***************** HELPER FUNCTIONS ********************/
// List currently available capabilities
function amp_current_capabilities() {
$current_capabilities = array();
$all_capabilities = array(
ampCap::ShowAdmin,
ampCap::AddURL,
ampCap::EditURL,
ampCap::DeleteURL,
ampCap::ShareURL,
ampCap::Traceless,
ampCap::ManageAnonURL,
ampCap::ManageUsrsURL,
ampCap::ManagePlugins,
ampCap::API,
ampCap::APIu,
ampCap::ViewStats,
ampCap::ViewAll,
);
foreach ( $all_capabilities as $cap ) {
if ( amp_have_capability( $cap ) ) {
$current_capabilities[] = $cap;
}
}
// allow manipulation of this list ( be mindfull of extending the ampCap class if needed )
$current_capabilities = yourls_apply_filter( 'amp_current_capabilities', $current_capabilities);
return $current_capabilities;
}
// Check for IP in a range
// from: http://stackoverflow.com/questions/594112/matching-an-ip-to-a-cidr-mask-in-php5
function amp_cidr_match($ip, $range) {
list ($subnet, $bits) = explode('/', $range);
$ip = ip2long($ip);
$subnet = ip2long($subnet);
$mask = -1 << (32 - $bits);
$subnet &= $mask; # nb: in case the supplied subnet wasn't correctly aligned
return ($ip & $mask) == $subnet;
}
// Check user access to a keyword ( can they see it )
function amp_access_keyword( $keyword ) {
$users = array( YOURLS_USER !== false ? YOURLS_USER : NULL , NULL );
$owner = amp_keyword_owner( $keyword );
if ( amp_have_capability( ampCap::ViewAll ) || in_array( $owner , $users ) )
return true;
}
// Check user rights to a keyword ( can manage it )
function amp_manage_keyword( $keyword, $capability ) {
$return = false; // default is to deny access
if ( amp_is_valid_user() ) { // only authenticated users can manaage keywords
$owner = amp_keyword_owner($keyword);
$user = defined('YOURLS_USER') ? YOURLS_USER : NULL;
if ( amp_have_capability( ampCap::ManageUsrsURL ) // Admin?
|| ( $owner === NULL && amp_have_capability( ampCap::ManageAnonURL ) ) // Editor?
|| ( $owner === $user && amp_have_capability( $capability ) ) ) // Self Edit?
$return = true;
}
return $return;
}
// Check keyword ownership
function amp_keyword_owner( $keyword ) {
global $ydb;
$table = YOURLS_DB_TABLE_URL;
$binds = array( 'keyword' => $keyword );
$sql = "SELECT * FROM `$table` WHERE `keyword` = :keyword";
$result = $ydb->fetchOne($sql, $binds);
return $result['user'];
}
// Record user info on keyword creation
yourls_add_action( 'insert_link', 'amp_insert_link' );
function amp_insert_link($actions) {
global $ydb;
$keyword = $actions[2];
$user = defined('YOURLS_USER') ? YOURLS_USER : NULL;
$table = YOURLS_DB_TABLE_URL;
// Insert $keyword against $username
$binds = array( 'user' => $user,
'keyword' => $keyword);
$sql = "UPDATE `$table` SET `user` = :user WHERE `keyword` = :keyword";
$result = $ydb->fetchAffected($sql, $binds);
}
// Quick user validation without triggering hooks
function amp_is_valid_user() {
$valid = defined( 'YOURLS_USER' ) ? true : false;
if ( !$valid ) {
if ( yourls_is_API()
&& isset( $_REQUEST['timestamp'] ) && !empty($_REQUEST['timestamp'] )
&& isset( $_REQUEST['signature'] ) && !empty($_REQUEST['signature'] ) )
$valid = yourls_check_signature_timestamp();
elseif ( yourls_is_API()
&& !isset( $_REQUEST['timestamp'] )
&& isset( $_REQUEST['signature'] ) && !empty( $_REQUEST['signature'] ) )
$valid = yourls_check_signature();
elseif ( isset( $_REQUEST['username'] ) && isset( $_REQUEST['password'] )
&& !empty( $_REQUEST['username'] ) && !empty( $_REQUEST['password'] ) )
$valid = yourls_check_username_password();
elseif ( !yourls_is_API() && isset( $_COOKIE[ yourls_cookie_name() ] ) )
$valid = yourls_check_auth_cookie();
}
return $valid;
}
yourls_add_action( 'html_footer', 'amp_format_table_javascript' );
function amp_format_table_javascript() {
echo <<<JS
<script>
if($("body").hasClass("index")) {
document.querySelector("#main_table tfoot th").colSpan = 7;
document.querySelector("#nourl_found td").colSpan = 7;
}
</script>
JS;
}
function array_insert($array, $position, $insert_array) {
$first_array = array_splice($array, 0, $position);
$array = array_merge($first_array, $insert_array, $array);
return $array;
}
yourls_add_filter('table_head_cells', 'amp_username_table_head');
function amp_username_table_head( $cells ) {
$user_head = array( 'username' => 'Username' );
$cells = array_insert($cells, 5, $user_head);
return $cells;
}
yourls_add_filter('table_add_row_cell_array', 'amp_add_user_row');
function amp_add_user_row( $cells, $keyword ) {
$username = amp_keyword_owner($keyword);
$user_cell = array(
'username' => array(
'template' => '%username%',
'username' => $username,
)
);
$cells = array_insert($cells, 5, $user_cell);
return $cells;
}
?>

View File

@ -0,0 +1,948 @@
@import url('https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');
// Mobile mixin
@mixin for-size($range) {
$phone-upper-boundary: 900px;
$tablet-portrait-upper-boundary: 1100px;
$tablet-landscape-upper-boundary: 1200px;
$desktop-upper-boundary: 1800px;
@if $range == phone-only {
@media (max-width: #{$phone-upper-boundary - 1}) { @content; }
} @else if $range == tablet-portrait-up {
@media (min-width: $phone-upper-boundary) { @content; }
} @else if $range == tablet-landscape-up {
@media (min-width: $tablet-portrait-upper-boundary) { @content; }
} @else if $range == desktop-up {
@media (min-width: $tablet-landscape-upper-boundary) { @content; }
} @else if $range == big-desktop-up {
@media (min-width: $desktop-upper-boundary) { @content; }
}
}
// Use it like this:
// @include for-size(phone-only) {
// margin: 30px;
// }
//
// Globals
//
body {
background-color: $darker;
display: inline;
}
div, p, td, input, p {
font-family: 'Open Sans', sans-serif !important;
}
h1,
h2 {
color: $title;
}
p {
color: $text;
}
a, a:link, a:active, a:visited {
color: #828282;
text-decoration: none;
}
a:hover {
color: darken($title, 20%);
transition: 0.4s all;
}
input {
padding: 10px;
border: none !important;
background: $light !important;
color: $text !important;
font-size: 1em !important;
outline: none;
margin: 0px 5px !important;
border-radius: 0 !important;
@if ($theme == "light") {
border-radius: 3px !important;
}
}
input.button,
input.submit,
input[type="submit"] {
border-left: 7px solid $accent !important;
background: $light !important;
font-weight: 600;
transition: 0.3s all !important;
cursor: pointer;
@if ($theme == "light") {
background: $accent !important;
border-left: none !important;
color: white !important;
font-weight: 700;
}
}
// Need to fix this, because I've had to copy this down lower to make it apply to the add URL button
input.button:hover,
input.submit:hover,
input[type="submit"]:hover {
background: darken($accent, 15%) !important;
@if ($theme == "light") {
background: darken($accent, 15%) !important;
}
}
input[type="button"]:disabled,
input[type="submit"]:disabled {
cursor: not-allowed;
}
input.text,
input[type="text"] {
border: 1px solid rgba(255, 255, 255, 0.25) !important;
transition: 0.4s all;
}
@if ($theme != "light") {
input.text:active,
input.text:focus {
border: 1px solid $accent !important;
}
}
select {
width: 150px;
padding: 5px 35px 5px 10px;
// font-size: 0.9em;
border: none;
border-radius: 0;
height: 26px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
color: $text;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAeCAYAAADZ7LXbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/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vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAKRJREFUeNrs1TEKwkAQheEvIoI2nsk7qFdIq1hoJ3gCC5sUVpY23sDKXnvrYOUBbGITG0kQjQriPlgYhmF/3ryFjbIs82nVfEEBEiAB8k+Q+q1IkqSDNVq4lMy3scIkjuP0FSdbjNHMLys6OwyQVlnXEsOS2QP6OL8jkzlmd70jus86eBT8FIu8PqGXg6oFX6ARGthgX+V1ReFnDJAACZAfhFwHAJI7HF2lZGQaAAAAAElFTkSuQmCC) 96% / 15% no-repeat $light;
margin: 5px 10px;
transition: 0.4s all;
outline: none;
}
select:hover {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAeCAYAAADZ7LXbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhU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dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAKRJREFUeNrs1TEKwkAQheEvIoI2nsk7qFdIq1hoJ3gCC5sUVpY23sDKXnvrYOUBbGITG0kQjQriPlgYhmF/3ryFjbIs82nVfEEBEiAB8k+Q+q1IkqSDNVq4lMy3scIkjuP0FSdbjNHMLys6OwyQVlnXEsOS2QP6OL8jkzlmd70jus86eBT8FIu8PqGXg6oFX6ARGthgX+V1ReFnDJAACZAfhFwHAJI7HF2lZGQaAAAAAElFTkSuQmCC) 96% / 15% no-repeat $light;
}
#javascript_error {
background: red;
color: white;
padding: 20px;
margin-top: 10px;
}
// End Globals
//
// Notification Bar
//
.jquery-notify-bar {
color: #fff;
text-shadow: none;
border: none;
opacity: 1;
box-shadow: none;
font-size: 1.1em;
font-weight: 500;
position: static;
margin-top: 30px;
margin-bottom: -45px;
padding: 10px;
a, a:link, a:active, a:visited {
color: white;
}
}
.jquery-notify-bar.error,
.jquery-notify-bar.fail {
background-color: #FF9800;
color: white;
}
.jquery-notify-bar.success {
color: white;
background-color: #4CAF50;
}
// End Notification Bar
//
// Login page
//
.login {
#wrap {
margin: auto;
}
label {
font-size: 1em;
font-weight: 600;
}
.login-logo {
width: 150px;
margin: 30px auto;
display: flex;
}
input.text {
width: 270px !important;
}
input.button {
font-weight: 600;
padding: 10px 25px;
margin-top: 15px !important;
font-weight: 600;
@if ($theme == "light") {
background: $accent !important;
} else {
background: $light !important;
border-left: 7px solid $accent !important;
}
}
input.button:hover {
background: darken($accent, 10%) !important;
}
.error {
padding: 10px;
background: $accent;
color: white;
position: fixed;
top: 0;
left: 0;
width: 100%;
margin: 0;
text-align: center
}
}
// End login page
//
// Start Index page
//
.index {
#add-url {
width: 200px;
}
#new_url_form {
box-sizing: border-box;
overflow: hidden;
// min-width: 900px;
}
#new_url {
border: none;
background: $default;
text-align: left;
input.button {
margin-top: 10px !important;
}
div {
background: $default;
padding: 4px;
padding-top: 0px;
}
}
.create {
background: $accent !important;
width: 150px;
font-size: 1.3em !important;
border: none !important;
font-weight: 700;
text-align: center;
margin-top: 10px !important;
margin-left: 20px !important;
}
.top {
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 50px;
@if ($theme == "light") {
background: darken($accent, 10%);
} @else {
background: $default;
}
label {
font-size: 1em;
font-weight: 600;
color: $text;
@if ($theme == "light") {
color: $default;
}
}
input.text {
width: 360px;
padding: 4px;
font-weight: 200;
font-size: 1em !important;
@if ($theme == "light") {
background: $default !important;
} @else {
background: $lightest !important;
}
}
.short {
padding-left: 10px;
}
#add-keyword {
width: 100px;
}
input.button {
font-weight: 500;
padding: 5px 10px;
font-size: 1em !important;
margin-left: 10px !important;
background: $lightest !important;
@if ($theme == "light") {
background: $default !important;
font-weight: 700;
color: $accent !important;
}
}
input.button:hover {
background: darken($accent, 10%) !important;
@if ($theme == "light") {
background: darken(white, 10%) !important;
}
}
#new_url_form {
margin-left: 260px;
padding: 12px;
}
}
// Table stuff
table.tblSorter {
background-color: $default;
color: $text;
a {
color: $text;
}
small a {
color: darken(white, 50%)
}
thead tr .tablesorter-header {
padding: 10px;
}
tfoot tr {
background-color: $default;
}
thead tr th,
tfoot tr th,
th.header {
background-color: transparent;
border: none;
/* font-size: 8pt; */
padding: 4px;
}
thead tr .tablesorter-headerAsc,
thead tr .tablesorter-headerDesc {
background-color: $lightest !important;
}
tbody td {
color: $text;
padding: 5px;
background-color: $light;
vertical-align: middle;
transition: 0.4s all;
}
tbody tr:hover td {
background-color: $lightest !important;
}
tbody tr.normal-row td {
background: $light;
}
.keyword {
border-left: 7px solid $accent;
}
input.text {
padding: 5px;
margin: 8px 5px !important;
}
.navigation .nav_link a {
background: $light;
border: none;
&:hover {
background: $lightest;
}
}
tr.edit-row td {
background: $default !important;
}
// Icons
$icons-list: stats, share, edit, delete;
@each $icon in $icons-list {
@if $icon == delete {
td.actions .button_#{$icon} {
background: red url(../img/#{$icon}.png) 0px center no-repeat;
background-size: 23px;
background-position: center;
border: none;
padding: 3px;
border-radius: 2px;
&:hover {
background: darken(red, 10%) url(../img/#{$icon}.png) 0px center no-repeat;
background-size: 23px;
background-position: center;
}
}
} @else {
td.actions .button_#{$icon} {
background: $accent url(../img/#{$icon}.png) 0px center no-repeat;
background-size: 23px;
background-position: center;
border: none;
padding: 3px;
border-radius: 2px;
&:hover {
background: darken($accent, 10%) url(../img/#{$icon}.png) 0px center no-repeat;
background-size: 23px;
background-position: center;
}
}
}
}
}
}
// End index page
//
// Nav
//
nav {
background: $default;
height: 100%;
position: fixed;
top: 0;
left: 0;
padding: 50px 30px;
width: 200px;
z-index: 10;
li#admin_menu_logout_link {
font-size: 1.3em;
}
ul#admin_menu li:hover {
list-style-type: none;
color: darken($title, 20%);
}
ul#admin_menu li {
color: $title;
padding: 5px 0;
}
#admin_menu_logout_link:hover {
color: $title !important;
}
.admin_menu_sublevel {
font-weight: 100;
margin-left: -20px;
}
.material-icons {
font-size: 1em;
vertical-align: middle;
margin-top: -1px;
}
ul {
list-style-type: none;
}
}
img.logo {
width: 90px;
position: fixed;
top: 0;
left: 0;
background: $accent;
padding: 9px 150px 8px 20px;
z-index: 20;
}
.nav-open {
color: white;
position: fixed;
top: 0;
right: 0;
z-index: 30;
padding: 10px 15px;
cursor: pointer;
display: none;
i {
font-size: 2em;
line-height: 30px;
}
}
header {
display: none;
}
// End nav
//
// Information
//
#wrap {
#tabs {
min-width: 580px;
.tab {
background: $light !important;
}
.wrap_unfloat {
margin-bottom: -5px;
}
ul#headers {
border: none;
padding: 0px;
}
li {
color: $text;
}
#historical_clicks li:hover {
background: darken($default, 10%) !important;
}
ul#headers li a,
#stats_lines li a {
outline: none;
border: none;
border-radius: 0;
background: $light;
color: $text;
padding: 10px 15px 7px 25px;
&:hover {
background: darken($default, 10%);
}
h2 {
font-weight: 400;
font-size: 1em;
}
&.selected {
background: $lightest;
border-bottom: 2px solid $accent;
&:hover {
background: darken($default, 15%);
}
}
}
#stats_lines li a {
padding: 7px 15px;
}
ul.toggle_display {
border: none;
}
svg {
ellipse {
fill: $accent;
}
}
}
}
//
// General Styles
//
body.index #wrap {
padding-top: 50px;
}
#wrap {
background: none;
margin-left: 270px;
border: none;
color: $text;
max-width: 100%;
}
.notice {
width: calc(100% - 22px);
margin: 0;
padding: 0;
border-radius: 0;
background: $accent;
border: 1px solid $accent;
padding: 10px;
p {
color: white;
}
}
#shareboxes {
margin-top: -10px;
}
#sharebox {
width: 558px;
margin-right: 0px;
}
div.share {
background: $default;
border-radius: 0;
border: none;
padding: 0px 20px 10px;
margin-top: 10px;
textarea {
background: $light;
color: $text;
border: none;
padding: 3px;
outline: none;
margin: 1px !important;
}
#charcount {
padding-left: 5px;
color: $text;
}
#share_links a {
color: $text;
}
}
.sub_wrap,
.plugins main,
.plugin_page_sleeky_settings main,
code {
background: $default;
padding: 10px;
padding: 5px 25px;
max-width: 100%;
span {
background: rgba(255, 255, 255, 0.2);
}
code,
tt {
background: rgba(0, 123, 255, 0.7);
@if ($theme == "light") {
background: rgba(35, 185, 222, 0.5);
}
}
a.bookmarklet {
border: none;
background: #ffffff url(/images/favicon.gif) 4px center no-repeat;
color: #3c3c3c;
border-radius: 1px;
padding: 7px 7px 7px 25px;
color: darken(white, 80%) !important;
&:hover {
background: #e0e0e0 url(/images/favicon.gif) 4px center no-repeat;
}
}
// Table
table.tblSorter {
background: $default;
a {
color: $text;
&:hover {
color: darken($text, 30%);
}
}
thead tr th,
tfoot tr th,
th.header {
border: none;
background-color: $light;
padding: 10px;
}
tbody td {
background: $lightest;
color: $text;
}
}
}
#filter_options {
padding: 0px 10px !important;
}
body > div > pre {
overflow-x: scroll;
padding-left: 290px;
}
// End General Styles
//
// Footer
//
#footer {
position: fixed;
bottom: 0;
width: 230px;
color: #828282;
padding: 10px;
text-align: left;
z-index: 10;
p {
background: none;
border: none;
font-size: 1em;
a {
background: none;
padding-left: 0;
color: $text;
&:hover {
color: #828282;
}
}
}
}
// End footer
// Mobile styles
@include for-size(phone-only) {
body.index #wrap {
padding-top: 210px;
}
body.tools #wrap,
body.plugins #wrap,
body.plugin_page_sleeky_settings #wrap {
padding-top: 50px;
}
#wrap {
margin-left: 0;
main {
overflow-x: scroll;
}
}
img.logo {
padding: 9px 100% 8px 20px;
}
.nav-open {
display: block;
}
nav {
height: 0;
padding: 0;
width: 0;
ul#admin_menu {
position: fixed;
top: 0;
left: 0;
z-index: 9999 !important;
width: 100%;
height: 100%;
padding: 50px;
display: none;
@if ($theme == "light") {
background: darken($accent, 10%);
} @else {
background: $default;
}
li {
color: white;
}
a, a:link, a:active, a:visited {
color: white;
}
}
}
.index {
.top {
display: block;
margin-top: 50px;
width: 100vw;
height: auto;
form {
margin-left: 0 !important;
}
#new_url_form {
min-width: unset;
height: auto;
}
.short {
padding: 0;
}
#add-url,
#add-keyword {
width: calc(100% - 10px);
margin: 10px 0px !important;
}
input.button {
margin: 0 !important;
width: 100%;
}
}
table.tblSorter {
min-width: 600px;
// Icons
$icons-list: stats, share, edit, delete;
@each $icon in $icons-list {
td.actions .button_#{$icon} {
background-size: 15px;
margin: 3px;
}
}
}
}
#copybox {
width: 100%;
}
.jquery-notify-bar {
margin-top: 210px;
margin-bottom: -210px;
width: calc(100vw - 20px);
a {
margin-left: -30px;
}
}
#footer {
display: none;
}
.infos #wrap {
margin-top: 30px;
#headers {
li {
margin: 0;
display: inline-block;
}
}
}
.infos #tabs {
min-width: initial;
.tab {
overflow: scroll;
}
ul#headers {
margin: 20px 0;
li {
a {
padding: 10px 5px;
}
h2 {
margin: 0;
}
}
}
}
body > div > pre {
padding-left: 20px;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,864 @@
@import url("https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800");
@import url("https://fonts.googleapis.com/icon?family=Material+Icons");
body {
background-color: #1d1d1d;
display: inline
}
div,
p,
td,
input,
p {
font-family: 'Open Sans', sans-serif !important
}
h1,
h2 {
color: #ececec
}
p {
color: #dcdcdc
}
a,
a:link,
a:active,
a:visited {
color: #828282;
text-decoration: none
}
a:hover {
color: #b9b9b9;
transition: 0.4s all
}
input {
padding: 10px;
border: none !important;
background: #313131 !important;
color: #dcdcdc !important;
font-size: 1em !important;
outline: none;
margin: 0px 5px !important;
border-radius: 0 !important
}
input.button,
input.submit,
input[type="submit"] {
border-left: 7px solid #7289DA !important;
background: #313131 !important;
font-weight: 600;
transition: 0.3s all !important;
cursor: pointer
}
input.button:hover,
input.submit:hover,
input[type="submit"]:hover {
background: #4E5D94 !important
}
input[type="button"]:disabled,
input[type="submit"]:disabled {
cursor: not-allowed
}
input.text,
input[type="text"] {
border: 1px solid rgba(255, 255, 255, 0.25) !important;
transition: 0.4s all
}
input.text:active,
input.text:focus {
border: 1px solid #7289DA !important
}
select {
width: 150px;
padding: 5px 35px 5px 10px;
border: none;
border-radius: 0;
height: 26px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
color: #dcdcdc;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAeCAYAAADZ7LXbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAc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vvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAKRJREFUeNrs1TEKwkAQheEvIoI2nsk7qFdIq1hoJ3gCC5sUVpY23sDKXnvrYOUBbGITG0kQjQriPlgYhmF/3ryFjbIs82nVfEEBEiAB8k+Q+q1IkqSDNVq4lMy3scIkjuP0FSdbjNHMLys6OwyQVlnXEsOS2QP6OL8jkzlmd70jus86eBT8FIu8PqGXg6oFX6ARGthgX+V1ReFnDJAACZAfhFwHAJI7HF2lZGQaAAAAAElFTkSuQmCC) 96%/15% no-repeat #313131;
margin: 5px 10px;
transition: 0.4s all;
outline: none
}
select:hover {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAeCAYAAADZ7LXbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXg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+V1ReFnDJAACZAfhFwHAJI7HF2lZGQaAAAAAElFTkSuQmCC) 96%/15% no-repeat #313131
}
#javascript_error {
background: red;
color: white;
padding: 20px;
margin-top: 10px
}
.jquery-notify-bar {
color: #fff;
text-shadow: none;
border: none;
opacity: 1;
box-shadow: none;
font-size: 1.1em;
font-weight: 500;
position: static;
margin-top: 30px;
margin-bottom: -45px;
padding: 10px
}
.jquery-notify-bar a,
.jquery-notify-bar a:link,
.jquery-notify-bar a:active,
.jquery-notify-bar a:visited {
color: white
}
.jquery-notify-bar.error,
.jquery-notify-bar.fail {
background-color: #FF9800;
color: white
}
.jquery-notify-bar.success {
color: white;
background-color: #4CAF50
}
.login #wrap {
margin: auto
}
.login label {
font-size: 1em;
font-weight: 600
}
.login .login-logo {
width: 200px;
margin: 30px auto;
display: flex
}
.login input.text {
width: 270px !important
}
.login input.button {
font-weight: 600;
padding: 10px 25px;
margin-top: 15px !important;
font-weight: 600
}
.login input.button else {
background: #313131 !important;
border-left: 7px solid #7289DA !important
}
.login input.button:hover {
background: #4E5D94 !important
}
.login .error {
padding: 10px;
background: #7289DA;
color: white;
position: fixed;
top: 0;
left: 0;
width: 100%;
margin: 0;
text-align: center
}
.index #add-url {
width: 200px
}
.index #new_url_form {
box-sizing: border-box;
overflow: hidden
}
.index #new_url {
border: none;
background: #232323;
text-align: left
}
.index #new_url input.button {
margin-top: 10px !important
}
.index #new_url div {
background: #232323;
padding: 4px;
padding-top: 0px
}
.index .create {
background: #7289DA !important;
width: 150px;
font-size: 1.3em !important;
border: none !important;
font-weight: 700;
text-align: center;
margin-top: 10px !important;
margin-left: 20px !important
}
.index .top {
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 50px;
background: #232323
}
.index .top label {
font-size: 1em;
font-weight: 600;
color: #dcdcdc
}
.index .top input.text {
width: 360px;
padding: 4px;
font-weight: 200;
font-size: 1em !important;
background: #464646 !important
}
.index .top .short {
padding-left: 10px
}
.index .top #add-keyword {
width: 100px
}
.index .top input.button {
font-weight: 500;
padding: 5px 10px;
font-size: 1em !important;
margin-left: 10px !important;
background: #464646 !important
}
.index .top input.button:hover {
background: #4E5D94 !important
}
.index .top #new_url_form {
margin-left: 260px;
padding: 12px
}
.index table.tblSorter {
background-color: #232323;
color: #dcdcdc
}
.index table.tblSorter a {
color: #dcdcdc
}
.index table.tblSorter small a {
color: gray
}
.index table.tblSorter thead tr .tablesorter-header {
padding: 10px
}
.index table.tblSorter tfoot tr {
background-color: #232323
}
.index table.tblSorter thead tr th,
.index table.tblSorter tfoot tr th,
.index table.tblSorter th.header {
background-color: transparent;
border: none;
padding: 4px
}
.index table.tblSorter thead tr .tablesorter-headerAsc,
.index table.tblSorter thead tr .tablesorter-headerDesc {
background-color: #464646 !important
}
.index table.tblSorter tbody td {
color: #dcdcdc;
padding: 5px;
background-color: #313131;
vertical-align: middle;
transition: 0.4s all
}
.index table.tblSorter tbody tr:hover td {
background-color: #464646 !important
}
.index table.tblSorter tbody tr.normal-row td {
background: #313131
}
.index table.tblSorter .keyword {
border-left: 7px solid #7289DA
}
.index table.tblSorter input.text {
padding: 5px;
margin: 8px 5px !important
}
.index table.tblSorter .navigation .nav_link a {
background: #313131;
border: none
}
.index table.tblSorter .navigation .nav_link a:hover {
background: #464646
}
.index table.tblSorter tr.edit-row td {
background: #232323 !important
}
.index table.tblSorter td.actions .button_stats {
background: #7289DA url(../img/stats.png) 0px center no-repeat;
background-size: 23px;
background-position: center;
border: none;
padding: 3px;
border-radius: 2px
}
.index table.tblSorter td.actions .button_stats:hover {
background: #4E5D94 url(../img/stats.png) 0px center no-repeat;
background-size: 23px;
background-position: center
}
.index table.tblSorter td.actions .button_share {
background: #7289DA url(../img/share.png) 0px center no-repeat;
background-size: 23px;
background-position: center;
border: none;
padding: 3px;
border-radius: 2px
}
.index table.tblSorter td.actions .button_share:hover {
background: #4E5D94 url(../img/share.png) 0px center no-repeat;
background-size: 23px;
background-position: center
}
.index table.tblSorter td.actions .button_edit {
background: #7289DA url(../img/edit.png) 0px center no-repeat;
background-size: 23px;
background-position: center;
border: none;
padding: 3px;
border-radius: 2px
}
.index table.tblSorter td.actions .button_edit:hover {
background: #4E5D94 url(../img/edit.png) 0px center no-repeat;
background-size: 23px;
background-position: center
}
.index table.tblSorter td.actions .button_delete {
background: red url(../img/delete.png) 0px center no-repeat;
background-size: 23px;
background-position: center;
border: none;
padding: 3px;
border-radius: 2px
}
.index table.tblSorter td.actions .button_delete:hover {
background: #c00 url(../img/delete.png) 0px center no-repeat;
background-size: 23px;
background-position: center
}
nav {
background: #232323;
height: 100%;
position: fixed;
top: 0;
left: 0;
padding: 50px 30px;
width: 200px;
z-index: 10
}
nav li#admin_menu_logout_link {
font-size: 1.3em
}
nav ul#admin_menu li:hover {
list-style-type: none;
color: #b9b9b9
}
nav ul#admin_menu li {
color: #ececec;
padding: 5px 0
}
nav #admin_menu_logout_link:hover {
color: #ececec !important
}
nav .admin_menu_sublevel {
font-weight: 100;
margin-left: -20px
}
nav .material-icons {
font-size: 1em;
vertical-align: middle;
margin-top: -1px
}
nav ul {
list-style-type: none
}
img.logo {
width: 150px;
position: fixed;
top: 0;
left: 0;
background: #7289DA;
padding: 9px 90px 8px 20px;
z-index: 20
}
.nav-open {
color: white;
position: fixed;
top: 0;
right: 0;
z-index: 30;
padding: 10px 15px;
cursor: pointer;
display: none
}
.nav-open i {
font-size: 2em;
line-height: 30px
}
header {
display: none
}
#wrap #tabs {
min-width: 580px
}
#wrap #tabs .tab {
background: #313131 !important
}
#wrap #tabs .wrap_unfloat {
margin-bottom: -5px
}
#wrap #tabs ul#headers {
border: none;
padding: 0px
}
#wrap #tabs li {
color: #dcdcdc
}
#wrap #tabs #historical_clicks li:hover {
background: #0a0a0a !important
}
#wrap #tabs ul#headers li a,
#wrap #tabs #stats_lines li a {
outline: none;
border: none;
border-radius: 0;
background: #313131;
color: #dcdcdc;
padding: 10px 15px 7px 25px
}
#wrap #tabs ul#headers li a:hover,
#wrap #tabs #stats_lines li a:hover {
background: #0a0a0a
}
#wrap #tabs ul#headers li a h2,
#wrap #tabs #stats_lines li a h2 {
font-weight: 400;
font-size: 1em
}
#wrap #tabs ul#headers li a.selected,
#wrap #tabs #stats_lines li a.selected {
background: #464646;
border-bottom: 2px solid #7289DA
}
#wrap #tabs ul#headers li a.selected:hover,
#wrap #tabs #stats_lines li a.selected:hover {
background: #000
}
#wrap #tabs #stats_lines li a {
padding: 7px 15px
}
#wrap #tabs ul.toggle_display {
border: none
}
#wrap #tabs svg ellipse {
fill: #7289DA
}
body.index #wrap {
padding-top: 50px
}
#wrap {
background: none;
margin-left: 270px;
border: none;
color: #dcdcdc;
max-width: 100%
}
.notice {
width: calc(100% - 22px);
margin: 0;
padding: 0;
border-radius: 0;
background: #7289DA;
border: 1px solid #7289DA;
padding: 10px
}
.notice p {
color: white
}
#shareboxes {
margin-top: -10px
}
#sharebox {
width: 558px;
margin-right: 0px
}
div.share {
background: #232323;
border-radius: 0;
border: none;
padding: 0px 20px 10px;
margin-top: 10px
}
div.share textarea {
background: #313131;
color: #dcdcdc;
border: none;
padding: 3px;
outline: none;
margin: 1px !important
}
div.share #charcount {
padding-left: 5px;
color: #dcdcdc
}
div.share #share_links a {
color: #dcdcdc
}
.sub_wrap,
.plugins main,
.plugin_page_sleeky_settings main,
code {
background: #232323;
padding: 10px;
padding: 5px 25px;
max-width: 100%
}
.sub_wrap span,
.plugins main span,
.plugin_page_sleeky_settings main span,
code span {
background: rgba(255, 255, 255, 0.2)
}
.sub_wrap code,
.sub_wrap tt,
.plugins main code,
.plugins main tt,
.plugin_page_sleeky_settings main code,
.plugin_page_sleeky_settings main tt,
code code,
code tt {
background: rgba(0, 123, 255, 0.7)
}
.sub_wrap a.bookmarklet,
.plugins main a.bookmarklet,
.plugin_page_sleeky_settings main a.bookmarklet,
code a.bookmarklet {
border: none;
background: #fff url(/images/favicon.gif) 4px center no-repeat;
color: #3c3c3c;
border-radius: 1px;
padding: 7px 7px 7px 25px;
color: #333 !important
}
.sub_wrap a.bookmarklet:hover,
.plugins main a.bookmarklet:hover,
.plugin_page_sleeky_settings main a.bookmarklet:hover,
code a.bookmarklet:hover {
background: #e0e0e0 url(/images/favicon.gif) 4px center no-repeat
}
.sub_wrap table.tblSorter,
.plugins main table.tblSorter,
.plugin_page_sleeky_settings main table.tblSorter,
code table.tblSorter {
background: #232323
}
.sub_wrap table.tblSorter a,
.plugins main table.tblSorter a,
.plugin_page_sleeky_settings main table.tblSorter a,
code table.tblSorter a {
color: #dcdcdc
}
.sub_wrap table.tblSorter a:hover,
.plugins main table.tblSorter a:hover,
.plugin_page_sleeky_settings main table.tblSorter a:hover,
code table.tblSorter a:hover {
color: #909090
}
.sub_wrap table.tblSorter thead tr th,
.sub_wrap table.tblSorter tfoot tr th,
.sub_wrap table.tblSorter th.header,
.plugins main table.tblSorter thead tr th,
.plugins main table.tblSorter tfoot tr th,
.plugins main table.tblSorter th.header,
.plugin_page_sleeky_settings main table.tblSorter thead tr th,
.plugin_page_sleeky_settings main table.tblSorter tfoot tr th,
.plugin_page_sleeky_settings main table.tblSorter th.header,
code table.tblSorter thead tr th,
code table.tblSorter tfoot tr th,
code table.tblSorter th.header {
border: none;
background-color: #313131;
padding: 10px
}
.sub_wrap table.tblSorter tbody td,
.plugins main table.tblSorter tbody td,
.plugin_page_sleeky_settings main table.tblSorter tbody td,
code table.tblSorter tbody td {
background: #464646;
color: #dcdcdc
}
#filter_options {
padding: 0px 10px !important
}
body>div>pre {
overflow-x: scroll;
padding-left: 290px
}
#footer {
position: fixed;
bottom: 0;
width: 230px;
color: #828282;
padding: 10px;
text-align: left;
z-index: 10
}
#footer p {
background: none;
border: none;
font-size: 1em
}
#footer p a {
background: none;
padding-left: 0;
color: #dcdcdc
}
#footer p a:hover {
color: #828282
}
@media (max-width: 899px) {
body.index #wrap {
padding-top: 210px
}
body.tools #wrap,
body.plugins #wrap,
body.plugin_page_sleeky_settings #wrap {
padding-top: 50px
}
#wrap {
margin-left: 0
}
#wrap main {
overflow-x: scroll
}
img.logo {
padding: 9px 100% 8px 20px
}
.nav-open {
display: block
}
nav {
height: 0;
padding: 0;
width: 0
}
nav ul#admin_menu {
position: fixed;
top: 0;
left: 0;
z-index: 9999 !important;
width: 100%;
height: 100%;
padding: 50px;
display: none;
background: #232323
}
nav ul#admin_menu li {
color: white
}
nav ul#admin_menu a,
nav ul#admin_menu a:link,
nav ul#admin_menu a:active,
nav ul#admin_menu a:visited {
color: white
}
.index .top {
display: block;
margin-top: 50px;
width: 100vw;
height: auto
}
.index .top form {
margin-left: 0 !important
}
.index .top #new_url_form {
min-width: unset;
height: auto
}
.index .top .short {
padding: 0
}
.index .top #add-url,
.index .top #add-keyword {
width: calc(100% - 10px);
margin: 10px 0px !important
}
.index .top input.button {
margin: 0 !important;
width: 100%
}
.index table.tblSorter {
min-width: 600px
}
.index table.tblSorter td.actions .button_stats {
background-size: 15px;
margin: 3px
}
.index table.tblSorter td.actions .button_share {
background-size: 15px;
margin: 3px
}
.index table.tblSorter td.actions .button_edit {
background-size: 15px;
margin: 3px
}
.index table.tblSorter td.actions .button_delete {
background-size: 15px;
margin: 3px
}
#copybox {
width: 100%
}
.jquery-notify-bar {
margin-top: 210px;
margin-bottom: -210px;
width: calc(100vw - 20px)
}
.jquery-notify-bar a {
margin-left: -30px
}
#footer {
display: none
}
.infos #wrap {
margin-top: 30px
}
.infos #wrap #headers li {
margin: 0;
display: inline-block
}
.infos #tabs {
min-width: initial
}
.infos #tabs .tab {
overflow: scroll
}
.infos #tabs ul#headers {
margin: 20px 0
}
.infos #tabs ul#headers li a {
padding: 10px 5px
}
.infos #tabs ul#headers li h2 {
margin: 0
}
body>div>pre {
padding-left: 20px
}
}

View File

@ -0,0 +1,872 @@
@import url("https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800");
@import url("https://fonts.googleapis.com/icon?family=Material+Icons");
body {
background-color: #efefef;
display: inline
}
div,
p,
td,
input,
p {
font-family: 'Open Sans', sans-serif !important
}
h1,
h2 {
color: #1d1d1d
}
p {
color: #313131
}
a,
a:link,
a:active,
a:visited {
color: #828282;
text-decoration: none
}
a:hover {
color: #000;
transition: 0.4s all
}
input {
padding: 10px;
border: none !important;
background: #fff !important;
color: #313131 !important;
font-size: 1em !important;
outline: none;
margin: 0px 5px !important;
border-radius: 0 !important;
border-radius: 3px !important
}
input.button,
input.submit,
input[type="submit"] {
border-left: 7px solid #007bff !important;
background: #fff !important;
font-weight: 600;
transition: 0.3s all !important;
cursor: pointer;
background: #007bff !important;
border-left: none !important;
color: white !important;
font-weight: 700
}
input.button:hover,
input.submit:hover,
input[type="submit"]:hover {
background: #0056b3 !important;
background: #0056b3 !important
}
input[type="button"]:disabled,
input[type="submit"]:disabled {
cursor: not-allowed
}
input.text,
input[type="text"] {
border: 1px solid rgba(255, 255, 255, 0.25) !important;
transition: 0.4s all
}
select {
width: 150px;
padding: 5px 35px 5px 10px;
border: none;
border-radius: 0;
height: 26px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
color: #313131;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAeCAYAAADZ7LXbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkk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jbIs82nVfEEBEiAB8k+Q+q1IkqSDNVq4lMy3scIkjuP0FSdbjNHMLys6OwyQVlnXEsOS2QP6OL8jkzlmd70jus86eBT8FIu8PqGXg6oFX6ARGthgX+V1ReFnDJAACZAfhFwHAJI7HF2lZGQaAAAAAElFTkSuQmCC) 96%/15% no-repeat #fff;
margin: 5px 10px;
transition: 0.4s all;
outline: none
}
select:hover {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAeCAYAAADZ7LXbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAg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u7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAKRJREFUeNrs1TEKwkAQheEvIoI2nsk7qFdIq1hoJ3gCC5sUVpY23sDKXnvrYOUBbGITG0kQjQriPlgYhmF/3ryFjbIs82nVfEEBEiAB8k+Q+q1IkqSDNVq4lMy3scIkjuP0FSdbjNHMLys6OwyQVlnXEsOS2QP6OL8jkzlmd70jus86eBT8FIu8PqGXg6oFX6ARGthgX+V1ReFnDJAACZAfhFwHAJI7HF2lZGQaAAAAAElFTkSuQmCC) 96%/15% no-repeat #fff
}
#javascript_error {
background: red;
color: white;
padding: 20px;
margin-top: 10px
}
.jquery-notify-bar {
color: #fff;
text-shadow: none;
border: none;
opacity: 1;
box-shadow: none;
font-size: 1.1em;
font-weight: 500;
position: static;
margin-top: 30px;
margin-bottom: -45px;
padding: 10px
}
.jquery-notify-bar a,
.jquery-notify-bar a:link,
.jquery-notify-bar a:active,
.jquery-notify-bar a:visited {
color: white
}
.jquery-notify-bar.error,
.jquery-notify-bar.fail {
background-color: #FF9800;
color: white
}
.jquery-notify-bar.success {
color: white;
background-color: #4CAF50
}
.login #wrap {
margin: auto
}
.login label {
font-size: 1em;
font-weight: 600
}
.login .login-logo {
width: 150px;
margin: 30px auto;
display: flex
}
.login input.text {
width: 270px !important
}
.login input.button {
font-weight: 600;
padding: 10px 25px;
margin-top: 15px !important;
font-weight: 600;
background: #007bff !important
}
.login input.button else {
background: #fff !important;
border-left: 7px solid #007bff !important
}
.login input.button:hover {
background: #0062cc !important
}
.login .error {
padding: 10px;
background: #007bff;
color: white;
position: fixed;
top: 0;
left: 0;
width: 100%;
margin: 0;
text-align: center
}
.index #add-url {
width: 200px
}
.index #new_url_form {
box-sizing: border-box;
overflow: hidden
}
.index #new_url {
border: none;
background: #f7f7f7;
text-align: left
}
.index #new_url input.button {
margin-top: 10px !important
}
.index #new_url div {
background: #f7f7f7;
padding: 4px;
padding-top: 0px
}
.index .create {
background: #007bff !important;
width: 150px;
font-size: 1.3em !important;
border: none !important;
font-weight: 700;
text-align: center;
margin-top: 10px !important;
margin-left: 20px !important
}
.index .top {
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 50px;
background: #0062cc
}
.index .top label {
font-size: 1em;
font-weight: 600;
color: #313131;
color: #f7f7f7
}
.index .top input.text {
width: 360px;
padding: 4px;
font-weight: 200;
font-size: 1em !important;
background: #f7f7f7 !important
}
.index .top .short {
padding-left: 10px
}
.index .top #add-keyword {
width: 100px
}
.index .top input.button {
font-weight: 500;
padding: 5px 10px;
font-size: 1em !important;
margin-left: 10px !important;
background: #e8e8e8 !important;
background: #f7f7f7 !important;
font-weight: 700;
color: #007bff !important
}
.index .top input.button:hover {
background: #0062cc !important;
background: #e6e6e6 !important
}
.index .top #new_url_form {
margin-left: 260px;
padding: 12px
}
.index table.tblSorter {
background-color: #f7f7f7;
color: #313131
}
.index table.tblSorter a {
color: #313131
}
.index table.tblSorter small a {
color: gray
}
.index table.tblSorter thead tr .tablesorter-header {
padding: 10px
}
.index table.tblSorter tfoot tr {
background-color: #f7f7f7
}
.index table.tblSorter thead tr th,
.index table.tblSorter tfoot tr th,
.index table.tblSorter th.header {
background-color: transparent;
border: none;
padding: 4px
}
.index table.tblSorter thead tr .tablesorter-headerAsc,
.index table.tblSorter thead tr .tablesorter-headerDesc {
background-color: #e8e8e8 !important
}
.index table.tblSorter tbody td {
color: #313131;
padding: 5px;
background-color: #fff;
vertical-align: middle;
transition: 0.4s all
}
.index table.tblSorter tbody tr:hover td {
background-color: #e8e8e8 !important
}
.index table.tblSorter tbody tr.normal-row td {
background: #fff
}
.index table.tblSorter .keyword {
border-left: 7px solid #007bff
}
.index table.tblSorter input.text {
padding: 5px;
margin: 8px 5px !important
}
.index table.tblSorter .navigation .nav_link a {
background: #fff;
border: none
}
.index table.tblSorter .navigation .nav_link a:hover {
background: #e8e8e8
}
.index table.tblSorter tr.edit-row td {
background: #f7f7f7 !important
}
.index table.tblSorter td.actions .button_stats {
background: #007bff url(../img/stats.png) 0px center no-repeat;
background-size: 23px;
background-position: center;
border: none;
padding: 3px;
border-radius: 2px
}
.index table.tblSorter td.actions .button_stats:hover {
background: #0062cc url(../img/stats.png) 0px center no-repeat;
background-size: 23px;
background-position: center
}
.index table.tblSorter td.actions .button_share {
background: #007bff url(../img/share.png) 0px center no-repeat;
background-size: 23px;
background-position: center;
border: none;
padding: 3px;
border-radius: 2px
}
.index table.tblSorter td.actions .button_share:hover {
background: #0062cc url(../img/share.png) 0px center no-repeat;
background-size: 23px;
background-position: center
}
.index table.tblSorter td.actions .button_edit {
background: #007bff url(../img/edit.png) 0px center no-repeat;
background-size: 23px;
background-position: center;
border: none;
padding: 3px;
border-radius: 2px
}
.index table.tblSorter td.actions .button_edit:hover {
background: #0062cc url(../img/edit.png) 0px center no-repeat;
background-size: 23px;
background-position: center
}
.index table.tblSorter td.actions .button_delete {
background: red url(../img/delete.png) 0px center no-repeat;
background-size: 23px;
background-position: center;
border: none;
padding: 3px;
border-radius: 2px
}
.index table.tblSorter td.actions .button_delete:hover {
background: #c00 url(../img/delete.png) 0px center no-repeat;
background-size: 23px;
background-position: center
}
nav {
background: #f7f7f7;
height: 100%;
position: fixed;
top: 0;
left: 0;
padding: 50px 30px;
width: 200px;
z-index: 10
}
nav li#admin_menu_logout_link {
font-size: 1.3em
}
nav ul#admin_menu li:hover {
list-style-type: none;
color: #000
}
nav ul#admin_menu li {
color: #1d1d1d;
padding: 5px 0
}
nav #admin_menu_logout_link:hover {
color: #1d1d1d !important
}
nav .admin_menu_sublevel {
font-weight: 100;
margin-left: -20px
}
nav .material-icons {
font-size: 1em;
vertical-align: middle;
margin-top: -1px
}
nav ul {
list-style-type: none
}
img.logo {
width: 90px;
position: fixed;
top: 0;
left: 0;
background: #007bff;
padding: 9px 150px 8px 20px;
z-index: 20
}
.nav-open {
color: white;
position: fixed;
top: 0;
right: 0;
z-index: 30;
padding: 10px 15px;
cursor: pointer;
display: none
}
.nav-open i {
font-size: 2em;
line-height: 30px
}
header {
display: none
}
#wrap #tabs {
min-width: 580px
}
#wrap #tabs .tab {
background: #fff !important
}
#wrap #tabs .wrap_unfloat {
margin-bottom: -5px
}
#wrap #tabs ul#headers {
border: none;
padding: 0px
}
#wrap #tabs li {
color: #313131
}
#wrap #tabs #historical_clicks li:hover {
background: #dedede !important
}
#wrap #tabs ul#headers li a,
#wrap #tabs #stats_lines li a {
outline: none;
border: none;
border-radius: 0;
background: #fff;
color: #313131;
padding: 10px 15px 7px 25px
}
#wrap #tabs ul#headers li a:hover,
#wrap #tabs #stats_lines li a:hover {
background: #dedede
}
#wrap #tabs ul#headers li a h2,
#wrap #tabs #stats_lines li a h2 {
font-weight: 400;
font-size: 1em
}
#wrap #tabs ul#headers li a.selected,
#wrap #tabs #stats_lines li a.selected {
background: #e8e8e8;
border-bottom: 2px solid #007bff
}
#wrap #tabs ul#headers li a.selected:hover,
#wrap #tabs #stats_lines li a.selected:hover {
background: #d1d1d1
}
#wrap #tabs #stats_lines li a {
padding: 7px 15px
}
#wrap #tabs ul.toggle_display {
border: none
}
#wrap #tabs svg ellipse {
fill: #007bff
}
body.index #wrap {
padding-top: 50px
}
#wrap {
background: none;
margin-left: 270px;
border: none;
color: #313131;
max-width: 100%
}
.notice {
width: calc(100% - 22px);
margin: 0;
padding: 0;
border-radius: 0;
background: #007bff;
border: 1px solid #007bff;
padding: 10px
}
.notice p {
color: white
}
#shareboxes {
margin-top: -10px
}
#sharebox {
width: 558px;
margin-right: 0px
}
div.share {
background: #f7f7f7;
border-radius: 0;
border: none;
padding: 0px 20px 10px;
margin-top: 10px
}
div.share textarea {
background: #fff;
color: #313131;
border: none;
padding: 3px;
outline: none;
margin: 1px !important
}
div.share #charcount {
padding-left: 5px;
color: #313131
}
div.share #share_links a {
color: #313131
}
.sub_wrap,
.plugins main,
.plugin_page_sleeky_settings main,
code {
background: #f7f7f7;
padding: 10px;
padding: 5px 25px;
max-width: 100%
}
.sub_wrap span,
.plugins main span,
.plugin_page_sleeky_settings main span,
code span {
background: rgba(255, 255, 255, 0.2)
}
.sub_wrap code,
.sub_wrap tt,
.plugins main code,
.plugins main tt,
.plugin_page_sleeky_settings main code,
.plugin_page_sleeky_settings main tt,
code code,
code tt {
background: rgba(0, 123, 255, 0.7);
background: rgba(35, 185, 222, 0.5)
}
.sub_wrap a.bookmarklet,
.plugins main a.bookmarklet,
.plugin_page_sleeky_settings main a.bookmarklet,
code a.bookmarklet {
border: none;
background: #fff url(/images/favicon.gif) 4px center no-repeat;
color: #3c3c3c;
border-radius: 1px;
padding: 7px 7px 7px 25px;
color: #333 !important
}
.sub_wrap a.bookmarklet:hover,
.plugins main a.bookmarklet:hover,
.plugin_page_sleeky_settings main a.bookmarklet:hover,
code a.bookmarklet:hover {
background: #e0e0e0 url(/images/favicon.gif) 4px center no-repeat
}
.sub_wrap table.tblSorter,
.plugins main table.tblSorter,
.plugin_page_sleeky_settings main table.tblSorter,
code table.tblSorter {
background: #f7f7f7
}
.sub_wrap table.tblSorter a,
.plugins main table.tblSorter a,
.plugin_page_sleeky_settings main table.tblSorter a,
code table.tblSorter a {
color: #313131
}
.sub_wrap table.tblSorter a:hover,
.plugins main table.tblSorter a:hover,
.plugin_page_sleeky_settings main table.tblSorter a:hover,
code table.tblSorter a:hover {
color: #000
}
.sub_wrap table.tblSorter thead tr th,
.sub_wrap table.tblSorter tfoot tr th,
.sub_wrap table.tblSorter th.header,
.plugins main table.tblSorter thead tr th,
.plugins main table.tblSorter tfoot tr th,
.plugins main table.tblSorter th.header,
.plugin_page_sleeky_settings main table.tblSorter thead tr th,
.plugin_page_sleeky_settings main table.tblSorter tfoot tr th,
.plugin_page_sleeky_settings main table.tblSorter th.header,
code table.tblSorter thead tr th,
code table.tblSorter tfoot tr th,
code table.tblSorter th.header {
border: none;
background-color: #fff;
padding: 10px
}
.sub_wrap table.tblSorter tbody td,
.plugins main table.tblSorter tbody td,
.plugin_page_sleeky_settings main table.tblSorter tbody td,
code table.tblSorter tbody td {
background: #e8e8e8;
color: #313131
}
#filter_options {
padding: 0px 10px !important
}
body>div>pre {
overflow-x: scroll;
padding-left: 290px
}
#footer {
position: fixed;
bottom: 0;
width: 230px;
color: #828282;
padding: 10px;
text-align: left;
z-index: 10
}
#footer p {
background: none;
border: none;
font-size: 1em
}
#footer p a {
background: none;
padding-left: 0;
color: #313131
}
#footer p a:hover {
color: #828282
}
@media (max-width: 899px) {
body.index #wrap {
padding-top: 210px
}
body.tools #wrap,
body.plugins #wrap,
body.plugin_page_sleeky_settings #wrap {
padding-top: 50px
}
#wrap {
margin-left: 0
}
#wrap main {
overflow-x: scroll
}
img.logo {
padding: 9px 100% 8px 20px
}
.nav-open {
display: block
}
nav {
height: 0;
padding: 0;
width: 0
}
nav ul#admin_menu {
position: fixed;
top: 0;
left: 0;
z-index: 9999 !important;
width: 100%;
height: 100%;
padding: 50px;
display: none;
background: #0062cc
}
nav ul#admin_menu li {
color: white
}
nav ul#admin_menu a,
nav ul#admin_menu a:link,
nav ul#admin_menu a:active,
nav ul#admin_menu a:visited {
color: white
}
.index .top {
display: block;
margin-top: 50px;
width: 100vw;
height: auto
}
.index .top form {
margin-left: 0 !important
}
.index .top #new_url_form {
min-width: unset;
height: auto
}
.index .top .short {
padding: 0
}
.index .top #add-url,
.index .top #add-keyword {
width: calc(100% - 10px);
margin: 10px 0px !important
}
.index .top input.button {
margin: 0 !important;
width: 100%
}
.index table.tblSorter {
min-width: 600px
}
.index table.tblSorter td.actions .button_stats {
background-size: 15px;
margin: 3px
}
.index table.tblSorter td.actions .button_share {
background-size: 15px;
margin: 3px
}
.index table.tblSorter td.actions .button_edit {
background-size: 15px;
margin: 3px
}
.index table.tblSorter td.actions .button_delete {
background-size: 15px;
margin: 3px
}
#copybox {
width: 100%
}
.jquery-notify-bar {
margin-top: 210px;
margin-bottom: -210px;
width: calc(100vw - 20px)
}
.jquery-notify-bar a {
margin-left: -30px
}
#footer {
display: none
}
.infos #wrap {
margin-top: 30px
}
.infos #wrap #headers li {
margin: 0;
display: inline-block
}
.infos #tabs {
min-width: initial
}
.infos #tabs .tab {
overflow: scroll
}
.infos #tabs ul#headers {
margin: 20px 0
}
.infos #tabs ul#headers li a {
padding: 10px 5px
}
.infos #tabs ul#headers li h2 {
margin: 0
}
body>div>pre {
padding-left: 20px
}
}

View File

@ -0,0 +1,22 @@
// Sleeky Admin Dark UI Theme
// Define theme
$theme: "dark";
// Set up our basic colour scheme
$lightest: #464646;
$light: #313131;
$default: #232323;
$darker: #1d1d1d;
$darkest: #161616;
// Accents
$accent: #007bff;
// $accent_primary: #007bff;
// Text colours
$title: #ececec;
$text: #dcdcdc;
// Import the base styles
@import "../base.scss";

View File

@ -0,0 +1,22 @@
// Sleeky Admin Light UI Theme
// Define theme
$theme: "light";
// Set up our basic colour scheme
$lightest: #e8e8e8;
$light: white;
$default: #f7f7f7;
$darker: #efefef;
$darkest: #161616;
// Accents
$accent: #007bff;
// $accent_secondary: black;
// Text colours
$title: #1d1d1d;
$text: #313131;
// Import the base styles
@import "../base.scss";

View File

@ -0,0 +1,10 @@
<div class="top" id="add">
<form id="new_url_form" action="javascript:add_link();" method="get">
<label>Link</label>
<input type="url" id="add-url" name="url" value="" class="text" placeholder="e.g. sleeky.flynntes.com" required>
<label class="short">Short URL</label>
<input type="text" id="add-keyword" name="keyword" value="" class="text" placeholder="e.g. theme">
<input type="hidden" id="nonce-add" name="nonce-add" value="">
<input type="button" id="add-button" name="add-button" value="Shorten" class="button" onclick="add_link();">
</form>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

File diff suppressed because one or more lines are too long

1293
user/plugins/backend/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,15 @@
{
"name": "sleeky-admin",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node-sass --watch assets/css/themes -o assets/css --output-style compressed"
},
"author": "",
"license": "ISC",
"dependencies": {
"node-sass": "^4.12.0"
}
}

View File

@ -0,0 +1,79 @@
<?php
/*
Plugin Name: DarkSleeky Backend
Plugin URI: https://sophia.wtf
Description: UI overhaul of the YOURLS backend
Version: 2.4.1
Author: Sophia Atkinson
Author URI: https://sophia.wtf
*/
// No direct call
if( !defined( 'YOURLS_ABSPATH' ) ) die();
// Plugin location URL
$url = yourls_plugin_url( __DIR__ );
yourls_add_action( 'html_head', 'init' );
function init()
{
echo <<<HEAD
<style>body {background: unset;}</style>
HEAD;
}
// Inject Sleeky files
yourls_add_action( 'html_head', 'sleeky_head_scripts' );
function sleeky_head_scripts() {
// This is so the user doesn't have to reload page twice in settings screen
if (isset( $_POST['theme_choice'] )) {
// User has just changed theme
if ($_POST['theme_choice'] == "light") {
setTheme("light");
} else {
setTheme("dark");
}
} else {
// User has not just changed theme
if (yourls_get_option( 'theme_choice' ) == "light") {
setTheme("light");
} else {
setTheme("dark");
}
}
}
// Inject Sleeky files
function setTheme($theme) {
$url = yourls_plugin_url( __DIR__ );
if ($theme == "light") {
echo <<<HEAD
<link rel="stylesheet" href="$url/assets/css/light.css">
<link rel="stylesheet" href="$url/assets/css/animate.min.css">
<script src="$url/assets/js/theme.js"></script>
<meta name="sleeky_theme" content="light">
HEAD;
} else if ($theme == "dark") {
echo <<<HEAD
<link rel="stylesheet" href="$url/assets/css/dark.css">
<link rel="stylesheet" href="$url/assets/css/animate.min.css">
<script src="$url/assets/js/theme.js"></script>
<meta name="sleeky_theme" content="dark">
HEAD;
}
}
// Inject information and options into the frontend
yourls_add_action( 'html_head', 'addOptions' );
function addOptions()
{
$url = yourls_plugin_url( __DIR__ );
echo <<<HEAD
<meta name="pluginURL" content="$url">
HEAD;
}

View File

@ -0,0 +1,28 @@
<?php
/*
Plugin Name: Custom Protocols
Plugin URI: http://yourls.org/
Description: Add custom protocol <code>blah://</code> for trusted users, blacklist all but <code>http</code> and <code>https</code> for others
Version: 1.0
Author: Ozh
Author URI: http://ozh.org/
*/
// Hook into 'kses_allowed_protocols' to modify array. See functions-kses.php/yourls_kses_init()
yourls_add_filter( 'kses_allowed_protocols', 'customproto_allowed_protocols' );
// Whitelist or blacklist protocols depending on user context
function customproto_allowed_protocols( $protocols ) {
if( yourls_is_valid_user() && yourls_is_admin() ) {
// if user is logged in, or valid cookie exists on the computer, and we're in admin area:
// add custom protocol 'blah://' to authorized protocols
$protocols[] = 'blah://';
} else {
// if no known user: remove all protocols except http & https
$protocols = array( 'http://', 'https://' );
}
return $protocols;
}

View File

@ -0,0 +1,18 @@
Plugin for YOURLS 1.6+: Custom Protocols
# What for
If the user is known, this plugin adds custom protocol `blah://` to authorized protocols.
If the user is unknown (using a public interface for instance) then this plugin restricts
authorized protocols to `http` and `https` only.
See [Public Shortening](https://github.com/YOURLS/YOURLS/wiki/Public-Shortening).
# How to
* In `/user/plugins`, create a new folder named `custom-protocols`
* Drop these files in that directory
* Go to the Plugins administration page and activate the plugin
* Have fun

View File

@ -0,0 +1,37 @@
<?php
/*
Plugin Name: Force Lowercase
Plugin URI: http://yourls.org/
Description: Force lowercase so http://sho.rt/ABC == http://sho.rt/abc
Version: 1.0
Author: Ozh
Author URI: http://ozh.org/
*/
/*********************************************************************************
* DISCLAIMER *
* This is stupid. The web is case sensitive and http://bit.ly/BLAH is different *
* from http://bit.ly/blah. Deal with it. More about this: see *
* http://www.w3.org/TR/WD-html40-970708/htmlweb.html *
* *
* This said, lots of users are pestering me for that kind of plugin, so there *
* it is. Have fun breaking the web! :) *
*********************************************************************************/
// Redirection: http://sho.rt/ABC first converted to http://sho.rt/abc
yourls_add_filter( 'get_request', 'ozh_break_the_web_lowercase' );
function ozh_break_the_web_lowercase( $keyword ){
return strtolower( $keyword );
}
// Short URL creation: custom keyword 'ABC' converted to 'abc'
yourls_add_action( 'add_new_link_custom_keyword', 'ozh_break_the_web_add_filter' );
function ozh_break_the_web_add_filter() {
yourls_add_filter( 'get_shorturl_charset', 'ozh_break_the_web_add_uppercase' );
yourls_add_filter( 'custom_keyword', 'ozh_break_the_web_lowercase' );
}
function ozh_break_the_web_add_uppercase( $charset ) {
return $charset . strtoupper( $charset );
}

View File

@ -0,0 +1,21 @@
Plugin for YOURLS 1.5+: Force Lowercase
# What for
Force short urls to lowercase so that http://sho.rt/ABC is the same as http://sho.rt/abc
# How to
* In `/user/plugins`, create a new folder named `force-lowercase`
* Drop these files in that directory
* Go to the Plugins administration page and activate the plugin
* Have fun
# Disclaimer: this is stupid
Disclaimer: this is **stupid**. The web is case sensitive, http://bit.ly/BLAH is different from http://bit.ly/blah. Deal with it.
More about this: see http://www.w3.org/TR/WD-html40-970708/htmlweb.html and particularly the part that says:
>URLs in general are case-sensitive (with the exception of machine names). There may be URLs, or parts of URLs, where case doesn't matter, but identifying these may not be easy. Users should always consider that URLs are case-sensitive.
This said, lots of users are pestering me for that kind of plugin, so there it is. Have fun breaking the web! :)

View File

@ -0,0 +1,22 @@
Allow Full Stops in Short URLs
---------------------------------------------
- Plugin Name: Allow Full Stops in Short URLs
- Plugin URI: http://sophia.wtf
- Description: Allow Full Stops in Short URLs
- Version: 1.0
- Author: Sophia Atkinson
- Author URI: http://sophia.wtf
- Plugin Based Off Of William Bargent's Allow Forward Slashes in Short URLs.
This plugin will allow forward slashes `.` in keywords when shortening URLS with YOURLS.
*NOTE This plugin will not work with URL Forwarding plugins active. Deactivate before activating this plugin.
###Installation
1. Download these file as a .zip.
2. Extract the files and copy them into `users/plugins/`.
3. Go to your plugin manager and click `Activate`.

View File

@ -0,0 +1,23 @@
<?php
/*
Plugin Name: Allow Full Stops in Short URLs
Plugin URI: http://sophia.wtf
Description: Allow Full Stops in Short URLs
Version: 1.0
Author: Sophia Atkinson
Author URI: http://sophia.wtf
Plugin Based Off Of William Bargent's Allow Forward Slashes in Short URLs.
*/
if( !defined( 'YOURLS_ABSPATH' ) ) die();
yourls_add_filter( 'get_shorturl_charset', 'full_stop_in_charset' );
function full_stop_in_charset( $in ) {
return $in.'.';
}
//This plugin will work with URL forwarding plugins active!

View File

@ -0,0 +1,60 @@
<?php
/**
* Google Safe Browsing Lookup admin page
*
*/
// Display admin page
function ozh_yourls_gsb_display_page() {
// Check if a form was submitted
if( isset( $_POST['ozh_yourls_gsb'] ) ) {
// Check nonce
yourls_verify_nonce( 'gsb_page' );
// Process form
ozh_yourls_gsb_update_option();
}
// Get value from database
$ozh_yourls_gsb = yourls_get_option( 'ozh_yourls_gsb' );
// Create nonce
$nonce = yourls_create_nonce( 'gsb_page' );
echo <<<HTML
<h2>Google Safe Browsing API Key</h2>
<p>Google requires you to have a <strong>Google account</strong> and a Safe Browsing <strong>API key</strong>
to use their <a href="https://developers.google.com/safe-browsing/lookup_guide">Safe Browsing Lookup Service</a>.</p>
<p>Get your API key here: <a href="https://developers.google.com/safe-browsing/key_signup">https://developers.google.com/safe-browsing/key_signup</a></p>
<h3>Disclaimer from Google</h3>
<p>Google works to provide the most accurate and up-to-date phishing and malware information. However, it cannot
guarantee that its information is comprehensive and error-free: some risky sites may not be identified, and some safe
sites may be identified in error.</p>
<h3>Configure the plugin</h3>
<form method="post">
<input type="hidden" name="nonce" value="$nonce" />
<p><label for="ozh_yourls_gsb">API Key</label> <input type="text" id="ozh_yourls_gsb" name="ozh_yourls_gsb" value="$ozh_yourls_gsb" size="70" /></p>
<p><input type="submit" value="Update value" /></p>
</form>
HTML;
}
// Update option in database
function ozh_yourls_gsb_update_option() {
$in = $_POST['ozh_yourls_gsb'];
if( $in ) {
// Validate ozh_yourls_gsb: alpha & digits
$in = preg_replace( '/[^a-zA-Z0-9-_]/', '', $in );
// Update value in database
yourls_update_option( 'ozh_yourls_gsb', $in );
yourls_redirect( yourls_admin_url( 'plugins.php?page=ozh_yourls_gsb' ) );
}
}

View File

@ -0,0 +1,106 @@
<?php
/**
* Google Safe Browsing Lookup client for YOURLS
*
*/
class ozh_yourls_GSB {
const PROTOCOL_VER = '4.0';
const CLIENT = 'yourls-plugin-gsb';
const APP_VER = '1.0';
private $url = '';
private $api_key = false;
/**
* Constructor : checks that plugin is properly configured
*
*/
public function __construct( $api_key ) {
$this->api_key = $api_key;
}
/**
* Check if a URL is blacklisted against GSB Lookup API
*
* The function returns an array of a boolean and a string.
* The boolean indicates whether $this->url is blacklisted (true) or not blacklisted (false)
* The string gives diagnosis details: reason of blacklisting, null if clear, or an error message if applicable
*
* @return array array of boolean ( is blacklisted, description )
*/
public function is_blacklisted( $url ) {
if( !$this->api_key ) {
return false;
}
$this->url = urlencode( yourls_sanitize_url( $url ) );
if( !$this->url ) {
return false;
}
$request = $this->request();
switch( $request->status_code ) {
case 200:
$response = json_decode($request->body);
$blacklisted = true;
if (!isset($response->matches))
$blacklisted = false;
return array($blacklisted, ($blacklisted ? $response->matches[0]->threatType : null));
case 400:
return array( false, 'Could not check Google Safe Browsing: Bad Request' );
case 403:
return array( false, 'Could not check Google Safe Browsing: API key not authorized' );
case 503:
return array( false, 'Could not check Google Safe Browsing: service unavailable' );
}
}
/**
* HTTP request wrapper
*
* @return Request request object
*/
private function request() {
$api_url = sprintf( 'https://safebrowsing.googleapis.com/v4/threatMatches:find?key=%s',
$this->api_key
);
// Request headers
$headers = array(
'Content-Type' => 'application/json'
);
// Request data
$data = array(
'client' => array(
'clientId' => self::CLIENT,
'clientVersion' => self::APP_VER
),
'threatInfo' => array(
'threatTypes' => array('MALWARE', 'SOCIAL_ENGINEERING', 'POTENTIALLY_HARMFUL_APPLICATION', 'UNWANTED_SOFTWARE'),
'platformTypes' => array('ANY_PLATFORM'),
'threatEntryTypes' => array('URL'),
'threatEntries' => array(
array(
'url' => $this->url
)
)
)
);
// Request options ?
$options = array(
);
return yourls_http_post( $api_url, $headers, json_encode($data), $options );
}
}

View File

@ -0,0 +1,112 @@
<?php
/*
Plugin Name: Google Safe Browsing
Plugin URI: https://github.com/yourls/google-safe-browsing/
Description: Check new links against Google's Safe Browsing service
Version: 1.1
Author: Ozh
Author URI: http://ozh.org/
*/
// No direct call
if( !defined( 'YOURLS_ABSPATH' ) ) die();
yourls_add_filter( 'shunt_add_new_link', 'ozh_yourls_gsb_check_add' );
/**
* Check for spam when someone adds a new link
*
* The filter used here is 'shunt_add_new_link', which passes in false as first argument. See
* https://github.com/YOURLS/YOURLS/blob/1.7/includes/functions.php#L192-L194
*
* @param bool $false bool false is passed in by the filter 'shunt_add_new_link'
* @param string $url URL to check, as passed in by the filter
* @return mixed false if nothing to do, anything else will interrupt the flow of events
*/
function ozh_yourls_gsb_check_add( $false, $url ) {
list( $blacklisted, $desc ) = ozh_yourls_gsb_is_blacklisted( $url );
// If blacklisted, halt here
if ( $blacklisted ) {
return array(
'status' => 'fail',
'code' => 'error:' . $desc,
'message' => 'This domain is blacklisted by Google Safe Browsing because of ' . $desc . ' suspicion. <a href="http://code.google.com/apis/safebrowsing/safebrowsing_faq.html#whyAdvisory" target="_blank">Read more</a>.',
'errorCode' => '403',
);
}
// If not blacklisted but still unsure (error message), we should warn the user
if( $desc ) {
define( 'OZH_YOURLS_GSB_EXTRA_INFO', $desc );
yourls_add_filter( 'add_new_link', 'ozh_yourls_gsb_extra_info' );
}
// All clear, don't interrupt the normal flow of events
return $false;
}
yourls_add_action( 'plugins_loaded', 'ozh_yourls_gsb_add_page' );
/**
* Register our plugin admin page
*/
function ozh_yourls_gsb_add_page() {
yourls_register_plugin_page( 'ozh_yourls_gsb', 'Google Safe Browsing', 'ozh_yourls_gsb_admin_page' );
if( ! yourls_get_option( 'ozh_yourls_gsb' ) ) {
ozh_yourls_gsb_please_configure();
}
}
/**
* Add extra information to the notification when a link has been added
*
* @param array Array passed in by filter 'add_new_link'
* @return array
*/
function ozh_yourls_gsb_extra_info( $return ) {
$return['message'] .= '<br/>(' . OZH_YOURLS_GSB_EXTRA_INFO . ')';
$return['status'] = 'error';
return $return;
}
/**
* Check if a URL is blacklisted by Google Safe Browsing
*
* @param string $url URL to check
* @return array array( (boolean)is_blacklisted, (string)description )
*/
function ozh_yourls_gsb_is_blacklisted( $url ) {
include_once dirname( __FILE__ ) . '/includes/class-gsb.php';
$api_key = yourls_get_option( 'ozh_yourls_gsb' );
if( !$api_key ) {
ozh_yourls_gsb_please_configure();
return false;
}
$gsb = new ozh_yourls_GSB( $api_key );
return $gsb->is_blacklisted( $url );
}
/**
* Display the admin page
*
*/
function ozh_yourls_gsb_admin_page() {
include_once dirname( __FILE__ ) . '/includes/admin-page.php';
ozh_yourls_gsb_display_page();
}
/**
* Nag user about missing configuration
*
*/
function ozh_yourls_gsb_please_configure() {
yourls_add_notice( 'Plugin <strong>Google Safe Browsing</strong> is not configured' );
}

View File

@ -0,0 +1,22 @@
Plugin for YOURLS 1.7+: Google Safe Browsing
# What for
Check every new URL against Google's Safe Browsing Lookup service, reject those who are identified as malware or phishing
# How to
* In `/user/plugins`, create a new folder named `google-safe-browsing`
* Drop these files in that directory
* Go to the Plugins administration page and activate the plugin
* Follow on-screen instructions
* Have fun
# Disclaimer
Using this plugin requires you to understand Google's Safe Browsing TOS. In short:
* you need a Google account
* you are limited to a certain amount of queries per day (10,000 as of writing this)
* you must understand that the service is not perfect.
[Read more](https://developers.google.com/safe-browsing/lookup_guide#AcceptableUsage)

View File

@ -0,0 +1,71 @@
<?php
// Project Honeypot http:BL plugin for Yourls - URL Shortener ~ Block Page Template
// Copyright (c) 2016, Josh Panter
// No direct call
if( !defined( 'YOURLS_ABSPATH' ) ) die();
header('HTTP/1.0 403 Forbidden');
?>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ALERT!</title>
<link rel="icon" href="%img%" type="image/png" />
<!-- Bootstrap core CSS -- USE LOCAL CACHE
<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/spacelab/bootstrap.min.css" rel="stylesheet" integrity="sha384-L/tgI3wSsbb3f/nW9V6Yqlaw3Gj7mpE56LWrhew/c8MIhAYWZ/FNirA64AVkB5pI" crossorigin="anonymous"> -->
<!-- Bootstrap core CSS -- LOCAL CACHE -->
<link href="%css%" rel="stylesheet" integrity="sha384-L/tgI3wSsbb3f/nW9V6Yqlaw3Gj7mpE56LWrhew/c8MIhAYWZ/FNirA64AVkB5pI" crossorigin="anonymous">
<!-- Add extra support of older browsers -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div style="padding:15px 0px 0px 0px;" class="col-md-6 col-md-offset-3">
<div style="text-align: center;" class="well well-lg">
<div style="display: inline-block; text-align: left">
<h2 class="text-danger" style="text-align:center;"><img src="%img%" width="30" height="30"/> Forbidden: Access Denied <img src="%img%" width="30" height="30"/></h2>
</br>
<p>Your IP: <strong>%ip%</strong>, has been flagged by <a href='https://www.projecthoneypot.org' target='_blank'>Project Honey Pot</a> due to the following:
<ul>
<li>Behavior Type: <strong>%typemeaning%</strong></li>
<li>Threat Level: <strong>%threat%</strong></li>
</ul>
<p>Information regarding threat levels can be found <a href="https://www.projecthoneypot.org/threat_info.php" target="_blank">here</a>.</p>
%greyList%
<p style="display:none;">Otherwise, please have fun with <a href="http://planetozh.com/smelly.php">this page</a></p>
<p>Thank you.</p>
</div>
</div>
</div>
</body>
<footer>
<script type="text/javascript">
function setcookie( name, value, expires, path, domain, secure ) {
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );
if ( expires ) {
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );
document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}
function letmein() {
setcookie('notabot','true',1,'/', '', '');
location.reload(true);
}
</script>
</footer>
</html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,18 @@
CREATE TABLE IF NOT EXISTS `httpBL_log` (
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
`action` varchar(9) NOT NULL,
`ip` varchar(255) NOT NULL,
`type` varchar(50) NOT NULL,
`threat` varchar(3) NOT NULL,
`activity` varchar(255) NOT NULL,
`page` varchar(255) NOT NULL,
`ua` varchar(255) NOT NULL,
PRIMARY KEY (`timestamp`)
) ENGINE=INNODB DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `httpBL_wl` (
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
`ip` varchar(255) NOT NULL,
`notes` varchar(255) NOT NULL,
PRIMARY KEY (`timestamp`)
) ENGINE=INNODB DEFAULT CHARSET=latin1;

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,6 @@
Hyphens in URLs
===============
This is a core plugin, bundled with YOURLS.
Don't modify this plugin. Instead, copy its folder
and modify your own copy. This way, your code won't
be overwritten when you upgrade YOURLS.

View File

@ -0,0 +1,19 @@
<?php
/*
Plugin Name: Allow Hyphens in Short URLs
Plugin URI: http://yourls.org/
Description: Allow hyphens in short URLs (like <tt>http://sho.rt/hello-world</tt>)
Version: 1.0
Author: Ozh
Author URI: http://ozh.org/
*/
// No direct call
if( !defined( 'YOURLS_ABSPATH' ) ) die();
yourls_add_filter( 'get_shorturl_charset', 'ozh_hyphen_in_charset' );
function ozh_hyphen_in_charset( $in ) {
return $in.'-';
}

View File

@ -0,0 +1,7 @@
Random ShortURLs
================
This is a core plugin, bundled with YOURLS.
Don't modify this plugin. Instead, copy its folder
and modify your own copy. This way, your code won't
be overwritten when you upgrade YOURLS.

View File

@ -0,0 +1,93 @@
<?php
/*
Plugin Name: Random ShortURLs
Plugin URI: https://yourls.org/
Description: Assign random keywords to shorturls, like bitly (sho.rt/hJudjK)
Version: 1.2
Author: Ozh
Author URI: https://ozh.org/
*/
/* Release History:
*
* 1.0 Initial release
* 1.1 Added: don't increment sequential keyword counter & save one SQL query
* Fixed: plugin now complies to character set defined in config.php
* 1.2 Adopted as YOURLS core plugin under a new name
* Now configured via YOURLS options instead of editing plugin file
*/
// No direct call
if( !defined( 'YOURLS_ABSPATH' ) ) die();
// Only register things if the old third-party plugin is not present
if( function_exists('ozh_random_keyword') ) {
yourls_add_notice( "<b>Random ShortURLs</b> plugin cannot function unless <b>Random Keywords</b> is removed first." );
} else {
// filter registration happens conditionally, to avoid conflicts
// settings action is left out here, as it allows checking settings before deleting the old plugin
yourls_add_filter( 'random_keyword', 'ozh_random_shorturl' );
yourls_add_filter( 'get_next_decimal', 'ozh_random_shorturl_next_decimal' );
}
// Generate a random keyword
function ozh_random_shorturl() {
$possible = yourls_get_shorturl_charset() ;
$str='';
while( strlen( $str ) < yourls_get_option( 'random_shorturls_length', 5 ) ) {
$str .= substr($possible, rand( 0, strlen( $possible ) - 1 ), 1 );
}
return $str;
}
// Don't increment sequential keyword tracker
function ozh_random_shorturl_next_decimal( $next ) {
return ( $next - 1 );
}
// Plugin settings page etc.
yourls_add_action( 'plugins_loaded', 'ozh_random_shorturl_add_settings' );
function ozh_random_shorturl_add_settings() {
yourls_register_plugin_page( 'random_shorturl_settings', 'Random ShortURLs Settings', 'ozh_random_shorturl_settings_page' );
}
function ozh_random_shorturl_settings_page() {
// Check if form was submitted
if( isset( $_POST['random_length'] ) ) {
// If so, verify nonce
yourls_verify_nonce( 'random_shorturl_settings' );
// and process submission if nonce is valid
ozh_random_shorturl_settings_update();
}
$random_length = yourls_get_option('random_shorturls_length', 5);
$nonce = yourls_create_nonce( 'random_shorturl_settings' );
echo <<<HTML
<main>
<h2>Random ShortURLs Settings</h2>
<form method="post">
<input type="hidden" name="nonce" value="$nonce" />
<p>
<label>Random Keyword Length</label>
<input type="number" name="random_length" min="1" max="128" value="$random_length" />
</p>
<p><input type="submit" value="Save" class="button" /></p>
</form>
</main>
HTML;
}
function ozh_random_shorturl_settings_update() {
$random_length = $_POST['random_length'];
if( $random_length ) {
if( is_numeric( $random_length ) ) {
yourls_update_option( 'random_shorturls_length', intval( $random_length ) );
} else {
echo "Error: Length given was not a number.";
}
} else {
echo "Error: No length value given.";
}
}

View File

@ -0,0 +1,22 @@
<?php
/*
Plugin Name: ReverseProxy
Plugin URI: https://github.com/Diftraku/yourls_cloudflare/
Description: Fixes incoming IPs to use the client IP from reverse proxies
Version: 2.0
Author: Diftraku
*/
// Block direct access to the plugin
if( !defined( 'YOURLS_ABSPATH' ) ) die();
// Add a filter to get_IP for the real IP instead of the reverse proxy
yourls_add_filter( 'get_IP', 'reverseproxy_get_ip');
function reverseproxy_get_ip( $ip ) {
if ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ) {
$ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
return yourls_sanitize_ip( $ip );
}

View File

@ -0,0 +1,129 @@
# Contributing
Please take a moment to review this document in order to make the contribution
process easy and effective for everyone involved.
Submitting an issue that is improperly or incompletely written is a waste of time for everybody.
Following these guidelines helps to communicate that you respect the time of
the developers managing and developing this open source project. In return,
they should reciprocate that respect in addressing your issue or assessing
patches and features.
## Using the issue tracker
The issue tracker is the preferred channel for [bug reports](#bug-reports),
[feature requests](#feature-requests) and [submitting pull
requests](#pull-requests), but please respect the following restrictions:
* Please **do not** use the issue tracker for personal support requests.
Use [discussions](https://github.com/telepathics/yourls-emojis/discussions) instead to ask the community for help.
* Please **do not** derail or troll issues.
Keep the discussion on topic and respect the opinions of others.
## Bug reports
A bug is a _demonstrable problem_ that is caused by the code in the repository.
Good bug reports are extremely helpful - thank you!
Guidelines for bug reports:
1. **Use the GitHub issue search**
Check if the issue has already been reported. Reporting duplicates is a waste of
time for everyone. Search in **all issues**, open and closed.
2. **Check if the issue has been fixed**
Try to reproduce it using the latest `master` or development branch in the repository.
Maybe it has been fixed since the last stable release.
3. **Give details**
A good bug report shouldn't leave others needing to chase you up for more
information. Please try to be as detailed as possible in your report.
Give any information that is relevant to the bug:
* YOURLS & MySQL & PHP versions
* Server Software
* Browser name & version
What is the expected output? What do you see instead? See the report example below.
7. **Isolate the problem**
Isolate the problem as much as you can, reduce to the bare minimum required to reproduce the issue.
Don't describe a general situation that doesn't work as expected and just count on us to pin
point the problem.
## Feature requests
Feature requests are welcome. But take a moment to find out whether your idea
fits with the scope and aims of the project. It's up to *you* to make a strong
case to convince the YOURLS developers of the merits of this feature. Please
provide as much detail and context as possible.
## Pull requests
Good pull requests - patches, improvements, new features - are a fantastic
help. They should remain focused in scope and avoid containing unrelated
commits.
1. **Please ask first**
Before embarking on any significant pull request (e.g. implementing features,
refactoring code), otherwise you risk spending a lot of time working on
something that the developers might not want to merge into the project.
2. **Licensing**
By submitting a patch, you agree that your code will be licensed under the
[MIT License](https://github.com/telepathics/yourls-emojis/blob/master/LICENSE) terms.
3. **Coding Standards**
Please adhere to the coding conventions used throughout the project (indentation,
comments, etc.). Make sure you've tested your patch under
different scenarios (various browsers, non default installation path, etc.).
Adhering to the following this process is the best way to get your work
merged:
1. [Fork the repo](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo), clone your fork,
and configure the remotes.
```bash
# Clone your fork of the repo into the current directory
git clone https://github.com/<your-username>/<repo-name>
# Navigate to the newly cloned directory
cd <repo-name>
# Assign the original repo to a remote called "upstream"
git remote add upstream https://github.com/<upsteam-owner>/<repo-name>
```
2. If you cloned a while ago, get the latest changes from upstream.
```bash
git checkout <dev-branch>
git pull upstream <dev-branch>
```
3. Create a new topic branch (off the main project development branch) to
contain your feature, change, or fix.
```bash
git checkout -b <topic-branch-name>
```
4. Commit your changes in logical chunks. Please adhere to these [git commit
message guidelines](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
or your code is unlikely be merged into the main project. Use Git's
[interactive rebase](https://docs.github.com/en/github/using-git/about-git-rebase)
feature to tidy up your commits before making them public.
5. Locally merge (or rebase) the upstream development branch into your topic branch:
```bash
git pull [--rebase] upstream <dev-branch>
```
6. Push your topic branch up to your fork:
```bash
git push origin <topic-branch-name>
```
10. [Open a Pull Request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests)
with a clear title and description.

View File

@ -0,0 +1,3 @@
# These are supported funding model platforms
github: telepathics

View File

@ -0,0 +1,36 @@
name: PHP Composer
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md
# - name: Run test suite
# run: composer run-script test

View File

@ -0,0 +1,3 @@
.DS_Store
/vendor/
/build/

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 telepathics
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,34 @@
# YOURLS Emojis
A YOURLS plugin that allows emojis in the custom short URLs.
## Description
Emojis in domain names and URLs are becoming increasingly popular, so I thought it would be fun to be able to include them in your YOURLS short codes.
[![Mentioned in Awesome YOURLS](https://awesome.re/mentioned-badge.svg)](https://github.com/YOURLS/awesome-yourls/)
[![Github Sponsors](https://img.shields.io/badge/sponsors-4-green.svg)](https://github.com/sponsors/telepathics)
[![PHP Composer](https://github.com/telepathics/yourls-emojis/actions/workflows/php.yml/badge.svg?branch=main)](https://github.com/telepathics/yourls-emojis/actions/workflows/php.yml)
## Installation
1. Unzip the [latest release](https://github.com/telepathics/yourls-emojis/releases) and move it into your YOURLS `/user/plugins` folder
2. Visit your plugins page (e.g. https://sho.rt/admin/plugins.php)
3. Activate the "Emojis" plugin by telepathics
4. Have fun!
### Upgrading
1. Delete (or replace) the old folder
2. Follow aforementioned installation instructions
## Contributing
Feature suggestion? Bug to report?
__Before opening any issue, please search for existing [issues](https://github.com/telepathics/yourls-emojis/issues) (open and closed) and read the [Contributing Guidelines](https://github.com/telepathics/yourls-emojis/blob/main/.github/CONTRIBUTING.md).__
Also visit the living [to do](https://github.com/telepathics/yourls-emojis/projects/1) kanban board and [discussions](https://github.com/telepathics/yourls-emojis/discussions) page.
## License
Released under the [MIT License](https://opensource.org/licenses/MIT).
See also:
[YOURLS](https://github.com/YOURLS/YOURLS) ♡
[SteppingHat/php-emoji-detector](https://github.com/SteppingHat/php-emoji-detector) ♡ [unicode.org](https://unicode.org/Public/emoji/13.1/emoji-test.txt)

View File

@ -0,0 +1,10 @@
{
"name": "telepathics/yourls-emojis",
"description": "A YOURLS plugin that allows emojis in the custom short URLs",
"license": "MIT",
"homepage": "https://github.com/telepathics/yourls-emojis",
"require": {
"php": ">=7.2",
"steppinghat/emoji-detector": "^1.1"
}
}

View File

@ -0,0 +1,63 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "d8ae5b9fddab58bd68089f83a8564e1e",
"packages": [
{
"name": "steppinghat/emoji-detector",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/SteppingHat/php-emoji-detector.git",
"reference": "d2301e9553795e1ac2f3f2638438b3808654c57f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/SteppingHat/php-emoji-detector/zipball/d2301e9553795e1ac2f3f2638438b3808654c57f",
"reference": "d2301e9553795e1ac2f3f2638438b3808654c57f",
"shasum": ""
},
"require": {
"ext-json": "*",
"ext-mbstring": "*",
"php": ">=7.1"
},
"require-dev": {
"symfony/phpunit-bridge": "^5.0@dev"
},
"type": "library",
"autoload": {
"psr-4": {
"SteppingHat\\EmojiDetector\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Javan Eskander",
"homepage": "https://javaneskander.com"
}
],
"description": "Detect and validate emoji in an input string",
"homepage": "https://github.com/steppinghat/emoji-detector",
"time": "2021-03-18T06:03:22+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=7.2"
},
"platform-dev": [],
"plugin-api-version": "1.1.0"
}

View File

@ -0,0 +1,50 @@
<?php
/*
Plugin Name: Emojis
Description: Create an emoji-only short link, like http://sho.rt/✨ or http://sho.rt/😎🆒🔗
Version: 1.0
Author: telepathics
Author URI: https://telepathics.xyz
*/
if( !defined( 'YOURLS_ABSPATH' ) ) die();
require_once(__DIR__ . '/vendor/autoload.php');
use SteppingHat\EmojiDetector;
/*
* Accept detected emojis
*/
yourls_add_filter( 'get_shorturl_charset', 'path_emojis_in_charset');
function path_emojis_in_charset($in) {
return $in . file_get_contents(__DIR__ . '/util/emojis.txt');
}
/*
* Accepts URLs that are ONLY emojis
*/
yourls_add_filter( 'sanitize_url', 'path_emojis_sanitize_url' );
function path_emojis_sanitize_url($unsafe_url) {
$clean_url = '';
$detector = new SteppingHat\EmojiDetector\EmojiDetector();
$detect_emoji = $detector->detect(urldecode($unsafe_url));
if( sizeof($detect_emoji) > 0 ) {
foreach ($detect_emoji as $emoji) {
$clean_url .= $emoji->getEmoji();
}
return $clean_url;
}
return $unsafe_url;
}
/*
* filter wrong spacing whoopsies
* see @link https://github.com/YOURLS/YOURLS/issues/1303
*/
yourls_add_filter( 'sanitize_url', 'fix_long_url' );
function fix_long_url( $url, $unsafe_url ) {
$search = array ( '%2520', '%2521', '%2522', '%2523', '%2524', '%2525', '%2526', '%2527', '%2528', '%2529', '%252A', '%252B', '%252C', '%252D', '%252E', '%252F', '%253D', '%253F', '%255C', '%255F' );
$replace = array ( '%20', '%21', '%22', '%23', '%24', '%25', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C', '%2D', '%2E', '%2F', '%3D', '%3F', '%5C', '%5F' );
$url = str_ireplace ( $search, $replace ,$url );
return yourls_apply_filter( 'after_fix_long_url', $url, $unsafe_url );
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,24 @@
<?php
/*
* you can update the emoji list by changing the unicode link below
* then, visit your site's /user/plugins/yourls-emojis/util/get_emojis.php page to run the script
*
* most recent 13.1 https://www.unicode.org/emoji/charts/full-emoji-list.html
*/
if( !defined( 'YOURLS_ABSPATH' ) ) die();
require_once __DIR__ . '/../vendor/autoload.php';
/*
* Last retrieved: April 11, 2021
*/
function get_emojis() {
$detect_emoji = Emoji\detect_emoji(file_get_contents('https://unicode.org/Public/emoji/13.1/emoji-test.txt'));
$file = fopen(__DIR__ . '/emojis.txt', 'w+');
if ( sizeof($detect_emoji) > 0 ) {
foreach ( $detect_emoji as $emoji ) {
fwrite($file, $emoji['emoji']);
}
}
}
get_emojis();

View File

@ -0,0 +1,16 @@
<?php
/*
Plugin Name: Change User Agent
Plugin URI: http://yourls.org/
Description: Identify YOURLS as a vanilla mozilla
Version: 1.0
Author: Ozh
Author URI: http://ozh.org/
*/
yourls_add_filter( 'http_user_agent', 'misterfu_useragent' );
// My own UA
function misterfu_useragent() {
return "CodsworthCrawler (SOP.wtf)";
}

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 Matthew Ghost
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,24 @@
YOURLS Password Protection
====================
Plugin for [YOURLS](http://yourls.org) `1.7.3`.
Description
-----------
The *Password Protection* Plugin will give you the ability to password protect any Short URL you want (*Passwords are set individually*)! The plugin will promt the user for a password before redircting them!
Installation
------------
1. In `/user/plugins`, create a new folder named `password-protection`.
2. Drop these files in that directory.
3. Go to the Plugins administration page ( *eg* `http://sho.rt/admin/plugins.php` ) and activate the plugin.
3. Configure the plugin ( *eg* `http://sho.rt/admin/plugins.php?page=matthew_pwp` )!
4. Have fun!
Example
-------
![Password Manager Example](https://mateoc.net/b_plugin/yourls_PasswordProtection/yourlsPasswordManager-1.1.gif "Password Manager Example")
License
-------
[Here](LICENSE)

View File

@ -0,0 +1,339 @@
<?php
/*
Plugin Name: YOURLSs Password Protection
Plugin URI: https://matc.io/yourls-password
Description: This plugin enables the feature of password protecting your short URLs!
Version: 1.4
Author: Matthew
Author URI: https://matc.io
*/
// No direct call
if( !defined( 'YOURLS_ABSPATH' ) ) die();
// Hook our custom function into the 'pre_redirect' event
yourls_add_action( 'pre_redirect', 'warning_redirection' );
// Custom function that will be triggered when the event occurs
function warning_redirection( $args ) {
$matthew_pwprotection_array = json_decode(yourls_get_option('matthew_pwprotection'), true);
if ($matthew_pwprotection_array === false) {
yourls_add_option('matthew_pwprotection', 'null');
$matthew_pwprotection_array = json_decode(yourls_get_option('matthew_pwprotection'), true);
if ($matthew_pwprotection_array === false) {
die("Unable to properly enable password protection due to an apparent problem with the database.");
}
}
$matthew_pwprotection_fullurl = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$matthew_pwprotection_urlpath = parse_url( $matthew_pwprotection_fullurl, PHP_URL_PATH );
$matthew_pwprotection_pathFragments = explode( '/', $matthew_pwprotection_urlpath );
$matthew_pwprotection_short = end( $matthew_pwprotection_pathFragments );
if( array_key_exists( $matthew_pwprotection_short, (array)$matthew_pwprotection_array ) ){
// Check if password is submited, and if it matches the DB
if( isset( $_POST[ 'password' ] ) && password_verify( $_POST[ 'password' ], $matthew_pwprotection_array[ $matthew_pwprotection_short ]) ){
$url = $args[ 0 ];
// Redirect client
header("Location: $url");
die();
} else {
$error = ( isset( $_POST[ 'password' ] ) ? "<script>alertify.error(\"Incorrect Password, try again\")</script>" : "");
$matthew_ppu = yourls__( "Password Protected URL", "matthew_pwp" ); // Translate Password Title
$matthew_ph = yourls__( "Password" , "matthew_pwp" ); // Translate the word Password
$matthew_sm = yourls__( "Please enter the password below to continue.", "matthew_pwp" ); // Translate the main message
$matthew_submit = yourls__( "Send!" , "matthew_pwp" ); // Translate the Submit button
// Displays main "Insert Password" area
echo <<<PWP
<html>
<head>
<title>Redirection Notice</title>
<style>
@import url(https://weloveiconfonts.com/api/?family=fontawesome);
@import url(https://meyerweb.com/eric/tools/css/reset/reset.css);
[class*="fontawesome-"]:before {
font-family: 'FontAwesome', sans-serif;
}
* {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
*:before, *:after {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
background: #2c3338;
color: #606468;
font: 87.5%/1.5em 'Open Sans', sans-serif;
margin: 0;
}
a {
color: #eee;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
input {
border: none;
font-family: 'Open Sans', Arial, sans-serif;
font-size: 14px;
line-height: 1.5em;
padding: 0;
-webkit-appearance: none;
}
p {
line-height: 1.5em;
}
.clearfix {
*zoom: 1;
}
.clearfix:before, .clearfix:after {
content: ' ';
display: table;
}
.clearfix:after {
clear: both;
}
.container {
left: 50%;
position: fixed;
top: 50%;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
#login {
width: 280px;
}
#login form span {
background-color: #363b41;
border-radius: 3px 0px 0px 3px;
color: #606468;
display: block;
float: left;
height: 50px;
line-height: 50px;
text-align: center;
width: 50px;
}
#login form input {
height: 50px;
}
#login form input[type="text"], input[type="password"] {
background-color: #3b4148;
border-radius: 0px 3px 3px 0px;
color: #606468;
margin-bottom: 1em;
padding: 0 16px;
width: 230px;
}
#login form input[type="submit"] {
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background-color: #ea4c88;
color: #eee;
font-weight: bold;
margin-bottom: 2em;
text-transform: uppercase;
width: 280px;
}
#login form input[type="submit"]:hover {
background-color: #d44179;
}
#login > p {
text-align: center;
}
#login > p span {
padding-left: 5px;
}
</style>
<!-- JavaScript -->
<script src="//cdn.jsdelivr.net/npm/alertifyjs@1.11.4/build/alertify.min.js"></script>
<!-- CSS -->
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/alertifyjs@1.11.4/build/css/alertify.min.css"/>
<!-- Default theme -->
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/alertifyjs@1.11.4/build/css/themes/default.min.css"/>
</head>
<body>
<div class="container">
<div id="login">
<form method="post">
<fieldset class="clearfix">
<p><span class="fontawesome-lock"></span><input type="password" name="password" value="Password" onBlur="if(this.value == '') this.value = 'Password'" onFocus="if(this.value == 'Password') this.value = ''" required></p>
<p><input type="submit" value="$matthew_submit"></p>
</fieldset>
</form>
</div>
</div>
$error
</body>
</html>
PWP;
die();
}
}
}
// Register plugin page in admin page
yourls_add_action( 'plugins_loaded', 'matthew_pwprotection_display_panel' );
function matthew_pwprotection_display_panel() {
yourls_register_plugin_page( 'matthew_pwp', 'Password Protection', 'matthew_pwprotection_display_page' );
}
// Function which will draw the admin page
function matthew_pwprotection_display_page() {
if( isset( $_POST[ 'checked' ] ) && isset( $_POST[ 'password' ] ) || isset( $_POST[ 'unchecked' ] ) ) {
matthew_pwprotection_process_new();
matthew_pwprotection_process_display();
} else {
if(yourls_get_option('matthew_pwprotection') !== false){
yourls_add_option( 'matthew_pwprotection', 'null' );
}
matthew_pwprotection_process_display();
}
}
// Set/Delete password from DB
function matthew_pwprotection_process_new() {
// Verify nonce token.
yourls_verify_nonce( "matthew_pwprotection_update" );
$matthew_pwprotection_array = json_decode(yourls_get_option('matthew_pwprotection'), true);
foreach( $_POST[ 'password' ] as $url => $url_password) {
if($url_password != "DONOTCHANGE_8fggwrFrRXvqndzw") {
$_POST[ 'password' ][ $url ] = password_hash($url_password, PASSWORD_BCRYPT);
} else {
$_POST[ 'password' ][ $url ] = $matthew_pwprotection_array[ $url ];
}
}
// Update database
yourls_update_option( 'matthew_pwprotection', json_encode( $_POST[ 'password' ] ) );
echo "<p style='color: green'>Success!</p>";
}
// Display Form
function matthew_pwprotection_process_display() {
$ydb = yourls_get_db();
$table = YOURLS_DB_TABLE_URL;
$sql = "SELECT * FROM `$table` WHERE 1=1";
$query = $ydb->fetchAll( $sql );
$matthew_su = yourls__( "Short URL" , "matthew_pwp" ); // Translate "Short URL"
$matthew_ou = yourls__( "Original URL", "matthew_pwp" ); // Translate "Original URL"
$matthew_pw = yourls__( "Password" , "matthew_pwp" ); // Translate "Password"
// Protect action with nonce
$matthew_pwprotection_noncefield = yourls_nonce_field( "matthew_pwprotection_update" );
echo <<<TB
<style>
table {
border-collapse: collapse;
width: 100%;
}
th, td {
text-align: left;
padding: 8px;
}
tr:nth-child(even){background-color: #313131}
tr:nth-child(odd){background-color: #232323}
</style>
<div style="overflow-x:auto;">
<form method="post">
<table>
<tr>
<th>$matthew_su</th>
<th>$matthew_ou</th>
<th>$matthew_pw</th>
</tr>
TB;
foreach( $query as $link ) { // Displays all shorturls in the YOURLS DB
$short = $link["keyword"];
$url = $link["url"];
$matthew_pwprotection_array = json_decode(yourls_get_option('matthew_pwprotection'), true); // Get array of currently active Password Protected URLs
if( strlen( $url ) > 51 ) { // If URL is too long, shorten it with '...'
$sURL = substr( $url, 0, 30 ). "...";
} else {
$sURL = $url;
}
if( array_key_exists( $short, (array)$matthew_pwprotection_array ) ){ // Check if URL is currently password protected or not
$text = yourls__( "Enable?" );
$password = "DONOTCHANGE_8fggwrFrRXvqndzw";
$checked = " checked";
$unchecked = '';
$style = '';
$disabled = '';
} else {
$text = yourls__( "Enable?" );
$password = '';
$checked = '';
$unchecked = ' disabled';
$style = 'display: none';
$disabled = ' disabled';
}
echo <<<TABLE
<tr>
<td>$short</td>
<td><span title="$url">$sURL</span></td>
<td>
<input type="checkbox" name="checked[{$short}]" class="matthew_pwprotection_checkbox" value="enable" data-input="$short"$checked> $text
<input type="hidden" name="unchecked[{$short}]" id="{$short}_hidden" value="true"$unchecked>
<input id="$short" type="password" name="password[$short]" style="$style" value="$password" placeholder="Password..."$disabled ><br>
</td>
</tr>
TABLE;
}
echo <<<END
</table>
$matthew_pwprotection_noncefield
<input type="submit" value="Submit">
</form>
</div>
<script>
$( ".matthew_pwprotection_checkbox" ).click(function() {
var dataAttr = "#" + this.dataset.input;
$( dataAttr ).toggle();
if( $( dataAttr ).attr( 'disabled' ) ) {
$( dataAttr ).removeAttr( 'disabled' );
$( dataAttr + "_hidden" ).attr( 'disabled' );
$( dataAttr + "_hidden" ).prop('disabled', true);
} else {
$( dataAttr ).attr( 'disabled' );
$( dataAttr ).prop('disabled', true);
$( dataAttr + "_hidden" ).removeAttr( 'disabled' );
}
});
</script>
END;
}
?>

View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Denny Dai
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,19 @@
Preview URL with QR Code
====================
Plugin for [YOURLS](http://yourls.org) `1.5+`.
Description
-----------
Add the character '~' to a short URL to display a preview screen & QR code before redirection
Installation
------------
1. In `/user/plugins`, create a new folder named `preview-url-with-qrcode`.
2. Drop these files in that directory.
3. Go to the Plugins administration page ( *eg* `http://sho.rt/admin/plugins.php` ) and activate the plugin.
4. Have fun!
License
-------
MIT License

View File

@ -0,0 +1,59 @@
<?php
/*
Plugin Name: Preview URL with QR Code
Plugin URI: https://github.com/dennydai
Description: Preview URLs before you're redirected there
Version: 1.0
Author: Denny Dai
Author URI: https://dennydai.github.io
*/
// EDIT THIS
// Character to add to a short URL to trigger the preview interruption
define( 'DD_PREVIEW_CHAR', '~' );
// DO NO EDIT FURTHER
// Handle failed loader request and check if there's a ~
yourls_add_action( 'loader_failed', 'dd_preview_loader_failed' );
function dd_preview_loader_failed( $args ) {
$request = $args[0];
$pattern = yourls_make_regexp_pattern( yourls_get_shorturl_charset() );
if( preg_match( "@^([$pattern]+)".DD_PREVIEW_CHAR."$@", $request, $matches ) ) {
$keyword = isset( $matches[1] ) ? $matches[1] : '';
$keyword = yourls_sanitize_keyword( $keyword );
dd_preview_show( $keyword );
die();
}
}
// Show the preview screen for a short URL
function dd_preview_show( $keyword ) {
require_once( YOURLS_INC.'/functions-html.php' );
yourls_html_head( 'preview', 'Short URL preview' );
yourls_html_logo();
$title = yourls_get_keyword_title( $keyword );
$url = yourls_get_keyword_longurl( $keyword );
$base = YOURLS_SITE;
$char = DD_PREVIEW_CHAR;
$qrcode = 'https://api.qrserver.com/v1/create-qr-code/?size=256x256&format=svg&bgcolor=1D1D1D&color=fff&charset-source=UTF-8&ecc=H&data='.YOURLS_SITE.'/'.$keyword;
echo <<<HTML
<h2>Link Preview</h2>
<p>You requested the short URL <strong><a href="$base/$keyword">$base/$keyword</a></strong></p>
<p>This short URL points to:</p>
<ul>
<li>Long URL: <strong><a href="$base/$keyword">$url</a></strong></li>
<li>Page title: <strong>$title</strong></li>
<li>QR Code: <br><img src="$qrcode"></li>
</ul>
<p>If you still want to visit this link, please <strong><a href="$base/$keyword">click here</a></strong>.</p>
<p>Thank you for using the SOP link shortener.</p>
HTML;
yourls_html_footer();
}

View File

@ -0,0 +1,45 @@
h1. YOURLS Pseudonymize Plugin
This plugin "pseudonymizes" the IP addresses so that it is in line with the German privacy laws.
This effectively means, that the last segment of an IP address is changed into a 0 ("zero"), thus removed.
*IPv4 and IPv6 addresses are supported.*
*NOTE*: Requires PHP >= 5.2.0 due to "filter_var":http://php.net/manual/en/function.filter-var.php usage.
h2. Download
Latest version: <a href="https://raw.github.com/ubicoo/yourls-pseudonymize/master/plugin.php">plugin.php</a>
h2. Install
Copy plugin.php to *YOURLS_HOME*/user/plugins/yourls-pseudonymize folder and activate via the admin menu.
h2. Support
<a href="http://blog.yourls.org/forums/topic/yourls-pseudonymize-plugin/">Discuss about this plugin</a> in the YOURLS forum.
<a href="https://github.com/ubicoo/yourls-pseudonymize/issues/new">File an issue</a> right here on the GitHub project home.
h2. MIT License
Copyright (c) 2010 Ubicoo - http://www.ubicoo.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -0,0 +1,34 @@
<?php
/*
Plugin Name: Pseudonymize Plugin
Plugin URI: http://github.com/ubicoo/yourls-pseudonymize
Description: Pseudonymize IP addresses (remove last segment). Supports IPv4 and IPv6.
Version: 1.1
Author: Ubicoo
Author URI: http://www.ubicoo.com
*/
yourls_add_filter( 'get_IP', 'ubicoo_pseudonymize_IP' );
function ubicoo_pseudonymize_IP( $ip ) {
if(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
$segments = explode(":", $ip);
$segments[count($segments)-1] = 0;
$pseudo_IP = implode(":", $segments);
# FIXME: also handle IPv4 addresses at the end of IPv6, like ::ffff:127.0.0.1
} elseif(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
$segments = explode(".", $ip);
$segments[3] = 0;
$pseudo_IP = implode(".", $segments);
} else {
$pseudo_IP = $ip;
}
return $pseudo_IP;
}

View File

@ -0,0 +1,36 @@
<?php
require_once 'plugin.php';
function yourls_add_filter($a, $b) { }
$fixture = array();
$fixture[] = array('127.0.0.1' => '127.0.0.0');
$fixture[] = array('192.0.43.10' => '192.0.43.0'); // example.com
$fixture[] = array('::1' => '::0');
$fixture[] = array('::ffff:127.0.0.1' => '::ffff:127.0.0.0');
$fixture[] = array('::ffff:192.0.43.10' => '::ffff:192.0.43.0');
$fixture[] = array('2001:0db8:85a3:0000:0000:8a2e:0370:7334' => '2001:0db8:85a3:0000:0000:8a2e:0370:0');
$success = TRUE;
echo "Running tests...\n";
for ($i = 0; $i <= count($fixture)-1; $i++) {
foreach ($fixture[$i] as $actual => $expected) {
$success &= assertEquals($expected, ubicoo_pseudonymize_IP( $actual ), $actual);
}
}
echo "Tests " . ($success ? "succeeded" : "failed") .".\n";
function assertEquals($expected, $actualAfter, $actualBefore)
{
echo " Checking $actualBefore => $expected ? ... ";
if ($actualAfter !== $expected) {
echo "FAILED - was $actualAfter\n";
return FALSE;
}
echo "OK\n";
return TRUE;
}

View File

@ -0,0 +1,72 @@
<?php
/*
Plugin Name: YouTube Title Fix
Plugin URI: https://github.com/joshp23/YOURLS-YouTube-title-fix
Description: Fetch YouTube Titles via Google API
Version: 2.0.0
Author: Josh Panter
Author URI: https://unfettered.net
*/
// No direct call
if( !defined( 'YOURLS_ABSPATH' ) ) die();
// Add the admin page
yourls_add_action( 'plugins_loaded', 'youtube_title_fix_add_page' );
function youtube_title_fix_add_page() {
yourls_register_plugin_page( 'youtube_title_fix', 'YouTube API', 'youtube_title_fix_do_page' );
}
// Display admin page
function youtube_title_fix_do_page() {
if( isset( $_POST['youtube_title_fix_api_key'] ) ) {
yourls_verify_nonce( 'youtube_title_fix' );
yourls_update_option( 'youtube_title_fix_api_key', $_POST['youtube_title_fix_api_key'] );
}
$youtube_title_fix_api_key = yourls_get_option( 'youtube_title_fix_api_key' );
$nonce = yourls_create_nonce( 'youtube_title_fix' );
echo <<<HTML
<div id="wrap">
<h2>YouTube API Key</h2>
<form method="post">
<input type="hidden" name="nonce" value="$nonce" />
<p><label for="youtube_title_fix_api_key">Your Key </label> <input type="text" size=60 id="youtube_title_fix_api_key" name="youtube_title_fix_api_key" value="$youtube_title_fix_api_key" /></p>
<p><input type="submit" value="Submit" /></p>
</form>
</div>
HTML;
}
yourls_add_filter( 'shunt_get_remote_title', 'youtube_title_fix_get_remote_title' );
function youtube_title_fix_get_remote_title( $return , $url ) {
$url = yourls_sanitize_url( $url );
// only deal with http(s)
if ( !in_array( yourls_get_protocol( $url ), array( 'http://', 'https://' ) ) )
return 'PROTOCOL';
// parse url and check host + querry string
$parsed_url = parse_url( $url );
$host = isset($parsed_url['host']) ? $parsed_url['host'] : '';
$query = isset($parsed_url['query']) ? $parsed_url['query'] : '';
parse_str( $query , $array );
if ( preg_match( '/(youtube|youtu\.be)/', $host ) && isset( $array['v'] ) ) {
// we need an API key
$API_KEY = yourls_get_option( 'youtube_title_fix_api_key' );
if( $API_KEY ) {
$vid = $array['v'];
$data = json_decode( file_get_contents( "https://www.googleapis.com/youtube/v3/videos?part=snippet&id=" . $vid ."&key=" . $API_KEY ) );
$title = $data->items[0]->snippet->title;
return $title;
}
}
return false;
}