#2787 Pending changes email notification

v4.3.0
open
nobody
None
5
2010-03-06
2010-02-20
NightOwl
No

I just noticed a problem PGV4.3.0 SVN 6929:
A user makes changes to the tree. All other users receive an email from the administrator as how there are pending changes, although the latter is that the right to modify, without being able to approve the changes.

Here's the email notification:

Le message suivant vous a été envoyé par phpgedview-noreply@genealogie-lapierre.ca

Il reste des modifications en attente de validation sur le site PhpGedView. Merci d'utiliser le lien suivant pour vous connecter et confirmer ces changements.

--------------------------------------

Ce message a été envoyé depuis l'URL
index.php?action=ajax&block=review_changes_block&side=main&bindex=3&ctype=gedcom

=--------------------------------------=
IP ADDRESS: 142.169.165.92
DNS LOOKUP: c142.169.165-92.clta.globetrotter.net
LANGUAGE: french

Discussion

  • NightOwl

    NightOwl - 2010-02-20
    • priority: 5 --> 9
     
  • NightOwl

    NightOwl - 2010-02-20
    • priority: 9 --> 7
     
  • NightOwl

    NightOwl - 2010-02-20
    • assigned_to: nobody --> canajun2eh
     
  • Gerry Kroll

    Gerry Kroll - 2010-02-20
    • assigned_to: canajun2eh --> nobody
     
  • NightOwl

    NightOwl - 2010-02-21
    • assigned_to: nobody --> yalnifj
    • priority: 7 --> 5
     
  • NightOwl

    NightOwl - 2010-02-22
    • assigned_to: yalnifj --> nobody
     
  • Meliza Amity

    Meliza Amity - 2010-02-27
    • status: open --> pending-fixed
     
  • Meliza Amity

    Meliza Amity - 2010-02-27

    I have reversed the SVN 6905 change in SVN 6942.

     
  • Marc Riley

    Marc Riley - 2010-03-05

    So I was board and decided to look into this… First had to add a new function in includes/functions/functions_db.php to properly search for users with accept ++ rights.
    Added the following code to line 2616 (includes/functions/functions_db.php)

    function get_accept_users() {
    global $TBLPREFIX;
    return
    PGV_DB::prepare("SELECT distinct usr.user_id, usr_ged.gedcom_id".
    " FROM {$TBLPREFIX}user usr".
    " Left JOIN {$TBLPREFIX}user_gedcom_setting usr_ged ON (usr.user_id=usr_ged.user_id)".
    " Left JOIN {$TBLPREFIX}user_setting usr_set ON (usr.user_id=usr_set.user_id)".
    " WHERE (usr_ged.setting_name='canedit' AND (usr_ged.setting_value='accept' OR usr_ged.setting_value='admin'))".
    " OR (usr_set.setting_name='canadmin' AND usr_set.setting_value='Y')".
    " ORDER BY user_name")
    ->fetchAssoc();
    }

    Then modified blocks/review_changes.php to properly lookup if the user has access to accept in the current database by modifying lines 68 ~ 71? With the following:

    foreach (get_accept_users() as $user_id=>$user_ged_id) {
    foreach (get_all_gedcoms() as $ged_id=>$ged_name) {
    if (exists_pending_change($user_id, $ged_id) && ($ged_id==$user_ged_id)) {
    $users_with_changes[$user_id]=get_user_name($user_id);
    break;

    and Also modified includes/authentication.php and updated the $SERVER_URL to the new PGV_SERVER_NAME.PGV_SCRIPT_PATH var to fix the link in the emails.

    Files Included :)

     
  • NightOwl

    NightOwl - 2010-03-06
    • status: pending-fixed --> open
     
  • NightOwl

    NightOwl - 2010-03-07

    includes/authentication.php

     
  • NightOwl

    NightOwl - 2010-03-07

    includes/functions/functions_db.php

     
  • NightOwl

    NightOwl - 2010-03-07

    blocks/review_changes.php

     
  • Julio Sánchez Fernández

    Reverting the change in SVN6905 makes site admins stop seeing the pending changes notice in pages. SVN6949 should be the complete fix.

     

Log in to post a comment.