Zurück   xt:Commerce Webshop Shop Support > xt:Commerce Shopsoftware Community Area > Shopbereich

Antwort
 
LinkBack Themen-Optionen Ansicht
  #1 (permalink)  
Alt 17.04.2005, 12:26
 
Registriert seit: 04.10.2004
Beiträge: 269
Standard

Ich habe eine neue Contribution "Down for Maintenance" bereit gestellt.

Damit kann der Admin das System w?hrend einer Wartungspahes gegen Zugriffe sperren.

Entsprechende Vorwarnhinweis k?nnen vor Beginn der Wartungsphase ebenfalls ausgegeben werden.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #2 (permalink)  
Alt 19.04.2005, 13:33
Benutzerbild von grandpiano  
Registriert seit: 29.01.2005
Beiträge: 120
Standard

Hallo,
ich habe das Modul ins das v3.0.3 eingebaut.
Nun habe ich damit folgendes Problem.

Setze ich "Vor der Wartungsabschaltung eine WARNUNG anzeigen" auf true, dann erhalte ich folgende Fehlermeldung, wenn ich mich ins Admin Menue einloggen will.

Fatal error: Call to undefined function: xtc_output_warning() in /www/htdocs/erotikdr/inc/down_for_maintenance.php on line 56

Die Zeile 56 sieht so aus:

xtc_output_warning($ErrorMessage);

Habe hier auch den kompletten Code.
Code:
<?php
// W. Kaiser BOF: Down for Maintenance except for admin ip or admin password
// Check for "Down for Maintenance" and allow processing or not

