/**********************************************************************************
* nWordPress is an automated migration of WordPress 2.5.1 performed by Numiton.
*
* copyright : (C) 2008 Numiton - www.numiton.com
* email : numiton@users.sourceforge.net
*
* $Id: Wp_passPage.java,v 1.3 2008/10/14 13:15:49 numiton Exp $
*
**********************************************************************************/
/**********************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
**********************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
package org.numiton.nwp;
import static com.numiton.VarHandling.*;
import static com.numiton.generic.PhpWeb.*;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.numiton.nwp.wp_includes.FunctionsPage;
import org.numiton.nwp.wp_includes.PluggablePage;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.numiton.DateTime;
import com.numiton.Network;
import com.numiton.Options;
import com.numiton.generic.PhpWebEnvironment;
import com.numiton.string.Strings;
@Controller
@Scope("request")
public class Wp_passPage extends NumitonController {
protected static final Logger LOG = Logger.getLogger(Wp_passPage.class.getName());
@Override
@RequestMapping("/wp-pass.php")
public ModelAndView execute(HttpServletRequest javaRequest, HttpServletResponse javaResponse) throws IOException {
return super.execute(javaRequest, javaResponse);
}
@Override
public String getViewName() {
return "wp_pass";
}
public Object generateContent(PhpWebEnvironment webEnv) throws IOException, ServletException {
/* Start of block */
super.startBlock("__wp_pass_block1");
gVars.webEnv = webEnv;
/* Condensed dynamic construct: 513604 */require(gVars, gConsts, Wp_configPage.class);
if (booleanval(Options.get_magic_quotes_gpc(gVars.webEnv))) {
gVars.webEnv._POST.putValue("post_password", Strings.stripslashes(gVars.webEnv, strval(gVars.webEnv._POST.getValue("post_password"))));
}
// 10 days
Network.setcookie(gVars.webEnv, "wp-postpass_" + gConsts.getCOOKIEHASH(), strval(gVars.webEnv._POST.getValue("post_password")), DateTime.time() + 864000, gConsts.getCOOKIEPATH());
getIncluded(PluggablePage.class, gVars, gConsts).wp_safe_redirect(getIncluded(FunctionsPage.class, gVars, gConsts).wp_get_referer(), 302);
return DEFAULT_VAL;
}
}