<?php

class Brivium_Credits_ControllerPublic_Login extends XFCP_Brivium_Credits_ControllerPublic_Login
{
	
	public function actionLogin()
	{
		$response = parent::actionLogin();
		if($userId = XenForo_Visitor::getUserId()){
			$creditModel = $this->_getCreditModel();
			$creditModel->updateUserCredit('login',$userId);
		}
		return $response;
	}
	/**
	 * Gets the action model.
	 *
	 * @return Brivium_Credits_Model_Credit
	 */
	protected function _getCreditModel()
	{
		return $this->getModelFromCache('Brivium_Credits_Model_Credit');
	}
}