Closed Bug 504167 Opened 16 years ago Closed 16 years ago

Create simple LDAP-driven PTO app

Categories

(mozilla.org Graveyard :: Webdev, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: morgamic, Assigned: kourge)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 3 obsolete files)

Need: - 1 database table - LDAP auth - email notification -- needs to email: -- karen@m.c, erica@m.c, person's manager (as pulled from LDAP) - a simple form that looks like: PTO Notification Reason: [ ] Start: [ ] (w/ datepicker) End: [ ] (w/ datepicker) Submit
Additionally, a JSON feed so this can be used internally in a dashboard will be needed eventually.
What do you think of an additional field to email other people/groups? Most of the time when I want PTO I also want to let webdev@mozilla.org know.
http://kourge.khan.mozilla.org/pto/ (Accessible through Mozilla-MPT on VPN.) It currently does not actually email your manager (even though he/she will show up), nor does it email Karen or Erica. It will, however, CC you (if you check the box) and mail to any address you manually enter in the box. A JSON feed is available at http://kourge.khan.mozilla.org/pto/json.php and there are currently four parameters accepted: - "valid_mime=1" will change the response Content-Type from "application/javascript" to "application/json". - "start" accepts a Unix timestamp and will filter out any submitted PTOs that start before such timestamp. - "end" accepts a Unix timestamp and will filter out any submitted PTOs that end after such timestamp. - "person" accepts a string, which will be used to narrow down to PTOs submitted by those whose alias contains such string. An alias is defined as the username of your formal @mozilla.com address, not your aliased one.
ideally it should email Karen, the person's manager and have an option field for additional emails. Hopefully a note that says "all" is not acceptable. Great work on this!
It *is* able to do that right now; the code that does that is currently commented out to avoid spamming Karen and the person's manager as this tool is currently in testing.
thanks for clarifying
I chatted with Wilson - we have a few things left to do including a simple report tool for Karen and HR so they can get an instant report on who is on PTO every week. Once that's done we can wrap this up -- hopefully tomorrow. Thanks for the hard work, Wilson!
json.php is now renamed export.php since multiple exporting formats are now supported. The old parameters are still valid, a new parameter is added, called "format". Therefore, what used to be http://kourge.khan.mozilla.org/pto/json.php is now effectively http://kourge.khan.mozilla.org/pto/export.php?format=json since new formats are added. CSV is currently supported, with a pretty HTML interface on the way, which would show up when export.php is requested without a format.
report access should probably be limited to hr...
Why? It just reports who is out when. People with LDAP should be able to see it, no?
HR should be the only people able to see the reason, I think... the status isn't protected, is it?
agreed - reason should be internal.
it should be internal and optional.
Blocks: 506189
The reason is now labeled as optional and is not shown to those outside of the HR department.
Blocks: 506192
We'd like to be able to use this code for MoMo folks as well. Gozer will propose a patch that should work, but we're ok w/ running our own instance as well if that works better for folks.
I am not certain what the LDAP schema, however, so I am assuming here that o=com,dc=mozillamessaging is where we are stashed at, but that might be incorrect.
Comment on attachment 392549 [details] [diff] [review] Small change to allow mozillamessaging folks as well. MoMo people are just under o=net with mail addresses containing @mozillamessaging.com. Might be time to move MoMo people to their own branch, though.
Attachment #392549 - Flags: review-
Patch committed at r48570.
(In reply to comment #19) > Patch committed at r48570. ???? I gave the patch r-, meaning it's not acceptable at all. Please back out your commit.
Sorry, I didn't pay attention. Backed out at r48575.
So this is what I'm seeing: - back out something that works right now - wait indefinitely for some change that may take weeks That's not the answer. If what Wilson has works now, push it now then update it when we change LDAP around. If we do it the other way, we block progress for Wilson and I'm not interested in doing that.
Is there a compromise? What can we check in to get it working right now?
Does it actually work? Reed's comment implies to me that it wouldn't, and I imagine that's why he gave it r-.
From a small irc chat with reed, I've been told momo folks live under: o=net,dc=mozilla, so here comes an adjusted patch to account for this properly.
Attachment #392549 - Attachment is obsolete: true
Attachment #392789 - Flags: review?(wlee)
Attachment #392789 - Flags: review?(reed)
There's more to the app than just fixing auth.php. I am currently refactoring all of the files seen below, revealed by simple grepping: http://pastebin.mozilla.org/665914 I've currently patched all of the files. ldap_find() in pto.inc is a difficult one to patch, since ldap_find() always searches with a base DN of "o=com,dc=mozilla". I'm resorting to performing two searches (one with o=com, one with o=net) and then returning the non-zero result.
Attached patch Remove o=com dependency (obsolete) — Splinter Review
Attachment #392789 - Attachment is obsolete: true
Attachment #392789 - Flags: review?(wlee)
Attachment #392789 - Flags: review?(reed)
Attachment #392789 - Flags: review-
Attachment #392807 - Attachment is patch: true
Attachment #392807 - Attachment mime type: application/octet-stream → text/plain
Attachment #392807 - Flags: review?
Attachment #392807 - Attachment description: Untie o=com dependency → Remove o=com dependency
You need to support o=org for MoFo folks, so just search based on dc=mozilla. You won't ever have two people with the same mail, even if they are in different orgs.
Attachment #392807 - Attachment is obsolete: true
Attachment #392807 - Flags: review?
Okay, the base DN for searches is now dc=mozilla.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
would it be possible to add a field for which organization they belong to? US CAD MZ Denmark New Zealand
Product: mozilla.org → mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: