<commit_before><?php

namespace App\Controllers;

use Core\Controllers\Controller;

class AppController extends Controller
{
    public $components = ["Session"];

    public function beforeRender()
    {
        $prefixe = $this->Request->prefixe;
        if ($prefixe == "user" && !isset($_SESSION['usertoken'])) {
            $this->Session->setFlash("Vous devez être connecté pour effectué cette action !", "error");
            $this->redirect("connexion");
        }
    }

}<commit_msg>change layout if connected<commit_after><?php

namespace App\Controllers;

use Core\Controllers\Controller;

class AppController extends Controller
{
    public $components = ["Session"];

    public function beforeRender()
    {
        $prefixe = $this->Request->prefixe;
        if ($prefixe == "user" && !isset($_SESSION['usertoken'])) {
            $this->Session->setFlash("Vous devez être connecté pour effectué cette action !", "error");
            $this->redirect("connexion");
        }

        if (isset($_SESSION['username']) && strpos($_SESSION['username'], 'fake-') === false) {
            $this->layout = "default-connected";
        }
    }

}
{'fraction_non_alphanumeric': 0.15497835497835497, 'fraction_numerical': 0.0, 'mean_word_length': 3.0704225352112675, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '1058355', 'n_tokens_mistral': 326, 'n_tokens_neox': 325, 'n_words': 72}