]> CyberLeo.Net >> Repos - Github/YOURLS.git/blob - includes/auth.php
Load auth functions from start if needed
[Github/YOURLS.git] / includes / auth.php
1 <?php
2 $auth = yourls_is_valid_user();
3
4 if( $auth !== true ) {
5
6         $format = ( isset($_REQUEST['format']) ? $_REQUEST['format'] : null );
7         
8         // API mode, 
9         if ( defined('YOURLS_API') && YOURLS_API == true ) {
10                 yourls_api_output( $format, array('shorturl' => $auth) );
11
12         // Regular mode
13         } else {
14                 yourls_login_screen( $auth );
15         }
16         
17         die();
18 }