<commit_before><?php

namespace admin\models;

use yii;
use yii\web\IdentityInterface;

/**
 * $salt = \Yii::$app->getSecurity()->generateRandomString();
 * $password = \Yii::$app->getSecurity()->generatePasswordHash("yourpass" . $salt);.
 *
 * @author nadar
 */
class User extends \admin\ngrest\base\Model implements IdentityInterface
{
    public function ngRestApiEndpoint()
    {
        return 'api-admin-user';
    }

    public function ngRestConfig($config)
    {
        $config->aw->register(new \admin\aws\ChangePassword(), 'Passwort ändern');

        //$config->activeWindow->register(new \admin\aws\Delete(), 'Löschen');

        $config->create->field('title', 'Anrede')->selectArray(\admin\models\User::getTitles(), 0);
        $config->create->field('firstname', 'Vorname')->text();
        $config->create->field('lastname', 'Nachname')->text();
        $config->create->field('email', 'E-Mail-Adresse')->text();
        $config->create->field('password', '<PASSWORD>')->password();

        $config->list->field('id', 'ID')->text();
        $config->list->field('firstname', 'Vorname')->text();
        $config->list->field('lastname', 'Nachname')->text();
        $config->update->copyFrom('create', ['password']);

        return $config;
    }

    public static function tableName()
    {
        return 'admin_user';
    }

    public function init()<commit_msg>adding delete possibility to user module<commit_after><?php

namespace admin\models;

use yii;
use yii\web\IdentityInterface;

/**
 * $salt = \Yii::$app->getSecurity()->generateRandomString();
 * $password = \Yii::$app->getSecurity()->generatePasswordHash("your<PASSWORD>" . $salt);.
 *
 * @author nadar
 */
class User extends \admin\ngrest\base\Model implements IdentityInterface
{
    use \admin\traits\SoftDeleteTrait;

    public function ngRestApiEndpoint()
    {
        return 'api-admin-user';
    }

    public function ngRestConfig($config)
    {
        $config->aw->register(new \admin\aws\ChangePassword(), 'Passwort ändern');

        //$config->activeWindow->register(new \admin\aws\Delete(), 'Löschen');

        $config->create->field('title', 'Anrede')->selectArray(\admin\models\User::getTitles(), 0);
        $config->create->field('firstname', 'Vorname')->text();
        $config->create->field('lastname', 'Nachname')->text();
        $config->create->field('email', 'E-Mail-Adresse')->text();
        $config->create->field('password', '<PASSWORD>')->password();

        $config->list->field('id', 'ID')->text();
        $config->list->field('firstname', 'Vorname')->text();
        $config->list->field('lastname', 'Nachname')->text();
        $config->update->copyFrom('create', ['password']);

        $config->delete = true;

        return $config;
    }

    public static function tableName()
    {
        return 'admin_user';
    }

    public function init()
{'fraction_non_alphanumeric': 0.2004864489228631, 'fraction_numerical': 0.0006949270326615705, 'mean_word_length': 3.4497681607418857, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 75, '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': '5975822', 'n_tokens_mistral': 871, 'n_tokens_neox': 849, 'n_words': 138}