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);
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";
$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?
// 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 />
// 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,
}
// 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);
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();
define('SURFBAR_URL_STATUS_REJECTED', "Abgelehnt");
define('SURFBAR_URL_STATUS_DELETED', "Gelöscht");
+// Member actions - submit buttons
+define('MEMBER_SURFBAR_ACTION_RETREAT_SUBMIT', "Zurücknehmen");
+define('MEMBER_SURFBAR_ACTION_FRAMETEST_SUBMIT', "Framkiller-Test");
+
//
?>
// 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&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!!!
$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")) {
// 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'] != "***")) {
$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);
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']))) {
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);
if (!is_INCWritable(".secret/dummy")) {
ADD_FATAL(SECRET_IS_WRITE_PROTECTED);
}
- }
+ } // END - if
}
// Any fatal messages?
$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;
);
// 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";
// 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']));