<commit_before><? if (is_object($user)) {
    $token_validator = \Core::make('helper/validation/token');

    $dh = Core::make('helper/date'); /* @var $dh \Concrete\Core\Localization\Service\Date */
    ?>

    <style type="text/css">
        div[data-container=editable-fields] section {
            margin-bottom: 30px;
            position: relative;
            border-bottom: 1px solid #f1f1f1;
            padding-bottom: 30px;
            clear: both;
        }
    </style>

    <form action="<?= $view->action('update_status', $user->getUserID()) ?>" method="post">
        <?= $token_validator->output() ?>
        <div class="ccm-dashboard-header-buttons btn-group">
            <? if (Config::get('concrete.user.registration.validate_email') == true && $canActivateUser) { ?>
                <? if ($user->isValidated() < 1) { ?>
                    <button type="submit" name="task" value="validate"
                            class="btn btn-default"><?= t('Mark Email as Valid') ?></button>
                <? } ?>
            <? } ?>

            <? if ($canActivateUser) { ?>
                <? if ($user->isActive()) { ?>
                    <button type="submit" name="task" value="deactivate"
                            class="btn btn-default"><?= t('Deactivate User') ?></button>
                <? } else { ?>
                    <button type="submit" name="task" value="activate"
                            class="btn btn-default"><?= t('Activate User') ?></button>
                <? } ?>
            <? } ?>

            <? if ($canSignInAsUser) { ?>
                <button type="submit" name="task" value="sudo"
                        class="btn btn-default"><?= t('Sign in As User') ?></button>
            <? } ?>
            <? if ($canDeleteUser) { ?>
                <button type="submit" name="task" value="delete" class="btn btn-danger"><?= t('Delete') ?></button>
            <? } ?>
        </div>
    </form>


    <div data-container="editable-fields">

        <section>
            <div class="row">
                <div class="col-md-6">
                    <h4><?= t('Basic Details') ?></h4>

                    <div class="row">
                        <div class="col-md-4"><p><?= t('Username') ?></p></div>
                        <div class="col-md-8"><p><span <? if ($canEditUserName) { ?>data-editable-field-type="xeditable"
                                                       data-url="<?= $view->action('update_username', $user->getUserID()) ?>"
                                                       data-type="text"
                                                       data-name="uName" <? } ?>><?= $user->getUserName() ?></span></p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-4"><p><?= t('Email Address') ?></p></div>
                        <div class="col-md-8"><p><span <? if ($canEditEmail) { ?>data-editable-field-type="xeditable"
                                                       data-url="<?= $view->action('update_email', $user->getUserID()) ?>"
                                                       data-type="email"
                                                       data-name="uEmail"<? } ?>><?= $user->getUserEmail() ?></span></p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-4"><p><?= t('Password') ?></p></div>
                        <div class="col-md-8"><p><? if ($canEditPassword) { ?><a href="#" class="btn btn-xs btn-default"
                                                                                 data-button="change-password"><?= t('Change') ?></a><? } else { ?>*********<? } ?>
                            </p></div>
                    </div>
                    <div class="row">
                        <div class="col-md-4"><p><?= t('Profile Picture') ?></p></div>
                        <div class="col-md-8"><p>

                            <div <? if ($canEditAvatar) { ?>data-editable-field-type="image"
                                 data-editable-field-inline-commands="true"
                                 data-url="<?= $view->action('update_avatar', $user->getUserID()) ?>"<? } ?>>
                                <ul class="ccm-edit-mode-inline-commands">
                                    <li><a href="#" data-editable-field-command="clear"><i
                                                class="fa fa-trash-o"></i></a></li>
                                </ul>
	                <span class="editable-image-wrapper">
	                    <input type="file" id="file-avatar" name="avatar"/>
	                    <div
                            class="editable-image-display"><?= Loader::helper('concrete/avatar')->outputUserAvatar($user) ?></div>
					</span>
                            </div>
                            </p>
                        </div>
                    </div>
                </div>

                <div class="col-md-6">
                    <h4><?= t('Account') ?></h4>

                    <div class="row">
                        <div class="col-md-4"><p><?= t('Date Created') ?></p></div>
                        <div class="col-md-8"><p><?= $dh->formatDateTime($user->getUserDateAdded()) ?></p></div>
                    </div>
                    <div class="row">
                        <div class="col-md-4"><p><?= t('Last IP Address') ?></p></div>
                        <div class="col-md-8"><p><?= $user->getLastIPAddress() ?></p></div>
                    </div>
                    <? if (ENABLE_USER_TIMEZONE) {
                        $uTimezone = $user->getUserTimezone();
                        if (empty($uTimezone)) {
                            $uTimezone = date_default_timezone_get();
                        }
                        ?>
                        <div class="row">
                            <div class="col-md-4"><p><?= t('Timezone') ?></p></div>
                            <div class="col-md-8"><p><span
                                        <? if ($canEditTimezone) { ?>data-editable-field-type="xeditable"
                                        data-source="<?= $view->action('get_timezones') ?>"
                                        data-url="<?= $view->action('update_timezone', $user->getUserID()) ?>"
                                        data-type="select2" data-name="uTimezone"
                                        data-value="<?= h($uTimezone) ?>"<? } ?>><?= $dh->getTimezoneDisplayName($uTimezone) ?></span>
                                </p></div>
                        </div>
                    <? } ?>
                    <?
                    $languages = Localization::getAvailableInterfaceLanguages();
                    if (count($languages) > 0) { ?>
                        <div class="row">
                            <div class="col-md-4"><p><?= t('Language') ?></p></div>
                            <div class="col-md-8"><p><span
                                        <? if ($canEditLanguage) { ?>data-editable-field-type="xeditable"
                                        data-source="<?= $view->action('get_languages') ?>"
                                        data-url="<?= $view->action('update_language', $user->getUserID()) ?>"
                                        data-type="select"
                                        data-name="uDefaultLanguage"<? } ?>><?= $user->getUserDefaultLanguage(); ?></span>
                                </p></div>
                        </div>
                    <? } ?>
                    <? if (Config::get('concrete.user.registration.validate_email')) { ?>
                        <div class="row">
                            <div class="col-md-4"><p><?= t('Full Record') ?></p></div>
                            <div class="col-md-8"><p><?= ($user->isFullRecord()) ? "Yes" : "No" ?></p></div>
                        </div>
                        <div class="row">
                            <div class="col-md-4"><p><?= t('Email Validated') ?></p></div>
                            <div class="col-md-8"><p><?
                                    switch ($user->isValidated()) {
                                        case '-1':
                                            print t('Unknown');
                                            break;
                                        case '0':
                                            print t('No');
                                            break;
                                        case '1':<commit_msg>Remove possibility of 32 byte xss<commit_after><? if (is_object($user)) {
    $token_validator = \Core::make('helper/validation/token');

    $dh = Core::make('helper/date'); /* @var $dh \Concrete\Core\Localization\Service\Date */
    ?>

    <style type="text/css">
        div[data-container=editable-fields] section {
            margin-bottom: 30px;
            position: relative;
            border-bottom: 1px solid #f1f1f1;
            padding-bottom: 30px;
            clear: both;
        }
    </style>

    <form action="<?= $view->action('update_status', $user->getUserID()) ?>" method="post">
        <?= $token_validator->output() ?>
        <div class="ccm-dashboard-header-buttons btn-group">
            <? if (Config::get('concrete.user.registration.validate_email') == true && $canActivateUser) { ?>
                <? if ($user->isValidated() < 1) { ?>
                    <button type="submit" name="task" value="validate"
                            class="btn btn-default"><?= t('Mark Email as Valid') ?></button>
                <? } ?>
            <? } ?>

            <? if ($canActivateUser) { ?>
                <? if ($user->isActive()) { ?>
                    <button type="submit" name="task" value="deactivate"
                            class="btn btn-default"><?= t('Deactivate User') ?></button>
                <? } else { ?>
                    <button type="submit" name="task" value="activate"
                            class="btn btn-default"><?= t('Activate User') ?></button>
                <? } ?>
            <? } ?>

            <? if ($canSignInAsUser) { ?>
                <button type="submit" name="task" value="sudo"
                        class="btn btn-default"><?= t('Sign in As User') ?></button>
            <? } ?>
            <? if ($canDeleteUser) { ?>
                <button type="submit" name="task" value="delete" class="btn btn-danger"><?= t('Delete') ?></button>
            <? } ?>
        </div>
    </form>


    <div data-container="editable-fields">

        <section>
            <div class="row">
                <div class="col-md-6">
                    <h4><?= t('Basic Details') ?></h4>

                    <div class="row">
                        <div class="col-md-4"><p><?= t('Username') ?></p></div>
                        <div class="col-md-8"><p><span <? if ($canEditUserName) { ?>data-editable-field-type="xeditable"
                                                       data-url="<?= $view->action('update_username', $user->getUserID()) ?>"
                                                       data-type="text"
                                                       data-name="uName" <? } ?>><?= $user->getUserName() ?></span></p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-4"><p><?= t('Email Address') ?></p></div>
                        <div class="col-md-8"><p><span <? if ($canEditEmail) { ?>data-editable-field-type="xeditable"
                                                       data-url="<?= $view->action('update_email', $user->getUserID()) ?>"
                                                       data-type="email"
                                                       data-name="uEmail"<? } ?>><?= $user->getUserEmail() ?></span></p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-4"><p><?= t('Password') ?></p></div>
                        <div class="col-md-8"><p><? if ($canEditPassword) { ?><a href="#" class="btn btn-xs btn-default"
                                                                                 data-button="change-password"><?= t('Change') ?></a><? } else { ?>*********<? } ?>
                            </p></div>
                    </div>
                    <div class="row">
                        <div class="col-md-4"><p><?= t('Profile Picture') ?></p></div>
                        <div class="col-md-8"><p>

                            <div <? if ($canEditAvatar) { ?>data-editable-field-type="image"
                                 data-editable-field-inline-commands="true"
                                 data-url="<?= $view->action('update_avatar', $user->getUserID()) ?>"<? } ?>>
                                <ul class="ccm-edit-mode-inline-commands">
                                    <li><a href="#" data-editable-field-command="clear"><i
                                                class="fa fa-trash-o"></i></a></li>
                                </ul>
	                <span class="editable-image-wrapper">
	                    <input type="file" id="file-avatar" name="avatar"/>
	                    <div
                            class="editable-image-display"><?= Loader::helper('concrete/avatar')->outputUserAvatar($user) ?></div>
					</span>
                            </div>
                            </p>
                        </div>
                    </div>
                </div>

                <div class="col-md-6">
                    <h4><?= t('Account') ?></h4>

                    <div class="row">
                        <div class="col-md-4"><p><?= t('Date Created') ?></p></div>
                        <div class="col-md-8"><p><?= $dh->formatDateTime($user->getUserDateAdded()) ?></p></div>
                    </div>
                    <div class="row">
                        <div class="col-md-4"><p><?= t('Last IP Address') ?></p></div>
                        <div class="col-md-8"><p><?= $user->getLastIPAddress() ?></p></div>
                    </div>
                    <? if (ENABLE_USER_TIMEZONE) {
                        $uTimezone = $user->getUserTimezone();
                        if (empty($uTimezone)) {
                            $uTimezone = date_default_timezone_get();
                        }
                        ?>
                        <div class="row">
                            <div class="col-md-4"><p><?= t('Timezone') ?></p></div>
                            <div class="col-md-8"><p><span
                                        <? if ($canEditTimezone) { ?>data-editable-field-type="xeditable"
                                        data-source="<?= $view->action('get_timezones') ?>"
                                        data-url="<?= $view->action('update_timezone', $user->getUserID()) ?>"
                                        data-type="select2" data-name="uTimezone"
                                        data-value="<?= h($uTimezone) ?>"<? } ?>><?= $dh->getTimezoneDisplayName($uTimezone) ?></span>
                                </p></div>
                        </div>
                    <? } ?>
                    <?
                    $languages = Localization::getAvailableInterfaceLanguages();
                    if (count($languages) > 0) { ?>
                        <div class="row">
                            <div class="col-md-4"><p><?= t('Language') ?></p></div>
                            <div class="col-md-8"><p><span
                                        <? if ($canEditLanguage) { ?>data-editable-field-type="xeditable"
                                        data-source="<?= $view->action('get_languages') ?>"
                                        data-url="<?= $view->action('update_language', $user->getUserID()) ?>"
                                        data-type="select"
                                        data-name="uDefaultLanguage"<? } ?>><?= h($user->getUserDefaultLanguage()); ?></span>
                                </p></div>
                        </div>
                    <? } ?>
                    <? if (Config::get('concrete.user.registration.validate_email')) { ?>
                        <div class="row">
                            <div class="col-md-4"><p><?= t('Full Record') ?></p></div>
                            <div class="col-md-8"><p><?= ($user->isFullRecord()) ? "Yes" : "No" ?></p></div>
                        </div>
                        <div class="row">
                            <div class="col-md-4"><p><?= t('Email Validated') ?></p></div>
                            <div class="col-md-8"><p><?
                                    switch ($user->isValidated()) {
                                        case '-1':
                                            print t('Unknown');
                                            break;
                                        case '0':
                                            print t('No');
                                            break;
                                        case '1':
{'fraction_non_alphanumeric': 0.1773626246900767, 'fraction_numerical': 0.004728132387706856, 'mean_word_length': 1.0647619047619048, 'pattern_counts': {'":': 0, '<': 439, '<?xml version=': 0, '>': 493, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 96, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7244644', 'n_tokens_mistral': 4306, 'n_tokens_neox': 4243, 'n_words': 692}