Changeset 1768 for plugins/private
- Timestamp:
- 10/27/09 01:01:16 (14 years ago)
- Location:
- plugins/private
- Files:
-
- 2 added
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/private/_define.php
r999 r1768 17 17 /* Description*/ "Protect your blog with a password", 18 18 /* Author */ "Osku and contributors", 19 /* Version */ '1. 0.1',19 /* Version */ '1.1RC1', 20 20 /* Permissions */ 'admin' 21 21 ); -
plugins/private/_prepend.php
r955 r1768 19 19 $privatefeed = md5($core->blog->settings->blog_private_pwd); 20 20 $core->url->register('feed',sprintf('%s-feed',$privatefeed),sprintf('^%s-feed/(.+)$',$privatefeed),array('urlPrivate','privateFeed')); 21 $core->url->register('pubfeed','feed','^feed/(.+)$',array('urlPrivate','publicFeed')); 21 22 } 22 23 ?> -
plugins/private/_public.php
r1000 r1768 31 31 self::feed($args); 32 32 } 33 34 public static function publicFeed($args) 35 { 36 global $core,$_ctx; 37 38 $type = null; 39 $params = array(); 40 41 $mime = 'application/xml'; 42 43 if (preg_match('#^rss2/xslt$#',$args,$m)) 44 { 45 # RSS XSLT stylesheet 46 self::serveDocument('rss2.xsl','text/xml'); 47 //exit; 48 } 49 elseif (preg_match('#^(atom|rss2)/comments/([0-9]+)$#',$args,$m)) 50 { 51 # Post comments feed 52 $type = $m[1]; 53 } 54 elseif (preg_match('#^(?:category/(.+)/)?(atom|rss2)(/comments)?$#',$args,$m)) 55 { 56 # All posts or comments feed 57 $type = $m[2]; 58 } 59 60 61 $tpl = $type == '' ? 'atom' : $type; 62 $tpl .= '-pv.xml'; 63 64 if ($type == 'atom') { 65 $mime = 'application/atom+xml'; 66 } 67 68 header('X-Robots-Tag: '.context::robotsPolicy($core->blog->settings->robots_policy,'')); 69 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates'); 70 self::serveDocument($tpl,$mime); 71 72 return; 73 } 33 74 34 75 public static function callbackbidon($args) … … 70 111 unset($urlp); 71 112 72 if ($type == 'feed' || $type == ' spamfeed' || $type == 'hamfeed' || $type == 'trackback')113 if ($type == 'feed' || $type == 'pubfeed' || $type == 'spamfeed' || $type == 'hamfeed' || $type == 'trackback') 73 114 { 74 115 return; … … 142 183 public static function PrivateMsg($attr) 143 184 { 144 return '<?php echo $core->blog->settings->blog_private_msg; ?>'; 185 $f = $GLOBALS['core']->tpl->getFilters($attr); 186 return '<?php echo '.sprintf($f,'$core->blog->settings->blog_private_msg').'; ?>'; 145 187 } 146 188 -
plugins/private/index.php
r955 r1768 28 28 29 29 // Getting current parameters 30 $private_flag 31 $private_conauto 32 $blog_private_title 33 $blog_private_msg 30 $private_flag = (boolean)$core->blog->settings->private_flag; 31 $private_conauto = (boolean)$core->blog->settings->private_conauto; 32 $blog_private_title = $core->blog->settings->blog_private_title; 33 $blog_private_msg = $core->blog->settings->blog_private_msg; 34 34 35 35 if ($blog_private_title === null) { … … 39 39 if ($blog_private_msg === null) { 40 40 $blog_private_msg = __('<p class="message">You need the password to view this blog.</p>'); 41 }42 43 if (is_null($core->blog->settings->blog_private_pwd))44 {45 $err = __('No password set.');46 41 } 47 42 … … 78 73 79 74 $core->blog->triggerBlog(); 80 81 $msg = __('Configuration successfully updated.'); 75 http::redirect($p_url.'&config=1'); 82 76 } 83 77 … … 87 81 } 88 82 } 83 if ($core->blog->settings->blog_private_pwd === null) 84 { 85 $err = __('No password set.'); 86 } 89 87 ?> 90 88 <html> … … 93 91 </head> 94 92 <body> 95 <h2 style="padding:8px 0 8px 34px;background:url(index.php?pf=private/icon_32.png) no-repeat;"> 96 <?php echo html::escapeHTML($core->blog->name); ?> › <?php echo __('Private mode'); ?></h2> 93 <?php 97 94 98 <?php if (!empty($msg)) echo '<p class="message">'.$msg.'</p>'; ?> 95 if (isset($_GET['config'])) { 96 echo '<p class="message">'.__('Configuration successfully updated.').'</p>'; 97 } 99 98 100 <?php if (!empty($err)) echo '<p class="error">'.$err.'</p>'; ?> 99 if (!empty($err)) echo '<p class="error">'.$err.'</p>'; 101 100 102 <div id="private_options"> 103 <form method="post" action="plugin.php"> 104 <fieldset> 105 <legend><?php echo __('Plugin activation'); ?></legend> 106 <div class="two-cols"> 107 <div class="col"> 108 <p class="field"> 109 <?php echo form::checkbox('private_flag', 1, $private_flag); ?> 110 <label class=" classic" for="private_flag"> <?php echo __('Enable Private mode');?></label> 111 </p> 112 <p><label class="required" title="<?php echo __('Required field');?>"> 113 <?php echo __('New password:'); ?> 114 <?php echo form::password('blog_private_pwd',30,255); ?> 115 </label></p> 116 <p><label class="required" title="<?php echo __('Required field');?>"> 117 <?php echo __('Confirm password:'); ?> 118 <?php echo form::password('blog_private_pwd_c',30,255); ?> 119 </label></p> 120 </div> 121 <div class="col"> 122 <p> 123 <?php echo form::checkbox('private_conauto', 1, $private_conauto); ?> 124 <label class=" classic" for="private_conauto"> <?php echo __('Propose automatic connection to visitors');?></label> 125 </p> 126 <p class="form-note"> 127 <?php echo __('With this option, the password could be stored in a cookie.'); ?> 128 <?php echo __('But it still remains a choice for the visitor.'); ?> 129 </p> 130 <p><?php echo sprintf(__('Don\'t forget to add a <a href="%s">widget</a> allowing disconnection from the blog.'),'plugin.php?p=widgets'); ?></p> 131 </div> 132 </div> 133 </fieldset> 134 <fieldset class="constrained"> 135 <legend><?php echo __('Presentation options'); ?></legend> 136 <p class="col"><label class="required" title="<?php echo __('Required field');?>"> 137 <?php echo __('Private page title:');?> 138 <?php echo form::field('blog_private_title',20,255,html::escapeHTML($blog_private_title),'maximal'); ?> 139 </label></p> 140 <p class="area"><label class="required" title="<?php echo __('Required field');?>"> 141 <?php echo __('Private message:');?> 142 <?php echo form::textarea('blog_private_msg',30,4,html::escapeHTML($blog_private_msg)); ?> 143 </label></p> 144 </fieldset> 101 echo '<h2>'.html::escapeHTML($core->blog->name).' › '.__('Private mode').'</h2>'; 145 102 146 <p><input type="hidden" name="p" value="private" /> 147 <?php echo $core->formNonce(); ?> 148 <input type="submit" name="saveconfig" value="<?php echo __('Save configuration'); ?>" /></p> 149 </form> 150 </div> 103 echo '<div id="private_options">'. 104 '<form method="post" action="'.$p_url.'">'. 105 '<fieldset>'. 106 '<legend>'. __('Plugin activation').'</legend>'. 107 '<div class="two-cols">'. 108 '<div class="col">'. 109 '<p class="field">'. 110 form::checkbox('private_flag', 1, $private_flag). 111 '<label class=" classic" for="private_flag">'.__('Enable Private mode').'</label>'. 112 '</p>'. 113 '<p><label class="required" title="'.__('Required field').'">'. 114 __('New password:'). 115 form::password('blog_private_pwd',30,255). 116 '</label></p>'. 117 '<p><label class="required" title="'.__('Required field').'">'. 118 __('Confirm password:'). 119 form::password('blog_private_pwd_c',30,255). 120 '</label></p>'. 121 '</div>'. 122 '<div class="col">'. 123 '<p>'. 124 form::checkbox('private_conauto', 1, $private_conauto). 125 '<label class=" classic" for="private_conauto">'. __('Propose automatic connection to visitors').'</label>'. 126 '</p>'. 127 '<p class="form-note">'. 128 __('With this option, the password could be stored in a cookie.'). 129 __('But it still remains a choice for the visitor.'). 130 '</p>'. 131 '<p>'.sprintf(__('Don\'t forget to add a <a href="%s">widget</a> allowing disconnection from the blog.'),'plugin.php?p=widgets').'</p>'. 132 '</div>'. 133 '</div>'. 134 '</fieldset>'. 135 '<fieldset>'. 136 '<legend>'.__('Presentation options').'</legend>'. 137 '<p class="col"><label class="required" title="'.__('Required field').'">'. 138 __('Private page title:'). 139 form::field('blog_private_title',20,255,html::escapeHTML($blog_private_title),'maximal'). 140 '.</label></p>'. 141 '<p class="area"><label class="required" title="'.__('Required field').'">'. 142 __('Private message:'). 143 form::textarea('blog_private_msg',30,4,html::escapeHTML($blog_private_msg)). 144 '</label></p>'. 145 '</fieldset>'. 146 147 '<p>'.form::hidden(array('p'),'private'). 148 $core->formNonce(). 149 '<input type="submit" name="saveconfig" value="'.__('Save configuration').'" /></p>'. 150 '</form>'. 151 '</div>'; 152 ?> 151 153 </body> 152 154 </html> -
plugins/private/locales/fr/main.po
r955 r1768 1 # French translations for PACKAGE package.2 # Copyright (C) 2008 THE PACKAGE'S COPYRIGHT HOLDER3 # This file is distributed under the same license as the PACKAGE package.4 # Greg <popech@gmail.com>, 2008.5 # 1 # Language: français 2 # Module: private - 1.1RC1 3 # Date: 2009-10-26 23:51:03 4 # Translated with translater 1.3 5 6 6 msgid "" 7 7 msgstr "" 8 " Project-Id-Version: PACKAGE VERSION\n"9 " Report-Msgid-Bugs-To:\n"10 "POT-Creation-Date: 2008-11-25 23:01+0100\n"11 "PO-Revision-Date: 200 8-11-25 23:01+0100\n"12 "Last-Translator: Greg <popech@gmail.com>\n"13 "Language-Team: French\n"8 "Content-Type: text/plain; charset=UTF-8\n" 9 "Project-Id-Version: private 1.1RC1\n" 10 "POT-Creation-Date: \n" 11 "PO-Revision-Date: 2009-10-26T23:51:03+00:00\n" 12 "Last-Translator: Osku\n" 13 "Language-Team: \n" 14 14 "MIME-Version: 1.0\n" 15 "Content-Type: text/plain; charset=ASCII\n"16 15 "Content-Transfer-Encoding: 8bit\n" 17 "Plural-Forms: nplurals=2; plural=(n > 1);\n"18 16 19 #: _admin.php:14 index.php:91 index.php:95 17 #: _admin.php:15 18 #: index.php:90 19 #: index.php:101 20 20 msgid "Private mode" 21 msgstr "Mode Privé"21 msgstr "Mode privé" 22 22 23 #: index.php:35 23 #: _public.php:146 24 #: _public.php:156 25 msgid "Wrong password" 26 msgstr "Mot de passe incorrect" 27 28 #: _public.php:165 29 msgid "Disconnected" 30 msgstr "Déconnecté(e)" 31 32 #: _public.php:214 33 msgid "Enable automatic connection" 34 msgstr "Activer la connexion automatique" 35 36 #: _widgets.php:21 37 #: _widgets.php:22 38 msgid "Blog logout" 39 msgstr "Déconnexion du blog" 40 41 #: _widgets.php:22 42 msgid "Title:" 43 msgstr "Titre :" 44 45 #: _widgets.php:23 46 msgid "Text:" 47 msgstr "Texte :" 48 49 #: _widgets.php:24 50 msgid "Button:" 51 msgstr "Bouton :" 52 53 #: _widgets.php:24 54 msgid "Disconnect" 55 msgstr "Se déconnecter" 56 57 #: _widgets.php:25 58 msgid "Home page only" 59 msgstr "Page d'accueil uniquement" 60 61 #: index.php:36 24 62 msgid "Private blog" 25 63 msgstr "Blog privé" 26 64 27 #: index.php: 3965 #: index.php:40 28 66 msgid "<p class=\"message\">You need the password to view this blog.</p>" 29 67 msgstr "<p class=\"message\">Vous avez besoin du mot de passe pour visualiser le blog.</p>" 30 68 31 #: index.php:44 69 #: index.php:54 70 msgid "No page title." 71 msgstr "Aucun titre pour la page" 72 73 #: index.php:58 74 msgid "No private message." 75 msgstr "Aucun message pour la page" 76 77 #: index.php:69 78 msgid "Passwords don't match" 79 msgstr "Les mots de passe ne correspondent pas" 80 81 #: index.php:85 32 82 msgid "No password set." 33 83 msgstr "Aucun mot de passe défini" 34 84 35 #: index.php:58 36 msgid "No page title." 37 msgstr "Aucun titre pour la page" 38 39 #: index.php:62 40 msgid "No private message." 41 msgstr "Aucun message pour la page" 42 43 #: index.php:73 44 msgid "Passwords don't match" 45 msgstr "Les mots de passe ne correspondent pas" 46 47 #: index.php:80 85 #: index.php:96 48 86 msgid "Configuration successfully updated." 49 87 msgstr "La configuration a été correctement enregistrée" 50 88 51 #: index.php:10 489 #: index.php:106 52 90 msgid "Plugin activation" 53 91 msgstr "Activation de l'extension" 54 92 55 #: index.php:1 0993 #: index.php:111 56 94 msgid "Enable Private mode" 57 95 msgstr "Activer le mode Privé" 58 96 59 #: index.php:111 index.php:115 index.php:135 index.php:139 97 #: index.php:113 98 #: index.php:117 99 #: index.php:137 100 #: index.php:141 60 101 msgid "Required field" 61 102 msgstr "Champ obligatoire" 62 103 63 #: index.php:11 2104 #: index.php:114 64 105 msgid "New password:" 65 msgstr " "106 msgstr "Nouveau mot de passe :" 66 107 67 #: index.php:11 6108 #: index.php:118 68 109 msgid "Confirm password:" 69 msgstr " Nouveau mot de passe:"110 msgstr "Confirmez le mot de passe :" 70 111 71 #: index.php:12 3112 #: index.php:125 72 113 msgid "Propose automatic connection to visitors" 73 114 msgstr "Proposer la connexion automatique aux visiteurs" 74 115 75 #: index.php:12 6116 #: index.php:128 76 117 msgid "With this option, the password could be stored in a cookie." 77 118 msgstr "Cette option permet la mémorisation du mot de passe dans un cookie." 78 119 79 #: index.php:12 7120 #: index.php:129 80 121 msgid "But it still remains a choice for the visitor." 81 122 msgstr "Mais ceci reste toutefois à la discrétion du visiteur." 82 123 83 #: index.php:129 84 #, php-format 85 msgid "" 86 "Don't forget to add a <a href=\"%s\">widget</a> allowing disconnection from " 87 "the blog." 124 #: index.php:131 125 msgid "Don't forget to add a <a href=\"%s\">widget</a> allowing disconnection from the blog." 88 126 msgstr "N'oubliez pas d'ajouter un <a href=\"%s\">widget</a> permettant la déconnexion du blog." 89 127 90 #: index.php:13 4128 #: index.php:136 91 129 msgid "Presentation options" 92 130 msgstr "Options d'affichage" 93 131 94 #: index.php:13 6132 #: index.php:138 95 133 msgid "Private page title:" 96 msgstr "Titre de la page privée 134 msgstr "Titre de la page privée" 97 135 98 #: index.php:14 0136 #: index.php:142 99 137 msgid "Private message:" 100 msgstr "Message privé "138 msgstr "Message privé :" 101 139 102 #: index.php:14 7140 #: index.php:149 103 141 msgid "Save configuration" 104 142 msgstr "Enregistrer la configuration" 105 143 106 #: _public.php:104 _public.php:114107 msgid "Wrong password"108 msgstr "Mot de passe incorrect"109 110 #: _public.php:123111 msgid "Disconnected"112 msgstr "Déconnecté(e)"113 114 #: _public.php:170115 msgid "Enable automatic connection"116 msgstr "Activer la connexion automatique"117 118 #: _widgets.php:20 _widgets.php:21119 msgid "Blog logout"120 msgstr "Déconnexion du blog"121 122 #: _widgets.php:21123 msgid "Title:"124 msgstr "Titre:"125 126 #: _widgets.php:22127 msgid "Text:"128 msgstr "Texte"129 130 #: _widgets.php:23131 msgid "Button:"132 msgstr "Bouton"133 134 #: _widgets.php:23135 msgid "Disconnect"136 msgstr "Se déconnecter"137 138 #: _widgets.php:24139 msgid "Home page only"140 msgstr "Page d'accueil uniquement"
Note: See TracChangeset
for help on using the changeset viewer.