<?php
/* Smarty version 3.1.33, created on 2021-11-04 17:25:49
  from '/opt/lampp/htdocs/testlink/gui/templates/usermanagement/userInfo.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.33',
  'unifunc' => 'content_6184098d74e734_02400804',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '8a60a67508c2a86016dfa47ebe87add8df175e5d' => 
    array (
      0 => '/opt/lampp/htdocs/testlink/gui/templates/usermanagement/userInfo.tpl',
      1 => 1636032773,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:inc_head.tpl' => 1,
    'file:inc_del_onclick.tpl' => 1,
    'file:inc_update.tpl' => 1,
    'file:error_icon.tpl' => 3,
  ),
),false)) {
function content_6184098d74e734_02400804 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_checkPlugins(array(0=>array('file'=>'/opt/lampp/htdocs/testlink/vendor/smarty/smarty/libs/plugins/function.html_options.php','function'=>'smarty_function_html_options',),));
$_smarty_tpl->_assignInScope('cfg_section', "login");
$_smarty_tpl->smarty->ext->configLoad->_loadConfigFile($_smarty_tpl, "input_dimensions.conf", $_smarty_tpl->tpl_vars['cfg_section']->value, 0);
?>


<?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang_get'][0], array( array('var'=>'labels','s'=>'title_account_settings,warning_empty_pwd,warning_different_pwd,never_logged,
             warning_enter_less1,warning_enter_at_least1,warning_enter_at_least2,
             warning_enter_less2,th_login,th_first_name,th_last_name,
             th_email,th_locale,btn_save,th_old_passwd,audit_login_history,none,
             th_new_passwd,th_new_passwd_again,btn_change_passwd,audit_last_failed_logins,
             your_password_is_external,user_api_key,btn_apikey_generate,empty_email_address,
             audit_last_succesful_logins,warning,warning_empty_first_name,no_good_email_address,
             warning_empty_last_name,passwd_dont_match,empty_old_passwd,show_event_history,
             demo_update_user_disabled,last_update,title_personal_data'),$_smarty_tpl ) );?>


<?php $_smarty_tpl->_assignInScope('action_mgmt', "lib/usermanagement/userInfo.php");?>

<?php $_smarty_tpl->_subTemplateRender("file:inc_head.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('jsValidate'=>"yes",'openHead'=>"yes"), 0, false);
$_smarty_tpl->_subTemplateRender("file:inc_del_onclick.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>


<?php echo '<script'; ?>
 type="text/javascript">
var warning_empty_pwd = "<?php echo strtr($_smarty_tpl->tpl_vars['labels']->value['warning_empty_pwd'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
";
var warning_different_pwd = "<?php echo strtr($_smarty_tpl->tpl_vars['labels']->value['warning_different_pwd'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
";
var warning_enter_less1 = "<?php echo strtr($_smarty_tpl->tpl_vars['labels']->value['warning_enter_less1'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
";
var warning_enter_at_least1 = "<?php echo strtr($_smarty_tpl->tpl_vars['labels']->value['warning_enter_at_least1'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
";
var warning_enter_at_least2 = "<?php echo strtr($_smarty_tpl->tpl_vars['labels']->value['warning_enter_at_least2'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
";
var warning_enter_less2 = "<?php echo strtr($_smarty_tpl->tpl_vars['labels']->value['warning_enter_less2'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
";
var names_max_len=<?php echo $_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, 'NAMES_MAXLEN');?>
;
var alert_box_title = "<?php echo strtr($_smarty_tpl->tpl_vars['labels']->value['warning'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
";
var warning_empty_name = "<?php echo strtr($_smarty_tpl->tpl_vars['labels']->value['warning_empty_first_name'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
";
var warning_empty_last = "<?php echo strtr($_smarty_tpl->tpl_vars['labels']->value['warning_empty_last_name'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
";
var warning_passwd_dont_match = "<?php echo strtr($_smarty_tpl->tpl_vars['labels']->value['passwd_dont_match'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
";
var warning_empty_old_password = "<?php echo strtr($_smarty_tpl->tpl_vars['labels']->value['empty_old_passwd'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
";
var warning_empty_email_address = "<?php echo strtr($_smarty_tpl->tpl_vars['labels']->value['empty_email_address'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
";
var warning_no_good_email_address = "<?php echo strtr($_smarty_tpl->tpl_vars['labels']->value['no_good_email_address'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
"; 


function validatePersonalData(f)
{
  var email_warning;
  var show_email_warning=false;
  
  if (isWhitespace(f.firstName.value))
  {
      alert_message(alert_box_title,warning_empty_name);
      selectField(f, 'firstName');
      return false;
  }

  if (isWhitespace(f.lastName.value))
  {
      alert_message(alert_box_title,warning_empty_last);
      selectField(f, 'lastName');
      return false;
  }

  if (isWhitespace(f.emailAddress.value))
  {
      show_email_warning=true;
      email_warning=warning_empty_email_address;
  }
  else 
  { 
    if (!/\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(f.emailAddress.value))
    {
      show_email_warning=true;
      email_warning=warning_no_good_email_address;
    }
  }

  if( show_email_warning )
  {
      alert_message(alert_box_title,email_warning);
      selectField(f, 'emailAddress');
      return false;
  }

  return true;
}


function checkPasswords(oldp,newp,newp_check)
{

  var oldvalue=document.getElementById(oldp).value;

  if (isWhitespace(oldvalue))
  {
    alert_message(alert_box_title,warning_empty_old_password);
    return false;
  }

  if( !validatePassword(newp,newp_check) )
  {
    alert_message(alert_box_title,warning_passwd_dont_match);
    return false;
  }
  return true;
}

function refreshLastUpdate (last_update) 
{
  document.getElementById("last_update").firstChild.nodeValue = last_update;
}
<?php echo '</script'; ?>
>
</head>

<body>

<h1 class="title"><?php echo $_smarty_tpl->tpl_vars['labels']->value['title_account_settings'];?>
</h1>

<?php $_smarty_tpl->_subTemplateRender("file:inc_update.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('user_feedback'=>$_smarty_tpl->tpl_vars['user_feedback']->value), 0, false);
?>

<div class="workBack">


<h2><?php echo $_smarty_tpl->tpl_vars['labels']->value['title_personal_data'];?>
</h2>
<form method="post" action="<?php echo $_smarty_tpl->tpl_vars['action_mgmt']->value;?>
" onsubmit="return validatePersonalData(this)">
  <input type="hidden" name="doAction" value="editUser" />
  <table class="common" width="50%">
    <tr>
      <th width="20%"><?php echo $_smarty_tpl->tpl_vars['labels']->value['th_login'];?>
</th>
      <td><?php echo $_smarty_tpl->tpl_vars['user']->value->login;?>
</td>
    </tr>
    <tr>
      <th><?php echo $_smarty_tpl->tpl_vars['labels']->value['th_first_name'];?>
</th>
      <td><input type="text" name="firstName" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['user']->value->firstName, ENT_QUOTES, 'UTF-8', true);?>
"
                 size="<?php echo $_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, 'NAMES_SIZE');?>
" maxlength="<?php echo $_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, 'NAMES_MAXLEN');?>
" />
                <?php $_smarty_tpl->_subTemplateRender("file:error_icon.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('field'=>"firstName"), 0, false);
?>
      </td>
    </tr>
    <tr>
      <th><?php echo $_smarty_tpl->tpl_vars['labels']->value['th_last_name'];?>
</th>
      <td><input type="text" name="lastName" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['user']->value->lastName, ENT_QUOTES, 'UTF-8', true);?>
"
                 size="<?php echo $_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, 'NAMES_SIZE');?>
" maxlength="<?php echo $_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, 'NAMES_MAXLEN');?>
" />
                 <?php $_smarty_tpl->_subTemplateRender("file:error_icon.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('field'=>"lastName"), 0, true);
?>
      </td>
    </tr>
    <tr>
      <th><?php echo $_smarty_tpl->tpl_vars['labels']->value['th_email'];?>
</th>
      <td><input type="text" name="emailAddress" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['user']->value->emailAddress, ENT_QUOTES, 'UTF-8', true);?>
"
                 size="<?php echo $_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, 'EMAIL_SIZE');?>
" maxlength="<?php echo $_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, 'EMAIL_MAXLEN');?>
" required />
                 <?php $_smarty_tpl->_subTemplateRender("file:error_icon.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('field'=>"emailAddress"), 0, true);
?>
      </td>
    </tr>
    <tr>
      <th><?php echo $_smarty_tpl->tpl_vars['labels']->value['th_locale'];?>
</th>
      <td>
        <?php echo '<script'; ?>
 type="text/javascript">
        js_locale = new Array();
        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['gui']->value->optLocale, 'value', false, 'locale');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['locale']->value => $_smarty_tpl->tpl_vars['value']->value) {
?>
          js_locale['<?php echo $_smarty_tpl->tpl_vars['locale']->value;?>
'] = "<?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang_get'][0], array( array('s'=>'last_update','locale'=>$_smarty_tpl->tpl_vars['locale']->value),$_smarty_tpl ) );?>
";
        <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
        <?php echo '</script'; ?>
>
        
        <select name="locale" onchange="javascript:refreshLastUpdate(js_locale[this.options[this.selectedIndex].value]);">
        <?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['gui']->value->optLocale,'selected'=>$_smarty_tpl->tpl_vars['user']->value->locale),$_smarty_tpl);?>

        </select>
        <span id="last_update"><?php echo $_smarty_tpl->tpl_vars['labels']->value['last_update'];?>
</span>
      </td>
    </tr>
  </table>
  <div class="groupBtn">
    <?php if ($_smarty_tpl->tpl_vars['tlCfg']->value->demoMode) {?>
      <?php echo $_smarty_tpl->tpl_vars['labels']->value['demo_update_user_disabled'];?>

    <?php } else { ?>
      <input type="submit" value="<?php echo $_smarty_tpl->tpl_vars['labels']->value['btn_save'];?>
" />
    <?php }?> 
  </div>
</form>

<hr />
<h2><?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang_get'][0], array( array('s'=>"title_personal_passwd"),$_smarty_tpl ) );?>
</h2>
<?php if ($_smarty_tpl->tpl_vars['external_password_mgmt']->value == 0) {?>
  <form name="changePass" method="post" action="<?php echo $_smarty_tpl->tpl_vars['action_mgmt']->value;?>
"
    onsubmit="return checkPasswords('oldpassword','newpassword','newpassword_check');">
    <input type="hidden" name="doAction" value="changePassword" />
    <table class="common">
      <tr><th><?php echo $_smarty_tpl->tpl_vars['labels']->value['th_old_passwd'];?>
</th>
        <td><input type="password" name="oldpassword"  id="oldpassword"
                   size="<?php echo $_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, 'PASSWD_SIZE');?>
" maxlength="<?php echo $_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, 'PASSWD_SIZE');?>
" required /></td></tr>
      <tr><th><?php echo $_smarty_tpl->tpl_vars['labels']->value['th_new_passwd'];?>
</th>
        <td><input type="password" name="newpassword" id="newpassword"
                   size="<?php echo $_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, 'PASSWD_SIZE');?>
" maxlength="<?php echo $_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, 'PASSWD_SIZE');?>
" required /></td></tr>
      <tr><th><?php echo $_smarty_tpl->tpl_vars['labels']->value['th_new_passwd_again'];?>
</th>
        <td><input type="password" name="newpassword_check" id="newpassword_check"
                   size="<?php echo $_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, 'PASSWD_SIZE');?>
" maxlength="<?php echo $_smarty_tpl->smarty->ext->configLoad->_getConfigVariable($_smarty_tpl, 'PASSWD_SIZE');?>
" required /></td></tr>
    </table>
    <div class="groupBtn">
    <?php if ($_smarty_tpl->tpl_vars['tlCfg']->value->demoMode) {?>
      <?php echo $_smarty_tpl->tpl_vars['labels']->value['demo_update_user_disabled'];?>

    <?php } else { ?>
      <input type="submit" value="<?php echo $_smarty_tpl->tpl_vars['labels']->value['btn_change_passwd'];?>
" />
    <?php }?> 
    </div>
  </form>
<?php } else { ?>
   <p><?php echo $_smarty_tpl->tpl_vars['labels']->value['your_password_is_external'];?>
<p>
<?php }?>

<?php if ($_smarty_tpl->tpl_vars['tlCfg']->value->api->enabled) {?>
<hr />
<h2><?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang_get'][0], array( array('s'=>"title_api_interface"),$_smarty_tpl ) );?>
</h2>
<div>
  <form name="genApi" method="post" action="<?php echo $_smarty_tpl->tpl_vars['action_mgmt']->value;?>
">
    <input type="hidden" name="doAction" value="genAPIKey" />
    <p><?php echo $_smarty_tpl->tpl_vars['labels']->value['user_api_key'];?>
 = <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['user']->value->userApiKey, ENT_QUOTES, 'UTF-8', true);?>
</p>
    <div class="groupBtn">
      <input type="submit" value="<?php echo $_smarty_tpl->tpl_vars['labels']->value['btn_apikey_generate'];?>
" />
    </div>
  </form>
</div>
<?php }?>


<hr />
<h2><?php echo $_smarty_tpl->tpl_vars['labels']->value['audit_login_history'];?>

  <?php if ($_smarty_tpl->tpl_vars['mgt_view_events']->value == "yes") {?>
  <img style="margin-left:5px;" class="clickable" src="<?php echo @constant('TL_THEME_IMG_DIR');?>
/question.gif" onclick="showEventHistoryFor('<?php echo $_smarty_tpl->tpl_vars['user']->value->dbID;?>
','users')" alt="<?php echo $_smarty_tpl->tpl_vars['labels']->value['show_event_history'];?>
" title="<?php echo $_smarty_tpl->tpl_vars['labels']->value['show_event_history'];?>
"/>
</h2>
<?php }?>
<div>
  <h3><?php echo $_smarty_tpl->tpl_vars['labels']->value['audit_last_succesful_logins'];?>
</h3>
  <?php if ($_smarty_tpl->tpl_vars['loginHistory']->value->ok != '') {?>
  <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['loginHistory']->value->ok, 'event');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['event']->value) {
?>
  <span><?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['localize_timestamp'][0], array( array('ts'=>$_smarty_tpl->tpl_vars['event']->value->timestamp),$_smarty_tpl ) );?>
</span>
  <span><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['event']->value->description, ENT_QUOTES, 'UTF-8', true);?>
</span>
  <br/>
  <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
  <?php } else { ?>
    <?php echo $_smarty_tpl->tpl_vars['labels']->value['never_logged'];?>

  <?php }?>
</div>
  <?php if ($_smarty_tpl->tpl_vars['loginHistory']->value->failed != '') {?>
  <div>
    <h3><?php echo $_smarty_tpl->tpl_vars['labels']->value['audit_last_failed_logins'];?>
</h3>
    <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['loginHistory']->value->failed, 'event');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['event']->value) {
?>
    <span><?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['localize_timestamp'][0], array( array('ts'=>$_smarty_tpl->tpl_vars['event']->value->timestamp),$_smarty_tpl ) );?>
</span>
    <span><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['event']->value->description, ENT_QUOTES, 'UTF-8', true);?>
</span>
    <br/>
    <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
  </div>
  <?php }?>

</div>
<?php if ($_smarty_tpl->tpl_vars['update_title_bar']->value == 1) {?>

<?php echo '<script'; ?>
 type="text/javascript">
  parent.titlebar.location.reload();
<?php echo '</script'; ?>
>

<?php }?>
</body>
</html>
<?php }
}
