/* * Copyright 2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.wamblee.photos.tapestry; import org.apache.tapestry.IRequestCycle; /** * Page for changing the password. */ public class EditProfilePage extends PhotosProtectedPage { public static String PAGE_NAME = "EditProfile"; private String _message; private String _oldPassword; private String _newPassword1; private String _newPassword2; public EditProfilePage() { initializeImpl(); } /* (non-Javadoc) * @see org.apache.tapestry.AbstractPage#initialize() */ @Override protected void initialize() { super.initialize(); initializeImpl(); } private void initializeImpl() { _message = ""; _oldPassword = ""; _newPassword1 = ""; _newPassword2 = ""; } public String getMessage() { return _message; } public void setMessage(String aMessage) { _message = aMessage; } /** * @return Returns the _newPassword1. */ public String getNewPassword1() { return _newPassword1; } /** * @param aPassword The _newPassword1 to set. */ public void setNewPassword1(String aPassword) { _newPassword1 = aPassword; } /** * @return Returns the _newPassword2. */ public String getNewPassword2() { return _newPassword2; } /** * @param aPassword The _newPassword2 to set. */ public void setNewPassword2(String aPassword) { _newPassword2 = aPassword; } /** * @return Returns the _oldPassword. */ public String getOldPassword() { return _oldPassword; } /** * @param aPassword The _oldPassword to set. */ public void setOldPassword(String aPassword) { _oldPassword = aPassword; } public void changePassword(IRequestCycle aCycle) { setMessage( getVisit().changePassword(aCycle, getOldPassword(), getNewPassword1(), getNewPassword2()) ); setOldPassword(""); setNewPassword1(""); setNewPassword2(""); } }