<dtml-var manage_page_header>

<main class="container-fluid">

<dtml-var "manage_form_title(this(), _, form_title='Change User')">

	<form action="manage_users" method="post" class="zmi-user">
		
		<div class="form-group row">
			<label for="name" class="form-label col-sm-3 col-md-2">Name</label>
			<div class="col-sm-9 col-md-10">
				<input class="form-control disabled text-muted" 
					disabled="disabled" 
					value="<dtml-var expr="user.name" html_quote>" />
			 </div>
			<input type="hidden" name="name" value="<dtml-var expr="user.name" html_quote>" />
		</div>
		
		<dtml-if remote_user_mode__>
		  <input type="hidden" name="password" value="&dtml-password;" />
		  <input type="hidden" name="confirm"  value="&dtml-password;" />
		<dtml-else>

		<div class="form-group row">
			<label for="pw" class="form-label col-sm-3 col-md-2">New Password</label>
			<div class="col-sm-9 col-md-10">
				<input id="pw" class="form-control" type="password" name="password" value="password" />
			</div>
		</div>

		<div class="form-group row">
			<label for="confirm" class="form-label col-sm-3 col-md-2">(Confirm)</label>
			<div class="col-sm-9 col-md-10">
				<input id="confirm" class="form-control" type="password" name="confirm" value="pconfirm" />
			</div>
		</div>
		</dtml-if>
		
		<div class="form-group row">
			<label for="domains" class="form-label col-sm-3 col-md-2">Domains</label>
			<div class="col-sm-9 col-md-10">
				<input id="domains" class="form-control" type="text" name="domains:tokens"
					value="<dtml-if expr="user.domains"><dtml-in expr="user.domains">&dtml-sequence-item; </dtml-in></dtml-if>" />
			</div>
		</div>
		
		<div class="form-group row">
			<label for="roles" class="form-label col-sm-3 col-md-2">Roles</label>
			<div class="col-sm-9 col-md-10">
				<select id="roles" class="form-control col" 
					name="roles:list" size="5" multiple="multiple">
					<dtml-in valid_roles>
						<dtml-if expr="_vars['sequence-item'] != 'Authenticated'">
						<dtml-if expr="_vars['sequence-item'] != 'Anonymous'">
						<dtml-if expr="_vars['sequence-item'] != 'Shared'">
						<dtml-if expr="_vars['sequence-item'] in user.roles">
						<option value="&dtml-sequence-item;" selected>&dtml-sequence-item;
						<dtml-else>
						<option value="&dtml-sequence-item;">&dtml-sequence-item;
						</dtml-if>
						</dtml-if>
						</dtml-if>
						</dtml-if>
					</dtml-in valid_roles>
				</select>
			</div>
		</div>
		
		<div class="zmi-controls">
			<input class="btn btn-primary" type="submit" name="submit" value="Change" />
		</div>

	</form>

</main>

<dtml-var manage_page_footer>
