<commit_before><?php

class SessionsController extends \BaseController {

  protected $sessionsValidator;

  public function __construct(UserSessionValidator $userSessionValidator, AdminSessionValidator $adminSessionValidator)
  {
    $this->userSessionValidator = $userSessionValidator;
    $this->adminSessionValidator = $adminSessionValidator;
  }


  /**
   * Show the form for creating a new resource.
   * GET /sessions/create
   *
   * @return Response
   */
  public function create()
  {
    // @TODO: switch email/phone based on IP.
    return View::make('sessions.create');
  }

  /**
   * Allows an admin to log in.
   *
   */
  public function adminCreate()
  {
    return View::make('sessions.admin-create');

  }

  /**
   * Store a newly created resource in storage.
   * POST /sessions
   *
   * @return Response
   */
  public function store()
  {
    // If coming from admin, use that login method.
    if (strpos($_SERVER['HTTP_REFERER'], 'admin')) {
      $input = Input::only('email', 'password');
      $this->adminSessionValidator->validate($input);
      return $this->adminLogin($input);
    }
    // Use the user login/create method.
    else {
      $input = Input::only('first_name', 'email', 'birthdate');
      $this->userSessionValidator->validate($input);

      return $this->userLogin($input);
    }
  }

  /**
   * Remove the specified resource from storage.<commit_msg>Remove spaces.<commit_after><?php

class SessionsController extends \BaseController {

  protected $sessionsValidator;

  public function __construct(UserSessionValidator $userSessionValidator, AdminSessionValidator $adminSessionValidator)
  {
    $this->userSessionValidator = $userSessionValidator;
    $this->adminSessionValidator = $adminSessionValidator;
  }


  /**
   * Show the form for creating a new resource.
   * GET /sessions/create
   *
   * @return Response
   */
  public function create()
  {
    // @TODO: switch email/phone based on IP.
    return View::make('sessions.create');
  }

  /**
   * Allows an admin to log in.
   *
   */
  public function adminCreate()
  {
    return View::make('sessions.admin-create');

  }

  /**
   * Store a newly created resource in storage.
   * POST /sessions
   *
   * @return Response
   */
  public function store()
  {
    // If coming from admin, use that login method.
    if (strpos($_SERVER['HTTP_REFERER'], 'admin')) {
      $input = Input::only('email', 'password');
      $this->adminSessionValidator->validate($input);
      return $this->adminLogin($input);
    }
    // Use the user login/create method.
    else {
      $input = Input::only('first_name', 'email', 'birthdate');
      $this->userSessionValidator->validate($input);
      return $this->userLogin($input);
    }
  }

  /**
   * Remove the specified resource from storage.
{'fraction_non_alphanumeric': 0.13122332859174965, 'fraction_numerical': 0.0, 'mean_word_length': 3.1125730994152048, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1066972', 'n_tokens_mistral': 822, 'n_tokens_neox': 800, 'n_words': 202}