define([
	'require',
	'marionette'
], function(lrequire, Marionette)
{
	var controller = {

		initialize: function (options)
		{
			this.options = options;
		},

		/**
		 * Register new account
		 */
		create: function ()
		{
			var app = this.options.app;

			lrequire([
				'./model/account',
				'./view/createAccountView'
			], function(AccountModel, CreateAccountView)
			{
				var createAccountView = new CreateAccountView({
					app: app,
					model: new AccountModel()
				});

				app.root.currentView.page.show(createAccountView);
			});
		},

		/**
		 * Show account view
		 */
		modify: function ()
		{
			var app = this.options.app;

			lrequire([
				'./model/account',
				'./view/modifyAccountView'
			], function (AccountModel, ModifyAccountView)
			{
				var data = {};

				if (app.user)
					data.id = app.user.id;

				var account = new AccountModel(data);

				account.fetch({
					success: function ()
					{
						var modifyAccountView = new ModifyAccountView({app: app, model: account});

						app.root.currentView.page.show(modifyAccountView);
					}
				});
			});
		}

	};

	return controller;
});

define([
	'require',
	'marionette'
], function(lrequire, Marionette)
{
	var controller = {

		initialize: function (options)
		{
			this.options = options;
		},

		/**
		 * Register new account
		 */
		create: function ()
		{
			var app = this.options.app;

			lrequire([
				'./model/account',
				'./view/createAccountView'
			], function(AccountModel, CreateAccountView)
			{
				var createAccountView = new CreateAccountView({
					app: app,
					model: new AccountModel()
				});

				app.root.currentView.page.show(createAccountView);
			});
		},

		/**
		 * Show a password reset form
		 */
		forgotPassword: function ()
		{
			var app = this.options.app;

			lrequire([
				'./view/forgotPasswordView'
			], function (ForgotPasswordView)
			{
				var forgotPasswordView = new ForgotPasswordView({app: app});

				app.root.currentView.page.show(forgotPasswordView);
			});
		},

		/**
		 * Show account view
		 */
		modify: function ()
		{
			var app = this.options.app;

			lrequire([
				'./model/account',
				'./view/modifyAccountView'
			], function (AccountModel, ModifyAccountView)
			{
				var data = {};

				if (app.user)
					data.id = app.user.id;

				var account = new AccountModel(data);

				account.fetch({
					success: function ()
					{
						var modifyAccountView = new ModifyAccountView({app: app, model: account});

						app.root.currentView.page.show(modifyAccountView);
					}
				});
			});
		},

		/**
		 * Show a reset password form
		 */
		resetPassword: function (id)
		{
			var app = this.options.app;

			lrequire([
				'./model/account',
				'./view/resetPasswordView'
			], function(AccountModel, ResetPasswordView)
			{
				var resetPasswordView = new ResetPasswordView({
					app: app,
					model: new AccountModel()
				});

				app.root.currentView.page.show(resetPasswordView);
			});
		}

	};

	return controller;
});

add method to show view for forgot password and reset password