Changeset 1093


Ignore:
Timestamp:
Jun 19, 2007, 2:01:53 PM (14 years ago)
Author:
Dominic Hargreaves
Message:

Send email notifications when moderated nodes are edited (fixes #138)

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Build.PL

    r1092 r1093  
    4343      enable_common_locales recent_changes_on_home_page
    4444      random_page_omits_locales random_page_omits_categories
    45       content_above_navbar_in_html show_gmap_in_node_display);
     45      content_above_navbar_in_html show_gmap_in_node_display
     46      send_moderation_notifications);
    4647
    4748my $skip_config = Module::Build->y_n("Skip OpenGuides configuration?", "n");
     
    105106   licence_name licence_url licence_info_url moderation_requires_password
    106107   enable_node_image enable_common_categories enable_common_locales
    107    spam_detector_module static_path static_url
     108   spam_detector_module static_path static_url send_moderation_notifications
    108109  ) ) {
    109110    my $q_method = $var . "__qu";
  • trunk/Changes

    r1086 r1093  
    2525        Move the common categories/locales navbar display decision into the
    2626          templates (#214).
     27        Add email notifications when moderated nodes are edited (#138)
    2728
    28290.60    13 May 2007
  • trunk/lib/OpenGuides.pm

    r1086 r1093  
    14051405    # Skip this for nodes needing moderation - this occurs for them once
    14061406    #  they've been moderated
    1407     unless($wiki->node_required_moderation($node)) {
     1407    my $needs_moderation = $wiki->node_required_moderation($node);
     1408    unless( $needs_moderation ) {
    14081409        $self->_autoCreateCategoryLocale(
    14091410                                          id       => $node,
     
    14161417
    14171418    if ($written) {
     1419        if ( $needs_moderation and $config->send_moderation_notifications ) {
     1420            my $body = "The node '$node' in the OpenGuides installation\n" .
     1421                "'" . $config->site_name . "' requires moderation. ".
     1422                "Please visit\n" .
     1423                $config->script_url . $config->script_name .
     1424                "?action=show_needing_moderation\nat your convenience.\n";
     1425            eval {
     1426                OpenGuides::Utils->send_email(
     1427                    config        => $config,
     1428                    subject       => "Node requires moderation",
     1429                    body          => $body,
     1430                    admin         => 1,
     1431                    return_output => $return_output
     1432                );
     1433            };
     1434            warn $@ if $@;
     1435        }
     1436
    14181437        my $output = $self->redirect_to_node($node);
    14191438        return $output if $return_output;
  • trunk/lib/OpenGuides/Config.pm

    r1088 r1093  
    2222   licence_name licence_url licence_info_url moderation_requires_password
    2323   enable_node_image enable_common_categories enable_common_locales
    24    spam_detector_module static_path static_url
     24   spam_detector_module static_path static_url send_moderation_notifications
    2525);
    2626my @questions = map { $_ . "__qu" } @variables;
     
    110110                     spam_detector_module => "",
    111111                     static_path => "/usr/local/share/openguides/static",
     112                     send_moderation_notifications => 1
    112113                   );
    113114
     
    193194        static_path => "What directory should we install static content (CSS, images, javascript) to?",
    194195        static_url => "What is the URL corresponding to the static content?",
     196        send_moderation_notifications => "Should we send email notifications when a moderated node is edited?"
    195197    );
    196198
     
    323325=item * static_url
    324326
     327=item * send_moderation_notifications
     328
    325329=back
    326330
Note: See TracChangeset for help on using the changeset viewer.