mirror of
https://github.com/kremalicious/krtmn.git
synced 2024-12-22 17:23:33 +01:00
28 lines
610 B
PHP
28 lines
610 B
PHP
<?php
|
|
// No direct call
|
|
if( !defined( 'YOURLS_ABSPATH' ) ) die();
|
|
|
|
$auth = yourls_apply_filter( 'is_valid_user', yourls_is_valid_user() );
|
|
|
|
if( $auth !== true ) {
|
|
|
|
// API mode,
|
|
if ( yourls_is_API() ) {
|
|
$format = ( isset($_REQUEST['format']) ? $_REQUEST['format'] : 'xml' );
|
|
$callback = ( isset($_REQUEST['callback']) ? $_REQUEST['callback'] : '' );
|
|
yourls_api_output( $format, array(
|
|
'simple' => $auth,
|
|
'message' => $auth,
|
|
'errorCode' => 403,
|
|
'callback' => $callback,
|
|
) );
|
|
|
|
// Regular mode
|
|
} else {
|
|
yourls_login_screen( $auth );
|
|
}
|
|
|
|
die();
|
|
}
|
|
|
|
yourls_do_action( 'auth_successful' ); |