]> git.mxchange.org Git - mailer.git/commitdiff
Added ability to allow empty passwords, if the user does so, a random password will...
authorRoland Häder <roland@mxchange.org>
Sun, 7 Nov 2010 20:05:13 +0000 (20:05 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 7 Nov 2010 20:05:13 +0000 (20:05 +0000)
53 files changed:
.gitattributes
inc/extensions-functions.php
inc/extensions/ext-register.php
inc/functions.php
inc/language/de.php
inc/language/register_de.php
inc/libs/holiday_functions.php
inc/libs/maintenance_functions.php [new file with mode: 0644]
inc/libs/network_functions.php
inc/libs/optimize_functions.php
inc/libs/rallye_functions.php
inc/libs/refback_functions.php
inc/libs/register_functions.php
inc/libs/task_functions.php
inc/mails/doubler_mails.php
inc/module-functions.php
inc/modules/admin/admin-inc.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-adminedit.php
inc/modules/admin/what-config_admin.php
inc/modules/admin/what-config_networks.php
inc/modules/admin/what-config_other.php
inc/modules/admin/what-config_register2.php
inc/modules/admin/what-guestedit.php
inc/modules/admin/what-list_links.php
inc/modules/admin/what-list_network_api_translation.php
inc/modules/admin/what-list_unconfirmed.php
inc/modules/admin/what-maintenance.php
inc/modules/admin/what-memedit.php
inc/modules/guest/what-register.php
inc/modules/guest/what-sponsor_reg.php
inc/modules/member/what-categories.php
inc/modules/member/what-holiday.php
inc/modules/sponsor/account.php
inc/pool/pool-bonus.php
inc/pool/pool-user.php
inc/reset/reset_100_bonus.php
inc/reset/reset_birthday.php
inc/reset/reset_daily.php
inc/template-functions.php
inc/wrapper-functions.php
install/tables.sql
modules.php
templates/de/html/admin/admin_config_register2.tpl
templates/de/html/guest/guest_receive_table.tpl
templates/de/html/guest/guest_register.tpl
theme/business/css/register.css
theme/default/css/register.css
theme/desert/css/register.css
theme/org/css/register.css
theme/schleuder/css/register.css
theme/ship-simu/css/register.css
view.php

index 554eb648f687e7e6a661c61a2bde3492d2c48dea..082ff8f706d8213f07a1e71d191c9671e5863f22 100644 (file)
@@ -295,6 +295,7 @@ inc/libs/holiday_functions.php -text svneol=unset#text/plain
 inc/libs/html_mail_functions.php -text svneol=unset#text/plain
 inc/libs/jackpot_functions.php -text svneol=unset#text/plain
 inc/libs/mailid_functions.php svneol=native#text/plain
+inc/libs/maintenance_functions.php svneol=native#text/plain
 inc/libs/mediadata_functions.php -text svneol=unset#text/plain
 inc/libs/network_functions.php -text svneol=unset#text/plain
 inc/libs/newsletter_functions.php -text svneol=unset#text/plain
index 332a3d2324e8db138c49751ea49ba89b70735b93..fa35d12e2b4a9f40bc7299f99f502092a161ef7c 100644 (file)
@@ -1651,14 +1651,8 @@ function getExtensionHasCss () {
 
 // Checks wether the given extension has a language file
 function ifExtensionHasLanguageFile ($ext_name) {
-       // Default is no language file
-       $hasLanguage = false;
-
        // Do we have cache?
        if (isset($GLOBALS['cache_array']['extension']['ext_lang'][$ext_name])) {
-               // Then use it
-               $hasLanguage = ($GLOBALS['cache_array']['extension']['ext_lang'][$ext_name] == 'Y');
-
                // Count cache hits
                incrementStatsEntry('cache_hits');
        } else {
index d6ed16780c0d162f493e82935ec4a24cbcf85988..cf5fff692a396cad004c84399571aa24d24f4305 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.5.4');
+setThisExtensionVersion('0.5.5');
 
 // Version history array (add more with , '0.1.0' and so on)
-setExtensionVersionHistory(array('0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4'));
+setExtensionVersionHistory(array('0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5'));
 
 switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
@@ -338,6 +338,12 @@ PRIMARY KEY (id)
                                setExtensionUpdateNotes("Weiteren Men&uuml;punkt aus <strong>menu-{?DEFAULT_LANG?} heraus geholt.");
                                break;
 
+                       case '0.5.5': // SQL queries for v0.5.5
+                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `register_generate_password_empty` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Weiteren Men&uuml;punkt aus <strong>menu-{?DEFAULT_LANG?} heraus geholt.");
+                               break;
                } // END - switch
                break;
 
index 4a1d8929b7eb49e20ee977ec5d36b582b854fb79..7676c1404dfa4589f256a79116a78ff326bb4ef1 100644 (file)
@@ -261,7 +261,7 @@ function sendRawEmail ($toEmail, $subject, $message, $headers) {
 // Generate a password in a specified length or use default password length
 function generatePassword ($length = '0') {
        // Auto-fix invalid length of zero
-       if ($length == '0') $length = getConfig('pass_len');
+       if ($length == '0') $length = getPassLen();
 
        // Initialize array with all allowed chars
        $ABC = explode(',', 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9,-,+,_,/,.');
index 0d5125aba20a05584b24456729c39c128a66b140..924e7c40688aa37cd2891561e6d0c42d8e838b41 100644 (file)
@@ -155,7 +155,7 @@ addMessages(array(
        'FAMILY' => "Nachname",
        'STREET_NR' => "Stra&szlig;e + Hausnummer",
        'COUNTRY' => "Land",
-       'ZIP' => "Postleitzahl",
+       'ZIP' => "PLZ",
        'CITY' => "Wohnort",
        'EMAIL' => "Email-Adresse",
        'MARKER' => "Markierer (keine Daten)",
@@ -192,7 +192,6 @@ addMessages(array(
        'PER_DAY' => "Mails",
        'REFID_BY' => "Sie wurden geworben von",
        'TERMS_OF_USAGE' => "AGBs zustimmen und absenden",
-       'YOU_FINALIZE' => "Sie haben es gleich geschafft.",
        'AGREE_TO_THIS' => "Stimmen Sie unseren [<a href=\"{%url=modules.php?module=index&amp;what=agb%}\" target=\"_blank\">AGBs</a>] zu?",
        'SUBMIT_REGISTER' => "Anmeldedaten abschicken",
        'HAVE_TO_AGREE' => "Sie m&uuml;ssen unseren AGBs zustimmen, damit Sie an diesem {?mt_word?} teilnehmen k&ouml;nnen.",
@@ -208,16 +207,14 @@ addMessages(array(
        'SETTINGS_SAVED' => "Einstellungen gespeichert.",
        'FATAL_CANNOT_LOAD_CONFIG' => "Kann die Konfigurationsdaten nicht laden! Vermutlich richtet der Webmaster diesen {?mt_word?} gerade das Script erst ein! Bitte schauen Sie sp&auml;ter noch einmal vorbei.",
        'ADMIN_ACTION_INVALID' => "Die action/what-Kombination <span class=\"data\">%s</span> ist ung&uuml;ltig.",
-       'SHORT_PASS' => "Das eingegebene Passwort ist nach unseren Sicherheitseinstellungen zu kurz. Mindestl&auml;nge ist",
+       'GUEST_SHORT_PASS' => "Das eingegebene Passwort ist nach unseren Sicherheitseinstellungen zu kurz. Mindestl&auml;nge ist",
+       'GUEST_EMPTY_PASSWORD_HINT' => "Lassen Sie beide Passw&ouml;rter leer, so wird Ihnen eines per Zufall generiert.",
        'ADMIN_EDIT_POINTS_SETTINGS_TITLE' => "&Auml;ndern der Willkommensgutschrift und anderer {?POINTS?}",
        'ADMIN_ENTER_POINTS_REGISTER' => "Willkommensgutschrift",
        'ADMIN_ENTER_POINTS_REFERAL' => "Einmalige Referal-Gutschrift",
-       'ADMIN_CONFIG_REGFORM_SETTINGS_TITLE' => "Einstellungen am Anmeldeformular",
-       'ADMIN_CONFIG_LEAST_CATEGORIES' => "Mindestens auszuw&auml;hlende Kategorieanzahl",
-       'CATS_LEAST' => "Bitte w&auml;hlen Sie mehr Kategorien aus! Minimum ist: <span class=\"data\">{?least_cats?}</span>",
-       'GUEST_EMAIL_ALREADY_DB' => "Sie haben sich bereits mit dieser Email-Adresse angemeldet, oder jemand anderes verwendet Ihre. Doppelte Anmeldungen sind bei uns verboten.",
+       'CHOOSE_MORE_CATEGORIES' => "Bitte w&auml;hlen Sie mehr Kategorien aus! Minimum ist: <span class=\"data\">{?least_cats?}</span>",
+       'GUEST_EMAIL_IS_ALREADY_REGISTERED' => "Sie haben sich bereits mit dieser Email-Adresse angemeldet, oder jemand anderes verwendet Ihre. Doppelte Anmeldungen sind bei uns verboten.",
        'ADMIN_CONFIG_REJECT_DOUBLE_EMAIL' => "Doppelt angemeldete Email-Adressen ablehnen?",
-       'ADMIN_CONFIG_REJECT_DOUBLE_PASS' => "Gleiche Passw&ouml;rter bei der Anmeldung ablehnen? (Wird nicht angezeigt!)",
        'ADMIN_EDIT_POINTS' => "Willkommensgutschrift und andere Festbetr&auml;ge editieren",
        'ADMIN_EDIT_REFERAL_DEPTHS' => "Referal-Ebenen editieren / l&ouml;schen / hinzuf&uuml;gen",
        'ADMIN_ADD_NEW_REFERAL_DEPTH_TITLE' => "Neue Referal-Ebene hinzuf&uuml;gen",
@@ -230,18 +227,15 @@ addMessages(array(
        'ADMIN_EDIT_LEVEL' => "Ref-Ebene editieren",
        'ADMIN_DELETE_LEVEL' => "Ref-Ebene l&ouml;schen",
        'HELLO' => "Hallo",
-       'GUEST_YOU_REGISTERED_WITH_US' => "vielen Dank, dass Sie sich f&uuml;r {?MAIN_TITLE?} entschieden haben! Sollten Sie dies nicht gewesen sein, so melden Sie sich bitte bei uns.",
-       'GUEST_YOUR_PERSONA_DATA' => "Hier sind nochmals zur &Uuml;berpr&uuml;fung Ihre pers&ouml;nlichen Daten",
        'GUEST_SURNAME' => "Vorname",
        'GUEST_FAMILY' => "Nachname",
        'GUEST_STREET_NR' => "Stra&szlig;e und Hausnummer",
        'GUEST_COUNTRY' => "L&auml;ndercode",
-       'GUEST_ZIPCODE' => "Postleitzahl",
+       'GUEST_ZIPCODE' => "PLZ",
        'GUEST_CITY' => "Wohnort",
        'GUEST_EMAIL' => "Email-Adresse",
        'GUEST_BIRTHDAY' => "Geburtsdatum",
        'GUEST_REF' => "Geworben von",
-       'GUEST_YOUR_REFERAL_LINK' => "Hier ist Ihr pers&ouml;nlicher Referal-Link, mit dem Sie bereits jetzt schon neue Mitglieder werben k&ouml;nnen:",
        'GUEST_CONFIRM_LINK_SUBJECT' => "Ihr Best&auml;tigungslink",
        'ADMIN_GUEST_REGISTERED_WITH_US' => "Ein Gast hat sich soeben bei uns angemeldet.",
        'ADMIN_GUEST_PERSONA_DATA' => "Hier sind zur &Uuml;berpr&uuml;fung nochmals seine pers&ouml;nlichen Daten",
index 0fd88c80da695719090afabc737ae1a2e0efd830..a3fff44bc5190f05885692ab46757cb56b52ab34 100644 (file)
@@ -48,16 +48,15 @@ addMessages(array(
        'ADMIN_REGISTER_FIELD_NAME' => "Eingabefeld",
        'ADMIN_REGISTER_FIELD_REQUIRED' => "Pflichtfeld?",
        'ADMIN_REGISTER_CHANGES_SAVED' => "Es wurden <span class=\"data\">%s</span> Pflichtfelder aktualisiert.",
-       'REGISTER_SURNAME_REQUIRED' => "Bitte geben Sie Ihren Vornamen ein.",
-       'REGISTER_FAMILY_REQUIRED' => "Bitte geben Sie Ihren Nachnamen ein.",
-       'REGISTER_STREET_NR_REQUIRED' => "Bitte geben Sie Stra&szlig;e und Hausnummer ein.",
-       'REGISTER_CNTRY_REQUIRED' => "Bitte geben Sie den zweistelligen L&auml;ndercode ein.",
-       'REGISTER_ZIP_REQUIRED' => "Bitte geben Sie die Postleitzahl ein.",
-       'REGISTER_CITY_REQUIRED' => "Bitte geben Sie den Wohnort ein.",
        'CNTRY' => "L&auml;ndercode",
        'ADMIN_CONFIG_REGISTER_DEFAULT' => "Standart-Vorauswahl in der Kategorienliste einstellen auf Ja/Nein",
        'ADMIN_CONFIG_REGISTER_DISPLAY_REFID' => "Soll die Ref-Id angezeigt werden? <div class=\"notice\">(Nein = id wird editierbar!)</div>",
        'ADMIN_CONFIG_REGISTER_IP_TIMEOUT' => "IP-Zeitsperre",
+       'ADMIN_CONFIG_REGFORM_SETTINGS_TITLE' => "Einstellungen am Anmeldeformular",
+       'ADMIN_CONFIG_LEAST_CATEGORIES' => "Mindestens auszuw&auml;hlende Kategorieanzahl",
+       'ADMIN_CONFIG_REGISTER_GENERATE_PASSWORD_EMPTY' => "Soll bei leergelassenem Passwort in der Anmeldung eines per Zufall generiert werden?",
+       'ADMIN_CONFIG_REJECT_DOUBLE_EMAIL' => "Doppelt angemeldete Email-Adressen ablehnen?",
+       'GUEST_EMAIL_IS_ALREADY_REGISTERED' => "Sie haben sich bereits mit dieser Email-Adresse angemeldet, oder jemand anderes verwendet Ihre. Doppelte Anmeldungen sind bei uns verboten.",
 ));
 
 // [EOF]
index bef825a89b4f5a944cc885f64b0de652d9204d42..5fe06735de477a959be3945268e7804d7d4a8922 100644 (file)
@@ -51,7 +51,7 @@ WHERE
        `holiday_end` <= UNIX_TIMESTAMP()
 ORDER BY
        `userid` ASC", __FUNCTION__, __LINE__);
-       if (SQL_NUMROWS($result_stop) > 0) {
+       if (!SQL_HASZERONUMS($result_stop)) {
                // We foud at least one
                $admin = '';
 
diff --git a/inc/libs/maintenance_functions.php b/inc/libs/maintenance_functions.php
new file mode 100644 (file)
index 0000000..be0e6cf
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 11/09/2010 *
+ * ===================                          Last change: 11/09/2010 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : maintenance_functions.php                        *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for ext-maintenance                    *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer ext-maintenance                  *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       die();
+} // END - if
+
+//-----------------------------------------------------------------------------
+//                   Wrapper functions for ext-maintenance
+//-----------------------------------------------------------------------------
+
+// Getter for 'maintenance'
+function getMaintenance () {
+       // Is the cache entry set
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = getConfig('maintenance');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether 'maintenance' is "YES"
+function isMaintenanceEnabled () {
+       // Is the cache entry set
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = (getMaintenance() == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// [EOF]
+?>
index b3800e9a69310d549ea39c5e1fca4d6c7ee27e1f..c6a23f75eaa58e1311d413250359ffb71cb743dc 100644 (file)
@@ -718,7 +718,7 @@ ORDER BY
        `sort` ASC', __FUNCTION__, __LINE__);
 
                // Do we have entries?
-               if (SQL_NUMROWS($result) > 0) {
+               if (!SQL_HASZERONUMS($result)) {
                        // Get all entries
                        while ($row = SQL_FETCHARRAY($result)) {
                                // Add it to our global array
index 66ec22b6322ddba1e5cd8f5ebe285f02acf71e45..4455cfcc8e4e96937b29c43a4f5375fa8e1e8644 100644 (file)
@@ -58,7 +58,7 @@ function repairOptimizeDatabase () {
        $ret['tables'] = array();
 
        // Do we have entries?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Fetch all rows
                while ($row = SQL_FETCHARRAY($result)) {
                        $tot_data = $row['Data_length'];
index 40e601a1896978a2f0016f97fb3be2b176e5d4bd..8f9f08127cad44fead03fe90ff7b90d4d74f4a71 100644 (file)
@@ -104,9 +104,7 @@ WHERE
        `userid`=%s
 LIMIT 1",
                        array(bigintval($id), bigintval($content['userid'])), __FUNCTION__, __LINE__);
-               if (SQL_NUMROWS($result_ref) == 0) {
-                       // Free memory
-                       SQL_FREERESULT($result_ref);
+               if (SQL_HASZERONUMS($result_ref)) {
 
                        // Add userid and his ref count to table
                        $result_ref = SQL_QUERY_ESC("SELECT 
@@ -149,6 +147,9 @@ WHERE
                        $un = true;
                } // END - if
 
+               // Free memory
+               SQL_FREERESULT($result_ref);
+
                // Ignored but for the template required refs (made before start of rallye)
                $content['refs']  = $count;
 
@@ -415,7 +416,7 @@ LIMIT 1",
                        ), __FUNCTION__, __LINE__);
 
                // Is this user added?
-               if (SQL_NUMROWS($result) < 1) {
+               if (SQL_HASZERONUMS($result)) {
                        // Add userid and his ref count to table
                        SQL_QUERY_ESC("INSERT INTO
        `{?_MYSQL_PREFIX?}_rallye_users`
index 575a918c2856a9bde7d0dd829fdde96c501bed06..cacd4de92c707d616d539271e33b8f45907cc199 100644 (file)
@@ -195,7 +195,7 @@ function updateRefbackTable ($userid) {
 
        // When no entry was updated then we have to create it here
        //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):found=".SQL_NUMROWS($result_refid)."<br />");
-       if (SQL_NUMROWS($result_refid) > 0) {
+       if (!SQL_HASZERONUMS($result_refid)) {
                // Load all refids
                while (list($GLOBALS['refback_refid'][$GLOBALS['refback_level']]) = SQL_FETCHROW($result_refid)) {
                        // Remmber userid
index 3d36d8c374fdcf80aad222b3c6483c007842b960..56056fd84c869d8153548ba9a6d76d3cfa771983 100644 (file)
@@ -94,7 +94,7 @@ function registerGenerateCategoryTable ($mode, $return=false) {
                        $content['default_no']  = '';
 
                        // Mark categories
-                       if ((postRequestParameter('cat', $content['id']) == 'Y') || ((getConfig('register_default') == 'Y') && (!isPostRequestParameterSet('cat', $content['id'])))) {
+                       if ((postRequestParameter('cat', $content['id']) == 'Y') || ((isRegisterDefaultEnabled()) && (!isPostRequestParameterSet('cat', $content['id'])))) {
                                $content['default_yes'] = ' checked="checked"';
                        } else {
                                $content['default_no']  = ' checked="checked"';
@@ -140,7 +140,9 @@ function FILTER_REGISTER_MUST_FILLOUT ($content) {
        while ($row = SQL_FETCHARRAY($result)) {
                // Must the user fill out this element?
                $value = '';
-               if ($row['field_required'] == 'Y') $value = '<span class="notice">(*)</span>';
+               if ($row['field_required'] == 'Y') {
+                       $value = '<span class="notice">(*)</span>';
+               } // END - if
 
                // Add it
                $content['must_fillout_' . strtolower($row['field_name']) . ''] = $value;
@@ -158,7 +160,7 @@ function isRegistrationDataComplete () {
        // Init elements
        $GLOBALS['registration_ip_timeout']     = false;
        $GLOBALS['registration_short_password'] = false;
-       $GLOBALS['register_selected_cats']      = '0';
+       $GLOBALS['registration_selected_cats']  = '0';
 
        // Default is okay
        $isOkay = true;
@@ -203,14 +205,42 @@ function isRegistrationDataComplete () {
                        setPostRequestParameter('pass1', '!');
                        setPostRequestParameter('pass2', '!');
                } else {
-                       if (!isPostRequestParameterSet('pass1')) { setPostRequestParameter('pass1', '!'); } else { setPostRequestParameter('pass1', ''); }
-                       if (!isPostRequestParameterSet('pass2')) { setPostRequestParameter('pass2', '!'); } else { setPostRequestParameter('pass2', ''); }
+                       if (!isPostRequestParameterSet('pass1')) {
+                               setPostRequestParameter('pass1', '!');
+                       } else {
+                               setPostRequestParameter('pass1', '');
+                       }
+                       if (!isPostRequestParameterSet('pass2')) {
+                               setPostRequestParameter('pass2', '!');
+                       } else {
+                               setPostRequestParameter('pass2', '');
+                       }
                }
                $isOkay = false;
        } // END - if
 
+       // Are both passwords zero length?
+       if ((strlen(postRequestParameter('pass1')) == 0) && (strlen(postRequestParameter('pass2')) == 0) && ($isOkay === true)) {
+               // Is the extension 'register' newer or equal 0.5.5?
+               if ((isExtensionInstalledAndNewer('register', '0.5.5')) && (isRegisterGeneratePasswordEmptyEnabled())) {
+                       // Generate a random password
+                       $randomPassword = generatePassword();
+
+                       // Set it in both entries
+                       setPostRequestParameter('pass1', $randomPassword);
+                       setPostRequestParameter('pass2', $randomPassword);
+               } else {
+                       // Not allowed or no recent extension version
+                       setPostRequestParameter('pass1', '!');
+                       setPostRequestParameter('pass2', '!');
+
+                       // ... which is both not okay
+                       $isOkay = false;
+               }
+       } // END - if
+
        // Is the password long enouth?
-       if ((strlen(postRequestParameter('pass1')) < getConfig('pass_len')) && ($isOkay === true)) {
+       if ((strlen(postRequestParameter('pass1')) < getPassLen()) && ($isOkay === true)) {
                $GLOBALS['registration_short_password'] = true;
                $isOkay = false;
        } // END - if
@@ -221,16 +251,16 @@ function isRegistrationDataComplete () {
                foreach (postRequestParameter('cat') as $id => $answer) {
                        // Is this category choosen?
                        if ($answer == 'Y') {
-                               $GLOBALS['register_selected_cats']++;
+                               $GLOBALS['registration_selected_cats']++;
                        } // END - if
                } // END - foreach
        } // END - if
 
        // Enougth categories selected?
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay='.intval($isOkay).',selected='.$GLOBALS['register_selected_cats'].'/'.getConfig('least_cats'));
-       $isOkay = (($isOkay) && ($GLOBALS['register_selected_cats'] >= getConfig('least_cats')));
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay='.intval($isOkay).',selected='.$GLOBALS['registration_selected_cats'].'/'.getLeastCats());
+       $isOkay = (($isOkay) && ($GLOBALS['registration_selected_cats'] >= getLeastCats()));
 
-       if ((postRequestParameter('email') != '!') && (getConfig('check_double_email') == 'Y')) {
+       if ((postRequestParameter('email') != '!') && (isCheckDoubleEmailEnabled())) {
                // Does the email address already exists in our database?
                if ((!isAdmin()) && (isEmailTaken(postRequestParameter('email')))) {
                        setPostRequestParameter('email', '?');
@@ -240,7 +270,7 @@ function isRegistrationDataComplete () {
 
        // Check for IP timeout?
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay='.intval($isOkay));
-       if ((!isAdmin()) && (getConfig('ip_timeout') > 0)) {
+       if ((!isAdmin()) && (getIpTimeout() > 0)) {
                // Check his IP number
                $GLOBALS['registration_ip_timeout'] = (countSumTotalData(detectRemoteAddr()  , 'user_data', 'userid', 'REMOTE_ADDR', true, " AND ((UNIX_TIMESTAMP() - `joined`) < {?ip_timeout?} OR (UNIX_TIMESTAMP() - `last_update`) < {?ip_timeout?}) LIMIT 1") == 1);
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isOkay='.intval($isOkay).',timeout='.intval($GLOBALS['registration_ip_timeout']));
@@ -294,7 +324,7 @@ function doRegistration () {
        // Check if I shall disable sending mail to newly registered members out about active/begging rallye
        //
        // First comes first: begging rallye
-       if (!isBegNewMemberNotifyEnabled()) {
+       if ((isExtensionInstalledAndNewer('beg', '0.2.7')) && (!isBegNewMemberNotifyEnabled())) {
                $GLOBALS['register_sql_columns'] .= ', `beg_rallye_enable_notify`, `beg_rallye_disable_notify`';
                $GLOBALS['register_sql_data']    .= ', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()';
        } // END - if
@@ -374,7 +404,9 @@ function doRegistration () {
        } // END - if
 
        // ... rewrite a zero referal id to the main title
-       if (!isValidUserId(postRequestParameter('refid'))) setPostRequestParameter('refid', getMainTitle());
+       if (!isValidUserId(postRequestParameter('refid'))) {
+               setPostRequestParameter('refid', getMainTitle());
+       } // END - if
 
        // Is ZIP code set?
        if (isPostRequestParameterSet('zip')) {
@@ -424,7 +456,7 @@ function doRegistration () {
        } // END - switch
 
        // Display information to the user that he got mail and send it away
-       $messageGuest = loadEmailTemplate('register-member', $content, $userid);
+       $messageGuest = loadEmailTemplate('register-member', $content, $userid, false);
 
        // Send mail to user (confirmation link!)
        $email = $content['email'];
@@ -435,5 +467,117 @@ function doRegistration () {
        sendAdminNotification('{--ADMIN_NEW_ACCOUNT_SUBJECT--}', 'register-admin', $content, $userid);
 }
 
+//-----------------------------------------------------------------------------
+//                      Wrapper functions for ext-register
+//-----------------------------------------------------------------------------
+
+// Getter for 'display_refid'
+function getDisplayRefid () {
+       // Is the cache entry set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = getConfig('display_refid');
+       } // END - if
+
+       // Return cached entry
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether 'display_refid' is "YES"
+function isDisplayRefidEnabled () {
+       // Is the cache entry set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = (getDisplayRefid() == 'Y');
+       } // END - if
+
+       // Return cached entry
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'ip_timeout'
+function getIpTimeout () {
+       // Is the cache entry set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = getConfig('ip_timeout');
+       } // END - if
+
+       // Return cached entry
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'check_double_email'
+function getCheckDoubleEmail () {
+       // Is the cache entry set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = getConfig('check_double_email');
+       } // END - if
+
+       // Return cached entry
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether 'check_double_email' is "YES"
+function isCheckDoubleEmailEnabled () {
+       // Is the cache entry set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = (getCheckDoubleEmail() == 'Y');
+       } // END - if
+
+       // Return cached entry
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'register_default'
+function getRegisterDefault () {
+       // Is the cache entry set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = getConfig('register_default');
+       } // END - if
+
+       // Return cached entry
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether 'register_default' is "YES"
+function isRegisterDefaultEnabled () {
+       // Is the cache entry set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = (getRegisterDefault() == 'Y');
+       } // END - if
+
+       // Return cached entry
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Getter for 'register_generate_password_empty'
+function getRegisterGeneratePasswordEmpty () {
+       // Is the cache entry set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = getConfig('register_generate_password_empty');
+       } // END - if
+
+       // Return cached entry
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether 'register_generate_password_empty' is "YES"
+function isRegisterGeneratePasswordEmptyEnabled () {
+       // Is the cache entry set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = (getRegisterGeneratePasswordEmpty() == 'Y');
+       } // END - if
+
+       // Return cached entry
+       return $GLOBALS[__FUNCTION__];
+}
+
 // [EOF]
 ?>
index f067f2e4ebcaca546ed04590ede935f82e60080d..6894f398ef0e499e328119bc75ab04c6cf5e1148 100644 (file)
@@ -567,7 +567,7 @@ function createExtraTaskRows ($WHATs, $DESCRs, $TITLEs) {
                        // Rewrite CSS class if not last entry is reached
                        if ($key < (count($sqls) - 1)) $content['bottom'] = 'bottom';
 
-                       if ((SQL_NUMROWS($result) > 0) && (!empty($WHATs[$key]))) {
+                       if ((!SQL_HASZERONUMS($result)) && (!empty($WHATs[$key]))) {
                                if (empty($TITLEs[$key])) {
                                        $TITLEs[$key] = '{--ADMIN_TASK_UNKNOWN_LIST_TITLE--}';
                                } // END - if
index 0c400f7780d1403d5d935a97dfa93110ad820f69..03da51b034ff205c9b59c53a39f18de4687f313a 100644 (file)
@@ -106,10 +106,12 @@ LIMIT {?doubler_max_sent?}",
        ), __FILE__, __LINE__);
 
 // Do we have entries found?
-if (((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == 'Y')) || ((SQL_NUMROWS($result_main) == getConfig('doubler_group_sent')) && (getConfig('doubler_sent_all') != 'Y'))) {
+if (((!SQL_HASZERONUMS($result_total)) && (getConfig('doubler_sent_all') == 'Y')) || ((SQL_NUMROWS($result_main) == getConfig('doubler_group_sent')) && (getConfig('doubler_sent_all') != 'Y'))) {
        // Switch to matching SQL resource
        $result_load = $result_main;
-       if ((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == 'Y')) $result_load = $result_total;
+       if ((!SQL_HASZERONUMS($result_total)) && (getConfig('doubler_sent_all') == 'Y')) {
+               $result_load = $result_total;
+       } // END - if
 
        // At least one account was found
        while ($content = SQL_FETCHARRAY($result_load)) {
index bf629eb46227b27e14d945201cbca2d8d04ffb82..5b520465b1c6c00b2bbe1445ee1847f0ab686b73 100644 (file)
@@ -61,7 +61,7 @@ function getModuleTitle ($module) {
                                array($module), __FUNCTION__, __LINE__);
 
                        // Is the entry there?
-                       if (SQL_NUMROWS($result)) {
+                       if (SQL_NUMROWS($result) == 1) {
                                // Get the title from database
                                $data = SQL_FETCHARRAY($result);
                        } // END - if
index 083d62be338dec1393d0b812e153cf8a04d082a9..78d2469e4bf62b58ef28534a79e296b0e62abd1d 100644 (file)
@@ -650,7 +650,7 @@ function generateUserProfileLink ($userid, $title = '', $what = 'list_user') {
 // Check "logical-area-mode"
 function adminGetMenuMode () {
        // Set the default menu mode as the mode for all admins
-       $mode = getConfig('admin_menu');
+       $mode = getAdminMenu();
        $adminMode = $mode;
 
        // Get admin id
@@ -677,7 +677,9 @@ function adminGetMenuMode () {
        }
 
        // Check what the admin wants and set it when it's not the default mode
-       if ($adminMode != 'global') $mode = $adminMode;
+       if ($adminMode != 'global') {
+               $mode = $adminMode;
+       } // END - if
 
        // Return admin-menu's mode
        return $mode;
index 31073f84bba7a3d708186fb0a54588d7136d8b83..1c0dd56c553f6c7bf0b6cf96e3f51a16836048bc 100644 (file)
@@ -70,7 +70,7 @@ function outputStandardOverview (&$result_tasks) {
                        // Is the extension not yet installed?
                        if ($extInstalled === false) {
                                // We maybe want to install an extension so let's test-drive it...
-                               if (loadExtension($ext_name, getExtensionMode(), '', true)) {
+                               if (loadExtension($ext_name, getExtensionMode(), '0.0', true)) {
                                        // Create a task for newly installed extension (we ignore the task id here)
                                        createNewExtensionTask($ext_name);
                                } // END - if
index 45d42bc01e42c0355d6bbcf9d21252f3f17cfa22..5f0ec0c4fa340d5fc2a50b5e5ab2625aaf068ea1 100644 (file)
@@ -192,7 +192,7 @@ LIMIT 1",
        $result = SQL_QUERY("SELECT id, action, what, title, sort FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." ORDER BY `sort` ASC", __FILE__, __LINE__);
 
        // Do we have entries?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Remember sub value
                $content['sub'] = $SUB;
 
index 31de2b0033144694bc7dd6c807eee0ce2a3104be..1feeafb9a8427a24cd0531e039e63e1d44728bad 100644 (file)
@@ -50,7 +50,7 @@ if (isFormSent()) {
        // Prepare data for the template
        $content['admin_menu_new'] = '';
        $content['admin_menu_old'] = '';
-       $content['admin_menu_' . strtolower(getConfig('admin_menu'))] = ' checked="checked"';
+       $content['admin_menu_' . strtolower(getAdminMenu())] = ' checked="checked"';
 
        // Display form
        loadTemplate('admin_config_admin', false, $content);
index d78e2b8f4a8467b34587920dc756b530117c7bfa..6a371411ee403d4349c1f82f29b61f6ad812b79c 100644 (file)
@@ -69,7 +69,7 @@ ORDER BY
        d.`network_short_name` ASC", __FILE__, __LINE__);
 
 // Do we have entries?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // We have some networks here
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
index f3f3a90378fc6eb482422139c782b40354d4fbc8..2672e5c07f45c4e7dd76de4c2b9d69a82f1f449f 100644 (file)
@@ -71,7 +71,7 @@ if (isFormSent()) {
        if (!isPostRequestParameterSet('max_send'))              { unsetPostRequestParameter('ok'); }
        if (!isPostRequestParameterSet('code_length'))           { unsetPostRequestParameter('ok'); }
        if (!isPostRequestParameterSet('reject_url'))            { unsetPostRequestParameter('ok'); }
-}
+} // END - if
 
 if (isFormSent()) {
        // Update stamps directly
index b8f08dc01b967545d2cdbbfa5d5946094e225f81..b601fa2ca1c6a9b437b941bb4b2250e87c3838a8 100644 (file)
@@ -54,11 +54,11 @@ if (isFormSent()) {
        adminSaveSettingsFromPostData();
 } else {
        // Remember stuff in constants
-       $content['display_refid']      = addSelectionBox('yn', getConfig('display_refid')     , 'display_refid');
-       $content['ip_timeout']         = createTimeSelections(getConfig('ip_timeout')         , 'ip_timeout', 'Dhm');
-       $content['check_double_email'] = addSelectionBox('yn', getConfig('check_double_email'), 'check_double_email');
-       $content['check_double_pass']  = addSelectionBox('yn', getConfig('check_double_pass') , 'check_double_pass');
-       $content['register_default']   = addSelectionBox('yn', getConfig('register_default')  , 'register_default');
+       $content['display_refid']                    = addSelectionBox('yn', getDisplayRefid()                 , 'display_refid');
+       $content['ip_timeout']                       = createTimeSelections(getIpTimeout()                     , 'ip_timeout', 'Dhm');
+       $content['check_double_email']               = addSelectionBox('yn', getCheckDoubleEmail()             , 'check_double_email');
+       $content['register_default']                 = addSelectionBox('yn', getRegisterDefault()              , 'register_default');
+       $content['register_generate_password_empty'] = addSelectionBox('yn', getRegisterGeneratePasswordEmpty(), 'register_generate_password_empty');
 
        // Load normal template
        loadTemplate('admin_config_register2', false, $content);
index 69c5b0a345c5ed7c41dbc807dcbb50780c091d65..bf99bcd72ab462b3b66899b00c2386fba915c748 100644 (file)
@@ -192,7 +192,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        }
 
        // Do we have entries?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Set sub value
                $content['sub'] = $subMenu;
 
index 394508fa856d1443ed1ae92348b8f4e247173f7d..ed535b2aa2d09b82838054b1102059a06cf24489 100644 (file)
@@ -64,7 +64,7 @@ if (isGetRequestParameterSet('userid')) {
                }
 
                // Do we have some entries?
-               if (SQL_NUMROWS($result) > 0) {
+               if (!SQL_HASZERONUMS($result)) {
                        // Some unconfirmed mails left
                        if (getRequestParameter('delete') == "all") {
                                // Delete all unconfirmed mails by this user
index a2d5150a5e9797385056563e00bc19d6b7cf9423..923e5dce6dfd3904f16a6a66b36871158d42d9ef 100644 (file)
@@ -105,7 +105,7 @@ ORDER BY
                ), __FILE__, __LINE__);
 
        // Do we have entries?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // List all entries
                $OUT = '';
                while ($row = SQL_FETCHARRAY($result)) {
index ee9be41504806da93ff773b61211cd89a3ff17b6..48e735be4e3087c8d97d4209fd4bad4e735b4ad2 100644 (file)
@@ -134,7 +134,7 @@ LIMIT %s",
                        ),__FILE__, __LINE__);
 
                // Do we have entries?
-               if (SQL_NUMROWS($result) > 0) {
+               if (!SQL_HASZERONUMS($result)) {
                        // At least one link left to confirm
                        $OUT = '';
                        while ($row = SQL_FETCHARRAY($result)) {
index 491e6107896e04d3c012439d386c054142e1ba07..58a8429269590bbbdc70ddf45555c8998d80a0f7 100644 (file)
@@ -45,7 +45,7 @@ addMenuDescription('admin', __FILE__);
 
 if (isFormSent()) {
        // De- or activate maintenance mode
-       switch (getConfig('maintenance')) {
+       switch (getMaintenance()) {
                case 'Y':
                        $target_mode = 'N';
                        $message = '{--ADMIN_MAINTENANCE_DEACTIVATED--}';
@@ -63,7 +63,7 @@ if (isFormSent()) {
        // Load template
        loadTemplate('admin_settings_saved', false, $message);
 } else {
-       switch (getConfig('maintenance')) {
+       switch (getMaintenance()) {
                case 'Y': // Maintenance mode is active
                        $message = '{--ADMIN_MAINTENANCE_MODE_IS_ACTIVE--}';
                        break;
index b7f294fcc2cd77a1b5329a7bb90ebbaa3b557319..315c2fdc3ead3954d497ce146420b22b5fd248f1 100644 (file)
@@ -188,7 +188,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        }
 
        // Some are there?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Set sub value
                $content['sub'] = $subMenu;
 
index 01773d9b814bed13e12931bcf76744c885974122..d28311ef8aa4f5a2e70b4a28c0edb8646658312d 100644 (file)
@@ -93,15 +93,15 @@ if ((isFormSent()) && (isRegistrationDataComplete())) {
                }
 
                if ((isset($GLOBALS['registration_short_password'])) && ($GLOBALS['registration_short_password'] === true)) {
-                       registerOutputFailedMessage('SHORT_PASS', ': ' . getConfig('pass_len'));
+                       registerOutputFailedMessage('GUEST_SHORT_PASS', ': ' . getPassLen());
                } // END - if
 
                if ((isset($GLOBALS['registration_ip_timeout'])) && ($GLOBALS['registration_ip_timeout'] === true)) {
                        registerOutputFailedMessage('REMOTE_ADDR_TIMEOUT');
                } // END - if
 
-               if ((!empty($GLOBALS['register_selected_cats'])) && ($GLOBALS['register_selected_cats'] < getConfig('least_cats'))) {
-                       registerOutputFailedMessage('', '{--CATS_LEAST--}');
+               if ((!empty($GLOBALS['registration_selected_cats'])) && ($GLOBALS['registration_selected_cats'] < getLeastCats())) {
+                       registerOutputFailedMessage('', '{--CHOOSE_MORE_CATEGORIES--}');
                } // END - if
        } // END - if
 
@@ -123,7 +123,7 @@ if ((isFormSent()) && (isRegistrationDataComplete())) {
        $content['max_receive_list'] = addMaxReceiveList('guest', '', true);
 
        // Shall I display the refid or shall I make it editable?
-       if (getConfig('display_refid') == 'Y') {
+       if (isDisplayRefidEnabled()) {
                // Load "hide" form template
                $content['refid_content'] = loadTemplate('guest_register_refid_hide', true);
        } else {
index ebe99458fe2219811c70754f0a8c47dd42bb65e3..757c9634159ad0d186c0579be0d4b2bea59d2153 100644 (file)
@@ -182,7 +182,7 @@ if (isFormSent()) {
                                $formErrors[] = '{--SPONSOR_PASSWORD2_EMPTY--}';
                        }
                }
-       } elseif (strlen(postRequestParameter('pass1')) < getConfig('pass_len')) {
+       } elseif (strlen(postRequestParameter('pass1')) < getPassLen()) {
                // Password is to short!
                $formErrors[] = '{--SPONSOR_PASSWORD_TOO_SHORT--}';
        }
index debdd3bcede01b51dcd2225e9df5205479fe0074..2812f0b0707d822f8e36fbb04497b88004290710 100644 (file)
@@ -52,7 +52,7 @@ if (isAdmin()) $whereStatement = '';
 $result = SQL_QUERY("SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats`".$whereStatement." ORDER BY `sort` ASC", __FILE__, __LINE__);
 
 // Do we have entries?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        $LEAST = false;
        if (isFormSent()) {
                $count = '0';
@@ -60,7 +60,7 @@ if (SQL_NUMROWS($result) > 0) {
                        if ($joined != 'Y') $count++;
                } // END - foreach
 
-               if ((SQL_NUMROWS($result) - $count) < getConfig('least_cats')) {
+               if ((SQL_NUMROWS($result) - $count) < getLeastCats()) {
                        unsetPostRequestParameter('ok');
                        $LEAST = true;
                } // END - if
@@ -115,7 +115,7 @@ if (SQL_NUMROWS($result) > 0) {
        } else {
                if ($LEAST === true) {
                        // Also here we have to secure it... :(
-                       loadTemplate('admin_settings_saved', false, '{--CATS_LEAST--}');
+                       loadTemplate('admin_settings_saved', false, '{--CHOOSE_MORE_CATEGORIES--}');
                } // END - if
 
                // Put some data into constants for the template
index edf15eec6c3a8939a7355753546f536b5894f907..f935d391631a4a6cfda99584581918b976fb89c1 100644 (file)
@@ -281,7 +281,8 @@ SET
        `holiday_active`='N'
 WHERE
        `userid`=%s
-LIMIT 1", array(getMemberId()), __FILE__, __LINE__);
+LIMIT 1",
+                                               array(getMemberId()), __FILE__, __LINE__);
                                        redirectToUrl('modules.php?module=login&amp;what=holiday');
                                        return;
                                }
index f39402baa58136b7880c7780be1bf51425a5d55b..0d0196de4a6c0219cf6e548c603c8705fb6a9169 100644 (file)
@@ -87,7 +87,7 @@ if (SQL_NUMROWS($result) == 1) {
                        } elseif ((isPostRequestParameterSet('pass1')) && (!isPostRequestParameterSet('pass2'))) {
                                // No password two entered
                                $message = '{--SPONSOR_PASSWORD_TWO_EMPTY--}';
-                       } elseif ((isPostRequestParameterSet('pass1')) && (strlen(postRequestParameter('pass1')) < getConfig('pass_len'))) {
+                       } elseif ((isPostRequestParameterSet('pass1')) && (strlen(postRequestParameter('pass1')) < getPassLen())) {
                                // Too short password
                                $message = '{--SPONSOR_PASSWORD_TOO_SHORT--}';
                        } else {
index 139f1f5e7cfb21658dc6fcc888ea60cb4ea5e482..ef5fb8e6961d953527159ae74dc14922b54d488c 100644 (file)
@@ -61,7 +61,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                $result_bonus = SQL_QUERY("SELECT `id`, `subject`, `text`, `receivers`, `points`, `time`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `data_type`='NEW' ORDER BY `timestamp` DESC", __FILE__, __LINE__);
        }
 
-       if (SQL_NUMROWS($result_bonus) > 0) {
+       if (!SQL_HASZERONUMS($result_bonus)) {
                // Send these mails away...
                $count2 = '';
                while ($DATA = SQL_FETCHARRAY($result_bonus)) {
index 5ac55c5946c891e3680b287cb2ae0b1c9602f1da..953e9733f9244cee4b86704159841e675ac5b911 100644 (file)
@@ -99,7 +99,7 @@ if (!SQL_HASZERONUMS($result_main)) {
 
                                        // If there's no stats entry add it!
                                        //* DEBUG: */ debugOutput('!L:'.__LINE__.'/'.SQL_NUMROWS($result_stats).'!');
-                                       if (SQL_NUMROWS($result_stats) == 0) {
+                                       if (SQL_HASZERONUMS($result_stats)) {
                                                // No entry was found, so we add him!
                                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_stats` (`pool_id` , `userid`, `cat_id`, `payment_id`, `subject`, `url` , `max_rec` , `timestamp_ordered`, `timestamp_sstart`) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s' , UNIX_TIMESTAMP())",
                                                        array(bigintval($DATA['id']), bigintval($DATA['sender']), bigintval($DATA['cat_id']), bigintval($DATA['payment_id']), $DATA['subject'], $DATA['url'], $DATA['target_send'], bigintval($DATA['timestamp'])), __FILE__, __LINE__);
index 7514202808fe6be49a35626e7866335284b1305f..55933843d7de259b0afa78a6786081ef8100afac 100644 (file)
@@ -58,7 +58,7 @@ WHERE
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
-if (SQL_NUMROWS($result_bonus) > 0) {
+if (!SQL_HASZERONUMS($result_bonus)) {
        // We found some mail orders...
        while ($content = SQL_FETCHARRAY($result_bonus)) {
                // Add points
index 2586efbecae11f653bc48e3a35bf010f7897d2a9..dc3f70660a635dd05f8aa3822855f840e6cf6b8e 100644 (file)
@@ -71,7 +71,7 @@ ORDER BY
        `userid` ASC",
        array($day, $month, $value), __FILE__, __LINE__);
 
-if (SQL_NUMROWS($result_birthday) > 0) {
+if (!SQL_HASZERONUMS($result_birthday)) {
        // Start sending out birthday mails
        while ($content = SQL_FETCHARRAY($result_birthday)) {
                // Calculate own timestamp for birthday and today
index 9fb76538548c489034810265947efe70fc25b149..d033e12db7abf952e6244b1300b4d7434197468d 100644 (file)
@@ -78,7 +78,7 @@ ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
 //* DEBUG: */ debugOutput(basename(__FILE__) . ':payout=0;daily|numRows=' . SQL_NUMROWS($result_daily));
-if (SQL_NUMROWS($result_daily) > 0) {
+if (!SQL_HASZERONUMS($result_daily)) {
        // Init SQLs
        initSqls();
 
@@ -98,7 +98,7 @@ ORDER BY
                        array(bigintval($content['userid'])), __FILE__, __LINE__);
 
                //* DEBUG: */ debugOutput(basename(__FILE__) . ':payout=0;points|numRows=' . SQL_NUMROWS($result_points));
-               if (SQL_NUMROWS($result_points) > 0) {
+               if (!SQL_HASZERONUMS($result_points)) {
                        // Ok transfer points
                        while ($content2 = SQL_FETCHARRAY($result_points)) {
                                // Merge both arrays
index beb7f685025dbae43840e6c928d00d62ccf8ef09..b675c6b6dc522617cd22de76010508efe72eed31 100644 (file)
@@ -415,7 +415,7 @@ function detectExtraTemplatePath ($template) {
 }
 
 // Loads an email template and compiles it
-function loadEmailTemplate ($template, $content = array(), $userid = '0') {
+function loadEmailTemplate ($template, $content = array(), $userid = '0', $loadUserData = true) {
        global $DATA;
 
        // Make sure all template names are lowercase!
@@ -452,7 +452,7 @@ function loadEmailTemplate ($template, $content = array(), $userid = '0') {
 
                // Merge data if valid
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "content()=".count($content)." - PRE<br />");
-               if (isUserDataValid()) {
+               if ((isUserDataValid()) && ($loadUserData === true)) {
                        $content = merge_array($content, getUserDataArray());
                } // END - if
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "content()=".count($content)." - AFTER<br />");
index fe3c593b43f2dccee88cb92822bd052747fd25a0..afd6a25b19b6e54dea2cb7ea70bdc306b7656d16 100644 (file)
@@ -1898,6 +1898,42 @@ function getCodeLength () {
        return $GLOBALS[__FUNCTION__];
 }
 
+// "Getter" for least_cats
+function getLeastCats () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('least_cats');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for pass_len
+function getPassLen () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('pass_len');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for admin_menu
+function getAdminMenu () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('admin_menu');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // Checks wether proxy configuration is used
 function isProxyUsed () {
        // Do we have cache?
index f7be8e2ab10acc7b0a0fe414b2a5f7da921e8f6d..cefe0af5cf4c4dd654a88c7888ae2ca59f5e2c34 100644 (file)
@@ -36,7 +36,6 @@ CREATE TABLE `{?_MYSQL_PREFIX?}_config` (
   `points_ref` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
   `least_cats` TINYINT(3) UNSIGNED NOT NULL DEFAULT 5,
   `check_double_email` ENUM('Y','N') NOT NULL DEFAULT 'Y',
-  `check_double_pass` ENUM('Y','N') NOT NULL DEFAULT 'N',
   `admin_notify` ENUM('Y','N') NOT NULL DEFAULT 'Y',
   `url_tlock` BIGINT(20) UNSIGNED NOT NULL DEFAULT '86400',
   `max_tlength` BIGINT(20) UNSIGNED NOT NULL DEFAULT '1000',
index 6a0ab78b379b22399fb7dd34f02ce7b377b2d8ba..fbcc2ff8bc4c10e71125b05da6d46cbff5b482ac 100644 (file)
@@ -65,7 +65,7 @@ $URL = '';
 $moduleState = 'failed';
 
 // Is the maintenance mode active or goes all well?
-if ((isExtensionActive('maintenance')) && (getConfig('maintenance') == 'Y') && (!isAdmin()) && (getModule() != 'admin')) {
+if ((isExtensionActive('maintenance')) && (isMaintenanceEnabled()) && (!isAdmin()) && (getModule() != 'admin')) {
        // Maintain mode is active and you are no admin
        addFatalMessage(__FILE__, __LINE__, '{--MAILER_DOWN_FOR_MAINTENANCE--}');
 } elseif ((SQL_IS_LINK_UP()) && (!ifFatalErrorsDetected())) {
index 5fa0a03092784edd00596681a6b61cff0ad71c58..798c8f178112118018813c76a52bc60332d52b61 100644 (file)
                <td align="center">$content[ip_timeout]</td>
        </tr>
        <tr>
-               <td align="right" width="280">{--ADMIN_CONFIG_REJECT_DOUBLE_EMAIL--}:</td>
+               <td align="right" width="280">{--ADMIN_CONFIG_REJECT_DOUBLE_EMAIL--}</td>
                <td align="center">$content[check_double_email]</td>
        </tr>
        <tr>
-               <td class="bottom" align="right" width="280">{--ADMIN_CONFIG_REJECT_DOUBLE_PASS--}:</td>
-               <td class="bottom" align="center">$content[check_double_pass]</td>
+               <td class="bottom" align="right" width="280">{--ADMIN_CONFIG_REGISTER_GENERATE_PASSWORD_EMPTY--}</td>
+               <td class="bottom" align="center">$content[register_generate_password_empty]</td>
        </tr>
        <tr>
                <td class="table_footer" colspan="2" align="center">
index 404739aca728276c99d5025f10d58430d8b5e9a1..0c080fdb47f42502733766d24e0a5a6ee7016370 100644 (file)
@@ -2,7 +2,7 @@
 <table border="0" cellspacing="0" cellpadding="0" width="440" class="table dashed">
        <tr>
                <td width="60%" align="right" height="40" class="register_left">
-                       <strong>{--MAX_PER_DAY--}:</strong>
+                       {--MAX_PER_DAY--}:
                </td>
                <td width="40%" class="register_right">
                        <select name="max_mails" size="1" class="form_select">
index c70adf33eea681f050a5330ff081823ea717711f..fa1bbea2bc79424f8cad03af33c0623b012e6ee9 100644 (file)
@@ -2,7 +2,7 @@
 <form accept-charset="utf-8" action="{%url=modules.php?module=index&amp;what=register%}" method="post" name="register">
 <table border="0" cellspacing="0" cellpadding="0" width="640" class="table dashed">
        <tr>
-               <td colspan="2" class="table_header bottom" height="70">
+               <td colspan="2" class="table_header bottom">
                        $content[header_content]
                </td>
        </tr>
                </td>
        </tr>
        <tr>
-               <td colspan="2" class="bottom">$content[category_selection]</td>
+               <td colspan="2" class="bottom">
+                       $content[category_selection]
+               </td>
        </tr>
        <tr>
                <td colspan="2" class="table_header bottom">
                        {--REGISTER_MISC--}:
                </td>
        </tr>
+       <tr>
+               <td colspan="2" align="center">
+                       <div class="notice tiny">{--GUEST_EMPTY_PASSWORD_HINT--}</div>
+               </td>
+       </tr>
        <tr>
                <td align="right" class="register_left">
                        {--PASS_1--}, {--PASS_2--}:
                </td>
        </tr>
        <tr>
-               <td colspan="2" align="center">$content[max_receive_list]</td>
+               <td colspan="2" align="center">
+                       $content[max_receive_list]
+               </td>
        </tr>
        $content[refid_content]
        <tr>
                <td colspan="2" class="table_header bottom top">
-                       <div>{--TERMS_OF_USAGE--}:</div>
-                       <div class="notice">{--YOU_FINALIZE--}</div>
+                       {--TERMS_OF_USAGE--}:
                </td>
        </tr>
        <tr>
-               <td class="bottom register_left" align="right">
-                       {--AGREE_TO_THIS--}:
-               </td>
-               <td class="bottom register_right">
-                       <input type="radio" class="form_field" name="agree" class="form_field" value="Y" /> {--YES--}<br />
-                       <input type="radio" class="form_field" name="agree" class="form_field" value="N" checked="checked" /> {--NO--}
+               <td colspan="2" class="bottom">
+                       <table border="0" cellspacing="0" cellpadding="0" width="640" class="table">
+                       <tr>
+                               <td width="50%" align="right">
+                                       {--AGREE_TO_THIS--}
+                               </td>
+                               <td width="50%">
+                                       <input type="radio" class="form_field" name="agree" class="form_field" value="Y" /> {--YES--}<br />
+                                       <input type="radio" class="form_field" name="agree" class="form_field" value="N" checked="checked" /> {--NO--}
+                               </td>
+                       </tr>
+                       </table>
                </td>
        </tr>
        <tr>
index 61ad42191075d082890a6cba9917c5bb2c0eb290..2b4a8dff65b29740db6cb8702ebb6499002649f3 100644 (file)
@@ -1,12 +1,11 @@
 .register_left {
+       width: 240px;
        text-align: right;
-       margin-right: 2px;
+       padding: 3px;
        color: #000000;
-       font-weight: bold;
        font-size: 14px;
        padding-left: 5px;
 }
 
 .register_right {
-       padding-right: 5px;
 }
index 3c00bf89ba140423921bef7e68f5a439694d6119..ef9c6c81c076e2656f3de23535b4bf2add357c19 100644 (file)
@@ -1,8 +1,8 @@
 .register_left {
+       width: 240px;
        text-align: right;
-       margin-right: 2px;
-       color: #0000AA;
-       font-weight: bold;
+       padding: 3px;
+       color: #000000;
        font-size: 14px;
 }
 
index c6498bb8a007bc84510541a83dd200af4fc23125..24317348d432736486b9e4f5d40b47b3f29c9639 100644 (file)
@@ -1,10 +1,9 @@
 .register_left {
+       width: 240px;
        text-align: right;
-       margin-right: 2px;
+       padding: 3px;
        color: #880000;
-       font-weight: bold;
        font-size: 14px;
-       padding-left: 5px;
 }
 
 .register_right {
index c600f81e1f4575fdb3b77529ee5b561905b56460..d9a903786584071fa12ca661c07878f5291166f8 100644 (file)
@@ -1,9 +1,9 @@
 .register_left {
-       text-align                      : right;
-       align                           : right;
-       margin-right            : 2px;
-       color                           : #0000AA;
-       font-weight                     : bold;
+       width: 240px;
+       text-align: right;
+       align: right;
+       padding: 3px;
+       color: #0000AA;
 }
 
 .register_right {
index fa2facec373518f6380e36ef8a5a4bcfda5b3d72..811f3f4e5149965f35cb97bfb5fd00ac25034b4f 100644 (file)
 }
 
 .register_left {
-       text-align              : right;
-       align                   : right;
-       margin-right            : 2px;
-       color                   : #FFFFFF;
-       font-weight             : bold;
-       font-size                       : 14px;
-       padding-left            : 5px;
+       width: 240px;
+       text-align: right;
+       align: right;
+       padding: 3px;
+       color: #FFFFFF;
+       font-size: 14px;
 }
 
 .register_right {
-       padding-right           : 5px;
 }
 
 .register_header {
index 72f4540bc7106462849d9e5543cf125e9ac266ef..5d6f7cdf329dc40176f0b0fc46e36ce627acabac 100644 (file)
 }
 
 .register_left {
-       text-align              : right;
-       align                   : right;
-       margin-right            : 2px;
-       color                   : #000000;
-       font-weight             : bold;
-       font-size                       : 14px;
-       padding-left            : 5px;
+       width: 240px;
+       text-align: right;
+       align: right;
+       padding: 3px;
+       color: #000000;
+       font-size: 14px;
 }
 
 .register_right {
-       padding-right           : 5px;
-}
-
-.register_header {
-       text-align              : center;
-       align                   : center;
-       background-color        : #EEEEFF;
-       color                   : #000000;
-       font-weight             : bold;
-       border-top              : 1px solid #000000;
-       border-bottom           : 1px solid #000000;
-       height                  : 25px;
-}
-
-A:hover.register_term {
-       background-color        : #EEEEFF;
-       border-top              : 1px solid #000000;
-       border-bottom           : 1px solid #000000;
-}
-.register_submit {
-       border-style            : outset;
-}
-
-.register_reset {
-       border-style            : groove;
-       border                  : solid 1px #000000;
-       color                   : #000000;
-}
-.register_submit {
-       color                   : #000000;
-       border-color            : #000000;
-}
-
-.register_select {
-       border                  : solid 1px;
-       border-color            : #000000;
-       background-color        : #EEEEFF;
-}
-
-.register_failed {
-       color                   : #000000;
-}
-
-.register_snote {
-       font-size                       : 12px;
-}
-
-.register_normal {
-       border-style            : solid;
-       border                  : solid 1px;
-       border-color            : #000000;
-       padding-right           : 5px;
-}
-
-.register_main {
-       background-color        : #FFFFFF;
-       width                   : 540px;
-}
-
-.register_done2 {
-       height                  : 40px;
-       color                   : #000000;
-       background-color        : #FFFFFF;
-       width                   : 500px;
-}
-
-.register_title {
-       background-color        : #EEEEFF;
-       text-align              : center;
-       align                   : center;
-       font-size                       : 18px;
-       padding-left            : 5px;
-       padding-right           : 5px;
-}
-
-.register_seperator {
-       height                  : 7px;
-       font-size                       : 1px;
-}
-
-.register_left {
-       text-align              : right;
-       align                   : right;
-       margin-right            : 2px;
-       color                   : #000000;
-       font-weight             : bold;
-       font-size                       : 14px;
-       padding-left            : 5px;
-}
-
-.register_right {
-       padding-right           : 5px;
 }
 
 .register_header {
index 08ee2944864eebf2dfe4511cbd1d5f5c8462a28d..d019810f7fc3dc4cb9bb8ffe192b6fb1e0bd2c3d 100644 (file)
--- a/view.php
+++ b/view.php
@@ -51,7 +51,7 @@ if ((isGetRequestParameterSet('user')) && (isGetRequestParameterSet('banner')))
                array(bigintval(getRequestParameter('banner'))), __FILE__, __LINE__);
 
        // Do we have the banner?
-       if (SQL_NUMROWS($result) == 1)  {
+       if (SQL_NUMROWS($result) == 1) {
                // Load the URL
                $data = SQL_FETCHARRAY($result);