]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-config_removeip.php
Some language strings fixed, renamed. Copyright notice updated
[mailer.git] / inc / modules / admin / what-config_removeip.php
index e4cf68b01a5a1d28b831bcfd2825f3f28a53f977..faf1a07a775a0b9bc5dbe15f03f9f5bda5b0f912 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 10/01/2008 *
- * ================                             Last change: 10/01/2008 *
+ * Mailer v0.2.1-FINAL                                Start: 10/01/2008 *
+ * ===================                          Last change: 10/01/2008 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : what-config_removeip.php                         *
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Konfiguration des Caching-Systems                *
  * -------------------------------------------------------------------- *
- * $Revision:: 856                                                    $ *
+ * $Revision::                                                        $ *
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  ************************************************************************/
 
 // Some security stuff...
-if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
-       require($INC);
-}
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+       die();
+} // END - if
 
 // Add description as navigation point
-ADD_DESCR("admin", __FILE__);
+addYouAreHereLink('admin', __FILE__);
 
-if (IS_FORM_SENT()) {
+if (isFormSent()) {
        // Save configuration
-       ADMIN_SAVE_SETTINGS_POST();
+       adminSaveSettingsFromPostData();
 } else {
        // Prepare data
-       switch (getConfig('removeip_anon_ip')) {
-               case "Y":
-                       define('__CFG_REMOVEIP_ANON_IP_Y', " checked=\"checked\"");
-                       define('__CFG_REMOVEIP_ANON_IP_N', "");
-                       break;
-
-               case "N":
-                       define('__CFG_REMOVEIP_ANON_IP_Y', "");
-                       define('__CFG_REMOVEIP_ANON_IP_N', " checked=\"checked\"");
-                       break;
-       } // END - switch
-
-       switch (getConfig('removeip_anon_host')) {
-               case "Y":
-                       define('__CFG_REMOVEIP_ANON_HOST_Y', " checked=\"checked\"");
-                       define('__CFG_REMOVEIP_ANON_HOST_N', "");
-                       break;
-
-               case "N":
-                       define('__CFG_REMOVEIP_ANON_HOST_Y', "");
-                       define('__CFG_REMOVEIP_ANON_HOST_N', " checked=\"checked\"");
-                       break;
-       } // END - switch
-
-       switch (getConfig('removeip_anon_ua')) {
-               case "Y":
-                       define('__CFG_REMOVEIP_ANON_UA_Y', " checked=\"checked\"");
-                       define('__CFG_REMOVEIP_ANON_UA_N', "");
-                       break;
-
-               case "N":
-                       define('__CFG_REMOVEIP_ANON_UA_Y', "");
-                       define('__CFG_REMOVEIP_ANON_UA_N', " checked=\"checked\"");
-                       break;
-       } // END - switch
-
-       switch (getConfig('removeip_anon_ref')) {
-               case "Y":
-                       define('__CFG_REMOVEIP_ANON_REF_Y', " checked=\"checked\"");
-                       define('__CFG_REMOVEIP_ANON_REF_N', "");
-                       break;
-
-               case "N":
-                       define('__CFG_REMOVEIP_ANON_REF_Y', "");
-                       define('__CFG_REMOVEIP_ANON_REF_N', " checked=\"checked\"");
-                       break;
-       } // END - switch
-
-       switch (getConfig('removeip_admin_show')) {
-               case "Y":
-                       define('__CFG_REMOVEIP_ADMIN_SHOW_Y', " checked=\"checked\"");
-                       define('__CFG_REMOVEIP_ADMIN_SHOW_N', "");
-                       break;
-
-               case "N":
-                       define('__CFG_REMOVEIP_ADMIN_SHOW_Y', "");
-                       define('__CFG_REMOVEIP_ADMIN_SHOW_N', " checked=\"checked\"");
-                       break;
-       } // END - switch
-
-       switch (getConfig('removeip_guest_show')) {
-               case "Y":
-                       define('__CFG_REMOVEIP_GUEST_SHOW_Y', " checked=\"checked\"");
-                       define('__CFG_REMOVEIP_GUEST_SHOW_N', "");
-                       break;
-
-               case "N":
-                       define('__CFG_REMOVEIP_GUEST_SHOW_Y', "");
-                       define('__CFG_REMOVEIP_GUEST_SHOW_N', " checked=\"checked\"");
-                       break;
-       } // END - switch
-
-       switch (getConfig('removeip_member_show')) {
-               case "Y":
-                       define('__CFG_REMOVEIP_MEMBER_SHOW_Y', " checked=\"checked\"");
-                       define('__CFG_REMOVEIP_MEMBER_SHOW_N', "");
-                       break;
-
-               case "N":
-                       define('__CFG_REMOVEIP_MEMBER_SHOW_Y', "");
-                       define('__CFG_REMOVEIP_MEMBER_SHOW_N', " checked=\"checked\"");
-                       break;
-       } // END - switch
-
-       switch (getConfig('removeip_sponsor_show')) {
-               case "Y":
-                       define('__CFG_REMOVEIP_SPONSOR_SHOW_Y', " checked=\"checked\"");
-                       define('__CFG_REMOVEIP_SPONSOR_SHOW_N', "");
-                       break;
-
-               case "N":
-                       define('__CFG_REMOVEIP_SPONSOR_SHOW_Y', "");
-                       define('__CFG_REMOVEIP_SPONSOR_SHOW_N', " checked=\"checked\"");
-                       break;
-       } // END - switch
-
-       switch (getConfig('anonymous_ip')) {
-               case "127.0.0.1":
-                       define('__CFG_ANONYMOUS_IP_LOCAL' , " selected=\"selected\"");
-                       define('__CFG_ANONYMOUS_IP_ZERO'  , "");
-                       define('__CFG_ANONYMOUS_IP_RANDOM', "");
-                       break;
-
-               case "0.0.0.0":
-                       define('__CFG_ANONYMOUS_IP_LOCAL' , "");
-                       define('__CFG_ANONYMOUS_IP_ZERO'  , " selected=\"selected\"");
-                       define('__CFG_ANONYMOUS_IP_RANDOM', "");
-                       break;
-
-               case "RANDOM":
-                       define('__CFG_ANONYMOUS_IP_LOCAL' , "");
-                       define('__CFG_ANONYMOUS_IP_ZERO'  , "");
-                       define('__CFG_ANONYMOUS_IP_RANDOM', " selected=\"selected\"");
-                       break;
-       } // END - switch
+       foreach (array('removeip_anon_ip','removeip_anon_host','removeip_anon_ua','removeip_anon_ref','removeip_admin_show','removeip_guest_show','removeip_member_show','removeip_sponsor_show') as $entry) {
+               $content[$entry . '_y'] = '';
+               $content[$entry . '_n'] = '';
+               $content[$entry . '_' . strtolower(getConfig($entry))] = ' selected="selected"';
+       } // END - if
+
+       // Prepare more entries
+       foreach (array('anonymous_ip_local','anonymous_ip_zero','anonymous_ip_random') as $entry) {
+               $content[$entry] =  '';
+       } // END - foreach
+
+       // Set default selections
+       foreach (array('anonymous_ip') as $entry) {
+               $content[$entry . '_' . strtolower(getConfig($entry))] = ' selected="selected"';
+       } // END - foreach
 
        // Load template
-       LOAD_TEMPLATE("admin_config_removeip");
+       loadTemplate('admin_config_removeip', false, $content);
 }
-//
+
+// [EOF]
 ?>