]> CyberLeo.Net >> Repos - Github/YOURLS.git/blob - includes/auth.php
Smarter default DB & table names. Fixes issue 34.
[Github/YOURLS.git] / includes / auth.php
1 <?php
2 require(dirname(__FILE__).'/functions-auth.php');
3
4 $auth = yourls_is_valid_user();
5
6 if( $auth !== true ) {
7
8         $format = ( isset($_REQUEST['format']) ? $_REQUEST['format'] : null );
9         
10         // API mode, 
11         if ( defined('YOURLS_API') && YOURLS_API == true ) {
12                 yourls_api_output( $format, array('shorturl' => $auth) );
13
14         // Regular mode
15         } else {
16                 yourls_login_screen( $auth );
17         }
18         
19         die();
20 }