Skip to content

Commit

Permalink
Stuff related to public shortening[1] & user auth[2]
Browse files Browse the repository at this point in the history
1- readme note and linkage to wiki
1- fix global $yourls_allowed_protocol to allow plugin override
2- rewording of phpdoc comment
2- action added to yourls_maybe_require_auth()
  • Loading branch information
ozh committed Apr 14, 2013
1 parent f2b123e commit 10d54f5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion includes/functions-auth.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Check for valid user. Returns true or an error message
* Check for valid user via login form or stored cookie. Returns true or an error message
*
*/
function yourls_is_valid_user() {
Expand Down
3 changes: 1 addition & 2 deletions includes/functions-kses.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
* The code for these vars is here and ready for any future use
*/

// Initialize empty values in globals - populate after plugins have loaded to allow user defined values
$yourls_allowedentitynames = $yourls_allowedprotocols = array();
// Populate after plugins have loaded to allow user defined values
yourls_add_action( 'plugins_loaded', 'yourls_kses_init' );

/**
Expand Down
6 changes: 5 additions & 1 deletion includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1151,8 +1151,12 @@ function yourls_is_private() {
*
*/
function yourls_maybe_require_auth() {
if( yourls_is_private() )
if( yourls_is_private() ) {
yourls_do_action( 'require_auth' );
require_once( YOURLS_INC.'/auth.php' );
} else {
yourls_do_action( 'require_no_auth' );
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ <h3 id="does404">If YOURLS generates 404 for your short URLs</h3>
<h3 id="noindex">There is no index page at the root of the install</h3>
<ul>
<li>Indeed. It's intented. It's up to the user to make what they need. Some will redirect the root to a different place, some make a public interface for anyone to shorten links, some make a portfolio. You make it.</li>
<li>If you want to make a public interface, there's a sample file provided as an example. In such a case, please be aware that you will most likely attract gazillions of spammers with pharmacy links and the like. You are strongly advised to install anti-spam plugins.</li>
<li>If you want to make a public interface and run your own little bitly.com, there's a sample file provided as an example: <code>sample-public-front-page.txt</code>. This implies important issues to deal with: spam, performance and security. Read <a href="http://yourls.org/public">Public Shortening</a> for important information.</li>
</ul>

<h3 id="lowercase">Uppercase letters in short URLs are eaten up, eg "<code>OmgOzh</code>" becomes "<code>mgzh</code>" !</h3>
Expand Down

0 comments on commit 10d54f5

Please sign in to comment.