<commit_before>{* $Id$ *}

{title help="Users+Management" admpage="login" url="tiki-adminusers.php"}{tr}Admin Users{/tr}{/title}

<div class="t_navbar form-group">
	{if $tiki_p_admin eq 'y'} {* only full admins can manage groups, not tiki_p_admin_users *}
		{button href="tiki-admingroups.php" class="btn btn-default" _text="{tr}Admin Groups{/tr}"}
	{/if}
	{button class="btn btn-default" _text="{tr}Admin Users{/tr}"}
	{if $tiki_p_admin eq 'y'}
	{permission_link mode=button label="{tr}Manage permissions{/tr}"}
	{/if}
	{if isset($userinfo.userId)}
		{button href="?add=1" class="btn btn-default" _text="{tr}Add a New User{/tr}"}
	{/if}
	{if $prefs.feature_invite eq 'y' and $tiki_p_invite eq 'y'}
		{button href="tiki-list_invite.php" class="btn btn-default" _text="{tr}Invitation List{/tr}"}
	{/if}
</div>

{if $prefs.feature_intertiki eq 'y' and ($prefs.feature_intertiki_import_groups eq 'y' or $prefs.feature_intertiki_import_preferences eq 'y')}
	{remarksbox type="warning" title="{tr}Warning{/tr}"}
		{if $prefs.feature_intertiki_import_groups eq 'y'}{tr}Since this Tiki site is in slave mode and imports groups, the master groups will be automatically reimported at each login{/tr}{/if}
		{if $prefs.feature_intertiki_import_preferences eq 'y'}{tr}Since this Tiki site is in slave mode and imports preferences, the master user preferences will be automatically reimported at each login{/tr}{/if}
	{/remarksbox}
{/if}

{if $tikifeedback}
	{remarksbox type="feedback" title="{tr}Feedback{/tr}"}
	{section name=n loop=$tikifeedback}
	{tr}{$tikifeedback[n].mes|escape}{/tr}
	<br>
	{/section}{/remarksbox}
{/if}

{if !empty($added) or !empty($discarded) or !empty($discardlist)}
	{remarksbox type="feedback" title="{tr}Batch Upload Results{/tr}"}
		{tr}Updated users{/tr}  {$added}
		{if $discarded != ""}- {tr}Rejected users{/tr} {$discarded}{/if}
		<br>
		<br>
		{if $discardlist != ''}
            <div class="table-responsive">
			<table class="table normal">
				<tr>
					<th>{tr}Username{/tr}</th>
					<th>{tr}Reason{/tr}</th>
				</tr>
				{section name=reject loop=$discardlist}
					<tr class="odd">
						<td class="username">{$discardlist[reject].login}</td>
						<td class="text">{$discardlist[reject].reason}</td>
					</tr>
				{/section}
			</table>
            </div>
		{/if}

		{if $errors}
			<br>
			{section name=ix loop=$errors}
				{$errors[ix]}<br>
			{/section}
		{/if}
	{/remarksbox}
{/if}

{tabset name='tabs_adminuers'}

