From: Roland Häder Date: Sun, 7 Nov 2010 20:05:13 +0000 (+0000) Subject: Added ability to allow empty passwords, if the user does so, a random password will... X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=7db85bc0c45b62c28ba49e728f489ad4bc1c115f Added ability to allow empty passwords, if the user does so, a random password will be generated, many wrapper functions introduced --- diff --git a/.gitattributes b/.gitattributes index 554eb648f6..082ff8f706 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/inc/extensions-functions.php b/inc/extensions-functions.php index 332a3d2324..fa35d12e2b 100644 --- a/inc/extensions-functions.php +++ b/inc/extensions-functions.php @@ -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 { diff --git a/inc/extensions/ext-register.php b/inc/extensions/ext-register.php index d6ed16780c..cf5fff692a 100644 --- a/inc/extensions/ext-register.php +++ b/inc/extensions/ext-register.php @@ -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üpunkt aus 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üpunkt aus menu-{?DEFAULT_LANG?} heraus geholt."); + break; } // END - switch break; diff --git a/inc/functions.php b/inc/functions.php index 4a1d8929b7..7676c1404d 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -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,-,+,_,/,.'); diff --git a/inc/language/de.php b/inc/language/de.php index 0d5125aba2..924e7c4068 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -155,7 +155,7 @@ addMessages(array( 'FAMILY' => "Nachname", 'STREET_NR' => "Straß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 [AGBs] zu?", 'SUBMIT_REGISTER' => "Anmeldedaten abschicken", 'HAVE_TO_AGREE' => "Sie müssen unseren AGBs zustimmen, damit Sie an diesem {?mt_word?} teilnehmen kö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äter noch einmal vorbei.", 'ADMIN_ACTION_INVALID' => "Die action/what-Kombination %s ist ungültig.", - 'SHORT_PASS' => "Das eingegebene Passwort ist nach unseren Sicherheitseinstellungen zu kurz. Mindestlänge ist", + 'GUEST_SHORT_PASS' => "Das eingegebene Passwort ist nach unseren Sicherheitseinstellungen zu kurz. Mindestlänge ist", + 'GUEST_EMPTY_PASSWORD_HINT' => "Lassen Sie beide Passwörter leer, so wird Ihnen eines per Zufall generiert.", 'ADMIN_EDIT_POINTS_SETTINGS_TITLE' => "Ä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ählende Kategorieanzahl", - 'CATS_LEAST' => "Bitte wählen Sie mehr Kategorien aus! Minimum ist: {?least_cats?}", - '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ählen Sie mehr Kategorien aus! Minimum ist: {?least_cats?}", + '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örter bei der Anmeldung ablehnen? (Wird nicht angezeigt!)", 'ADMIN_EDIT_POINTS' => "Willkommensgutschrift und andere Festbeträge editieren", 'ADMIN_EDIT_REFERAL_DEPTHS' => "Referal-Ebenen editieren / löschen / hinzufügen", 'ADMIN_ADD_NEW_REFERAL_DEPTH_TITLE' => "Neue Referal-Ebene hinzufügen", @@ -230,18 +227,15 @@ addMessages(array( 'ADMIN_EDIT_LEVEL' => "Ref-Ebene editieren", 'ADMIN_DELETE_LEVEL' => "Ref-Ebene löschen", 'HELLO' => "Hallo", - 'GUEST_YOU_REGISTERED_WITH_US' => "vielen Dank, dass Sie sich fü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 Überprüfung Ihre persönlichen Daten", 'GUEST_SURNAME' => "Vorname", 'GUEST_FAMILY' => "Nachname", 'GUEST_STREET_NR' => "Straße und Hausnummer", 'GUEST_COUNTRY' => "Lä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önlicher Referal-Link, mit dem Sie bereits jetzt schon neue Mitglieder werben können:", 'GUEST_CONFIRM_LINK_SUBJECT' => "Ihr Bestätigungslink", 'ADMIN_GUEST_REGISTERED_WITH_US' => "Ein Gast hat sich soeben bei uns angemeldet.", 'ADMIN_GUEST_PERSONA_DATA' => "Hier sind zur Überprüfung nochmals seine persönlichen Daten", diff --git a/inc/language/register_de.php b/inc/language/register_de.php index 0fd88c80da..a3fff44bc5 100644 --- a/inc/language/register_de.php +++ b/inc/language/register_de.php @@ -48,16 +48,15 @@ addMessages(array( 'ADMIN_REGISTER_FIELD_NAME' => "Eingabefeld", 'ADMIN_REGISTER_FIELD_REQUIRED' => "Pflichtfeld?", 'ADMIN_REGISTER_CHANGES_SAVED' => "Es wurden %s 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ße und Hausnummer ein.", - 'REGISTER_CNTRY_REQUIRED' => "Bitte geben Sie den zweistelligen Ländercode ein.", - 'REGISTER_ZIP_REQUIRED' => "Bitte geben Sie die Postleitzahl ein.", - 'REGISTER_CITY_REQUIRED' => "Bitte geben Sie den Wohnort ein.", 'CNTRY' => "Lä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?
(Nein = id wird editierbar!)
", 'ADMIN_CONFIG_REGISTER_IP_TIMEOUT' => "IP-Zeitsperre", + 'ADMIN_CONFIG_REGFORM_SETTINGS_TITLE' => "Einstellungen am Anmeldeformular", + 'ADMIN_CONFIG_LEAST_CATEGORIES' => "Mindestens auszuwä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] diff --git a/inc/libs/holiday_functions.php b/inc/libs/holiday_functions.php index bef825a89b..5fe06735de 100644 --- a/inc/libs/holiday_functions.php +++ b/inc/libs/holiday_functions.php @@ -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 index 0000000000..be0e6cfd83 --- /dev/null +++ b/inc/libs/maintenance_functions.php @@ -0,0 +1,72 @@ + diff --git a/inc/libs/network_functions.php b/inc/libs/network_functions.php index b3800e9a69..c6a23f75ea 100644 --- a/inc/libs/network_functions.php +++ b/inc/libs/network_functions.php @@ -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 diff --git a/inc/libs/optimize_functions.php b/inc/libs/optimize_functions.php index 66ec22b632..4455cfcc8e 100644 --- a/inc/libs/optimize_functions.php +++ b/inc/libs/optimize_functions.php @@ -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']; diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php index 40e601a189..8f9f08127c 100644 --- a/inc/libs/rallye_functions.php +++ b/inc/libs/rallye_functions.php @@ -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` diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php index 575a918c28..cacd4de92c 100644 --- a/inc/libs/refback_functions.php +++ b/inc/libs/refback_functions.php @@ -195,7 +195,7 @@ function updateRefbackTable ($userid) { // When no entry was updated then we have to create it here //* DEBUG: */ print(__FUNCTION__ . '(' . __LINE__."):found=".SQL_NUMROWS($result_refid)."
"); - 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 diff --git a/inc/libs/register_functions.php b/inc/libs/register_functions.php index 3d36d8c374..56056fd84c 100644 --- a/inc/libs/register_functions.php +++ b/inc/libs/register_functions.php @@ -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 = '(*)'; + if ($row['field_required'] == 'Y') { + $value = '(*)'; + } // 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] ?> diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index f067f2e4eb..6894f398ef 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -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 diff --git a/inc/mails/doubler_mails.php b/inc/mails/doubler_mails.php index 0c400f7780..03da51b034 100644 --- a/inc/mails/doubler_mails.php +++ b/inc/mails/doubler_mails.php @@ -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)) { diff --git a/inc/module-functions.php b/inc/module-functions.php index bf629eb462..5b520465b1 100644 --- a/inc/module-functions.php +++ b/inc/module-functions.php @@ -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 diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 083d62be33..78d2469e4b 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -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; diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index 31073f84bb..1c0dd56c55 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -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 diff --git a/inc/modules/admin/what-adminedit.php b/inc/modules/admin/what-adminedit.php index 45d42bc01e..5f0ec0c4fa 100644 --- a/inc/modules/admin/what-adminedit.php +++ b/inc/modules/admin/what-adminedit.php @@ -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; diff --git a/inc/modules/admin/what-config_admin.php b/inc/modules/admin/what-config_admin.php index 31de2b0033..1feeafb9a8 100644 --- a/inc/modules/admin/what-config_admin.php +++ b/inc/modules/admin/what-config_admin.php @@ -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); diff --git a/inc/modules/admin/what-config_networks.php b/inc/modules/admin/what-config_networks.php index d78e2b8f4a..6a371411ee 100644 --- a/inc/modules/admin/what-config_networks.php +++ b/inc/modules/admin/what-config_networks.php @@ -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)) { diff --git a/inc/modules/admin/what-config_other.php b/inc/modules/admin/what-config_other.php index f3f3a90378..2672e5c07f 100644 --- a/inc/modules/admin/what-config_other.php +++ b/inc/modules/admin/what-config_other.php @@ -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 diff --git a/inc/modules/admin/what-config_register2.php b/inc/modules/admin/what-config_register2.php index b8f08dc01b..b601fa2ca1 100644 --- a/inc/modules/admin/what-config_register2.php +++ b/inc/modules/admin/what-config_register2.php @@ -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); diff --git a/inc/modules/admin/what-guestedit.php b/inc/modules/admin/what-guestedit.php index 69c5b0a345..bf99bcd72a 100644 --- a/inc/modules/admin/what-guestedit.php +++ b/inc/modules/admin/what-guestedit.php @@ -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; diff --git a/inc/modules/admin/what-list_links.php b/inc/modules/admin/what-list_links.php index 394508fa85..ed535b2aa2 100644 --- a/inc/modules/admin/what-list_links.php +++ b/inc/modules/admin/what-list_links.php @@ -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 diff --git a/inc/modules/admin/what-list_network_api_translation.php b/inc/modules/admin/what-list_network_api_translation.php index a2d5150a5e..923e5dce6d 100644 --- a/inc/modules/admin/what-list_network_api_translation.php +++ b/inc/modules/admin/what-list_network_api_translation.php @@ -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)) { diff --git a/inc/modules/admin/what-list_unconfirmed.php b/inc/modules/admin/what-list_unconfirmed.php index ee9be41504..48e735be4e 100644 --- a/inc/modules/admin/what-list_unconfirmed.php +++ b/inc/modules/admin/what-list_unconfirmed.php @@ -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)) { diff --git a/inc/modules/admin/what-maintenance.php b/inc/modules/admin/what-maintenance.php index 491e610789..58a8429269 100644 --- a/inc/modules/admin/what-maintenance.php +++ b/inc/modules/admin/what-maintenance.php @@ -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; diff --git a/inc/modules/admin/what-memedit.php b/inc/modules/admin/what-memedit.php index b7f294fcc2..315c2fdc3e 100644 --- a/inc/modules/admin/what-memedit.php +++ b/inc/modules/admin/what-memedit.php @@ -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; diff --git a/inc/modules/guest/what-register.php b/inc/modules/guest/what-register.php index 01773d9b81..d28311ef8a 100644 --- a/inc/modules/guest/what-register.php +++ b/inc/modules/guest/what-register.php @@ -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 { diff --git a/inc/modules/guest/what-sponsor_reg.php b/inc/modules/guest/what-sponsor_reg.php index ebe99458fe..757c963415 100644 --- a/inc/modules/guest/what-sponsor_reg.php +++ b/inc/modules/guest/what-sponsor_reg.php @@ -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--}'; } diff --git a/inc/modules/member/what-categories.php b/inc/modules/member/what-categories.php index debdd3bced..2812f0b070 100644 --- a/inc/modules/member/what-categories.php +++ b/inc/modules/member/what-categories.php @@ -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 diff --git a/inc/modules/member/what-holiday.php b/inc/modules/member/what-holiday.php index edf15eec6c..f935d39163 100644 --- a/inc/modules/member/what-holiday.php +++ b/inc/modules/member/what-holiday.php @@ -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&what=holiday'); return; } diff --git a/inc/modules/sponsor/account.php b/inc/modules/sponsor/account.php index f39402baa5..0d0196de4a 100644 --- a/inc/modules/sponsor/account.php +++ b/inc/modules/sponsor/account.php @@ -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 { diff --git a/inc/pool/pool-bonus.php b/inc/pool/pool-bonus.php index 139f1f5e7c..ef5fb8e696 100644 --- a/inc/pool/pool-bonus.php +++ b/inc/pool/pool-bonus.php @@ -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)) { diff --git a/inc/pool/pool-user.php b/inc/pool/pool-user.php index 5ac55c5946..953e9733f9 100644 --- a/inc/pool/pool-user.php +++ b/inc/pool/pool-user.php @@ -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__); diff --git a/inc/reset/reset_100_bonus.php b/inc/reset/reset_100_bonus.php index 7514202808..55933843d7 100644 --- a/inc/reset/reset_100_bonus.php +++ b/inc/reset/reset_100_bonus.php @@ -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 diff --git a/inc/reset/reset_birthday.php b/inc/reset/reset_birthday.php index 2586efbeca..dc3f70660a 100644 --- a/inc/reset/reset_birthday.php +++ b/inc/reset/reset_birthday.php @@ -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 diff --git a/inc/reset/reset_daily.php b/inc/reset/reset_daily.php index 9fb7653854..d033e12db7 100644 --- a/inc/reset/reset_daily.php +++ b/inc/reset/reset_daily.php @@ -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 diff --git a/inc/template-functions.php b/inc/template-functions.php index beb7f68502..b675c6b6dc 100644 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -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
"); - if (isUserDataValid()) { + if ((isUserDataValid()) && ($loadUserData === true)) { $content = merge_array($content, getUserDataArray()); } // END - if //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "content()=".count($content)." - AFTER
"); diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index fe3c593b43..afd6a25b19 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -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? diff --git a/install/tables.sql b/install/tables.sql index f7be8e2ab1..cefe0af5cf 100644 --- a/install/tables.sql +++ b/install/tables.sql @@ -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', diff --git a/modules.php b/modules.php index 6a0ab78b37..fbcc2ff8bc 100644 --- a/modules.php +++ b/modules.php @@ -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())) { diff --git a/templates/de/html/admin/admin_config_register2.tpl b/templates/de/html/admin/admin_config_register2.tpl index 5fa0a03092..798c8f1781 100644 --- a/templates/de/html/admin/admin_config_register2.tpl +++ b/templates/de/html/admin/admin_config_register2.tpl @@ -25,12 +25,12 @@ $content[ip_timeout] - {--ADMIN_CONFIG_REJECT_DOUBLE_EMAIL--}: + {--ADMIN_CONFIG_REJECT_DOUBLE_EMAIL--} $content[check_double_email] - {--ADMIN_CONFIG_REJECT_DOUBLE_PASS--}: - $content[check_double_pass] + {--ADMIN_CONFIG_REGISTER_GENERATE_PASSWORD_EMPTY--} + $content[register_generate_password_empty] diff --git a/templates/de/html/guest/guest_receive_table.tpl b/templates/de/html/guest/guest_receive_table.tpl index 404739aca7..0c080fdb47 100644 --- a/templates/de/html/guest/guest_receive_table.tpl +++ b/templates/de/html/guest/guest_receive_table.tpl @@ -2,7 +2,7 @@
- {--MAX_PER_DAY--}: + {--MAX_PER_DAY--}: - @@ -88,13 +88,20 @@ - + + + + - + $content[refid_content] - - diff --git a/theme/business/css/register.css b/theme/business/css/register.css index 61ad421910..2b4a8dff65 100644 --- a/theme/business/css/register.css +++ b/theme/business/css/register.css @@ -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; } diff --git a/theme/default/css/register.css b/theme/default/css/register.css index 3c00bf89ba..ef9c6c81c0 100644 --- a/theme/default/css/register.css +++ b/theme/default/css/register.css @@ -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; } diff --git a/theme/desert/css/register.css b/theme/desert/css/register.css index c6498bb8a0..24317348d4 100644 --- a/theme/desert/css/register.css +++ b/theme/desert/css/register.css @@ -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 { diff --git a/theme/org/css/register.css b/theme/org/css/register.css index c600f81e1f..d9a9037865 100644 --- a/theme/org/css/register.css +++ b/theme/org/css/register.css @@ -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 { diff --git a/theme/schleuder/css/register.css b/theme/schleuder/css/register.css index fa2facec37..811f3f4e51 100644 --- a/theme/schleuder/css/register.css +++ b/theme/schleuder/css/register.css @@ -60,17 +60,15 @@ } .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 { diff --git a/theme/ship-simu/css/register.css b/theme/ship-simu/css/register.css index 72f4540bc7..5d6f7cdf32 100644 --- a/theme/ship-simu/css/register.css +++ b/theme/ship-simu/css/register.css @@ -60,108 +60,15 @@ } .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 { diff --git a/view.php b/view.php index 08ee294486..d019810f7f 100644 --- 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);
+ $content[header_content]
$content[category_selection] + $content[category_selection] +
{--REGISTER_MISC--}:
+
{--GUEST_EMPTY_PASSWORD_HINT--}
+
{--PASS_1--}, {--PASS_2--}: @@ -105,22 +112,29 @@
$content[max_receive_list] + $content[max_receive_list] +
-
{--TERMS_OF_USAGE--}:
-
{--YOU_FINALIZE--}
+ {--TERMS_OF_USAGE--}:
- {--AGREE_TO_THIS--}: - - {--YES--}
- {--NO--} +
+ + + + + +
+ {--AGREE_TO_THIS--} + + {--YES--}
+ {--NO--} +