if (DOWN_FOR_MAINTENANCE == 'true')
{
	if (!$_SESSION['allowmaintenance']) 
	{
 ?// set the WARN_BEFORE_DOWN_FOR_MAINTENANCE to false if DOWN_FOR_MAINTENANCE = true
 ?if (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true')
 ?{
 ?	xtc_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = 'false', last_modified = '
 ? ? ?now()' where configuration_key = 'WARN_BEFORE_DOWN_FOR_MAINTENANCE'"); 
 ?}
 ?//Check if user is allowed to work
 ?$RemoteAdress=getenv('REMOTE_ADDR');
 ?if ($RemoteAdress == EXCLUDE_ADMIN_IP_FOR_MAINTENANCE)
 ?{
 ?	// ADMIN_IP --> Allow working
 ?}
 ?elseif ($_GET['allowmaintenance'] == ADMIN_PASSWORD_FOR_MAINTENANCE)
 ?{
 ?	// "allowmaintenance"-password --> Allow working
 ?}
 ?elseif ($RemoteAdress == "127.0.0.1")
 ?{
 ?	// Local system --> Allow working
 ?}
 ?else
 ?{
 ?	// No special user --> Show info
 ? ? ?xtc_redirect(xtc_href_link(FILENAME_DOWN_FOR_MAINTENANCE, '', 'NONSSL'));
	
 ?}
 ?$_SESSION['allowmaintenance']=true;
	}
	$ErrorMessage = TEXT_ADMIN_DOWN_FOR_MAINTENANCE;
}
elseif (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true') 
{
	$ErrorMessage = TEXT_BEFORE_DOWN_FOR_MAINTENANCE;
}
if ($ErrorMessage != '') 
{
	$IsAdminFunction = strpos($_SERVER['REQUEST_URI'],'/admin/') > 0;
	if (PERIOD_DOWN_FOR_MAINTENANCE != '') 
	{
 ?$ErrorMessage .= " (" . DOWN_FOR_MAINTENANCE_NAME . ' ' . ltrim(PERIOD_DOWN_FOR_MAINTENANCE).")";
	}
	if ($IsAdminFunction) 
	{
 ?$messageStack->add($ErrorMessage, 'warning');
	}
	else 
	{
 ?xtc_output_warning($ErrorMessage);
	}
}

// ?W. Kaiser EOF: WebMakers.com Added: Down for Maintenance
?>
Ich hoffe das Ihr bei meinem Problem helfen k?nnt.

Gru?
Grandpiano

P.S. Habe mein Problem auch nochmal im Sponsoren Bereich gepostet aber leider noch keine Antwort. :cry:
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #3 (permalink)  
Alt 19.04.2005, 14:31
Erfahrener Benutzer
 
Registriert seit: 11.02.2005
Beiträge: 1.956
Standard

Zitat:
Originally posted by grandpiano@Apr 19 2005, 14:33 PM
Hallo,
ich habe das Modul ins das v3.0.3 eingebaut.
Nun habe ich damit folgendes Problem.

Setze ich "Vor der Wartungsabschaltung eine WARNUNG anzeigen" auf true, dann erhalte ich folgende Fehlermeldung.

Fatal error: Call to undefined function: xtc_output_warning() in /www/htdocs/erotikdr/inc/down_for_maintenance.php on line 56

Die Zeile 56 sieht so aus:

xtc_output_warning($ErrorMessage);

Habe hier auch den kompletten Code.
Code:
<?php
// W. Kaiser BOF: Down for Maintenance except for admin ip or admin password
// Check for "Down for Maintenance" and allow processing or not

if (DOWN_FOR_MAINTENANCE == 'true')
{
	if (!$_SESSION['allowmaintenance']) 
	{
 // set the WARN_BEFORE_DOWN_FOR_MAINTENANCE to false if DOWN_FOR_MAINTENANCE = true
 if (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true')
 {
 	xtc_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = 'false', last_modified = '
   now()' where configuration_key = 'WARN_BEFORE_DOWN_FOR_MAINTENANCE'"); 
 }
 //Check if user is allowed to work
 $RemoteAdress=getenv('REMOTE_ADDR');
 if ($RemoteAdress == EXCLUDE_ADMIN_IP_FOR_MAINTENANCE)
 {
 	// ADMIN_IP --> Allow working
 }
 elseif ($_GET['allowmaintenance'] == ADMIN_PASSWORD_FOR_MAINTENANCE)
 {
 	// "allowmaintenance"-password --> Allow working
 }
 elseif ($RemoteAdress == "127.0.0.1")
 {
 	// Local system --> Allow working
 }
 else
 {
 	// No special user --> Show info
   xtc_redirect(xtc_href_link(FILENAME_DOWN_FOR_MAINTENANCE, '', 'NONSSL'));
	
 }
 $_SESSION['allowmaintenance']=true;
	}
	$ErrorMessage = TEXT_ADMIN_DOWN_FOR_MAINTENANCE;
}
elseif (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true') 
{
	$ErrorMessage = TEXT_BEFORE_DOWN_FOR_MAINTENANCE;
}
if ($ErrorMessage != '') 
{
	$IsAdminFunction = strpos($_SERVER['REQUEST_URI'],'/admin/') > 0;
	if (PERIOD_DOWN_FOR_MAINTENANCE != '') 
	{
 $ErrorMessage .= " (" . DOWN_FOR_MAINTENANCE_NAME . ' ' . ltrim(PERIOD_DOWN_FOR_MAINTENANCE).")";
	}
	if ($IsAdminFunction) 
	{
 $messageStack->add($ErrorMessage, 'warning');
	}
	else 
	{
 xtc_output_warning($ErrorMessage);
	}
}

// W. Kaiser EOF: WebMakers.com Added: Down for Maintenance
?>
Ich hoffe das Ihr bei meinem Problem helfen k?nnt.

Gru?
Grandpiano

P.S. Habe mein Problem auch nochmal im Sponsoren Bereich gepostet aber leider noch keine Antwort. :cry:
Ist das nicht eigentlich nur f?r die 2er Version passend?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #4 (permalink)  
Alt 19.04.2005, 14:58
Benutzerbild von grandpiano  
Registriert seit: 29.01.2005
Beiträge: 120
Standard

Ja richtig, es ist f?r die V2. Aber ich wollte das Modul in die v3 ?bernehmen.
Ich denke mal das es nur um einen kleinen Fehler handelt.
F?r jede Hilfe bin ich Dankbar.

Gru?
Grandpiano
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #5 (permalink)  
Alt 20.04.2005, 06:20
 
Registriert seit: 04.10.2004
Beiträge: 269
Standard

Zitat:
Originally posted by grandpiano@Apr 19 2005, 14:58 PM
Ja richtig, es ist f?r die V2. Aber ich wollte das Modul in die v3 ?bernehmen.
Ich denke mal das es nur um einen kleinen Fehler handelt.
F?r jede Hilfe bin ich Dankbar.

Gru?
Grandpiano
Gibt es in der V3 die Funktion "xtc_output_warning" ("inc/xtc_output_warning.inc.php")?

Offenbar nicht, wie die Fehlermeldung zeigt. In der V3 schein die "Warnungsausgabe" anders gel?st zu sein.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #6 (permalink)  
Alt 20.04.2005, 12:03
Benutzerbild von grandpiano  
Registriert seit: 29.01.2005
Beiträge: 120
Standard

Hi,
in der V3 gibt es die Datei im INC Ordner. Hier mal der Code:

Code:
<?php
/* -----------------------------------------------------------------------------------------
 ? $Id: xtc_output_warning.inc.php,v 1.1 2003/09/06 21:47:50 fanta2k Exp $ ? 

 ? XT-Commerce - community made shopping
 ? http://www.xt-commerce.com

 ? Copyright (c) 2003 XT-Commerce
 ? -----------------------------------------------------------------------------------------
 ? based on: 
 ? (c) 2000-2001 The Exchange Project ?(earlier name of osCommerce)
 ? (c) 2002-2003 osCommerce(general.php,v 1.225 2003/05/29); www.oscommerce.com 
 ? (c) 2003 ?nextcommerce (xtc_output_warning.inc.php,v 1.3 2003/08/13); www.nextcommerce.org
 ? 
 ? Released under the GNU General Public License 
 ? ---------------------------------------------------------------------------------------*/
 ? 
 ?function xtc_output_warning($warning) {
 ? ?new errorBox(array(array('text' => xtc_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . ' ' . $warning)));
 ?}

 ?>
Hast Du ne Idee woran mein Problem liegt?

Gru?
Grandpiano
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #7 (permalink)  
Alt 21.04.2005, 06:00
 
Registriert seit: 04.10.2004
Beiträge: 269
Standard

Es k?nnte sein, dass in der V3 "xtc_output_warning" noch nicht definiert ist.

Versuche doch mal in "admin\includes\header.php"

vor

Code:
	include(DIR_FS_INC . FILENAME_DOWN_FOR_MAINTENANCE);
Code:
	require_once(DIR_FS_INC . 'xtc_output_warning.inc.php');
einzuf?gen.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #8 (permalink)  
Alt 21.04.2005, 07:41
Benutzerbild von grandpiano  
Registriert seit: 29.01.2005
Beiträge: 120
Standard

nun erhalte ich diesen Fehler:

Fatal error: Cannot instantiate non-existent class: errorbox in /www/htdocs/erotikdr/inc/xtc_output_warning.inc.php on line 19
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #9 (permalink)  
Alt 21.04.2005, 09:16
 
Registriert seit: 04.10.2004
Beiträge: 269
Standard

V3 und V2 sind hier wohl zu unterschiedlich. Macht keinen Sinn, das weiter zu verfolgen..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
  #10 (permalink)  
Alt 21.04.2005, 11:52
Benutzerbild von grandpiano  
Registriert seit: 29.01.2005
Beiträge: 120
Standard

Ich habe einfach im Admin/header.php entfernt. Ohne diese Meldung im Admin Menue kann ich auch mit leben. Es geht aber jetzt.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!
Mit Zitat antworten
Antwort

Lesezeichen

Stichworte
contribution, down for maintenance

Themen-Optionen
Ansicht

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are aus
Pingbacks are aus
Refbacks are aus



Alle Zeitangaben in WEZ +1. Es ist jetzt 22:17 Uhr.

Copyright © 2011 xt:Commerce GmbH / xt:Commerce International Ltd. - All Rights Reserved

xt:Commerce is a SafeCharge brand