X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-subids.php;h=8fd6b2a2e4d366c6e706d13f674773a1c8caa333;hb=32f930539d6b5cb5e603bece41277f3e5cca8fa9;hp=3ca4364019432a921d15c80c6a3bdb6e1147cce3;hpb=b0ed0547ba277e815ca38b3333b191149a88019c;p=mailer.git diff --git a/inc/modules/member/what-subids.php b/inc/modules/member/what-subids.php index 3ca4364019..8fd6b2a2e4 100644 --- a/inc/modules/member/what-subids.php +++ b/inc/modules/member/what-subids.php @@ -55,11 +55,11 @@ if ((!isExtensionActive('user')) && (!isAdmin())) { } // END - if // By default show the list... -$show = true; +$show = TRUE; // Check for 'url_id' element //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isFormSent()=' . intval(isFormSent('add_subid')) . ',ifPostContainsSelections()=' . intval(ifPostContainsSelections()) . ',countRequestPost()=' . countRequestPost()); -if ((!isFormSent('add_subid')) && ((!ifPostContainsSelections()) || (countRequestPost() == 0))) { +if ((countRequestPost('id') > 0) && (!isFormSent('add_subid')) && ((!ifPostContainsSelections('id')) || (countRequestPost('id') == 0))) { // Not found so output message displayMessage('{--MEMBER_SUBID_NO_SELECTIONS--}'); @@ -70,35 +70,53 @@ if ((!isFormSent('add_subid')) && ((!ifPostContainsSelections()) || (countReques // Edit or delete button hit? if (isFormSent('add_subid')) { // Add new sub id - showEntriesByXmlCallback('member_add_do_subid'); + doGenericXmlTemplateCallback('member_add_do_user_subid'); } elseif (isFormSent('edit')) { // Show entries for editing - showEntriesByXmlCallback('member_edit_show_subid'); + doGenericXmlTemplateCallback('member_edit_show_user_subid'); // Do not show the list of URLs after this template - $show = false; + $show = FALSE; } elseif (isFormSent('do_edit')) { // Change data of entries - showEntriesByXmlCallback('member_edit_do_subid'); + doGenericXmlTemplateCallback('member_edit_do_user_subid'); } elseif (isFormSent('delete')) { // Show entries for deletion - showEntriesByXmlCallback('member_delete_show_subid'); + doGenericXmlTemplateCallback('member_delete_show_user_subid'); // Do not show the list of URLs after this template - $show = false; + $show = FALSE; } elseif (isFormSent('do_delete')) { // Remove entries from database - showEntriesByXmlCallback('member_delete_do_subid'); + doGenericXmlTemplateCallback('member_delete_do_user_subid'); +} elseif ((isGetRequestElementSet('do')) && (isGetRequestElementSet('id'))) { + // Construct module name + $incFile = sprintf("inc/modules/member/subid-%s.php", SQL_ESCAPE(getRequestElement('do'))); + + // Is the include readable and is the sub id assigned to current member? + if (!isUserSubIdAssignedToMember(getRequestElement('id'))) { + // Sub id is not assigned to current member or doesn't exist + displayMessage('{--MEMBER_USER_SUBID_NOT_ASSIGNED_404--}'); + } elseif (isIncludeReadable($incFile)) { + // Then include it + loadIncludeOnce($incFile); + + // Do not show the list of URLs after this template + $show = FALSE; + } else { + // Display error message + displayMessage('{--MEMBER_INVALID_DO_USER_SUBID--}'); + } } // Show entries? -if ($show === false) { +if ($show === FALSE) { // No, a form has already been show - return false; + return FALSE; } // END - if // List all campaigns -showEntriesByXmlCallback('member_list_subid'); +doGenericXmlTemplateCallback('member_list_subid'); // Display form for adding a sub id loadTemplate('member_add_subid');