> > Topic

Understanding notifications

Sep 27, 2006 / pixtur
Nov 14, 2008 / pixtur
 

Attached files

No files uploaded
 
Notifications are automatically sent e-mails; for account activation, or for keep users informed about relevant changes to tasks and projects within streber.

Account activationπ

Streber does not store plain-text passwords, but instead, stores encrypted passwords as checksums (hashes). If a user forgets his password, he can not get the administrator to tell him (well, he can.. but the administrator won't be able to tell him). The administrator could enter a new password for him, but that's far from ideal.

The preferred way is account activation via email. For this to happen, you have to enter at least one email address for a user when you create it. After the account has been created, the user will receive an email with a link to his profile, where he can adjust his profile and password. Once he adjusts his password, the link in the activation mail will not work any longer.

If he forgets his password again, he will still be able to refer to the "forgot password" options on the login screen to get a new activation e-mail.

Notificationsπ

To activate notifications for a user: go to People, edit a profile, and set the Send notifications drop-down to a value other than Never.

For each user, streber stores the time that the last e-mail was sent. When notifications are triggered (ie. when a user logs out), streber compares (this time + the notification period) with the current time. If enough time has passed, all the relevant events during this time period are selected and and e-mail is composed and sent. Here is an example e-mail:

Content-Type: text/plain; charset=UTF-8

Hallo Thomas Mann!

Diese Nachricht möchte Sie darüber informieren, dass
seit 23. May 2006 folgendes auf www.still-scene.org passierte:

== Projekt Neuigkeiten ==

Gabelstapler

- harald: new Feature >  modeling tasks
- harald: bearbeitet >  1a - Planung weiteres Vorgehen
- harald: Kommentiert >  create precise list of load types

Wenn Sie keine weiteren Mails bekommen möchten oder Ihr Passwort vergessen haben, passen Sie bitte Ihr Profil an.:
https://www.still-scene.org/index.php?go=activateAccount&tuid=f8b2af06749cb6f620c508c8467d499d

  Danke für Ihre Zeit,
  Die Verwaltung

As you can see, the notification e-mail will be composed in the language of the receiver. It contains a plain-text version and an HTML version with the valid links into the project.

Triggering Notifications with Cron Jobsπ

Normally notifications are triggered if a person logs out, as that is the only page refresh which is not time critical and won't have an impact on the performance of streber. Additionally, you can manually trigger the notification process by requesting:

http://www.yourDomain.com/index.php?go=triggerSendNotifications

This request can be performed without authentication and it does not produce any meaningful HTML output. This allows one to easily schedule calls to the URL (ie. at 6 o'clock every morning).

An excellent solution for triggering on UNIX-based operation systems are cronjobs. However, if you do not have UNIX shell available, a suggestion would be to try http://www.cron-job.org as they are providing a completely free service for exactly this purpose. (I am using this to trigger notifications at this site, as well as some other streber installations.)

Please note that the notification trigger also compares the time of its activation with the Notification Period, so it does not send all outstanding mails as it is dependent on the user's profile settings.

Account Activation: Under the Hoodπ

  • A user has been created with a random password,
  • A cookie has been generated,
  • An e-mail gets sent with this cookie and a link to http://www.yourDomain.com/index.php?go=activateAccount&tuid=739857394875938245435"
  • adjust login-mechanism to handle direct tuid's
    • check if person-list has tuid-entry
    • don't store as cookie, when it's passed as POST/GET directly
    • adjust "direct login" as flag to pagehandles (personEdit, personEditSubmit) so only activateAccount can be view with the NUID
  • render editPerson():
  • add new cookie as hidden tuid value
  • render personEditSubmit():
  • if form-Data has not been validate (like new passwords don't match) go back to editPerson()
  • if successful store call $auth->setUserCookie()
  • print special message
  • Probably send addition account activation mail with password as a reminder?
  • if guest-account available, don't ask for login/password but render small form as login-item (upper right corner)





also read:

8 Comments

guest:where do i change the email content?

11 years ago -

I need to change the information sent in the notification email. I am not finding a en.inc.php file for English language.

axelle:changing the email content

11 years ago

Hi,

please look at mail.inc.php, in the directory "std".
you'll find what you need. I think you don't have a file named en.inc.php because default language is english (en).
You may observe that text is already in english in mail.inc.php

Sincerely,

axelle:problem with immediate notifications

11 years ago (3. update 9 years ago)

Hi all,
i am implementing immediate notifications with streber on my local server. I already obtain mails when i create/update a task.
But i still have some problems i can't resolve, maybe i did something wrong? please if anyone can help...
i join the errors i currently have in error.log.php:

Error 20070629093310 NOTICE: render\render_page.inc.php : 229 'page' global var already defined!
Error 20070629093310 pages\task_view.inc.php : 63 -> Page::__construct()
Error 20070629093310 std\class_pagehandler.inc.php : 729 -> TaskView()
Error 20070629093310 std\class_pagehandler.inc.php : 620 -> PageHandler::show("taskView", [1])
Error 20070629093310 pages\task_more.inc.php :1421 -> PageHandler::showFromPage()
Error 20070629093310 std\class_pagehandler.inc.php : 729 -> taskEditSubmit()
Error 20070629093310 index.php : 206 -> PageHandler::show("taskEditSubmit")
Error 20070629093310
Error 20070629093310 Variables in __construct():
Error 20070629093310 this = OBJECT
Error 20070629093310 args = NULL
Error 20070629093310 _PAGE = OBJECT
Error 20070629093310 auth = OBJECT
Error 20070629093310 PH = OBJECT
Error 20070629093310 v0.08, taskView, from 127.0.0.1, uri:/streber_v0.08/index.php

this is due to the following lines i have added in function taskEditSubmit, in file task_more.inc.php:
    ### set up page and write header ####
    {
  $newpage= new Page();
  initPageForTask($newpage,$task,$project);
  // echo(new PageHeader);
 }
 //echo (new PageContentOpen);

I comented the lines with "echo" because otherwise, i have other error messages stating that i can't modify headers.
But if i comment also the 2 others, i also have many error lines:

Error 20070628164808 WARNING: render\render_page.inc.php : 459 Cannot create PageElement s without Page-object
Error 20070628164808 render\render_block.inc.php : 98 -> PageElement::__construct(NULL)
Error 20070628164808 render\render_list.inc.php :1261 -> PageBlock::__construct(NULL)
Error 20070628164808 lists\list_changes.inc.php : 31 -> ListBlock::__construct(NULL)
Error 20070628164808 pages\notification.inc.php : 19 -> ListBlock_changes::__construct()
Error 20070628164808 pages\task_more.inc.php :1396 -> sendNotification(*Project)
Error 20070628164808 std\class_pagehandler.inc.php : 729 -> taskEditSubmit()
Error 20070628164808 index.php : 206 -> PageHandler::show("taskEditSubmit")
Error 20070628164808
Error 20070628164808 Variables in __construct():
Error 20070628164808 args = NULL
Error 20070628164808 _PAGE = NULL
Error 20070628164808 v0.08, taskEditSubmit, from 127.0.0.1, uri:/streber_v0.08/index.php

Sincerely,

Axelle.

axelle:well, ...

11 years ago

i think i have found a solution to my problem but i'm still testing.

bw:notification

10 years ago

I had a hard time understanding the notification structure. The face it I never log out. I just close the window. So I never received any email.

I am going to sent notifications on fixed periods vie the cron. but is it possible to disable the send on logout feature?

ganesh:Output of index.php?go=triggerSendNotifications not useful

9 years ago (2. update 9 years ago)

Currently, if I wget index.php?go=triggerSendNotifications I get a text-only output containing a localized version of the string "%s notifications sent" with possibile variations "One notification sent" and "No notifications sent".
IMHO, there are two problems:
  1. the reported number of notifications is wrong: the number output is count($PH->messages); but $PH->messages contains one FeedbackMessage object for each person who might have received a notification but did NOT get it because there was nothing to notify, plus one FeedbackWarning object for each error while sending the mail. (Unless I'm much mistaken, notifications actually sent are not even counted!)
  2. the output message is not suitable for a cron job: human are not expected to be reading this output, OTOH a script might need to parse it in order to propagate warnings to an administrator
I have prepared a fix to address the first problem, but in order to address the second problem I would like hear peoples opinion about how the message should be formatted. My opinions are:
  1. I would avoid localization and variations as they make non-human parsing more complicated
  2. In case of warnings, the message should contain the text of all warning messages (these messages may be localized, as long as a script is able to detect that they're warnings)
For example, I would stick with:
Notifications sent: %s // line always present
Warning: %s // one line for each warning if present
Comments?

pixtur:cool

9 years ago

Hi ganish,

thanks for addressing this problem. Your are totally right in all of your points. No human is going to read it, so giving a human readable response is useless.

I am not sure about printing the warnings, though, because it might have some security consideration like revealing usernames. Remember: TriggerNotifications is available anonymously.

How about something like this:

Notifications sent: %s
Warning: %s
# Please check errors.log.php for details. 

Please consider to create a new topic of discussions like this, because too many comments will make the user-documenation unreadable.

How would you like to submit the patch? Svn?

  pixtur

ganesh:moved to tasks

9 years ago

See