X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Fregister_functions.php;h=1bb911df8f768f3c49a57e1e3748c19517f88dc8;hp=b330fea6c1aa225c098f9207a5da1ab5fad26fd3;hb=49acdb7a7adbcf25a8e8683b5581bfcec72b23bd;hpb=dabf3d37a62230bc705be02682c656f4cb4a344f diff --git a/inc/libs/register_functions.php b/inc/libs/register_functions.php index b330fea6c1..1bb911df8f 100644 --- a/inc/libs/register_functions.php +++ b/inc/libs/register_functions.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2013 by Mailer Developer Team * + * Copyright (c) 2009 - 2015 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -98,7 +98,7 @@ ORDER BY `sort` ASC', __FUNCTION__, __LINE__); - if (!ifSqlHasZeroNums($result)) { + if (!ifSqlHasZeroNumRows($result)) { // List alle visible modules (or all to the admin) $OUT .= ''; while ($content = sqlFetchArray($result)) { @@ -130,7 +130,7 @@ ORDER BY } // Outputs a 'failed message' -function registerOutputFailedMessage ($messageId, $extra='') { +function registerOutputFailedMessage ($messageId, $extra = '') { if (empty($messageId)) { outputHtml('
' . $extra . '
'); } else { @@ -328,6 +328,14 @@ function doGenericUserRegistration () { return FALSE; } // END - if + // These elements must be set + assert(isset($GLOBALS['register_country_row'])); + assert(isset($GLOBALS['register_country_data'])); + assert(isset($GLOBALS['register_confirm_hash'])); + + // Only comment this in if you develop + //* DEVELOPER-CODE: */ $GLOBALS['register_userid'] = 1; return TRUE; + // Create user's account... sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_user_data` @@ -411,6 +419,9 @@ function doGenericUserRegistration () { return FALSE; } // END - if + // Set new user id globally + $GLOBALS['register_userid'] = $filterData['register_insert_id']; + // Shall we reset random refid? Only possible with latest ext-user if (isExtensionInstalledAndNewer('user', '0.3.4')) { // Reset all accounts, registration is done @@ -661,5 +672,63 @@ function doTemplateAdminRegisterCategoryTable ($templateName, $clear = FALSE, $c return registerGenerateCategoryTable('admin', $configEntry); } +// Template helper for generating a list of all activated user registration provider +function doTemplateGuestRegistrationList ($templateName, $clear = FALSE) { + // Init output + $content = ''; + + // Default is only activated provider + $addSql = " AND `provider_is_active`='Y'"; + + // Is admin logged-in? + if (isAdmin()) { + // Then show all + $addSql = ''; + } // END - if + + // Search for all + $result = sqlQuery("SELECT + `provider_name`, + `provider_extension` +FROM + `{?_MYSQL_PREFIX?}_user_register_provider` +WHERE + `provider_extension` != 'register' + " . $addSql . " +ORDER BY + `provider_name` ASC", __FUNCTION__, __LINE__); + + // Are there entries? + if (sqlNumRows($result) > 0) { + // Loop through all + $row = ''; + while ($content = sqlFetchArray($result)) { + // Load row template + $row .= loadTemplate('guest_registration_provider_row', TRUE, $content); + } // END - while + + // Load main template + $content = loadTemplate('guest_registration_provider', TRUE, $row); + } else { + // Nothing found + $content = returnMessage('{--GUEST_EXTRA_REGISTRATION_PROVIDER_404--}'); + } + + // Free result + sqlFreeResult($result); + + // Return the generated content + return $content; +} + +// ---------------------------------------------------------------------------- +// "Translator" functions +// ---------------------------------------------------------------------------- + +function translateRegistrationProviderName ($providerName) { + // "Translate it" + return '{--REGISTRATION_PROVIDER_' . strtoupper($providerName) . '--}'; +} + // [EOF] ?>