<!DOCTYPE GenieGate [                                                                                          
        <!ENTITY dir "GenieGate/views/user">                                                                               
]>

<GenieGate>
<!--
$Id: user.xml,v 1.2 2008/10/30 14:46:29 joe Exp $

This sets the initial views for the user functions.

Changing a view here will not change it in the application until the setup 
utility is run. If you are trying to change the view, you will need to
run setup for the changes to take effect. 

see the comments in admin.xml for more details. (or, hopefully some day.. documentation
on the web site..) Meanwhile, please feel free to contact us via the contact
form with any questions you may have about this file.

-->
<global-forwards>
	<forward name="login">
		<Param name="inc.file" value="&dir;/new-user.php" />
	</forward>
	<forward name="error">
		<Param name="inc.file" value="&dir;/error-general.php" />
	</forward>
	<forward name="message">
		<Param name="inc.file" value="&dir;/message.php" />
	</forward>
	<forward name="redir" class="GenieGate_View_Location" require="GenieGate/View/Location.php" />
</global-forwards>

<action method="default_index">
	<forward name="ok">
		<Param name="inc.file" value="&dir;/main.php" />
	</forward>
	<forward name="signon" require="GenieGate/View/Location.php" class="GenieGate_View_Location">
		<!-- LOCATION - The location to redirect to -->
	</forward>
	<forward name="new-user">
		<Param name="inc.file" value="&dir;/new-user.php" />
	</forward>
</action>

<action method="do_logout">
	<forward name="ok">
		<Param name="inc.file" value="&dir;/logged-out.php" />
	</forward>
	<forward name="redir" class="GenieGate_View_Location" require="GenieGate/View/Location.php" />
</action>

<action method="do_signup">
	<!-- Show the signup form -->
	<forward name="get">
		<Param name="inc.file" value="&dir;/user-signup.php" />
	</forward>	
	<!-- Error during signup process -->
	<forward name="error-post">
		<Param name="inc.file" value="&dir;/error-signup.php" />
	</forward>
	<!-- Class responsible for sending the email text -->
	<forward name="email-confirm" require="GenieGate/View/Mail.php" class="GenieGate_View_Mail" >
		<Param name="inc.file" value="&dir;/mail/mail-confirm.php" />
		<Param name="txt.subject" value="Confirmation of signup required" />
		<Param name="txt.body"><![CDATA[
Hello %info.name%, 

Thank you for signing up, your user ID is: %info.uid%

Your password is %info.password%
Your confirmation number is: %conf.code%

To activate your account, please visit this url:

%conf.url% 

]]></Param>
	</forward>
	<!-- If there is a LOCATION form variable, this is used to redirect the user -->
	<forward name="post-redir" class="GenieGate_View_Location" require="GenieGate/View/Location.php" />
	<!-- 
		HTML shown to the user after they've signed up but BEFORE the account is confirmed 
		Should say "check email" This is used if there ISN'T a LOCATION set.
	-->
	<forward name="post-ok">
		<Param name="inc.file" value="&dir;/check-email.php" />
	</forward>
</action>

<action method="do_confirm_account">
	<forward name="error">
		<Param name="inc.file" value="&dir;/error-confirm.php" />
	</forward>
	<forward name="ok">
		<Param name="inc.file" value="&dir;/account-confirmed.php" />
	</forward>
</action>

<action method="do_change_password">
	<forward name="form">
		<Param name="inc.file" value="&dir;/change-password.php" />
	</forward>
	<forward name="error">
		<Param name="inc.file" value="&dir;/error-general.php" />
	</forward>
	<forward name="ok">
		<Param name="inc.file" value="&dir;/password-changed.php" />
	</forward>
</action>

<action method="do_send_password">
	<forward name="get">
		<Param name="inc.file" value="&dir;/show-email-password.php" />
	</forward>
	<forward name="ok">
		<Param name="inc.file" value="&dir;/sent-password.php" />
	</forward>
	<forward name="error">
		<Param name="inc.file" value="&dir;/error-general.php" />
	</forward>
	<forward name="email" require="GenieGate/View/Mail.php" class="GenieGate_View_Mail" >
		<!-- Which param to make available as %INFO.that% -->
		<Param name="inc.file" value="&dir;/mail/mail-password.php" />
		<Param name="txt.subject" value="Your password" />
		<Param name="txt.body"><![CDATA[
Hello %info.name%,

You have requested that your password be sent to you.

User ID: %info.uid%

Password: %info.password%

Account Expiration Date: %info.expires%
]]></Param>
	</forward>