{* ---------------------- tab with list -------------------- *}
{tab name="{tr}Users{/tr}"}
	<h2>{tr}Users{/tr}</h2>
	{if !$tsOn}
		<form method="get" class="form-horizontal small" action="tiki-adminusers.php">
			<div class="form-group">
				<label class="control-label col-sm-4" for="find">{tr}Find{/tr}</label>
				<div class="col-sm-8">
					<input type="text" class="form-control input-sm" id="find" name="find" value="{$find|escape}">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-sm-4" for="numrows">{tr}Number of displayed rows{/tr}</label>
				<div class="col-sm-8">
					<input class="form-control input-sm" type="number" id="numrows" name="numrows" value="{$numrows|escape}">
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-8 col-sm-offset-4">
					<a href="javascript:toggleBlock('search')" class="link">{icon _id='add' alt="{tr}more{/tr}"}&nbsp;{tr}More Criteria{/tr}</a>
				</div>
			</div>
			{autocomplete element='#find' type='username'}
			<div class="col-sm-12" id="search" {if $filterGroup or $filterEmail}style="display:block;"{else}style="display:none;"{/if}>
				<div class="form-group">
					<label class="control-label col-sm-4" for="filterGroup">{tr}Group (direct){/tr}</label>
					<div class="col-sm-8">
						<select class="form-control input-sm" name="filterGroup" id="filterGroup">
							<option value=""></option>
							{section name=ix loop=$all_groups}
								{if $all_groups[ix] != 'Registered' && $all_groups[ix] != 'Anonymous'}
									<option value="{$all_groups[ix]|escape}" {if $filterGroup eq $all_groups[ix]}selected{/if}>{$all_groups[ix]|escape}</option>
								{/if}
							{/section}
						</select>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-4 col-sm-8">
						<div class="checkbox">
							<label>
								<input id="filterEmailNotConfirmed" name="filterEmailNotConfirmed" type="checkbox"{if !empty($smarty.request.filterEmailNotConfirmed)} checked="checked"{/if}>{tr}Email not confirmed{/tr}
							</label>
						</div>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-4 col-sm-8">
						<div class="checkbox">
							<label>
								<input id="filterNeverLoggedIn" name="filterNeverLoggedIn" type="checkbox"{if !empty($smarty.request.filterNeverLoggedIn)} checked="checked"{/if}>{tr}Never logged in{/tr}
							</label>
						</div>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-4 col-sm-8">
						<div class="checkbox">
							<label>
								<input id="filterNotValidated" name="filterNotValidated" type="checkbox"{if !empty($smarty.request.filterNotValidated)} checked="checked"{/if}>{tr}User not validated{/tr}
							</label>
						</div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-8 col-sm-offset-4">
					<input type="hidden" name="sort_mode" value="{$sort_mode|escape}">
					<input type="submit" class="btn btn-default btn-sm" value="{tr}Find{/tr}" name="search">
				</div>
			</div>
		</form>
	{/if}
	{if ($cant > $numrows or !empty($initial)) && !$tsOn}
		{initials_filter_links}
	{/if}

	<form class="form-horizontal" name="checkform" method="post" action="{$smarty.server.PHP_SELF|escape}">
		<div id="adminusers-div" {if $tsOn}style="display: none;"{/if}>
			<table id="adminusers" class="table normal">
				{* Note: for any changes in the logic determining which columns are shown, corresponding changes will
				need to be made in the getTableSettings function at /lib/core/Table/Settings/Adminusers.php *}
				<thead>
					<tr>
						<th {if $prefs.mobile_mode eq "y"}style="width:40px;"{else}class="auto"{/if}>
							{if $users}
							   {select_all checkbox_names='checked[]'}
							{/if}
						</th>
						<th>{self_link _sort_arg='sort_mode' _sort_field='login'}{tr}User{/tr}{/self_link}</th>
						{if $prefs.login_is_email neq 'y'}
							<th>{self_link _sort_arg='sort_mode' _sort_field='email'}{tr}Email{/tr}{/self_link}</th><commit_msg>[FIX] adminusers: change container div from display none to visibility hidden so that it can be unhidden after jquery processes<commit_after>{* $Id$ *}

{title help="Users+Management" admpage="login" url="tiki-adminusers.php"}{tr}Admin Users{/tr}{/title}

<div class="t_navbar form-group">
	{if $tiki_p_admin eq 'y'} {* only full admins can manage groups, not tiki_p_admin_users *}
		{button href="tiki-admingroups.php" class="btn btn-default" _text="{tr}Admin Groups{/tr}"}
	{/if}
	{button class="btn btn-default" _text="{tr}Admin Users{/tr}"}
	{if $tiki_p_admin eq 'y'}
	{permission_link mode=button label="{tr}Manage permissions{/tr}"}
	{/if}
	{if isset($userinfo.userId)}
		{button href="?add=1" class="btn btn-default" _text="{tr}Add a New User{/tr}"}
	{/if}
	{if $prefs.feature_invite eq 'y' and $tiki_p_invite eq 'y'}
		{button href="tiki-list_invite.php" class="btn btn-default" _text="{tr}Invitation List{/tr}"}
	{/if}
</div>

{if $prefs.feature_intertiki eq 'y' and ($prefs.feature_intertiki_import_groups eq 'y' or $prefs.feature_intertiki_import_preferences eq 'y')}
	{remarksbox type="warning" title="{tr}Warning{/tr}"}
		{if $prefs.feature_intertiki_import_groups eq 'y'}{tr}Since this Tiki site is in slave mode and imports groups, the master groups will be automatically reimported at each login{/tr}{/if}
		{if $prefs.feature_intertiki_import_preferences eq 'y'}{tr}Since this Tiki site is in slave mode and imports preferences, the master user preferences will be automatically reimported at each login{/tr}{/if}
	{/remarksbox}
{/if}

{if $tikifeedback}
	{remarksbox type="feedback" title="{tr}Feedback{/tr}"}
	{section name=n loop=$tikifeedback}
	{tr}{$tikifeedback[n].mes|escape}{/tr}
	<br>
	{/section}{/remarksbox}
{/if}

{if !empty($added) or !empty($discarded) or !empty($discardlist)}
	{remarksbox type="feedback" title="{tr}Batch Upload Results{/tr}"}
		{tr}Updated users{/tr}  {$added}
		{if $discarded != ""}- {tr}Rejected users{/tr} {$discarded}{/if}
		<br>
		<br>
		{if $discardlist != ''}
            <div class="table-responsive">
			<table class="table normal">
				<tr>
					<th>{tr}Username{/tr}</th>
					<th>{tr}Reason{/tr}</th>
				</tr>
				{section name=reject loop=$discardlist}
					<tr class="odd">
						<td class="username">{$discardlist[reject].login}</td>
						<td class="text">{$discardlist[reject].reason}</td>
					</tr>
				{/section}
			</table>
            </div>
		{/if}

		{if $errors}
			<br>
			{section name=ix loop=$errors}
				{$errors[ix]}<br>
			{/section}
		{/if}
	{/remarksbox}
{/if}

