<commit_before><?php
namespace api\controllers;

use Yii;
use yii\web\Controller;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use api\models\LoginForm;
use common\models\Permission;

/**
 * Site controller
 */
class AccountController extends Controller
{
	public $enableCsrfValidation = false;
	private $api_key ='43S4342342Asfd';
	public $layout =false;
	public function init()
    {
        \Yii::$app->response->format = 'json';
    }
    /**
     * @inheritdoc
     */
    /*public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'only' => ['logout', 'signup'],
                'rules' => [
                    [
                        'actions' => ['signup'],
                        'allow' => true,
                        'roles' => ['?'],
                    ],
                    [
                        'actions' => ['logout'],
                        'allow' => false,
                        'roles' => ['@'],
                    ],
                ],
            ],
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'logout' => ['post'],
                ],
            ],
        ];
    }*/

    /**
     * @inheritdoc
     */
    public function actions()
    {
        return [
            'captcha' => [
                'class' => 'yii\captcha\CaptchaAction',
                'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
            ],
        ];
    }

    /**
     * Displays homepage.
     *
     * @return mixed
     */
    public function actionIndex()
    {
		
       die("HELLO API");
    }

	public function actionLogin()
    {
        if (!Yii::$app->user->isGuest) {
			
			$permission_group_id = Yii::$app->user->identity->permission_group_id;
			$user_permission = \common\models\Permission::getListPermissionByGroup($permission_group_id);
			$list_permission_group = \common\models\Permission::getAllPermissionGroup();
			$list_permissions = Permission::getAllPermission();
			$department = \common\models\Department::find()
				->where(['company_id'=>Yii::$app->user->identity->company_id])->asArray()<commit_msg>update log login<commit_after><?php
namespace api\controllers;

use Yii;
use yii\web\Controller;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use api\models\LoginForm;
use common\models\Permission;
use common\components\KLogger;

/**
 * Site controller
 */
class AccountController extends Controller
{
    public $logger;
	public $enableCsrfValidation = false;
	private $api_key ='43S4342342Asfd';
	public $layout =false;
	public function init()
    {
        $this->logger = new KLogger('api_' . date('Ymd'), KLogger::INFO);
        \Yii::$app->response->format = 'json';
    }
    /**
     * @inheritdoc
     */
    /*public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'only' => ['logout', 'signup'],
                'rules' => [
                    [
                        'actions' => ['signup'],
                        'allow' => true,
                        'roles' => ['?'],
                    ],
                    [
                        'actions' => ['logout'],
                        'allow' => false,
                        'roles' => ['@'],
                    ],
                ],
            ],
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'logout' => ['post'],
                ],
            ],
        ];
    }*/

    /**
     * @inheritdoc
     */
    public function actions()
    {
        return [
            'captcha' => [
                'class' => 'yii\captcha\CaptchaAction',
                'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
            ],
        ];
    }

    /**
     * Displays homepage.
     *
     * @return mixed
     */
    public function actionIndex()
    {
		
       die("HELLO API");
    }

	public function actionLogin()
    {
        $this->logger->LogInfo("actionLogin data  :" . json_encode(Yii::$app->request->post()));

        if (!Yii::$app->user->isGuest) {
			
			$permission_group_id = Yii::$app->user->identity->permission_group_id;
			$user_permission = \common\models\Permission::getListPermissionByGroup($permission_group_id);
			$list_permission_group = \common\models\Permission::getAllPermissionGroup();
			$list_permissions = Permission::getAllPermission();
			$department = \common\models\Department::find()
				->where(['company_id'=>Yii::$app->user->identity->company_id])->asArray()
{'fraction_non_alphanumeric': 0.15392781316348195, 'fraction_numerical': 0.003821656050955414, 'mean_word_length': 1.6347874720357942, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 68, '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': '3852641', 'n_tokens_mistral': 1416, 'n_tokens_neox': 1316, 'n_words': 213}