</action>

<action method="do_resend_confirm">
	<forward name="get">
		<Param name="inc.file" value="&dir;/remind-confno.php" />
	</forward>
	<forward name="error">
		<Param name="inc.file" value="&dir;/error-general.php" />
	</forward>
	<forward name="ok">
		<Param name="inc.file" value="&dir;/check-email-remind.php" />
	</forward>	
	<forward name="email" require="GenieGate/View/Mail.php" class="GenieGate_View_Mail" >
		<Param name="inc.file" value="&dir;/mail/mail-confirm.php" />
		<Param name="txt.subject" value="Confirmation Code" />
		<Param name="txt.body"><![CDATA[
Hello %info.name%,

You have requested your confirmation number, here are your account details:

Your user ID is: %info.uid%

Your password is: %info.password%
Your account status: %conf.status%
Your activation code is %conf.code%

You may activate your account with this url:

%conf.url% 
]]></Param>
	</forward>
</action>


<!-- 
	NOTE: additional forms can be created by creating views that begin
		  with prop- so, for a custom comment form, you might have
		  a view named [prop-comment]  
-->
<action method="do_properties">
	<forward name="get">
		<Param name="inc.file" value="&dir;/prop-default.php" />
	</forward>
	<forward name="prop-contact">
		<Param name="inc.file" value="&dir;/prop-contact.php" />
	</forward>
	<forward name="prop-personal">
		<Param name="inc.file" value="&dir;/prop-personal.php" />
	</forward>
	<forward name="post">
		<Param name="inc.file" value="&dir;/message.php" />
		<Param name="txt.message" value="Settings have been saved" />
	</forward>
</action>

<!-- Test to see if the userID already exists -->
<action method="do_ajax_check_uid">
	<forward name="exists">
		<Param name="inc.file" value="&dir;/ajax/error.php" />
		<Param name="txt.message" value="UserID already exists" />
	</forward>
	<forward name="non-exist">
		<Param name="inc.file" value="&dir;/ajax/message.php" />
		<Param name="txt.message" value="UserID OK" />
		<Param name="attr.names" value="UID" />
	</forward>
</action>

<action method="do_paypal_signup">
	<forward name="error-item-no">
		<Param name="inc.file" value="&dir;/error-general.php" />
		<Param name="txt.message" value="Invalid item number" />
	</forward>
	<forward name="error-signup">
		<Param name="inc.file" value="&dir;/error-signup.php" />
	</forward>
	<forward name="error-misconf">
		<Param name="inc.file" value="&dir;/error-general.php" />
		<!-- Error if there is no configured email address -->
		<Param name="txt.message" value="Misconfiguration (webmaster has no paypal email address)" />
	</forward>
	<forward name="signup">
		<Param name="inc.file" value="&dir;/paypal-signup.php" />
	</forward>
	<forward name="upgrade">
		<Param name="inc.file" value="&dir;/paypal-upgrade.php" />
	</forward>
	<forward name="proceed">
		<Param name="inc.file" value="&dir;/paypal-proceed.php" />
	</forward>
</action>

<action method="do_paypal_ipn">
	<forward name="error-no-debug">
		<Param name="inc.file" value="&dir;/error-general.php" />
		<Param name="txt.message" value="GET method not supported without DEBUG on." />
	</forward>
	<forward name="test-ok">
		<Param name="inc.file" value="&dir;/paypal-test-form.php" />
	</forward>
	<forward name="ok">
		<Param name="inc.file" value="&dir;/paypal-ipn-response.php" />
	</forward>
</action>

<action method="do_paypal_cancel">
	<forward name="ok">
		<Param name="inc.file" value="&dir;/paypal-cancel.php" />
	</forward>
</action>
<action method="do_paypal_return">
	<forward name="error">
		<Param name="inc.file" value="&dir;/error-general.php" />
	</forward>
	<forward name="error-payment">
		<Param name="inc.file" value="&dir;/paypal-payment-problem.php" />
	</forward>
	<forward name="ok">
		<Param name="inc.file" value="&dir;/paypal-return.php" />
	</forward>
</action>

</GenieGate>
