X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Flibs%2Fregister_functions.php;h=f0bd6cd97f9ed50b64e73e1f9d29628232e1858c;hb=6ef6799565051ceac37a56b80c3f2a87b01e3ca2;hp=9fdf938c698c4f5008ce37e29ab1d281430bd439;hpb=e5dffd4249c97200cbad02f3f4eaf5c373fdb89a;p=mailer.git diff --git a/inc/libs/register_functions.php b/inc/libs/register_functions.php index 9fdf938c69..f0bd6cd97f 100644 --- a/inc/libs/register_functions.php +++ b/inc/libs/register_functions.php @@ -289,6 +289,21 @@ function doUserRegistration () { reportBug(__FUNCTION__, __LINE__, 'Tried to register a user account without ext-user installed.'); } // END - if + // Init filter data array + $filterData = array( + // Registration status is always FALSE by default + 'status' => FALSE, + ); + + // Run filter chain for user registration + $filterData = runFilterChain('user_registration', $filterData); + + // Return status + return $filterData['status']; +} + +// Generic user registration +function doGenericUserRegistration () { // Init extra SQL data initExtraRegistrationSql(); @@ -612,6 +627,18 @@ function isRegisterGeneratePasswordEmptyEnabled () { return $GLOBALS[__FUNCTION__]; } +// Getter for 'default_registration_provider' +function getDefaultRegistrationProvider () { + // Is the cache entry set? + if (!isset($GLOBALS[__FUNCTION__])) { + // No, so determine it + $GLOBALS[__FUNCTION__] = getConfig('default_registration_provider'); + } // END - if + + // Return cached entry + return $GLOBALS[__FUNCTION__]; +} + // "Getter" for least_cats function getLeastCats () { // Is there cache? @@ -634,5 +661,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] ?>