<?xml version="1.0"?>
<?xml-stylesheet href="NULL" type="application/x-xsp"?>
<?xml-stylesheet href="/transforms/user/make-control.xsl" type="text/xsl"?>
<?xml-stylesheet href="/transforms/user/xhtml/user.xsl" type="text/xsl"?>
<xsp:page
  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
  xmlns:ct="http://www.kjetil.kjernsmo.net/software/TABOO/NS/Control"
  xmlns:cust="http://www.kjetil.kjernsmo.net/software/TABOO/NS/CustomGrammar"
  xmlns:user="http://www.kjetil.kjernsmo.net/software/TABOO/NS/User"
  xmlns:userinc="http://www.kjetil.kjernsmo.net/software/TABOO/NS/User/Include"
  xmlns:param="http://www.axkit.org/2002/XSP/QueryParam"
  xmlns:session="http://www.axkit.org/2002/XSP/BasicSession"
  xmlns:i18n="http://www.kjetil.kjernsmo.net/software/TABOO/NS/I18N"
  xmlns="http://www.w3.org/1999/xhtml">
  <cust:user>
    <cust:title><i18n:insert>user-info</i18n:insert></cust:title>
    <param:if-exists name="submitted">
      <user:store/>
    </param:if-exists>
    
    <user:get-user>
      <user:username><param:get name="username"/></user:username>
    </user:get-user>
    

    
    <user:is-authorized authlevel="6">
      <user:username><xsp:expr><param:get name="username"/></xsp:expr></user:username>
      <user:true>
	
	<h2>
	  <i18n:insert>edit</i18n:insert>
	  <i18n:insert>user-info</i18n:insert>
	</h2>
		    
	<ct:control element="input" type="text" name="name" size="30" maxlength="30">
	  <ct:title><i18n:insert>user-name</i18n:insert></ct:title>
	  <ct:descr><i18n:insert>new-username-descr</i18n:insert></ct:descr>
	  <!-- Have the XSLT include the value -->	  
	  <ct:value><userinc:name/></ct:value> 
	</ct:control>
	<ct:control element="input" type="text" name="email" size="30" maxlength="129">
	  <ct:title><i18n:insert>user-email</i18n:insert></ct:title>
	  <ct:descr><i18n:insert>new-email-descr</i18n:insert></ct:descr>
	  <!-- Have the XSLT include the value -->	  
	  <ct:value><userinc:email/></ct:value> 
	</ct:control>

	<ct:control element="input" type="text" name="uri" size="60" maxlength="254">
	  <ct:title>
	    <i18n:insert>homepage</i18n:insert>
	    <i18n:insert>uri</i18n:insert>
	  </ct:title>
	  <ct:descr><i18n:insert>new-uri-descr</i18n:insert></ct:descr>
	  <!-- Have the XSLT include the value -->	  
	  <ct:value><userinc:uri/></ct:value> 
	</ct:control>
	
	<ct:control element="input" type="text" name="bio" size="60" maxlength="254">
	  <ct:title>
	    <i18n:insert>user-bio</i18n:insert>
	  </ct:title>
	  <ct:descr><i18n:insert>new-bio-descr</i18n:insert></ct:descr>
	  <!-- Have the XSLT include the value -->	  
	  <ct:value><userinc:bio/></ct:value> 
	</ct:control>


      </user:true>
    </user:is-authorized>
    
    <user:is-authorized>
      <user:username><xsp:expr><param:get name="username"/></xsp:expr></user:username>
      <user:true>
	<h3>
	  <i18n:insert>change</i18n:insert>
	  <i18n:insert>password</i18n:insert>
	</h3>	
	<ct:control element="input" type="password" name="newpasswd1" size="8">
	  <ct:title><i18n:insert>new-password</i18n:insert></ct:title>
	  <ct:descr><i18n:insert>to-change-passwd-descr</i18n:insert></ct:descr>
	</ct:control>

	<ct:control element="input" type="password" name="newpasswd2" size="8">
	  <ct:title>
	    <i18n:insert>repeat</i18n:insert>
	    <i18n:insert>new-password</i18n:insert>
	  </ct:title>
	</ct:control>


      </user:true>
    </user:is-authorized>


    
    <ct:control element="select" name="authlevel">
      <ct:title>
      	  <i18n:insert>change</i18n:insert>
	  <i18n:insert>authlevel</i18n:insert>
      </ct:title>
      	  <ct:descr><i18n:insert>authlevel-descr</i18n:insert></ct:descr>

      <ct:value>
	<user:valid-authlevels>      
	  <user:username><xsp:expr><param:get name="username"/></xsp:expr></user:username>
	</user:valid-authlevels>
      </ct:value>
    </ct:control>

    <ct:control element="input" type="hidden" name="username">
      <ct:value><param:get name="username"/></ct:value>
    </ct:control>


    <user:is-authorized authlevel="4">
      <user:username><xsp:expr><param:get name="username"/></xsp:expr></user:username>
      <user:true>
	<ct:control element="input" type="submit" name="submitted"> 
	  <ct:value><i18n:insert>update</i18n:insert></ct:value>
	</ct:control>
      </user:true>
    </user:is-authorized>



  </cust:user>
</xsp:page>


