Skip to content

Removed email & phone#328

Merged
pokhiii merged 1 commit intodevelopfrom
fix/update-email-optional-in-individual-signup
Oct 5, 2024
Merged

Removed email & phone#328
pokhiii merged 1 commit intodevelopfrom
fix/update-email-optional-in-individual-signup

Conversation

@nishant22029
Copy link
Copy Markdown
Collaborator

@nishant22029 nishant22029 commented Oct 5, 2024

  • Removed email and phone

Summary by CodeRabbit

  • New Features

    • Enhanced user redirection for logged-in users to the CiviCRM dashboard.
    • Custom handling for login failures with user feedback.
    • Validation for login fields to ensure completeness before authentication.
    • Improved password reset process with redirection to confirmation pages.
    • New shortcodes for better content management and messaging.
  • Bug Fixes

    • Streamlined redirection processes after individual creation and user identification.

@nishant22029 nishant22029 self-assigned this Oct 5, 2024
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 5, 2024

Walkthrough

The pull request introduces multiple modifications to the functions.php file of the Goonj CRM theme, focusing on user interaction and redirection logic. Key changes include new functions for user redirection after login and registration, handling login failures, validating login fields, and managing password resets. Additional functionalities include processing user identification forms, checking volunteer induction status, and adding new shortcodes for content management. These changes collectively enhance the user experience related to authentication and registration processes.

Changes

File Path Change Summary
wp-content/themes/goonj-crm/functions.php - Added functions for user redirection, login failure handling, field validation, and password reset management.
- Implemented custom messages for login forms and user identification processing.
- Introduced new shortcodes and registered a query variable for enhanced content management.
- Modified redirection logic after individual creation.

Possibly related PRs

Suggested reviewers

  • pokhiii

🐇 "In the garden where bunnies play,
New functions hop in, brightening the day.
With redirection paths and messages clear,
User journeys are smoother, oh dear!
Let's celebrate this code, so spry,
Hopping along, we reach for the sky!" 🌼✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@pokhiii pokhiii merged commit c41d887 into develop Oct 5, 2024
@pokhiii pokhiii deleted the fix/update-email-optional-in-individual-signup branch October 5, 2024 13:05
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (1)
wp-content/themes/goonj-crm/functions.php (1)

Line range hint 146-151: Email and phone data are still being used despite the PR objective to remove them

According to the PR objectives, email and phone information should be removed. However, in goonj_handle_user_identification_form(), the variables $email and $phone are still being retrieved from $_POST and used in the logic. Please review and remove these references if they are no longer needed.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between d66a1b0 and 68f5cd4.

📒 Files selected for processing (1)
  • wp-content/themes/goonj-crm/functions.php (3 hunks)
🔇 Additional comments (1)
wp-content/themes/goonj-crm/functions.php (1)

455-455: Approved: Added necessary fields to the query

The addition of 'source', 'Individual_fields.Creation_Flow', and 'Individual_fields.Source_Processing_Center' to the addSelect method is appropriate for the subsequent logic.

Comment on lines +500 to 502
'/processing-center/material-contribution/details/#?Material_Contribution.Goonj_Office=%s&source_contact_id=%s',
$sourceProcessingCenter,
$individual['id']
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Ensure URL parameters are properly encoded to prevent injection attacks

Again, encoding the parameters is crucial for security.

Apply this change:

$redirectPath = sprintf(
    '/processing-center/material-contribution/details/#?Material_Contribution.Goonj_Office=%s&source_contact_id=%s',
-    $sourceProcessingCenter,
-    $individual['id']
+    urlencode($sourceProcessingCenter),
+    urlencode($individual['id'])
);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'/processing-center/material-contribution/details/#?Material_Contribution.Goonj_Office=%s&source_contact_id=%s',
$sourceProcessingCenter,
$individual['id']
'/processing-center/material-contribution/details/#?Material_Contribution.Goonj_Office=%s&source_contact_id=%s',
urlencode($sourceProcessingCenter),
urlencode($individual['id'])

Comment on lines +492 to 494
'/processing-center/office-visit/details/#?Office_Visit.Goonj_Processing_Center=%s&source_contact_id=%s',
$sourceProcessingCenter,
$individual['id']
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Ensure URL parameters are properly encoded to prevent injection attacks

Similar to the previous comment, encoding the parameters enhances security when constructing URLs.

Apply this change:

$redirectPath = sprintf(
    '/processing-center/office-visit/details/#?Office_Visit.Goonj_Processing_Center=%s&source_contact_id=%s',
-    $sourceProcessingCenter,
-    $individual['id']
+    urlencode($sourceProcessingCenter),
+    urlencode($individual['id'])
);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'/processing-center/office-visit/details/#?Office_Visit.Goonj_Processing_Center=%s&source_contact_id=%s',
$sourceProcessingCenter,
$individual['id']
'/processing-center/office-visit/details/#?Office_Visit.Goonj_Processing_Center=%s&source_contact_id=%s',
urlencode($sourceProcessingCenter),
urlencode($individual['id'])

Comment on lines +483 to 485
'/material-contribution/#?Material_Contribution.Collection_Camp=%s&source_contact_id=%s',
$collectionCamp['id'],
$individual['id']
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Ensure URL parameters are properly encoded to prevent injection attacks

When constructing URLs with dynamic query parameters, it's important to encode the parameters to prevent injection attacks or malformed URLs. Consider using urlencode() on the parameters before inserting them into the URL.

Apply this change:

$redirectPath = sprintf(
    '/material-contribution/#?Material_Contribution.Collection_Camp=%s&source_contact_id=%s',
-    $collectionCamp['id'],
-    $individual['id']
+    urlencode($collectionCamp['id']),
+    urlencode($individual['id'])
);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'/material-contribution/#?Material_Contribution.Collection_Camp=%s&source_contact_id=%s',
$collectionCamp['id'],
$individual['id']
'/material-contribution/#?Material_Contribution.Collection_Camp=%s&source_contact_id=%s',
urlencode($collectionCamp['id']),
urlencode($individual['id'])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants