<commit_before>{* $Id$ *}
{jq notonready=true}
function capLock(e, el){
	kc = e.keyCode ? e.keyCode : e.which;
	sk = e.shiftKey ? e.shiftKey : (kc == 16 ? true : false);
	if ((kc >= 65 && kc <= 90 && !sk) || (kc >= 97 && kc <= 122 && sk)) {
		$('.divCapson', $(el).parents('div:first')).show();
	} else {
		$('.divCapson', $(el).parents('div:first')).hide();
	}
}
{/jq}
{jq}
$("#loginbox-{{$module_logo_instance}}").submit( function () {
	if ($("#login-user_{{$module_logo_instance}}").val() && $("#login-pass_{{$module_logo_instance}}").val()) {
		return true;
	} else {
		$("#login-user_{{$module_logo_instance}}").focus();
		return false;
	}
});
if (jqueryTiki.no_cookie) {
	$('.box-login_box input').each(function(){
		$(this).change(function() {
			if (jqueryTiki.no_cookie && $(this).val()) {
				alert(jqueryTiki.cookie_consent_alert);
			}
		});
	});
}
{/jq}
{if !isset($tpl_module_title)}{* Left for performance, since tiki-login_scr.php includes this template directly. *}
	{assign var=tpl_module_title value="{tr}Log in{/tr}"}
	{if !isset($module_params)}{assign var=module_params value=' '}{/if}
	{if isset($nobox)}{$module_params.nobox = $nobox}{/if}
	{if isset($style)}{$module_params.style = $style}{/if}
{/if}
{tikimodule error=$module_params.error title=$tpl_module_title name="login_box" flip=$module_params.flip decorations=$module_params.decorations nobox=$module_params.nobox notitle=$module_params.notitle style=$module_params.style}
	{if $mode eq "header"}<div class="siteloginbar{if $user} logged-in{/if}">{/if}
	{if $user}
		{if empty($mode) or $mode eq "module"}
			<div class="form-group">{tr}Logged in as:{/tr} <span style="white-space: nowrap">{$user|userlink}</span></div>
			<div class="text-center form-group">
				{button href="tiki-logout.php" _text="{tr}Log out{/tr}"}
			</div>
			{if $login_module.can_revert}
				<form action="{$login_module.login_url|escape}" method="post">
					<fieldset>
						<legend>{tr}Return to Main User{/tr}</legend>
						<input type="hidden" name="su" value="revert" />
						<input type="hidden" name="
						e" value="auto" />
						<div class="text-center"><button type="submit" class="btn btn-primary" name="actsu">{tr}Switch{/tr}</button></div>
					</fieldset>
				</form>
			{elseif $tiki_p_admin eq 'y'}
				<form action="{$login_module.login_url|escape}" method="post"{if $prefs.desactive_login_autocomplete eq 'y'} autocomplete="off"{/if} role="form">
					<fieldset>
						<legend>{tr}Switch User{/tr}</legend>
						<div class="form-group">
							<label for="login-switchuser_{$module_logo_instance}">{tr}Username{/tr} {if $prefs.login_allow_email eq 'y'} {tr}or e-mail address{/tr}{/if}:</label>
							<input type="hidden" name="su" value="1" class="form-control" />
							{if $prefs.feature_help eq 'y'}
								{help url="Switch+User" desc="{tr}Help{/tr}" desc="{tr}Switch User:{/tr}{tr}Enter a username and click 'Switch'.<br>Useful for testing permissions.{/tr}"}
							{/if}
							<input type="text" name="username" class="form-control" id="login-switchuser_{$module_logo_instance}" {* size="{if empty($module_params.input_size)}15{else}{$module_params.input_size}{/if}" *} />
						</div>
						<div class="text-center"><button type="submit" class="btn btn-primary" name="actsu">{tr}Switch{/tr}</button></div>
						{autocomplete element="#login-switchuser_"|cat:$module_logo_instance type="username"}
					</fieldset>
				</form>
			{/if}
		{elseif $mode eq "header"}
			<span style="white-space: nowrap">{$user|userlink}</span> <a href="tiki-logout.php" title="{tr}Log out{/tr}">{tr}Log out{/tr}</a>
		{elseif $mode eq "popup"}
			<div class="siteloginbar_popup dropdown pull-right">
				{if $module_params.show_user_name eq 'y'}{$user|avatarize}{/if}
				<a href="tiki-logout.php" class="dropdown-toggle login_link btn btn-link" data-toggle="dropdown">
					{if $module_params.show_user_name eq 'y'}{$user|username}{else}{$user|avatarize:n:n:n}{/if}
					<span class="caret"></span>
				</a>
				<ul class="clearfix dropdown-menu pull-right">

						<li>
							<a href="tiki-user_information.php">{tr}My Account{/tr}</a>
						</li>

					<li>
						<a href="tiki-logout.php" title="{tr}Log out{/tr}">{tr}Log out{/tr}</a>
					</li>
				</ul>
			</div>
		{/if}
		{if $prefs.auth_method eq 'openid' and $openid_userlist|@count gt 1}
			<form method="get" action="tiki-login_openid.php">
				<fieldset>
					<legend>{tr}Switch user{/tr}</legend>
					<select name="select">
					{foreach item=username from=$openid_userlist}
						<option{if $username eq $user} selected="selected"{/if}>{$username}</option>
					{/foreach}
					</select>
					<input type="hidden" name="action" value="select"/>
					<input type="submit" class="btn btn-primary" value="{tr}Go{/tr}"/>
				</fieldset>
			</form>
		{/if}
	{elseif $prefs.auth_method eq 'cas' && $showloginboxes neq 'y'}
		<b><a class="linkmodule" href="tiki-login.php?cas=y">{tr}Log in through CAS{/tr}</a></b>
		{if $prefs.cas_skip_admin eq 'y'}
			<br><a class="linkmodule" href="tiki-login_scr.php?user=admin">{tr}Log in as admin{/tr}</a>
		{/if}
	{elseif $prefs.auth_method eq 'shib' && $showloginboxes neq 'y'}
		<b><a class="linkmodule" href="tiki-login.php">{tr}Log in through Shibboleth{/tr}</a></b>
		{if $prefs.shib_skip_admin eq 'y'}
			<br><a class="linkmodule" href="tiki-login_scr.php?user=admin">{tr}Log in as admin{/tr}</a>
		{/if}
	{else}
		{assign var='close_tags' value=''}
		{if $mode eq "popup"}
			<div class="siteloginbar_popup dropdown btn-group pull-right">
				<button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown">
					{tr}Log in{/tr}
					<span class="caret"></span>
				</button>
				<div class="siteloginbar_poppedup dropdown-menu pull-right modal-sm"><div class="panel-body">
					{capture assign="close_tags"}</div></div></div>{$close_tags}{/capture}
		{/if}

		<form name="loginbox" class="form{if $mode eq "header"} form-inline{/if}" id="loginbox-{$module_logo_instance}" action="{$login_module.login_url|escape}"
				method="post" {if $prefs.feature_challenge eq 'y'}onsubmit="doChallengeResponse(this)"{/if}
				{if $prefs.desactive_login_autocomplete eq 'y'} autocomplete="off"{/if}
		>
		{capture assign="close_tags"}</form>{$close_tags}{/capture}

		{if $prefs.feature_challenge eq 'y'}
			<script type='text/javascript' src="vendor/jquery/md5/js/md5.js"></script>
			{jq notonready=true}
				function doChallengeResponse(form) {
					var $form = $(form), hashstr, str;
					hashstr= $("input[name=user]", $form).val() +
								$("input[name=pass]", $form).val() +
								$("input[name=email]", $form).val();
					str = $("input[name=user]", $form).val() + md5(hashstr) + $("input[name=challenge]", $form).val();
					$("input[name=response]", $form).val(md5(str));
					//$("input[name=pass]", $form).val(""); // (form does not submit without password)
					$form.submit();
					return false;
				}
			{/jq}
			<input type="hidden" name="challenge" value="{$challenge|escape}" />
			<input type="hidden" name="response" value="" />
		{/if}
		{if !empty($urllogin)}<input type="hidden" name="url" value="{$urllogin|escape}" />{/if}
		{if $module_params.nobox neq 'y'}
			<fieldset>
				{capture assign="close_tags"}</fieldset>{$close_tags}{/capture}
		{/if}
		{if !empty($error_login)}
			{remarksbox type='errors' title="{tr}Error{/tr}"}
				{if $error_login == -5}{tr}Invalid username or password{/tr}
				{elseif $error_login == -3}{tr}Invalid username or password{/tr}
				{else}{$error_login|escape}{/if}
			{/remarksbox}
		{/if}
		<div class="user form-group">
			{if !isset($module_logo_instance)}{assign var=module_logo_instance value=' '}{/if}
			<label for="login-user_{$module_logo_instance}">{if $prefs.login_is_email eq 'y'}{tr}Email:{/tr}{else}{tr}Username{/tr}{if $prefs.login_allow_email eq 'y'} {tr}or e-mail address{/tr}{/if}:</label>{/if}</label>
			{if !isset($loginuser) or $loginuser eq ''}
				<input class="form-control" type="text" name="user" id="login-user_{$module_logo_instance}" {*size="{if empty($module_params.input_size)}15{else}{$module_params.input_size}{/if}"*} {if !empty($error_login)} value="{$error_user|escape}"{elseif !empty($adminuser)} value="{$adminuser|escape}"{/if}/>
				{jq}if ($('#login-user_{{$module_logo_instance}}:visible').length) {if ($("#login-user_{{$module_logo_instance}}").offset().top < $(window).height()) {$('#login-user_{{$module_logo_instance}}')[0].focus();} }{/jq}
			{else}
				<input class="form-control" type="hidden" name="user" id="login-user_{$module_logo_instance}" value="{$loginuser|escape}" /><b>{$loginuser|escape}</b>
			{/if}
		</div>
		{if $prefs.feature_challenge eq 'y'} <!-- quick hack to make challenge/response work until 1.8 tiki auth overhaul -->
			<div class="email form-group">
				<label for="login-email_{$module_logo_instance}">{tr}eMail:{/tr}</label>
				<input class="form-control" type="text" name="email" id="login-email_{$module_logo_instance}" {*size="{if empty($module_params.input_size)}15{else}{$module_params.input_size}{/if}"*} />
			</div>
		{/if}
		<div class="pass form-group">
			<label for="login-pass_{$module_logo_instance}">{tr}Password:{/tr}</label>
			<input onkeypress="capLock(event, this)" type="password" name="pass" class="form-control" id="login-pass_{$module_logo_instance}" size="{if empty($module_params.input_size)}15{else}{$module_params.input_size}{/if}" />
			<div class="divCapson" style="display:none;">
				{icon name='error' istyle="vertical-align:middle"} {tr}CapsLock is on.{/tr}
			</div>
		</div>
		{if $prefs.rememberme ne 'disabled' and (empty($module_params.remember) or $module_params.remember neq 'n')}
			{if $prefs.rememberme eq 'always'}
				<input type="hidden" name="rme" id="login-remember-module-input_{$module_logo_instance}" value="on" />
			{else}
				<div class="form-group">
					<div class="checkbox rme">
						<label for="login-remember-module_{$module_logo_instance}"><input type="checkbox" name="rme" id="login-remember-module_{$module_logo_instance}" value="on" />
							{tr}Remember me{/tr}
							({tr}for{/tr}
							{if $prefs.remembertime eq 300}
								5 {tr}minutes{/tr})<commit_msg>[FIX] Removed extra label closing tag in the popup login form<commit_after>{* $Id$ *}
{jq notonready=true}
function capLock(e, el){
	kc = e.keyCode ? e.keyCode : e.which;
	sk = e.shiftKey ? e.shiftKey : (kc == 16 ? true : false);
	if ((kc >= 65 && kc <= 90 && !sk) || (kc >= 97 && kc <= 122 && sk)) {
		$('.divCapson', $(el).parents('div:first')).show();
	} else {
		$('.divCapson', $(el).parents('div:first')).hide();
	}
}
{/jq}
{jq}
$("#loginbox-{{$module_logo_instance}}").submit( function () {
	if ($("#login-user_{{$module_logo_instance}}").val() && $("#login-pass_{{$module_logo_instance}}").val()) {
		return true;
	} else {
		$("#login-user_{{$module_logo_instance}}").focus();
		return false;
	}
});
if (jqueryTiki.no_cookie) {
	$('.box-login_box input').each(function(){
		$(this).change(function() {
			if (jqueryTiki.no_cookie && $(this).val()) {
				alert(jqueryTiki.cookie_consent_alert);
			}
		});
	});
}
{/jq}
{if !isset($tpl_module_title)}{* Left for performance, since tiki-login_scr.php includes this template directly. *}
	{assign var=tpl_module_title value="{tr}Log in{/tr}"}
	{if !isset($module_params)}{assign var=module_params value=' '}{/if}
	{if isset($nobox)}{$module_params.nobox = $nobox}{/if}
	{if isset($style)}{$module_params.style = $style}{/if}
{/if}
{tikimodule error=$module_params.error title=$tpl_module_title name="login_box" flip=$module_params.flip decorations=$module_params.decorations nobox=$module_params.nobox notitle=$module_params.notitle style=$module_params.style}
	{if $mode eq "header"}<div class="siteloginbar{if $user} logged-in{/if}">{/if}
	{if $user}
		{if empty($mode) or $mode eq "module"}
			<div class="form-group">{tr}Logged in as:{/tr} <span style="white-space: nowrap">{$user|userlink}</span></div>
			<div class="text-center form-group">
				{button href="tiki-logout.php" _text="{tr}Log out{/tr}"}
			</div>
			{if $login_module.can_revert}
				<form action="{$login_module.login_url|escape}" method="post">
					<fieldset>
						<legend>{tr}Return to Main User{/tr}</legend>
						<input type="hidden" name="su" value="revert" />
						<input type="hidden" name="
						e" value="auto" />
						<div class="text-center"><button type="submit" class="btn btn-primary" name="actsu">{tr}Switch{/tr}</button></div>
					</fieldset>
				</form>
			{elseif $tiki_p_admin eq 'y'}
				<form action="{$login_module.login_url|escape}" method="post"{if $prefs.desactive_login_autocomplete eq 'y'} autocomplete="off"{/if} role="form">
					<fieldset>
						<legend>{tr}Switch User{/tr}</legend>
						<div class="form-group">
							<label for="login-switchuser_{$module_logo_instance}">{tr}Username{/tr} {if $prefs.login_allow_email eq 'y'} {tr}or e-mail address{/tr}{/if}:</label>
							<input type="hidden" name="su" value="1" class="form-control" />
							{if $prefs.feature_help eq 'y'}
								{help url="Switch+User" desc="{tr}Help{/tr}" desc="{tr}Switch User:{/tr}{tr}Enter a username and click 'Switch'.<br>Useful for testing permissions.{/tr}"}
							{/if}
							<input type="text" name="username" class="form-control" id="login-switchuser_{$module_logo_instance}" {* size="{if empty($module_params.input_size)}15{else}{$module_params.input_size}{/if}" *} />
						</div>
						<div class="text-center"><button type="submit" class="btn btn-primary" name="actsu">{tr}Switch{/tr}</button></div>
						{autocomplete element="#login-switchuser_"|cat:$module_logo_instance type="username"}
					</fieldset>
				</form>
			{/if}
		{elseif $mode eq "header"}
			<span style="white-space: nowrap">{$user|userlink}</span> <a href="tiki-logout.php" title="{tr}Log out{/tr}">{tr}Log out{/tr}</a>
		{elseif $mode eq "popup"}
			<div class="siteloginbar_popup dropdown pull-right">
				{if $module_params.show_user_name eq 'y'}{$user|avatarize}{/if}
				<a href="tiki-logout.php" class="dropdown-toggle login_link btn btn-link" data-toggle="dropdown">
					{if $module_params.show_user_name eq 'y'}{$user|username}{else}{$user|avatarize:n:n:n}{/if}
					<span class="caret"></span>
				</a>
				<ul class="clearfix dropdown-menu pull-right">

						<li>
							<a href="tiki-user_information.php">{tr}My Account{/tr}</a>
						</li>

					<li>
						<a href="tiki-logout.php" title="{tr}Log out{/tr}">{tr}Log out{/tr}</a>
					</li>
				</ul>
			</div>
		{/if}
		{if $prefs.auth_method eq 'openid' and $openid_userlist|@count gt 1}
			<form method="get" action="tiki-login_openid.php">
				<fieldset>
					<legend>{tr}Switch user{/tr}</legend>
					<select name="select">
					{foreach item=username from=$openid_userlist}
						<option{if $username eq $user} selected="selected"{/if}>{$username}</option>
					{/foreach}
					</select>
					<input type="hidden" name="action" value="select"/>
					<input type="submit" class="btn btn-primary" value="{tr}Go{/tr}"/>
				</fieldset>
			</form>
		{/if}
	{elseif $prefs.auth_method eq 'cas' && $showloginboxes neq 'y'}
		<b><a class="linkmodule" href="tiki-login.php?cas=y">{tr}Log in through CAS{/tr}</a></b>
		{if $prefs.cas_skip_admin eq 'y'}
			<br><a class="linkmodule" href="tiki-login_scr.php?user=admin">{tr}Log in as admin{/tr}</a>
		{/if}
	{elseif $prefs.auth_method eq 'shib' && $showloginboxes neq 'y'}
		<b><a class="linkmodule" href="tiki-login.php">{tr}Log in through Shibboleth{/tr}</a></b>
		{if $prefs.shib_skip_admin eq 'y'}
			<br><a class="linkmodule" href="tiki-login_scr.php?user=admin">{tr}Log in as admin{/tr}</a>
		{/if}
	{else}
		{assign var='close_tags' value=''}
		{if $mode eq "popup"}
			<div class="siteloginbar_popup dropdown btn-group pull-right">
				<button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown">
					{tr}Log in{/tr}
					<span class="caret"></span>
				</button>
				<div class="siteloginbar_poppedup dropdown-menu pull-right modal-sm"><div class="panel-body">
					{capture assign="close_tags"}</div></div></div>{$close_tags}{/capture}
		{/if}

		<form name="loginbox" class="form{if $mode eq "header"} form-inline{/if}" id="loginbox-{$module_logo_instance}" action="{$login_module.login_url|escape}"
				method="post" {if $prefs.feature_challenge eq 'y'}onsubmit="doChallengeResponse(this)"{/if}
				{if $prefs.desactive_login_autocomplete eq 'y'} autocomplete="off"{/if}
		>
		{capture assign="close_tags"}</form>{$close_tags}{/capture}

		{if $prefs.feature_challenge eq 'y'}
			<script type='text/javascript' src="vendor/jquery/md5/js/md5.js"></script>
			{jq notonready=true}
				function doChallengeResponse(form) {
					var $form = $(form), hashstr, str;
					hashstr= $("input[name=user]", $form).val() +
								$("input[name=pass]", $form).val() +
								$("input[name=email]", $form).val();
					str = $("input[name=user]", $form).val() + md5(hashstr) + $("input[name=challenge]", $form).val();
					$("input[name=response]", $form).val(md5(str));
					//$("input[name=pass]", $form).val(""); // (form does not submit without password)
					$form.submit();
					return false;
				}
			{/jq}
			<input type="hidden" name="challenge" value="{$challenge|escape}" />
			<input type="hidden" name="response" value="" />
		{/if}
		{if !empty($urllogin)}<input type="hidden" name="url" value="{$urllogin|escape}" />{/if}
		{if $module_params.nobox neq 'y'}
			<fieldset>
				{capture assign="close_tags"}</fieldset>{$close_tags}{/capture}
		{/if}
		{if !empty($error_login)}
			{remarksbox type='errors' title="{tr}Error{/tr}"}
				{if $error_login == -5}{tr}Invalid username or password{/tr}
				{elseif $error_login == -3}{tr}Invalid username or password{/tr}
				{else}{$error_login|escape}{/if}
			{/remarksbox}
		{/if}
		<div class="user form-group">
			{if !isset($module_logo_instance)}{assign var=module_logo_instance value=' '}{/if}
			<label for="login-user_{$module_logo_instance}">{if $prefs.login_is_email eq 'y'}{tr}Email:{/tr}{else}{tr}Username{/tr}{if $prefs.login_allow_email eq 'y'} {tr}or e-mail address{/tr}{/if}:{/if}</label>
			{if !isset($loginuser) or $loginuser eq ''}
				<input class="form-control" type="text" name="user" id="login-user_{$module_logo_instance}" {*size="{if empty($module_params.input_size)}15{else}{$module_params.input_size}{/if}"*} {if !empty($error_login)} value="{$error_user|escape}"{elseif !empty($adminuser)} value="{$adminuser|escape}"{/if}/>
				{jq}if ($('#login-user_{{$module_logo_instance}}:visible').length) {if ($("#login-user_{{$module_logo_instance}}").offset().top < $(window).height()) {$('#login-user_{{$module_logo_instance}}')[0].focus();} }{/jq}
			{else}
				<input class="form-control" type="hidden" name="user" id="login-user_{$module_logo_instance}" value="{$loginuser|escape}" /><b>{$loginuser|escape}</b>
			{/if}
		</div>
		{if $prefs.feature_challenge eq 'y'} <!-- quick hack to make challenge/response work until 1.8 tiki auth overhaul -->
			<div class="email form-group">
				<label for="login-email_{$module_logo_instance}">{tr}eMail:{/tr}</label>
				<input class="form-control" type="text" name="email" id="login-email_{$module_logo_instance}" {*size="{if empty($module_params.input_size)}15{else}{$module_params.input_size}{/if}"*} />
			</div>
		{/if}
		<div class="pass form-group">
			<label for="login-pass_{$module_logo_instance}">{tr}Password:{/tr}</label>
			<input onkeypress="capLock(event, this)" type="password" name="pass" class="form-control" id="login-pass_{$module_logo_instance}" size="{if empty($module_params.input_size)}15{else}{$module_params.input_size}{/if}" />
			<div class="divCapson" style="display:none;">
				{icon name='error' istyle="vertical-align:middle"} {tr}CapsLock is on.{/tr}
			</div>
		</div>
		{if $prefs.rememberme ne 'disabled' and (empty($module_params.remember) or $module_params.remember neq 'n')}
			{if $prefs.rememberme eq 'always'}
				<input type="hidden" name="rme" id="login-remember-module-input_{$module_logo_instance}" value="on" />
			{else}
				<div class="form-group">
					<div class="checkbox rme">
						<label for="login-remember-module_{$module_logo_instance}"><input type="checkbox" name="rme" id="login-remember-module_{$module_logo_instance}" value="on" />
							{tr}Remember me{/tr}
							({tr}for{/tr}
							{if $prefs.remembertime eq 300}
								5 {tr}minutes{/tr})
{'fraction_non_alphanumeric': 0.21413139546302662, 'fraction_numerical': 0.00333889816360601, 'mean_word_length': 4.927532013969732, 'pattern_counts': {'":': 0, '<': 264, '<?xml version=': 0, '>': 262, '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': '5813559', 'n_tokens_mistral': 8469, 'n_tokens_neox': 7376, 'n_words': 1307}