Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
$header(formurl,breadcrumbs,shortcuts)$

$if(error)$<div class="error">$error$</div>$endif$
$if(success)$<div class="success">$success$</div>$endif$

<div><form method="post" action='$formurl$/person.edit' id="person_update" class="person">
<input type="hidden" name="id" value="$uuid$"/>
<input type="hidden" name="q" value="$q$"/>
<input type="hidden" name="a" value="$auth$" />

<h2>Account details</h2>

<label for='first_name'>
<span class='question'>First name</span>
<span class='answer'><input type="text" name="first_name" id="first_name" value='$first_name;format="html"$' /></span>
</label>

<label for='last_name'>
<span class='question'>Last name</span>
<span class='answer'><input type="text" name="last_name" id="last_name" value='$last_name;format="html"$' /></span>
</label>

<label for='email'>
<span class='question'>Email</span>
<span class='answer'><input type="text" name="email" id="email" value='$email;format="html"$' /></span>
</label>

<label for='expiry'>
<span class='question'>Expiry</span>
<span class='answer'><input type="text" name="expiry" placeholder="dd/mm/yyyy hh:mmAM" id="expiry" value='$expiry;format="html"$' /></span>
</label>

$if(has_username)$
<label for='username'>
<span class='question'>$if(ldap_enabled)$LDAP $endif$Username</span>
<span class='answer'>$p.username;format="english"$</span>
</label>
$endif$

$if(p.lastAuth)$
<label for='last_auth'>
<span class='question'>Last sign in</span>
<span class='answer'>$p.lastAuth;format="english"$</span>
</label>
$endif$

$if(p.lastAuthIp)$
<label for='last_auth_ip'>
<span class='question'>Last sign in IP</span>
<span class='answer'>$p.lastAuthIp;format="html"$</span>
</label>
$endif$

<br/><br/>

<h3 class="admin_roles">Administrative Roles</h3>

$roles:{r|
	$if(!r.role.internal)$
<label for='role_$r.role.role$' class='custom'>
	<span class='question'>$r.role.name;format="html"$</span>
	<span class='answer'><input type="checkbox" name="role_$r.role.role$" id="role_$r.role.role$" value="true" $if(r.selected)$ checked="checked"$endif$ /> $r.role.description;format="html"$</span>
</label>
	$endif$
}$

$if(has_custom_role)$
<br/><br/>
$endif$

$roles:{r|
	$if(r.role.internal)$
<label for='role_$r.role.role$' class='internal'>
	<span class='question'>$r.role.name;format="html"$</span>
	<span class='answer'><input type="checkbox" name="role_$r.role.role$" id="role_$r.role.role$" value="true" $if(r.selected)$ checked="checked"$endif$ /> $r.role.description;format="html"$</span>
</label>
	$endif$
}$

<div class='submit'>
<input type="submit" value="Save"/>
</div>
</form>

$if(show_groups)$
<div><form method="post" action='$formurl$/person.edit' id="person_groups" class="person">
<input type="hidden" name="id" value="$uuid$"/>
<input type="hidden" name="q" value="$q$"/>
<input type="hidden" name="a" value="$auth$" />
<input type="hidden" name="update_groups" value="update_groups" />

<h3 class="groups">Groups</h3>

$if(first(groups))$
<ul>
$groups:{g|
	<li>$g.name;format="html"$</li>
}$
</ul>
$else$
<p>$p.displayName$ does not belong to any groups.</p>
$endif$

$if(group_manager)$
<div>
	<u style="color: #8080c0; display: block; text-align: right;" onclick="flipdisplay('sm1')">Manage groups »</u>
	<div id="sm1" style="display: none; margin-left: 1em; border: 0">
		<table border="0">
$group_options:{go|
			<tr>
				<td><input type="checkbox" name="group" value='$go.key;format="html"$' $if(go.selected)$checked="checked"$endif$/></td>
				<td>$go.value;format="html"$</td>
			</tr>
}$
			<tr>
				<td style="padding-top: 4px;" colspan="2"><input type="submit" value="Save groups"/></td>
			</tr>
			</table>
	</div>
</div>
$endif$

</form></div>
$endif$

$if(role_manager)$
<div><form method="post" action='$formurl$/person.edit' id="person_roles" class="person">
<input type="hidden" name="id" value="$uuid$"/>
<input type="hidden" name="q" value="$q$"/>
<input type="hidden" name="a" value="$auth$" />

<h3>Roles</h3>

<p>The following roles are associated with this person:</p>

<ul class="current_roles chevron">
	<li>
		$if(role_to_add)$
		<input name="add_role" type="hidden" value='$role_to_add;format="html"$' />
		<select name="role_resource">
			$possible_resource_based_roles:{r|
			<option value='$r.key;format="html"$'>$role_to_add_name$ &mdash; $r.value;format="html"$</option>}$
		</select>
		$else$
		<select name="add_role">
			$rr:{r|
			<option value='$r.role;format="html"$'>$r.name;format="html"$</option>}$
		</select>
		$endif$
		<input type="submit" value="Add"/>
	</li>
$current_resource_based_roles:{r|
	<li>
		<span>$r.name;format="html"$</span> &mdash; $r.resource;format="html"$ <a class="delete" href='$formurl$/person.edit?delete_role=$r.role;format="url"$&amp;resource=$r.uid;format="url"$&id=$uuid$&a=$auth$'>Delete</a>
	</li>
}$
</ul>

<div class="submit"></div>

</form></div>
$endif$
 
<script type="text/javascript">
	document.getElementById('first_name').focus();

	function flipdisplay(name) {
		if(document.getElementById(name).style.display=='none') {
			document.getElementById(name).style.display='block';
		} else {
			document.getElementById(name).style.display='none';
		}
	}
</script>

$footer()$
New to GrepCode? Check out our FAQ X