<?php

if (get_option('disable_toolbar')) {
  show_admin_bar(false);
}

if (get_option('disable_dashboard')) {

  if(!function_exists(disableDashboard)) {

    add_action('admin_init', 'disableDashboard');

    function disableDashboard() {
      if (!current_user_can('manage_options') && $_SERVER['DOING_AJAX'] != '/wp-admin/admin-ajax.php') {
        wp_redirect(home_url()); exit;
      }
    }

  }

}

<?php

if (get_option('disable_toolbar')) {
  show_admin_bar(false);
}

if (get_option('disable_dashboard')) {

  if(!function_exists('disableDashboard')) {

    add_action('admin_init', 'disableDashboard');

    function disableDashboard() {
      if (!current_user_can('manage_options') && $_SERVER['DOING_AJAX'] != '/wp-admin/admin-ajax.php') {
        wp_redirect(home_url()); exit;
      }
    }

  }

}

Check as string, not constant..
Check as string, not constant..
