Dotclear

Changeset 1861


Ignore:
Timestamp:
11/08/09 07:07:56 (13 years ago)
Author:
JcDenis
Message:

Activity report 0.6:

  • Fixed date display (closes #340)
  • Fixed RSS 'protection' (closes #339)
  • Added blog name to mail subject
  • Fixed typo
Location:
plugins/activityReport
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • plugins/activityReport/_define.php

    r1744 r1861  
    1717     /* Description*/         "Receive your blog activity by email", 
    1818     /* Author */             "JC Denis", 
    19      /* Version */            '0.5', 
     19     /* Version */            '0.6', 
    2020     /* Permissions */        'admin', 
    21      /* Priority */           -100000000 //??? 
     21     /* Priority */           -1000000  
    2222); 
    23      /* date */          #20091026 
     23     /* date */          #20091108 
    2424?> 
  • plugins/activityReport/_prepend.php

    r1744 r1861  
    2525          'activityReport', 
    2626          'reports', 
    27           '^reports/(atom|rss2)$', 
     27          '^reports/((atom|rss2)/(.+))$', 
    2828          array('activityReportPublicUrl','feed') 
    2929     ); 
  • plugins/activityReport/_public.php

    r1593 r1861  
    2828          global $core, $_ctx; 
    2929 
    30           if (!preg_match('#^(atom|rss2)$#',$args,$m)) 
     30          if (!preg_match('/^(atom|rss2)\/(.+)$/',$args,$m)) 
    3131          { 
    3232               self::p404(); 
     
    4343          } 
    4444          $mime = $m[1] == 'atom' ? 'application/atom+xml' : 'application/xml'; 
     45 
     46          if (false === $core->activityReport->checkUserCode($m[2])) { 
     47               self::p404(); 
     48               return; 
     49          } 
    4550 
    4651          $_ctx->nb_entry_per_page = $core->blog->settings->nb_post_per_feed; 
  • plugins/activityReport/inc/class.activity.report.php

    r1593 r1861  
    598598          ); 
    599599 
    600           $subject = mail::B64Header(__('Blog activity report')); 
     600          $subject = $this->_global ? 
     601               mail::B64Header(__('Blog activity report')) : 
     602               mail::B64Header('['.$this->core->blog->name.'] '.__('Blog activity report')); 
    601603 
    602604          $msg =  
     
    618620          } 
    619621     } 
     622      
     623     public function getUserCode() 
     624     { 
     625          $code = 
     626          pack('a32',$this->core->auth->userID()). 
     627          pack('H*',crypt::hmac(DC_MASTER_KEY,$this->core->auth->getInfo('user_pwd'))); 
     628          return bin2hex($code); 
     629     } 
     630      
     631     public function checkUserCode($code) 
     632     { 
     633          $code = pack('H*',$code); 
     634           
     635          $user_id = trim(@pack('a32',substr($code,0,32))); 
     636          $pwd = @unpack('H40hex',substr($code,32,40)); 
     637           
     638          if ($user_id === false || $pwd === false) { 
     639               return false; 
     640          } 
     641           
     642          $pwd = $pwd['hex']; 
     643           
     644          $strReq = 'SELECT user_id, user_pwd '. 
     645                    'FROM '.$this->core->prefix.'user '. 
     646                    "WHERE user_id = '".$this->core->con->escape($user_id)."' "; 
     647           
     648          $rs = $this->core->con->select($strReq); 
     649           
     650          if ($rs->isEmpty()) { 
     651               return false; 
     652          } 
     653           
     654          if (crypt::hmac(DC_MASTER_KEY,$rs->user_pwd) != $pwd) { 
     655               return false; 
     656          } 
     657           
     658          return $rs->user_id; 
     659     } 
    620660 
    621661     public static function encode($a) 
  • plugins/activityReport/inc/lib.activity.report.index.php

    r1593 r1861  
    8181 
    8282          $bl = $O->getSetting('lastreport'); 
    83           $blog_last = !$bl ? __('never') : dt::str('%Y-%m-%d %H:%M:%S',$bl,$core->blog->settings->blog_timezone); 
     83          $blog_last = !$bl ? __('never') : dt::str($core->blog->settings->date_format.', '.$core->blog->settings->time_format,$bl,$core->auth->getInfo('user_tz')); 
    8484 
    8585          $bi = $O->getSetting('interval'); 
    86           $blog_next = !$bl ? __('on new activity') : dt::str('%Y-%m-%d %H:%M:%S',$bl+$bi,$core->blog->settings->blog_timezone); 
     86          $blog_next = !$bl ? __('on new activity') : dt::str($core->blog->settings->date_format.', '.$core->blog->settings->time_format,$bl+$bi,$core->auth->getInfo('user_tz')); 
    8787 
    8888          $emails = implode(';',$O->getSetting('mailinglist')); 
     
    9090          ?> 
    9191          <div class="multi-part" id="<?php echo $t; ?>_settings" title="<?php echo $title; ?>"> 
     92 
     93          <?php if (!$global) { ?> 
     94 
    9295          <p><img alt=="<?php echo __('RSS feed'); ?>" src="index.php?pf=activityReport/inc/img/feed.png" /> 
    93           <a title="<?php echo __('RSS feed'); ?>" href="<?php echo $core->blog->url.$core->url->getBase('activityReport'); ?>/rss2"> 
     96          <a title="<?php echo __('RSS feed'); ?>" href="<?php echo $core->blog->url.$core->url->getBase('activityReport').'/rss2/'.$O->getUserCode(); ?>"> 
    9497          <?php echo __('Rss2 feed for activity on this blog'); ?></a> 
    9598          <br /> 
    9699          <img alt=="<?php echo __('Atom feed'); ?>" src="index.php?pf=activityReport/inc/img/feed.png" /> 
    97           <a title="<?php echo __('Atom feed'); ?>" href="<?php echo $core->blog->url.$core->url->getBase('activityReport'); ?>/atom"> 
     100          <a title="<?php echo __('Atom feed'); ?>" href="<?php echo $core->blog->url.$core->url->getBase('activityReport').'/atom/'.$O->getUserCode(); ?>"> 
    98101          <?php echo __('Atom feed for activity on this blog'); ?></a></p> 
     102           
     103          <?php } ?> 
     104 
    99105          <form method="post" action="plugin.php"> 
    100106 
     
    284290                         ' offline' : ''; 
    285291                    $date = dt::str( 
    286                          '%Y-%m-%d %H:%M:%S', 
     292                         $core->blog->settings->date_format.', '.$core->blog->settings->time_format, 
    287293                         strtotime($logs->activity_dt), 
    288                          $core->blog->settings->blog_timezone 
     294                         $core->auth->getInfo('user_tz') 
    289295                    ); 
    290296                    $action = $O->getGroups($logs->activity_group,$logs->activity_action); 
  • plugins/activityReport/locales/fr/main.lang.php

    r1747 r1861  
    11<?php 
    22// Language: français  
    3 // Module: activityReport - 0.5 
    4 // Date: 2009-10-26 05:41:32  
     3// Module: activityReport - 0.6 
     4// Date: 2009-11-08 06:03:10  
    55// Translated with dcTranslater - 1.3  
    66 
     
    6666 
    6767#inc/class.activity.report.behaviors.php:133 
    68 $GLOBALS['__l10n']['A new trackback to "%" at "%s" was created on post "%s" at %s'] = 'Un nouveau rétrolien vers "%s" a été crée sur le billet "%s" à l\'adresse "%s"'; 
     68$GLOBALS['__l10n']['A new trackback to "%" at "%s" was created on post "%s" at %s'] = 'Un nouveau rétrolien vers "%s" a été créé sur le billet "%s" à l\'adresse "%s"'; 
    6969 
    7070#inc/class.activity.report.behaviors.php:141 
     
    7575 
    7676#inc/class.activity.report.behaviors.php:148 
    77 $GLOBALS['__l10n']['A new category called "%s" was created by "%s" at %s'] = 'Un nouvelle catégorie nommée "%s" a été crée par "%s" à l\'adresse "%s"'; 
     77$GLOBALS['__l10n']['A new category called "%s" was created by "%s" at %s'] = 'Un nouvelle catégorie nommée "%s" a été créé par "%s" à l\'adresse "%s"'; 
    7878 
    7979#inc/class.activity.report.behaviors.php:157 
     
    109109#inc/class.activity.report.php:413 
    110110#inc/class.activity.report.php:424 
    111 $GLOBALS['__l10n']['Period: from %s to %s'] = 'Période : du %s au %s'; 
     111$GLOBALS['__l10n']['Period: from %s to %s'] = 'Période : Du %s au %s'; 
    112112 
    113113#inc/class.activity.report.php:421 
     
    120120$GLOBALS['__l10n']['Activity report module'] = 'Module de rapport d\'activité'; 
    121121 
    122 #inc/class.activity.report.php:600 
     122#inc/class.activity.report.php:601 
     123#inc/class.activity.report.php:602 
    123124$GLOBALS['__l10n']['Blog activity report'] = 'Rapport d\'activité du blog'; 
    124125 
    125 #inc/class.activity.report.php:603 
     126#inc/class.activity.report.php:605 
    126127$GLOBALS['__l10n']['You received a message from your blog\'s activity report module.'] = 'Vous recevez un message du module de rapport d\'activité de votre blog.'; 
    127128 
    128 #inc/class.activity.report.php:615 
     129#inc/class.activity.report.php:617 
    129130$GLOBALS['__l10n']['Failed to send email notification'] = 'Impossible d\'envoyer le courrier électronique'; 
    130131 
     
    153154$GLOBALS['__l10n']['on new activity'] = 'lors d\'une nouvelle activité'; 
    154155 
    155 #inc/lib.activity.report.index.php:92 
    156 #inc/lib.activity.report.index.php:93 
     156#inc/lib.activity.report.index.php:95 
     157#inc/lib.activity.report.index.php:96 
    157158$GLOBALS['__l10n']['RSS feed'] = 'Flux RSS'; 
    158159 
    159 #inc/lib.activity.report.index.php:94 
     160#inc/lib.activity.report.index.php:97 
    160161$GLOBALS['__l10n']['Rss2 feed for activity on this blog'] = 'Flux Rss2 pour l\'activité de ce blog'; 
    161162 
    162 #inc/lib.activity.report.index.php:96 
    163 #inc/lib.activity.report.index.php:97 
     163#inc/lib.activity.report.index.php:99 
     164#inc/lib.activity.report.index.php:100 
    164165$GLOBALS['__l10n']['Atom feed'] = 'Flux Atom'; 
    165166 
    166 #inc/lib.activity.report.index.php:98 
     167#inc/lib.activity.report.index.php:101 
    167168$GLOBALS['__l10n']['Atom feed for activity on this blog'] = 'Flux Atom pour l\'activité de ce blog'; 
    168169 
    169 #inc/lib.activity.report.index.php:101 
     170#inc/lib.activity.report.index.php:107 
    170171#index.php:41 
    171172$GLOBALS['__l10n']['Settings'] = 'Paramètres'; 
    172173 
    173 #inc/lib.activity.report.index.php:107 
     174#inc/lib.activity.report.index.php:113 
    174175$GLOBALS['__l10n']['Enable super administrator report'] = 'Autoriser le rapport de super administrateur'; 
    175176 
    176 #inc/lib.activity.report.index.php:108 
     177#inc/lib.activity.report.index.php:114 
    177178$GLOBALS['__l10n']['Enable report on this blog'] = 'Autoriser le rapport sur ce blog'; 
    178179 
    179 #inc/lib.activity.report.index.php:120 
     180#inc/lib.activity.report.index.php:126 
    180181$GLOBALS['__l10n']['Add activity report on dashboard items'] = 'Ajouter le rapport d\'activité au tableau de bord'; 
    181182 
    182 #inc/lib.activity.report.index.php:127 
     183#inc/lib.activity.report.index.php:133 
    183184$GLOBALS['__l10n']['Send report:'] = 'Rapport envoyé :'; 
    184185 
    185 #inc/lib.activity.report.index.php:131 
     186#inc/lib.activity.report.index.php:137 
    186187$GLOBALS['__l10n']['Recipients:'] = 'Destinataires :'; 
    187188 
    188 #inc/lib.activity.report.index.php:134 
    189 $GLOBALS['__l10n']['Separate multiple email addresses with a semicolon ";"'] = 'Separer les adresses email par un point-virgule ";"'; 
    190  
    191 #inc/lib.activity.report.index.php:137 
     189#inc/lib.activity.report.index.php:140 
     190$GLOBALS['__l10n']['Separate multiple email addresses with a semicolon ";"'] = 'Séparer les adresses email par un point-virgule ";"'; 
     191 
     192#inc/lib.activity.report.index.php:143 
    192193$GLOBALS['__l10n']['Last report by email:'] = 'Dernier rapport par email :'; 
    193194 
    194 #inc/lib.activity.report.index.php:138 
     195#inc/lib.activity.report.index.php:144 
    195196$GLOBALS['__l10n']['Next report by email:'] = 'Prochain rapport par email :'; 
    196197 
    197 #inc/lib.activity.report.index.php:177 
     198#inc/lib.activity.report.index.php:183 
    198199$GLOBALS['__l10n']['Report'] = 'Rapport'; 
    199200 
    200 #inc/lib.activity.report.index.php:218 
     201#inc/lib.activity.report.index.php:224 
    201202$GLOBALS['__l10n']['Send report by email now'] = 'Envoyer un rapport par email maintenant'; 
    202203 
    203 #inc/lib.activity.report.index.php:224 
     204#inc/lib.activity.report.index.php:230 
    204205$GLOBALS['__l10n']['Delete all logs'] = 'Supprimer tous les enregistrements'; 
    205206 
    206 #inc/lib.activity.report.index.php:261 
     207#inc/lib.activity.report.index.php:267 
    207208$GLOBALS['__l10n']['No log'] = 'Pas d\'enregistrement'; 
    208209 
    209 #inc/lib.activity.report.index.php:271 
     210#inc/lib.activity.report.index.php:277 
    210211$GLOBALS['__l10n']['Message'] = 'Message'; 
    211212 
  • plugins/activityReport/locales/fr/main.po

    r1747 r1861  
    11# Language: français 
    2 # Module: activityReport - 0.5 
    3 # Date: 2009-10-26 05:41:32 
     2# Module: activityReport - 0.6 
     3# Date: 2009-11-08 06:03:11 
    44# Translated with translater 1.3 
    55 
     
    77msgstr "" 
    88"Content-Type: text/plain; charset=UTF-8\n" 
    9 "Project-Id-Version: activityReport 0.5\n" 
     9"Project-Id-Version: activityReport 0.6\n" 
    1010"POT-Creation-Date: \n" 
    11 "PO-Revision-Date: 2009-10-26T05:41:32+00:00\n" 
     11"PO-Revision-Date: 2009-11-08T06:03:11+00:00\n" 
    1212"Last-Translator: JC Denis\n" 
    1313"Language-Team: \n" 
     
    9696#: inc/class.activity.report.behaviors.php:133 
    9797msgid "A new trackback to \"%\" at \"%s\" was created on post \"%s\" at %s" 
    98 msgstr "Un nouveau rétrolien vers \"%s\" a été crée sur le billet \"%s\" à l'adresse \"%s\"" 
     98msgstr "Un nouveau rétrolien vers \"%s\" a été créé sur le billet \"%s\" à l'adresse \"%s\"" 
    9999 
    100100#: inc/class.activity.report.behaviors.php:141 
     
    108108#: inc/class.activity.report.behaviors.php:148 
    109109msgid "A new category called \"%s\" was created by \"%s\" at %s" 
    110 msgstr "Un nouvelle catégorie nommée \"%s\" a été crée par \"%s\" à l'adresse \"%s\"" 
     110msgstr "Un nouvelle catégorie nommée \"%s\" a été créé par \"%s\" à l'adresse \"%s\"" 
    111111 
    112112#: inc/class.activity.report.behaviors.php:157 
     
    153153#: inc/class.activity.report.php:424 
    154154msgid "Period: from %s to %s" 
    155 msgstr "Période : du %s au %s" 
     155msgstr "Période : Du %s au %s" 
    156156 
    157157#: inc/class.activity.report.php:421 
     
    167167msgstr "Module de rapport d'activité" 
    168168 
    169 #: inc/class.activity.report.php:600 
     169#: inc/class.activity.report.php:601 
     170#: inc/class.activity.report.php:602 
    170171msgid "Blog activity report" 
    171172msgstr "Rapport d'activité du blog" 
    172173 
    173 #: inc/class.activity.report.php:603 
     174#: inc/class.activity.report.php:605 
    174175msgid "You received a message from your blog's activity report module." 
    175176msgstr "Vous recevez un message du module de rapport d'activité de votre blog." 
    176177 
    177 #: inc/class.activity.report.php:615 
     178#: inc/class.activity.report.php:617 
    178179msgid "Failed to send email notification" 
    179180msgstr "Impossible d'envoyer le courrier électronique" 
     
    211212msgstr "lors d'une nouvelle activité" 
    212213 
    213 #: inc/lib.activity.report.index.php:92 
    214 #: inc/lib.activity.report.index.php:93 
     214#: inc/lib.activity.report.index.php:95 
     215#: inc/lib.activity.report.index.php:96 
    215216msgid "RSS feed" 
    216217msgstr "Flux RSS" 
    217218 
    218 #: inc/lib.activity.report.index.php:94 
     219#: inc/lib.activity.report.index.php:97 
    219220msgid "Rss2 feed for activity on this blog" 
    220221msgstr "Flux Rss2 pour l'activité de ce blog" 
    221222 
    222 #: inc/lib.activity.report.index.php:96 
    223 #: inc/lib.activity.report.index.php:97 
     223#: inc/lib.activity.report.index.php:99 
     224#: inc/lib.activity.report.index.php:100 
    224225msgid "Atom feed" 
    225226msgstr "Flux Atom" 
    226227 
    227 #: inc/lib.activity.report.index.php:98 
     228#: inc/lib.activity.report.index.php:101 
    228229msgid "Atom feed for activity on this blog" 
    229230msgstr "Flux Atom pour l'activité de ce blog" 
    230231 
    231 #: inc/lib.activity.report.index.php:101 
     232#: inc/lib.activity.report.index.php:107 
    232233#: index.php:41 
    233234msgid "Settings" 
    234235msgstr "Paramètres" 
    235236 
    236 #: inc/lib.activity.report.index.php:107 
     237#: inc/lib.activity.report.index.php:113 
    237238msgid "Enable super administrator report" 
    238239msgstr "Autoriser le rapport de super administrateur" 
    239240 
    240 #: inc/lib.activity.report.index.php:108 
     241#: inc/lib.activity.report.index.php:114 
    241242msgid "Enable report on this blog" 
    242243msgstr "Autoriser le rapport sur ce blog" 
    243244 
    244 #: inc/lib.activity.report.index.php:120 
     245#: inc/lib.activity.report.index.php:126 
    245246msgid "Add activity report on dashboard items" 
    246247msgstr "Ajouter le rapport d'activité au tableau de bord" 
    247248 
    248 #: inc/lib.activity.report.index.php:127 
     249#: inc/lib.activity.report.index.php:133 
    249250msgid "Send report:" 
    250251msgstr "Rapport envoyé :" 
    251252 
    252 #: inc/lib.activity.report.index.php:131 
     253#: inc/lib.activity.report.index.php:137 
    253254msgid "Recipients:" 
    254255msgstr "Destinataires :" 
    255256 
    256 #: inc/lib.activity.report.index.php:134 
     257#: inc/lib.activity.report.index.php:140 
    257258msgid "Separate multiple email addresses with a semicolon \";\"" 
    258 msgstr "Separer les adresses email par un point-virgule \";\"" 
    259  
    260 #: inc/lib.activity.report.index.php:137 
     259msgstr "Séparer les adresses email par un point-virgule \";\"" 
     260 
     261#: inc/lib.activity.report.index.php:143 
    261262msgid "Last report by email:" 
    262263msgstr "Dernier rapport par email :" 
    263264 
    264 #: inc/lib.activity.report.index.php:138 
     265#: inc/lib.activity.report.index.php:144 
    265266msgid "Next report by email:" 
    266267msgstr "Prochain rapport par email :" 
    267268 
    268 #: inc/lib.activity.report.index.php:177 
     269#: inc/lib.activity.report.index.php:183 
    269270msgid "Report" 
    270271msgstr "Rapport" 
    271272 
    272 #: inc/lib.activity.report.index.php:218 
     273#: inc/lib.activity.report.index.php:224 
    273274msgid "Send report by email now" 
    274275msgstr "Envoyer un rapport par email maintenant" 
    275276 
    276 #: inc/lib.activity.report.index.php:224 
     277#: inc/lib.activity.report.index.php:230 
    277278msgid "Delete all logs" 
    278279msgstr "Supprimer tous les enregistrements" 
    279280 
    280 #: inc/lib.activity.report.index.php:261 
     281#: inc/lib.activity.report.index.php:267 
    281282msgid "No log" 
    282283msgstr "Pas d'enregistrement" 
    283284 
    284 #: inc/lib.activity.report.index.php:271 
     285#: inc/lib.activity.report.index.php:277 
    285286msgid "Message" 
    286287msgstr "Message" 
  • plugins/activityReport/release.txt

    r1744 r1861  
     10.6 20091108 
     2 * Fixed date display (closes #340) 
     3 * Fixed RSS 'protection' (closes #339) 
     4 * Added blog name to mail subject 
     5 
    160.5 20091026 
    27 * Changed priority to -1000000 in order to work ?! 
Note: See TracChangeset for help on using the changeset viewer.

Sites map