BSIT-3-1-APPDEV / PUPSRC-AutomatedElectionSystem

iVOTE is a web-based voting application developed for the student academic organizations of PUP Sta. Rosa Campus.
https://ivote-pupsrc.com
4 stars 8 forks source link

feat: added the emailing of start end close of election #283

Closed C-Ivan-Bandilla closed 2 months ago

C-Ivan-Bandilla commented 2 months ago

Used the official email on mailing Refactored usage of variables due to conflicting of values of inclusion of logger.php which requires the session-exchange.php that already has the organization-list.php

Added activity logging on

Already deleted the mailer-test.php and updated the gitignore file image

gitguardian[bot] commented 2 months ago

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | | | -------------- | ------------------ | ------------------------------ | ---------------- | --------------- | -------------------- | | [13043212](https://dashboard.gitguardian.com/workspace/558516/incidents/13043212?occurrence=160914376) | Triggered | SMTP credentials | ad9229b1d4a8feec4ee4c3a714859bf34715371a | src/includes/mailer-test.php | [View secret](https://github.com/BSIT-3-1-APPDEV/PUPSRC-AutomatedElectionSystem/commit/ad9229b1d4a8feec4ee4c3a714859bf34715371a#diff-7c014e330afeb8f6740ef0b23948f90e2f4ac56301328b1991f074c8c3118f83L36) |
🛠 Guidelines to remediate hardcoded secrets
1. Understand the implications of revoking this secret by investigating where it is used in your code. 2. Replace and store your secret safely. [Learn here](https://blog.gitguardian.com/secrets-api-management?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) the best practices. 3. Revoke and [rotate this secret](https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/smtp_assignment#revoke-the-secret?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). 4. If possible, [rewrite git history](https://blog.gitguardian.com/rewriting-git-history-cheatsheet?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data. To avoid such incidents in the future consider - following these [best practices](https://blog.gitguardian.com/secrets-api-management/?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) for managing and storing secrets including API keys and other credentials - install [secret detection on pre-commit](https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) to catch secret before it leaves your machine and ease remediation.

🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

C-Ivan-Bandilla commented 2 months ago

Working on demo Still finding the issue that I can run the email sender manually and sends email okay

But the cron job in hostinger is not executing the PHP properly even no error run output

C-Ivan-Bandilla commented 2 months ago

Finally it worked!

https://drive.google.com/open?id=1tEOQd3cx-9pFpVEAWKHifz9I62PRhTF_&usp=drive_fs

here is the correct email should have been scrolled down to see the latest email I thought it also had the incorrect time image

fix the include and require conflict found on https://olive-deer-977022.hostingersite.com/

Issue overview The sending of mass mail manually has no issue but when it is run from cron job there is a hidden error The issue is within inclusion of session-exchange.php that is included in email-sender.php The session-exchange.php contains the session-handler.php that causes this error

2024-07-19 5:21 pm Error: [2] ini_set(): Session ini settings cannot be changed after headers have already been sent - /home/u155023598/domains/olive-deer-977022.hostingersite.com/public_html/src/includes/session-handler.php: 6 2024-07-19 5:21 pm Error: [2] ini_set(): Session ini settings cannot be changed after headers have already been sent - /home/u155023598/domains/olive-deer-977022.hostingersite.com/public_html/src/includes/session-handler.php: 7 2024-07-19 5:21 pm Error: [2] session_set_cookie_params(): Session cookie parameters cannot be changed after headers have already been sent - /home/u155023598/domains/olive-deer-977022.hostingersite.com/public_html/src/includes/session-handler.php: 10 2024-07-19 5:21 pm Error: [2] session_start(): Session cannot be started after headers have already been sent - /home/u155023598/domains/olive-deer-977022.hostingersite.com/public_html/src/includes/session-handler.php: 17 2024-07-19 5:21 pm Error: [2] Cannot modify header information - headers already sent by (output started at /home/u155023598/domains/olive-deer-977022.hostingersite.com/public_html/src/cron-jobs/send-email-queue.php:10) - /home/u155023598/domains/olive-deer-977022.hostingersite.com/public_html/src/includes/session-exchange.php: 8

C-Ivan-Bandilla commented 2 months ago

Upon approval and confirmation that mass emailling is working this issue shall be close #282

Carl-Tabuso commented 2 months ago

@biellamariscotes UP

Carl-Tabuso commented 2 months ago

It seems that you've managed to make it work, if so, you think we can merge this?

C-Ivan-Bandilla commented 2 months ago

It seems that you've managed to make it work, if so, you think we can merge this?

Yes, it can be

I already setup also the cron job for ivote it can be tested further once updated

NOTE: if more than 98 verified voters in table they will be divided into 98 per batch with 30mins interval each

github-actions[bot] commented 2 months ago

:tada: This PR is included in version 2.41.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: