Projekt

Allgemein

Profil

Revision 2

Unterschiede anzeigen:

admin/includes/modules/customers_edit.php
85 85
        <div class="formAreaC">
86 86
          <table class="tableConfig borderall">
87 87
            <?php
88
            
89
            <?php
90
            # TESTMODUS
91
             	if($_GET['cID'] == $_SESSION['customer_id']){
92
            ?> 
93
            <tr>
94
              <td class="dataTableConfig col-left">Testmodus&nbsp;(IP):</td>
95
              <td class="dataTableConfig col-single-right">
96
                <?php       
97
                 	echo xtc_draw_checkbox_field('ip_testmodus', 1, ($cInfo->ip_testmodus == $_SERVER['REMOTE_ADDR']));
98
                ?>
99
              </td>
100
            </tr>
101
            <?php
102
             	}
103
            ?> 
104
            
105
            
88 106
              if (ACCOUNT_GENDER == 'true') {
89 107
            ?>
90 108
            <tr>
admin/includes/application_top.php
32 32
//Run Mode
33 33
define('RUN_MODE_ADMIN',true);
34 34

  
35
# TESTMODUS
36
if (file_exists('../includes/extra/testmodus/testmodus.php'))
37
 require_once('../includes/extra/testmodus/testmodus.php');
38
 
35 39
// Start the clock for the page parse time log
36 40
define('PAGE_PARSE_START_TIME', microtime(true));
37 41

  
admin/includes/column_left.php
232 232
    }
233 233
echo endMenue(BOX_HEADING_CONFIGURATION2);
234 234

  
235
# TESTMODUS
236
if(TESTMODUS){
237
  echo '<li class="dataNavHeadingContent"><a href="#"><strong style="color: yellow">!- TESTMODUS -!</strong></a></li>';
238
}
239

  
235 240
echo '</ul>'; 
236 241
echo '</div>';
237 242

  
admin/customers.php
578 578
            $sql_data_array['customers_dob'] = xtc_date_raw($customers_dob);
579 579
          }
580 580

  
581
          # TESTMODUS
582
          if(isset($_POST['ip_testmodus'])) {
583
            $sql_data_array['ip_testmodus'] = $_SERVER['REMOTE_ADDR'];
584
          }                              
585

  
581 586
          xtc_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '".$customers_id."' AND customers_default_address_id = '".$address_book_id."'");
582 587

  
588
          # TESTMODUS
589
          $ip_query = xtc_db_query("select ip_testmodus from ".TABLE_CUSTOMERS." where ip_testmodus != ''");
590
          if($fp =   @fopen(DIR_FS_DOCUMENT_ROOT . "includes/testmodus.csv", "w")){
591
            while($ips = xtc_db_fetch_array($ip_query)){
592
              if(isset($_POST['ip_testmodus']) || $ips['ip_testmodus'] != $_SERVER['REMOTE_ADDR']) 
593
                    fwrite($fp, $ips['ip_testmodus']."\n");
594
            }
595
            fclose($fp);          
596
          }
597

  
583 598
          xtc_db_query("UPDATE ".TABLE_CUSTOMERS_INFO."
584 599
                           SET customers_info_date_account_last_modified = now()
585 600
                         WHERE customers_info_id = '".$customers_id."'");
inc/xtc_php_mail.inc.php
34 34
  require_once(DIR_FS_INC.'xtc_not_null.inc.php');
35 35
  require_once(DIR_FS_INC.'parse_multi_language_value.inc.php');
36 36
  
37
  # TESTMODUS
38
  if(defined('TESTMODUS') && TESTMODUS && EMAIL_CATCH_ALL){
39
    $email_subject = str_replace("::", "::(Testmodus: Umleitung von $to_email_address) - ", $email_subject);
40
    $to_email_address = EMAIL_CATCH_ALL;
41
    $forwarding_to = EMAIL_CATCH_ALL;
42
  }  
43
  
37 44
  // includes main class
38 45
  if (!is_object($main)) {
39 46
    require_once(DIR_FS_CATALOG.'includes/classes/main.php');
includes/extra/testmodus/testmodus.php
1
<?php
2

  
3
if(!defined('DB_SERVER')){
4

  
5
    define('DIR_FS_DOCUMENT_ROOT', '/homepages/123/456789/htdocs/');
6
    
7
    $testfile = 'includes/testmodus.csv';
8
    $path = HTTP_SERVER . DIR_WS_CATALOG;
9

  
10
    if(is_file(DIR_FS_DOCUMENT_ROOT.$testfile)) {
11
      if(constant("RUN_MODE_ADMIN") && RUN_MODE_ADMIN){
12
        $testfile = '../'.$testfile;
13
      }
14
      $arr_testmodus = file($testfile);
15
      foreach ($arr_testmodus as $line => $ip) {
16
        if($_SERVER["REMOTE_ADDR"] == trim($ip))
17
          $pass_testmodus = true;    
18
      }
19
    }
20
    
21
    # abweichende DB oder Einstellungen (> Konstanten) im Testmodus
22
    if($pass_testmodus){
23
      define('TESTMODUS', true);
24
      define('EMAIL_CATCH_ALL', 'post123@post.net'); 
25
      
26
      # abweichende DB 
27
      define('DB_SERVER', 'db123.hosting-data.io');
28
      define('DB_SERVER_USERNAME', 'db123');  
29
      define('DB_DATABASE', 'db123');
30
      define('DB_SERVER_PASSWORD', 'pw');  
31
      
32
      # abweichende Einstellungen 
33
      # define('USE_CACHE', false);
34
      # define('DB_CACHE', false);
35

  
36
      # abweichende Einstellungen Backend
37
      if(constant("RUN_MODE_ADMIN") && RUN_MODE_ADMIN){
38
       
39
      }            
40
    }
41
    
42
}  
43

  
44
define('TESTMODUS', false);
45
define('EMAIL_CATCH_ALL', false); 
46

  
47
?>
includes/header/header_body/testmodus.php
1
<?php
2
# TESTMODUS
3
if(TESTMODUS){
4
?>
5
<style>
6
.testmodus {
7
	width: 100%;
8
	text-align: center;
9
	line-height: 30px;
10
	color: yellow;
11
	background: #AF417E;
12
	font-weight: bold;
13
}
14
</style>
15

  
16
<?php
17
  echo '<div class="testmodus">!- TESTMODUS -!</div>';  
18
}            
19
?>
includes/application_top.php
33 33
  include_once ('includes/xss_secure.php');
34 34
}
35 35

  
36
# TESTMODUS
37
if (file_exists('includes/extra/testmodus/testmodus.php'))
38
 require_once('includes/extra/testmodus/testmodus.php');
39
 
36 40
// start the timer for the page parse time log
37 41
define('PAGE_PARSE_START_TIME', microtime(true));
38 42

  

Auch abrufbar als: Unified diff