Subversion-Projekte lars-tiefland.ci

Revision

Revision 756 | Revision 2004 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 756 Revision 2003
Zeile 1... Zeile 1...
1
<?php
1
<?php
Zeile 2... Zeile 2...
2
 
2
 
Zeile -... Zeile 3...
-
 
3
// $Id: weban_helper.php 2003 2017-02-01 20:27:30Z lars $
-
 
4
 
-
 
5
    if ( !defined( "CONTINUE_ON_ERROR" ) )
-
 
6
    {
-
 
7
        define( "CONTINUE_ON_ERROR", false );
-
 
8
    }
-
 
9
    if ( !defined( "CRON" ) )
-
 
10
    {
-
 
11
        if ( php_sapi_name() == "cli" )
-
 
12
        {
-
 
13
            define( "CRON", true );
-
 
14
        }
-
 
15
        else
-
 
16
        {
-
 
17
            define( "CRON", false );
-
 
18
        }
-
 
19
    }
-
 
20
 
-
 
21
    if ( !defined( "EOL" ) )
-
 
22
    {
-
 
23
        if ( php_sapi_name() == "cli" )
-
 
24
        {
-
 
25
            define( "EOL", "\n" );
-
 
26
        }
-
 
27
        else
-
 
28
        {
-
 
29
            define( "EOL", "<br>" );
3
// $Id: weban_helper.php 713 2016-09-29 17:39:30Z lars $
30
        }
4
 
31
    }
5
$GLOBALS['ci'] = &get_instance();
32
$GLOBALS['ci'] = &get_instance();
6
$GLOBALS['order_db'] = $GLOBALS['ci']->load->database('order_db', TRUE);
33
$GLOBALS['order_db'] = $GLOBALS['ci']->load->database('order_db', TRUE);
-
 
34
$GLOBALS['db_red'] = $GLOBALS['ci']->load->database('db_red', TRUE);
-
 
35
$GLOBALS['ci']->load->model('artikel_model', 'artikel');
-
 
36
$domain = "faltradxxs.de";
-
 
37
$GLOBALS["Eigenschaften"] = getVersandEigenschaften($domain);
Zeile 7... Zeile 38...
7
$GLOBALS['db_red'] = $GLOBALS['ci']->load->database('db_red', TRUE);
38
$GLOBALS["web_rechte"] = getWebRechte($domain);
8
$GLOBALS['ci']->load->model('artikel_model', 'artikel');
39
isWeban();
9
 
40
 
10
$GLOBALS["zahlsysteme"] = array(
41
$GLOBALS["zahlsysteme"] = array(
Zeile 69... Zeile 100...
69
 
100
 
70
function getVersandLaender()
101
function getVersandLaender()
71
{
102
{
72
	// ME: Länder raus, und die bit-Schiebeoperation ungestört durchzählen lasssen
103
	// ME: Länder raus, und die bit-Schiebeoperation ungestört durchzählen lasssen
73
	// LT: für Smarty umgebaut
-
 
74
	$domain = "faltradxxs.de";
-
 
75
	$GLOBALS["Eigenschaften"] = getVersandEigenschaften($domain);
-
 
76
	$GLOBALS["web_rechte"] = getWebRechte($domain);
104
	// LT: für Smarty umgebaut
77
	$forbiddenLands = array();
105
	$forbiddenLands = array();
78
	if (table_exists("bestelladresse", $GLOBALS["INI"]["dbConnect"]["order_db"]) &&
106
	if (table_exists("bestelladresse", $GLOBALS["INI"]["dbConnect"]["order_db"]) &&
79
		$GLOBALS["INI"]["modules"]["adresssystem"] == "neu")
107
		$GLOBALS["INI"]["modules"]["adresssystem"] == "neu")
80
	{
108
	{
Zeile 1203... Zeile 1231...
1203
		$gewicht += $artikel['gewicht'];
1231
		$gewicht += $artikel['gewicht'];
1204
	}
1232
	}
1205
	return $gewicht;
1233
	return $gewicht;
1206
}
1234
}
Zeile 1207... Zeile -...
1207
 
-
 
1208
?>
1235
 
-
 
1236
    /**
-
 
1237
     *
-
 
1238
     * definiert die Konstante IS_WEBAN
-
 
1239
     * diese wird auf "true" gesetzt, wenn ein Zugriff über mindestens einen der 
-
 
1240
     * folgende Wege erfolgt:
-
 
1241
     * 
-
 
1242
     * 1. über die öffentliche IP der Firma
-
 
1243
     * 2. Mit dem Benutzernamen "admin"
-
 
1244
     * 3. aus dem lokalen Netz der Firma
-
 
1245
     *
-
 
1246
     */
-
 
1247
 
-
 
1248
    function isWeban()
-
 
1249
    {
-
 
1250
        $webanIP = "89.245.130.99";
-
 
1251
        if ( !defined( "IS_WEBAN" ) )
-
 
1252
        {
-
 
1253
            if ( ( isset( $_SERVER["REMOTE_ADDR"] ) && $_SERVER["REMOTE_ADDR"] ==
-
 
1254
                $webanIP ) || ( isset( $_SERVER["PHP_AUTH_USER"] ) && $_SERVER["PHP_AUTH_USER"] ==
-
 
1255
                "admin" ) || ( isset( $_SERVER["REMOTE_ADDR"] ) && preg_match( "/192\.168\.0/",
-
 
1256
                $_SERVER["REMOTE_ADDR"] ) ) || CRON === true )
-
 
1257
            {
-
 
1258
                define( "IS_WEBAN", true );
-
 
1259
            }
-
 
1260
            else
-
 
1261
            {
-
 
1262
                define( "IS_WEBAN", false );
-
 
1263
            }
-
 
1264
        }
-
 
1265
    }
-
 
1266
    function admin_debug( $var, $die = false )
-
 
1267
    {
-
 
1268
        if ( IS_WEBAN === true )
-
 
1269
        {
-
 
1270
            echo EOL . "Admin-Debug:" . EOL;
-
 
1271
            var_dump( $var );
-
 
1272
            if ( $die === true )
-
 
1273
            {
-
 
1274
                die();
-
 
1275
            }
-
 
1276
        }
-
 
1277
        else
-
 
1278
        {
-
 
1279
            //mail( "ltiefland@gmail.com", "Fehler auf " . __SHOP__, var_export( $var, true ) );
-
 
1280
        }
-
 
1281
    }
-
 
1282
?>