{tabset name='tabs_adminuers'}

{* ---------------------- tab with list -------------------- *}
{tab name="{tr}Users{/tr}"}
	<h2>{tr}Users{/tr}</h2>
	{if !$tsOn}
		<form method="get" class="form-horizontal small" action="tiki-adminusers.php">
			<div class="form-group">
				<label class="control-label col-sm-4" for="find">{tr}Find{/tr}</label>
				<div class="col-sm-8">
					<input type="text" class="form-control input-sm" id="find" name="find" value="{$find|escape}">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-sm-4" for="numrows">{tr}Number of displayed rows{/tr}</label>
				<div class="col-sm-8">
					<input class="form-control input-sm" type="number" id="numrows" name="numrows" value="{$numrows|escape}">
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-8 col-sm-offset-4">
					<a href="javascript:toggleBlock('search')" class="link">{icon _id='add' alt="{tr}more{/tr}"}&nbsp;{tr}More Criteria{/tr}</a>
				</div>
			</div>
			{autocomplete element='#find' type='username'}
			<div class="col-sm-12" id="search" {if $filterGroup or $filterEmail}style="display:block;"{else}style="display:none;"{/if}>
				<div class="form-group">
					<label class="control-label col-sm-4" for="filterGroup">{tr}Group (direct){/tr}</label>
					<div class="col-sm-8">
						<select class="form-control input-sm" name="filterGroup" id="filterGroup">
							<option value=""></option>
							{section name=ix loop=$all_groups}
								{if $all_groups[ix] != 'Registered' && $all_groups[ix] != 'Anonymous'}
									<option value="{$all_groups[ix]|escape}" {if $filterGroup eq $all_groups[ix]}selected{/if}>{$all_groups[ix]|escape}</option>
								{/if}
							{/section}
						</select>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-4 col-sm-8">
						<div class="checkbox">
							<label>
								<input id="filterEmailNotConfirmed" name="filterEmailNotConfirmed" type="checkbox"{if !empty($smarty.request.filterEmailNotConfirmed)} checked="checked"{/if}>{tr}Email not confirmed{/tr}
							</label>
						</div>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-4 col-sm-8">
						<div class="checkbox">
							<label>
								<input id="filterNeverLoggedIn" name="filterNeverLoggedIn" type="checkbox"{if !empty($smarty.request.filterNeverLoggedIn)} checked="checked"{/if}>{tr}Never logged in{/tr}
							</label>
						</div>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-4 col-sm-8">
						<div class="checkbox">
							<label>
								<input id="filterNotValidated" name="filterNotValidated" type="checkbox"{if !empty($smarty.request.filterNotValidated)} checked="checked"{/if}>{tr}User not validated{/tr}
							</label>
						</div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-8 col-sm-offset-4">
					<input type="hidden" name="sort_mode" value="{$sort_mode|escape}">
					<input type="submit" class="btn btn-default btn-sm" value="{tr}Find{/tr}" name="search">
				</div>
			</div>
		</form>
	{/if}
	{if ($cant > $numrows or !empty($initial)) && !$tsOn}
		{initials_filter_links}
	{/if}

	<form class="form-horizontal" name="checkform" method="post" action="{$smarty.server.PHP_SELF|escape}">
		<div id="adminusers-div" {if $tsOn}style="visibility:hidden;"{/if}>
			<table id="adminusers" class="table normal">
				{* Note: for any changes in the logic determining which columns are shown, corresponding changes will
				need to be made in the getTableSettings function at /lib/core/Table/Settings/Adminusers.php *}
				<thead>
					<tr>
						<th {if $prefs.mobile_mode eq "y"}style="width:40px;"{else}class="auto"{/if}>
							{if $users}
							   {select_all checkbox_names='checked[]'}
							{/if}
						</th>
						<th>{self_link _sort_arg='sort_mode' _sort_field='login'}{tr}User{/tr}{/self_link}</th>
						{if $prefs.login_is_email neq 'y'}
							<th>{self_link _sort_arg='sort_mode' _sort_field='email'}{tr}Email{/tr}{/self_link}</th>
{'fraction_non_alphanumeric': 0.2008090367882766, 'fraction_numerical': 0.0035109143642192034, 'mean_word_length': 3.9916190476190474, 'pattern_counts': {'":': 0, '<': 213, '<?xml version=': 0, '>': 215, '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': '3371437', 'n_tokens_mistral': 5586, 'n_tokens_neox': 4763, 'n_words': 949}