<commit_before><?php

class IPFAuthAdminUserForm extends IPF_Form_Extra_CheckGroup
{
    function initFields($extra=array())
    {
        parent::initFields($extra);
        
        $this->fields['email']->label = 'E-mail';
        
        $this->fields['is_active']->label    = 'Active';
        $this->fields['is_staff']->label     = 'Staff status';
        $this->fields['is_superuser']->label = 'Superuser status';

        $this->fields['is_active']->help_text    = 'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.';
        $this->fields['is_staff']->help_text     = 'Designates whether the user can log into this admin site.';
        $this->fields['is_superuser']->help_text = 'Designates that this user has all permissions without explicitly assigning them.';
        
        $this->fields['username']->help_text = 'Required. 32 characters or less. Alphanumeric characters only (letters, digits and underscores).';        
        
        if (!$this->model->id)
        {
            unset($this->fields['password']);
            
            $this->fields['password1'] = new IPF_Form_Field_Varchar(array(
                'label' => 'Password',
                'required' => true,
                'max_length' => 32,
                'widget' => 'IPF_Form_Widget_PasswordInput'
            ));
            
            $this->fields['password2'] = new IPF_Form_Field_Varchar(array(
                'label' => 'Password (again)',
                'required' => true,
                'max_length' => 32,
                'widget' => 'IPF_Form_Widget_PasswordInput',
                'help_text' => 'Enter the same password as above, for verification.'
            ));
            
            $account = array('username', '<PASSWORD>', '<PASSWORD>');
        }
        else
        {
            $this->fields['password']->help_text = "Use '[algo]$[salt]$[hexdigest]' or use the <a href=\"password/\">change password form</a>."; 
            
            $account = array('username', 'password');
        }
        
        if (IPF_Auth_App::ArePermissionsEnabled())
        {
            $this->fields['Roles']->label = 'Groups';
            $this->fields['Roles']->help_text = 'In addition to the permissions manually assigned, this user will also get all permissions granted to each group he/she is in.';

            parent::SetupForm($this);            
        }
        else
        {
            $this->fields['Permissions']->widget = new IPF_Form_Widget_HiddenInput();
            $this->fields['Roles']->widget = new IPF_Form_Widget_HiddenInput();
        }
        <commit_msg>admin site: edit user: remove unused fields.<commit_after><?php

class IPFAuthAdminUserForm extends IPF_Form_Extra_CheckGroup
{
    function initFields($extra=array())
    {
        parent::initFields($extra);
        
        $this->fields['email']->label = 'E-mail';
        
        $this->fields['is_active']->label    = 'Active';
        $this->fields['is_staff']->label     = 'Staff status';
        $this->fields['is_superuser']->label = 'Superuser status';

        $this->fields['is_active']->help_text    = 'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.';
        $this->fields['is_staff']->help_text     = 'Designates whether the user can log into this admin site.';
        $this->fields['is_superuser']->help_text = 'Designates that this user has all permissions without explicitly assigning them.';
        
        $this->fields['username']->help_text = 'Required. 32 characters or less. Alphanumeric characters only (letters, digits and underscores).';        
        
        if (!$this->model->id)
        {
            unset($this->fields['password']);
            
            $this->fields['password1'] = new IPF_Form_Field_Varchar(array(
                'label' => 'Password',
                'required' => true,
                'max_length' => 32,
                'widget' => 'IPF_Form_Widget_PasswordInput'
            ));
            
            $this->fields['password2'] = new IPF_Form_Field_Varchar(array(
                'label' => 'Password (again)',
                'required' => true,
                'max_length' => 32,
                'widget' => 'IPF_Form_Widget_PasswordInput',
                'help_text' => 'Enter the same password as above, for verification.'
            ));
            
            $account = array('username', '<PASSWORD>', '<PASSWORD>');
        }
        else
        {
            $this->fields['password']->help_text = "Use '[algo]$[salt]$[hexdigest]' or use the <a href=\"password/\">change password form</a>."; 
            
            $account = array('username', 'password');
        }
        
        if (IPF_Auth_App::ArePermissionsEnabled())
        {
            $this->fields['Roles']->label = 'Groups';
            $this->fields['Roles']->help_text = 'In addition to the permissions manually assigned, this user will also get all permissions granted to each group he/she is in.';

            parent::SetupForm($this);            
        }
        else
        {
            unset($this->fields['Permissions']);
            unset($this->fields['Roles']);
        }
        
{'fraction_non_alphanumeric': 0.14095491725318623, 'fraction_numerical': 0.003043560966330607, 'mean_word_length': 2.0534262485481998, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 89, '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': '322824', 'n_tokens_mistral': 1443, 'n_tokens_neox': 1404, 'n_words': 316}