Restrict function call to page load but not ajax call

Check the constant DOING_AJAX. It is always defined when someone uses the WordPress AJAX API.

if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
    return;

if ( is_admin() )
    add_action( 'admin_init', 'xcsn_redirect_from_admin' );

techhipbettruvabetnorabahisbahis forumutaraftarium24eduedueduedusedusedusedusedusedusedus