Tutorials/en/maintenance-mode

With this neat module you can access the frontend by simply adding "?user=admin_user_name&amp;pass=admin_password" as URL parameters. This module can as well be used when doing some maintenance in a running system.

Save the following code as "modules/powertemplate/pt_oxcmp_shop/pt_oxcmp_shop.php" and activate the module by adding "oxcmp_shop =&gt; powertemplate/pt_oxcmp_shop/pt_oxcmp_shop" in the modules section ain the backend.

&lt;?php /** *   This file is part of OXID eShop Community Edition. * *   OXID eShop Community Edition 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 3 of the License, or *    (at your option) any later version. * *   OXID eShop Community Edition is distributed in the hope that it will be useful, *   but WITHOUT ANY WARRANTY; without even the implied warranty of *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *   GNU General Public License for more details. * *   You should have received a copy of the GNU General Public License *   along with OXID eShop Community Edition. If not, see &lt;http://www.gnu.org/licenses/&gt;. * * @link http://www.oxid-esales.com * @package views * @copyright (C) OXID eSales AG 2003-2009 * @version OXID eShop CE * $Id: oxcmp_shop.php 16306 2009-02-05 10:28:05Z rimvydas.paskevicius $ * * Modified by Avenger to allow admin logins to front-end for inactive shops * * @copyright (C) Avenger 2010 * @version OXID eShop CE * $Id: pt_oxcmp_shop.php 1702 2010-02-04 06:22:13Z avenger $ * * Activate with: oxcmp_shop =&gt; powertemplate/pt_oxcmp_shop/pt_oxcmp_shop */

/** * Translarent shop manager (executed automatically), sets * registration information and current shop object. * @subpackage oxcmp */ class pt_oxcmp_shop extends pt_oxcmp_shop_parent { /**   * Marking object as component * @var bool */ protected $_blIsComponent = true;

/** * Executes parent::render and returns active shop object. * * @return  object  $this-&gt;oActShop active shop object */ public function render {   //Avenger $myConfig = $this-&gt;getConfig; // is shop active? $oShop = $myConfig-&gt;getActiveShop; if (!$oShop-&gt;oxshops__oxactive-&gt;value &amp;&amp; !$this-&gt;isAdmin &amp;&amp; 'oxstart' != $myConfig-&gt;getActiveView-&gt;getClassName) {     $logged_in=false; $sUser=$_GET['user']; $sPassword=$_GET['pass']; if ($sUser &amp;&amp; $sPassword) {       $_GET['lgn_usr']=$sUser ; $_GET['lgn_pwd']=$sPassword; $oUser=oxnew('oxcmp_user'); $logged_in=$oUser-&gt;login($sUser, $sPassword); $logged_in=$logged_in&lt;&gt;'user'; $_SESSION['logged_in']=$logged_in; }     else {       $logged_in=$_SESSION['logged_in']; }     if (!$logged_in) {       oxUtils::getInstance-&gt;redirect( 'offline.html',false,302); //Use alternate template for maintenance announcement //oxUtils::getInstance-&gt;redirect( 'maintenance.html',false,302); }   }    $sShopLogo = $myConfig-&gt;getConfigParam( 'sShopLogo' ); if ( $sShopLogo &amp;&amp; file_exists( $myConfig-&gt;getAbsImageDir.'/'.$sShopLogo ) ) {     $this-&gt;_oParent-&gt;setShopLogo($sShopLogo); // Passing to view. Left for compatibility reasons for a while. Will be removed in future $this-&gt;_oParent-&gt;addTplParam( 'shoplogo', $this-&gt;_oParent-&gt;getShopLogo ); }   //Avenger return $oShop; } } ?&gt; Now you can set your shop as "offline" by unchecking "active" in the backend. While your visitors can not access the shop, you can by adding "?user=admin_user_name&amp;pass=admin_password" to your shop URL. Your visitors will be redirected to "offline.html" automatically.

If you want to design a seperate page for the maintenance-information, you can change following code-lines from: oxUtils::getInstance-&gt;redirect( 'offline.html',false,302); //Use alternate template for maintenance announcement //oxUtils::getInstance-&gt;redirect( 'maintenance.html',false,302); simply to //oxUtils::getInstance-&gt;redirect( 'offline.html',false,302); //Use alternate template for maintenance announcement oxUtils::getInstance-&gt;redirect( 'maintenance.html',false,302); Now all visitors get redirected to maintenance.html which you can design according to your needs.

According to the forums thread http://www.oxid-esales.com/forum/showthread.php?t=4389&amp;page=2#post73751 this module is working as well in actual 4.5.x versions.

Thanks to Avenger for sharing!