Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature update: add credentials for IMAP #702

Merged
merged 2 commits into from
Jul 6, 2023
Merged

Feature update: add credentials for IMAP #702

merged 2 commits into from
Jul 6, 2023

Conversation

haymaker
Copy link
Contributor

@haymaker haymaker commented Jul 4, 2023

I had a use case requiring separate credentials for IMAP - created a simple update to add credentials support.

Decided to keep it simple rather than add extra logic for cross-credential checking. If both sets of credentials are the same, they can just be duplicated.

DB version bumped to 0.6.2.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hello & Welcome! :)

Thanks for taking the time to help improve ITFlow. We're excited to review your contributions - we'll review this PR as soon as we can!

Whilst you're waiting, please feel free to check out the forum.

@wrongecho
Copy link
Collaborator

Test these changes at: https://imapcredentials702.pr-review.itflow.org
(automatic message)

@haymaker
Copy link
Contributor Author

haymaker commented Jul 4, 2023

PR review link gives invalid credentials for demo@demo, tested against my local copy, no obvious issues, works as intended.

//if (CURRENT_DATABASE_VERSION == '0.6.1') {
if (CURRENT_DATABASE_VERSION == '0.6.1') {
mysqli_query($mysqli, "ALTER TABLE `settings` ADD COLUMN `config_imap_username` VARCHAR(200) NULL DEFAULT NULL AFTER `config_imap_encryption`");
mysqli_query($mysqli, "ALTER TABLE `settings` ADD COLUMN `config_imap_password` VARCHAR(200) NULL DEFAULT NULL AFTER `config_imap_username`;");
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • Remove semi colon at end of query statement.

  • Add update statement for database version

@wrongecho
Copy link
Collaborator

wrongecho commented Jul 5, 2023

Hey! Welcome to ITFlow, it's great to have you here.

Firstly, thanks for the PR :) This was a feature we didn't add initially as we were going for MVP - it's great that you've taken the time to add it!

I'm not sure what happened with the PR Review instance, the users table was blank. I re-copied it across and it seems to work now. I'll look into it, but am low on time at the moment.

Just a couple of things to adjust, please - both in in database_updates.php:

  1. The PR misses the line to update the database version - this causes the update database screen to just loop.
// Then, update the database to the next sequential version
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.6.2'");
  1. The second update statement in the PR has a semi-colon. I'm not sure if this breaks things or not (due to the looping above), but could we please remove for consistency's sake?
mysqli_query($mysqli, "ALTER TABLE `settings` ADD COLUMN `config_imap_password` VARCHAR(200) NULL DEFAULT NULL AFTER `config_imap_username`;");`

image

Could you please adjust the above and we'll take another look? Appreciate your time.

Cheers!

@sonarcloud
Copy link

sonarcloud bot commented Jul 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@haymaker
Copy link
Contributor Author

haymaker commented Jul 6, 2023

Thanks for the reply! I'm not sure how this got missed - I swear I had this in my code prior to commit, so I have no idea how it disappeared. I remove the semicolon and re-added the version update statement.

Thank you!

Hey! Welcome to ITFlow, it's great to have you here.

Firstly, thanks for the PR :) This was a feature we didn't add initially as we were going for MVP - it's great that you've taken the time to add it!

I'm not sure what happened with the PR Review instance, the users table was blank. I re-copied it across and it seems to work now. I'll look into it, but am low on time at the moment.

Just a couple of things to adjust, please - both in in database_updates.php:

  1. The PR misses the line to update the database version - this causes the update database screen to just loop.
// Then, update the database to the next sequential version
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.6.2'");
  1. The second update statement in the PR has a semi-colon. I'm not sure if this breaks things or not (due to the looping above), but could we please remove for consistency's sake?
mysqli_query($mysqli, "ALTER TABLE `settings` ADD COLUMN `config_imap_password` VARCHAR(200) NULL DEFAULT NULL AFTER `config_imap_username`;");`

image

Could you please adjust the above and we'll take another look? Appreciate your time.

Cheers!

@johnnyq
Copy link
Collaborator

johnnyq commented Jul 6, 2023

nice work @haymaker i'll reel this one in tomorrow

@haymaker
Copy link
Contributor Author

haymaker commented Jul 6, 2023

@johnnyq I'll see about getting some time to possibly contribute more, as I'm permitted. I'll look around at the forums/issues and see what I might be able to pick up and work on, keeping as close to the spirit of the code as I can for consistency's sake.

@johnnyq
Copy link
Collaborator

johnnyq commented Jul 6, 2023

@haymaker That would be fantastic and were looking forward to working with you =]

@johnnyq johnnyq merged commit b54a388 into itflow-org:master Jul 6, 2023
@haymaker haymaker deleted the imap-credentials branch July 7, 2023 11:02
@haymaker haymaker restored the imap-credentials branch July 7, 2023 11:02
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.

3 participants