<commit_before><?php

namespace frontend\controllers;

use Yii;
use common\models\LoginForm;
use yii\base\InvalidParamException;
use yii\web\BadRequestHttpException;
use yii\web\Controller;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use app\components\UserService;
use common\models\User;
use app\components;
use app\components\RelationService;
use app\components\RelationMode;
use app\components\RelationType;
use app\components\PhotoService;
use app\components\AccessService;
use app\components\Permission;

class IntouchController extends Controller
{

    private $AccessService = null;
    private $PhotoService = null;
    private $PostService = null;
    private $RelationService = null;
    private $SearchService = null;

    public function __construct($id, $module, $config = [])
    {
        $this->AccessService = new AccessService();
        $this->PhotoService = new PhotoService();
        $this->PostService = new components\PostsService();
        $this->RelationService = new RelationService();
        $this->SearchService = new components\SearchService();

        parent::__construct($id, $module, $config);
    }

    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'rules' => [
                    [
                        'allow' => true,
                        'roles' => ['@'],
                    ],
                ],
            ],
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'logout' => ['post'],
                ],
            ],
        ];
    }

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

    public function actionIndex()
    {
        $this->getUserData();
        $this->AccessService->check(Permission::CreateAccount, Location::MyProfiePage);
        $zdjecie = new \app\models\Photo();
        $dane = $zdjecie->find()->all();
        //UserService::setBirthDate(1, "28-04-1993");
        //UserService::setPassword(1, "<PASSWORD>");
        //////////////////////////////////
        $this->layout = 'logged';
        return $this->render('index', ['dane' => $dane]);
    }

    public function actionProfile()
    {
        $id = Yii::$app->user->getId();
        if (Yii::$app->request->isPost)
        {

            //To upload profile photo
            $plik = $_FILES['exampleInputFile']['tmp_name'];
            if (strlen($plik) > 0)
            {
                $nazwa = md5(uniqid(time())) . '.jpg';
                move_uploaded_file($plik, Yii::$app->basePath .
                        '/web/dist/content/images/' .
                        $nazwa);<commit_msg>Quick FIX. | You still have to execute that command. All of you! Without any exception!  .....  hint for n00bs: "from a previous commit".  It will be better if you read the descriptions of all the commits, not only the last one!<commit_after><?php

namespace frontend\controllers;

use Yii;
use common\models\LoginForm;
use yii\base\InvalidParamException;
use yii\web\BadRequestHttpException;
use yii\web\Controller;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use app\components\UserService;
use common\models\User;
use app\components;
use app\components\RelationService;
use app\components\RelationMode;
use app\components\RelationType;
use app\components\PhotoService;
use app\components\AccessService;
use app\components\Permission;

class IntouchController extends Controller
{

    private $AccessService = null;
    private $PhotoService = null;
    private $PostService = null;
    private $RelationService = null;
    private $SearchService = null;

    public function __construct($id, $module, $config = [])
    {
        $this->AccessService = new AccessService();
        $this->PhotoService = new PhotoService();
        $this->PostService = new components\PostsService();
        $this->RelationService = new RelationService();
        $this->SearchService = new components\SearchService();

        parent::__construct($id, $module, $config);
    }

    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'rules' => [
                    [
                        'allow' => true,
                        'roles' => ['@'],
                    ],
                ],
            ],
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'logout' => ['post'],
                ],
            ],
        ];
    }

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

    public function actionIndex()
    {
        $this->getUserData();
        $zdjecie = new \app\models\Photo();
        $dane = $zdjecie->find()->all();
        //UserService::setBirthDate(1, "28-04-1993");
        //UserService::setPassword(1, "<PASSWORD>");
        //////////////////////////////////
        $this->layout = 'logged';
        return $this->render('index', ['dane' => $dane]);
    }

    public function actionProfile()
    {
        $id = Yii::$app->user->getId();
        if (Yii::$app->request->isPost)
        {

            //To upload profile photo
            $plik = $_FILES['exampleInputFile']['tmp_name'];
            if (strlen($plik) > 0)
            {
                $nazwa = md5(uniqid(time())) . '.jpg';
                move_uploaded_file($plik, Yii::$app->basePath .
                        '/web/dist/content/images/' .
                        $nazwa);
{'fraction_non_alphanumeric': 0.15050814647523794, 'fraction_numerical': 0.004194224874979836, 'mean_word_length': 1.796571944068561, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 69, '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': '2967515', 'n_tokens_mistral': 1774, 'n_tokens_neox': 1711, 'n_words': 342}