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

Candidate Not Registered #466

Open
grichardomi opened this issue Feb 28, 2020 · 15 comments
Open

Candidate Not Registered #466

grichardomi opened this issue Feb 28, 2020 · 15 comments
Labels
5 - Contrib Contribution proposed, needs admin

Comments

@grichardomi
Copy link

Using Firefox,

Login an existing candidate from the Career Page, I'm getting this message "You have not registered yet. Please wait while we direct you to the job list"

Can anyone help with the cause of this message or how to register a candidate?

Thank you!

@RussH
Copy link
Member

RussH commented Feb 28, 2020

so I don't use the careers page, however;

https://demo.opencats.org/careers/

should reproduce what you want. If you haven't registered, you just browse the job listings, and then when you try to apply for one, you're prompted to register.

@grichardomi
Copy link
Author

Thanks for responding.

I still get the message after registering (admin@example.com | test4 | 84770) . And it is not allowing me to update my profile.

@shantadam
Copy link
Contributor

shantadam commented Feb 29, 2020 via email

@grichardomi
Copy link
Author

what is your role while accessing OpenCATS?
Candidate

Were you given access to a link?
https://demo.opencats.org/careers/
admin2@example.com | lastname: test5 | zipcode: 84770

Are you a user?
Candidate

If not an admin, do you have an admin?
Candidates should not have to have admin access in order to update their profile

Are you trying to install?
I experience same behavior on demo site and on an newly installed server.

@shantadam
Copy link
Contributor

shantadam commented Mar 1, 2020 via email

@grichardomi
Copy link
Author

No change with Browser cache cleared on Firefox.

As a candidate applying for job, I should be able to revise profile as needed. When trying to update, message is displayed: "You have not registered yet. Please wait while we direct you to the job list..."

@shantadam
Copy link
Contributor

shantadam commented Mar 1, 2020 via email

@grichardomi
Copy link
Author

I looking to enlist PHP consultants for a fix. So far, no positive feedback. Will keep any outcome here.

@grichardomi
Copy link
Author

Will post any outcome here.

@grichardomi
Copy link
Author

Had a consultant working on this. Here is the fix:

  1. modules\careers\CareersUI.php

  2. Edit the line 1748 (This will change the preg pattern) to the below

  3. /"([^\"]+)"="([^\"]*)"/

Correct condition is below
if (preg_match_all('/"([^\"]+)"="([^\"]*)"/', $_COOKIE[$id], $matches) > 0)

@shantadam
Copy link
Contributor

shantadam commented Mar 2, 2020 via email

@grichardomi
Copy link
Author

No, I'm a very small fish.

I hired a PHP consultant specifically for this fix.

@shantadam
Copy link
Contributor

shantadam commented Mar 2, 2020 via email

@RussH RussH added the 5 - Contrib Contribution proposed, needs admin label Sep 2, 2022
@hansmach1ne
Copy link
Contributor

hansmach1ne commented Sep 25, 2022

While assessing application's security I stumbled upon the careers endpoint. It appears to me that application gives cookie after login on the /careers/index.php endpoint. The cookie format is the following (after URL decoding it): cats1cw="email"="mach1ne@XXX.org""lastName"="mach1ne""zip"="10000",

Regex that is incorrectly validating the cookie is here: https://github.com/opencats/OpenCATS/blob/master/modules/careers/CareersUI.php#L262.

Said regex will match the cookie only when in this format: \"email\"=\"mach1ne%40mach1ne.org\"\"lastName\"=\"mach1ne\"\"zip\"=\"10000\".

Bottom line is regex inside getCookieField function need to be modified (for the careers module at least), to /"([^"]+)"="([^"]*)"/ as grichardomi provided will fix the issue.

@RussH
Copy link
Member

RussH commented Sep 27, 2022

@hansmach1ne @grichardomi thank you for the commit - I'll test this in a local instance (& then assuming it's good I'll accept it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Contrib Contribution proposed, needs admin
Projects
None yet
Development

No branches or pull requests

4 participants