]> git.mxchange.org Git - mailer.git/commitdiff
Fixes for installation mode
authorquix0r <quix0r@mxchange.org>
Sun, 21 Sep 2008 21:17:37 +0000 (21:17 +0000)
committerquix0r <quix0r@mxchange.org>
Sun, 21 Sep 2008 21:17:37 +0000 (21:17 +0000)
13 files changed:
inc/databases.php
inc/extensions.php
inc/functions.php
inc/header.php
inc/install-inc.php
inc/language/surfbar_de.php
inc/libs/surfbar_functions.php
inc/load_extensions.php
inc/modules/admin.php
inc/mysql-connect.php
inc/mysql-manager.php
inc/stylesheet.php
inc/theme-manager.php

index a441f85285beff0aacc92ac4d5b03185997fa823..542f5afa3d66b7f998f508ef99cfc304b7321747 100644 (file)
@@ -113,7 +113,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "382");
+define('CURR_SVN_REVISION', "383");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index 84506151e18d3cfb4ccb897df18e80c8048d8cc1..3973f4132afb746d5403111617ac69ccaf6819dc 100644 (file)
@@ -319,7 +319,7 @@ function EXT_IS_ACTIVE ($ext_name) {
        global $cacheArray, $_CONFIG;
 
        // Extensions are all inactive during installation
-       if ((!defined('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (empty($ext_name))) return false;
+       if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (empty($ext_name))) return false;
 
        // Not active is the default
        $active = "N";
@@ -368,7 +368,7 @@ function GET_EXT_VERSION ($ext_name) {
        $ret = false;
 
        // Extensions are all inactive during installation
-       if ((!defined('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return "";
+       if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return "";
        //* DEBUG: */ echo __FUNCTION__.": ext_name={$ext_name}<br />\n";
 
        // Is the cache written?
index c4a1171f000d79c4da5f9fa29ba3a6243ebf7700..90fc0dfde3e87117f9f8a45150cf6e93a6766355 100644 (file)
@@ -321,7 +321,7 @@ function LOAD_TEMPLATE($template, $return=false, $content="") {
 
                // Add surrounding HTML comments to help finding bugs faster
                $ret = "<!-- Template ".$template." - Start -->\n".$ret."<!-- Template ".$template." - End -->\n";
-       } elseif ((IS_ADMIN()) || ((isBooleanConstantAndTrue('mxchange_installing')) && (!defined('mxchange_installed')))) {
+       } elseif ((IS_ADMIN()) || ((isBooleanConstantAndTrue('mxchange_installing')) && (!isBooleanConstantAndTrue('mxchange_installed')))) {
                // Only admins shall see this warning or when installation mode is active
                $ret = "<br /><SPAN class=\"guest_failed\">".TEMPLATE_404."</SPAN><br />
 (".basename($file).")<br />
index 1031590a81c4746f0a56a7933c295454fb0541d8..8f2d54deae8f6518ec0d94e4a5a4b05c0ce70e83 100644 (file)
@@ -80,7 +80,7 @@ if (($header != "1") && ($header != "2")) {
 
                                // Remember title in constant for the template
                                define('__PAGE_TITLE', html_entity_decode($TITLE));
-                       } elseif ((!defined('mxchange_installed')) || (!defined('admin_registered'))) {
+                       } elseif ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered'))) {
                                // Load language file because it was missing in installation finalizer step... *sigh*
                                require_once(sprintf("%sinc/language/install_%s.php",
                                        PATH,
index 80f4686904fdc7ba1e97d6201ec4e45233a0a4c0..47f6e86b481c8b1983dd619551e54f77fda37bea 100644 (file)
@@ -136,7 +136,7 @@ if ((isset($_GET['page']) && ($_GET['page'] == 5))) {
 }
 
 // Is MXChange installed or no admin registered so far?
-if ((!defined('mxchange_installed')) || (!defined('admin_registered')))
+if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered')))
 {
        // Set URL for FORM actions
        define('__BURL_ACTION', $burl);
@@ -331,7 +331,7 @@ if ((!defined('mxchange_installed')) || (!defined('admin_registered')))
                break;
 
        case "finalize": // Write captured data to files
-               if ((!empty($_POST['finalize'])) && (!defined('mxchange_installed'))) {
+               if ((!empty($_POST['finalize'])) && (!isBooleanConstantAndTrue('mxchange_installed'))) {
                        // You have submitted data then we have to reset the fatal messages
                        $FATAL = array(); $SQLs = array();
 
index 319a96e80b6a50a494c629c2097b0769f0368989..be6cb67efb90f3ba4be27da2e131a28c8133872f 100644 (file)
@@ -124,5 +124,9 @@ define('SURFBAR_URL_STATUS_STOPPED', "Angehalten");
 define('SURFBAR_URL_STATUS_REJECTED', "Abgelehnt");
 define('SURFBAR_URL_STATUS_DELETED', "Gel&ouml;scht");
 
+// Member actions - submit buttons
+define('MEMBER_SURFBAR_ACTION_RETREAT_SUBMIT', "Zur&uuml;cknehmen");
+define('MEMBER_SURFBAR_ACTION_FRAMETEST_SUBMIT', "Framkiller-Test");
+
 //
 ?>
index f4c90eb5850008fc5b584a9330c710c943d63d7e..0a404409889307001f540de5bdd5c47da6afd272 100644 (file)
@@ -940,9 +940,50 @@ ORDER BY u.id ASC",
        // Return the array
        return $URLs;
 }
+// "Getter" for member action array for given status
+function SURFBAR_GET_ACTION_ARRAY ($status) {
+       // Init array
+       $returnArray = array();
+
+       // Get all assigned actions
+       $result = SQL_QUERY_ESC("SELECT action FROM "._MYSQL_PREFIX."_surfbar_actions WHERE status='%s' ORDER BY id ASC",
+               array($status), __FILE__, __LINE__);
+
+       // Some entries there?
+       if (SQL_NUMROWS($result) > 0) {
+               // Load all actions
+               while (list($action) = SQL_FETCHROW($result)) {
+                       $returnArray[] = $action;
+               } // END - if
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return result
+       return $returnArray;
+}
 // Create list of actions depending on status for the user
 function SURFBAR_MEMBER_ACTIONS ($id, $status) {
-       /* DEBUG: */ die("id={$id},status={$status}");
+       // Load all actions in an array for given status
+       $actionArray = SURFBAR_GET_ACTION_ARRAY($status);
+
+       // Init HTML code
+       $OUT = "";
+
+       // "Walk" through all actions and create forms
+       foreach ($actionArray as $action) {
+               // Add form for this action
+               $OUT .= sprintf("<form action=\"".URL."/modules.php?module=login&amp;what=surfbar_list\" method=\"post\" style=\"padding-bottom:0px\">
+<input type=\"submit\" name=\"%s\" value=\"{--MEMBER_SURFBAR_ACTION_%s_SUBMIT--}\" />
+</form>",
+                       $action,
+                       strtoupper($action)
+               );
+       } // END - if
+
+       // Return code
+       return $OUT;
 }
 // Determine next id for surfbar or get data for given id, always call this before you call other
 // getters below this function!!!
index bc9a4a5bb4c4cdfe24efc839c990a9a14c289d2c..4a7015304512b2d0b9dd5d9a156ddacae73118a2 100644 (file)
@@ -42,7 +42,7 @@ $EXT_CSS_FILES = array();
 $ADD = "";
 
 // Skip loading extensions
-if ((!defined('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return;
+if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return;
 
 // Load default sql_patches extension if present
 if (FILE_READABLE(PATH."inc/extensions/ext-sql_patches.php")) {
index 36a322a0c9e6a579d0797fb8b37197563f4ff308..d1a728404623e9749c220cc68a2cd073c92bbe8b 100644 (file)
@@ -49,7 +49,7 @@ require_once(PATH."inc/modules/admin/admin-inc.php");
 // Fix "deleted" cookies in PHP4 (PHP5 does remove them, PHP4 sets them to deleted!)
 FIX_DELETED_COOKIES(array('admin_login', 'admin_md5', 'admin_last', 'admin_to'));
 
-if (!defined('admin_registered')) {
+if (!isBooleanConstantAndTrue('admin_registered')) {
        // Admin is not registered so we have to inform the user
        if ((isset($_POST['ok'])) && ((empty($_POST['login'])) || (empty($_POST['pass'])) || (strlen($_POST['pass']) < 4))) $_POST['ok'] = "***";
        if ((isset($_POST['ok'])) && ($_POST['ok'] != "***")) {
@@ -90,7 +90,7 @@ if (!defined('admin_registered')) {
                                $ret = "done";
                        }
 
-                       if (!defined('admin_registered')) {
+                       if (!isBooleanConstantAndTrue('admin_registered')) {
                                // Write to config that registration is done
                                admin_WriteData(PATH."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
 
index fd24ac49037b6b064a069172a52d0f7a748cf886..f7df593665497ee16ef9bcc6165b1f1240f45c26 100644 (file)
@@ -94,10 +94,8 @@ if ((empty($MySQL['login'])) && (!defined('mxchange_installing')) && (!isset($_G
 if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed'))) {
        // Check for write-permission for config.php and inc directory
        if (empty($GLOBALS['module'])) $GLOBALS['module'] = "index";
-       if (($GLOBALS['module'] != "admin") && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_SERVER['WINDIR']))) {
-               // DEPRECATED: if (is_INCWritable("config"))     ADD_FATAL(FATAL_CONFIG_WRITABLE);
-               // DEPRECATED: if (is_INCWritable("dummy"))      ADD_FATAL(FATAL_INC_WRITABLE);
-       }
+
+       // CSS array
        $EXT_CSS_FILES = array();
 
        if ((!empty($MySQL['host'])) && (!empty($MySQL['login'])) && (!empty($MySQL['password'])) && (!empty($MySQL['dbase']))) {
@@ -223,10 +221,10 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
        if (($installPhp != "install.php") && ($CSS != "1") && ($CSS != -1)) {
                // Redirect to the installation system
                LOAD_URL("install.php");
-       }
+       } // END - if
 
        // Double-check installation mode
-       if ((!defined('mxchange_installed')) || (!defined('admin_registered'))) {
+       if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered'))) {
                // Check for file permissions
                if (!is_INCWritable("config")) {
                        ADD_FATAL(CONFIG_IS_WRITE_PROTECTED);
@@ -237,7 +235,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
                if (!is_INCWritable(".secret/dummy")) {
                        ADD_FATAL(SECRET_IS_WRITE_PROTECTED);
                }
-       }
+       } // END - if
 }
 
 // Any fatal messages?
index 003589d527ec4ce6d1ead84f961a2a90dfdb5fcf..2774a3ba1c62fe7c7045701ff80e89703471acd7 100644 (file)
@@ -101,7 +101,7 @@ function CHECK_MODULE($mod) {
        $ret = "major";
 
        // Check if script is installed if not return a "done" to prevent some errors
-       if ((!defined('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (!defined('admin_registered'))) return "done";
+       if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (!isBooleanConstantAndTrue('admin_registered'))) return "done";
 
        // Check if cache is latest version
        $locked = "Y"; $hidden = "N"; $admin = "N"; $mem = "N"; $found = false;
index edebd693fc049fa65e7de754849e9a217f4c9475..10341b96e8652fcb0e7832a3922b69beca7866dd 100644 (file)
@@ -43,7 +43,7 @@ $STYLES = array(
 );
 
 // Add stylesheet for installation
-if ((basename($_SERVER['PHP_SELF']) == "install.php") || (!defined('mxchange_installed')) || (isset($_GET['installing']))) $STYLES[] = "install.css";
+if ((basename($_SERVER['PHP_SELF']) == "install.php") || (!isBooleanConstantAndTrue('mxchange_installed')) || (isset($_GET['installing']))) $STYLES[] = "install.css";
 
 // When no CSS output-mode is set, set it to file-output
 if (empty($_CONFIG['css_php'])) $_CONFIG['css_php'] = "FILE";
index b568553745125e188a0e6f76d11ecc4ba15873eb..ab5cb1dbe6f081069a16299148f16381061e5286 100644 (file)
@@ -63,7 +63,7 @@ function GET_CURR_THEME() {
                        // Fix it to default
                        $ret = "default";
                } // END - if
-       } elseif ((!defined('mxchange_installed')) && ((isBooleanConstantAndTrue('mxchange_installing')) || ($CSS == true)) && ((!empty($_GET['theme'])) || (!empty($_POST['theme'])))) {
+       } elseif ((!isBooleanConstantAndTrue('mxchange_installed')) && ((isBooleanConstantAndTrue('mxchange_installing')) || ($CSS == true)) && ((!empty($_GET['theme'])) || (!empty($_POST['theme'])))) {
                // Prepare FQFN for checking
                $theme = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_GET['theme']));