Changeset 955 for plugins/private
- Timestamp:
- 03/29/09 16:10:50 (14 years ago)
- Location:
- plugins/private
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/private/_admin.php
r863 r955 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # This file is part of Private mode, a plugin for Dotclear. 3 # 4 # This file is part of Private mode, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2008, 2009 Osku 6 # 7 # Licensed under the GPL version 2.0 license. 6 # Copyright (c) 2008-2009 Osku and contributors 7 ## Licensed under the GPL version 2.0 license. 8 8 # A copy of this license is available in LICENSE file or at 9 9 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 # 10 11 # -- END LICENSE BLOCK ------------------------------------ 11 12 -
plugins/private/_define.php
r866 r955 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # This file is part of Private mode, a plugin for Dotclear. 3 # 4 # This file is part of Private mode, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2008, 2009 Osku 6 # 7 # Licensed under the GPL version 2.0 license. 6 # Copyright (c) 2008-2009 Osku and contributors 7 ## Licensed under the GPL version 2.0 license. 8 8 # A copy of this license is available in LICENSE file or at 9 9 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 # 10 11 # -- END LICENSE BLOCK ------------------------------------ 11 12 … … 15 16 /* Name */ "Private mode", 16 17 /* Description*/ "Protect your blog with a password", 17 /* Author */ "Osku ",18 /* Version */ ' 0.7-rc1',18 /* Author */ "Osku and contributors", 19 /* Version */ '1.0', 19 20 /* Permissions */ 'admin' 20 21 ); -
plugins/private/_prepend.php
r863 r955 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # This file is part of Private mode, a plugin for Dotclear. 3 # 4 # This file is part of Private mode, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2008, 2009 Osku 6 # 7 # Licensed under the GPL version 2.0 license. 6 # Copyright (c) 2008-2009 Osku and contributors 7 ## Licensed under the GPL version 2.0 license. 8 8 # A copy of this license is available in LICENSE file or at 9 9 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 # 10 11 # -- END LICENSE BLOCK ------------------------------------ 11 12 -
plugins/private/_public.php
r866 r955 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # This file is part of Private mode, a plugin for Dotclear. 3 # 4 # This file is part of Private mode, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2008, 2009 Osku 6 # 7 # Licensed under the GPL version 2.0 license. 6 # Copyright (c) 2008-2009 Osku and contributors 7 ## Licensed under the GPL version 2.0 license. 8 8 # A copy of this license is available in LICENSE file or at 9 9 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 # 10 11 # -- END LICENSE BLOCK ------------------------------------ 11 12 … … 76 77 else 77 78 { 78 // Add cookie test 79 // Add cookie test (automatic login) 79 80 $cookiepass="dc_privateblog_cookie_".$core->blog->id; 80 81 if (!empty($_COOKIE[$cookiepass])) { … … 88 89 if ($cookiepassvalue != false) { 89 90 $_SESSION['sess_blog_private'] = $_COOKIE[$cookiepass]; 90 //setcookie($cookiepass,$_COOKIE[$cookiepass],time()+31536000,'/');91 91 return; 92 92 … … 165 165 public static function PrivatePassRemember($attr) 166 166 { 167 $res = '<p><label class="classic">'. 168 form::checkbox(array('pass_remember'),1,'','',2).' '. 169 __('Enable automatic connection').'</label></p>'; 170 return $res; 167 if ($core->blog->settings->private_conauto) 168 { 169 $res = '<p><label class="classic">'. 170 form::checkbox(array('pass_remember'),1,'','',2).' '. 171 __('Enable automatic connection').'</label></p>'; 172 return $res; 173 } 174 else 175 { 176 return; 177 } 171 178 } 172 179 -
plugins/private/_widgets.php
r863 r955 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # This file is part of Private mode, a plugin for Dotclear. 3 # 4 # This file is part of Private mode, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2008, 2009 Osku 6 # 7 # Licensed under the GPL version 2.0 license. 6 # Copyright (c) 2008-2009 Osku and contributors 7 ## Licensed under the GPL version 2.0 license. 8 8 # A copy of this license is available in LICENSE file or at 9 9 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 # 10 11 # -- END LICENSE BLOCK ------------------------------------ 11 12 … … 19 20 { 20 21 $widgets->create('privateblog',__('Blog logout'),array('tplPrivate','privateWidgets')); 21 $widgets->privateblog->setting('title',__('Title:'), '');22 $widgets->privateblog->setting('title',__('Title:'),__('Blog logout')); 22 23 $widgets->privateblog->setting('text',__('Text:'),'','textarea'); 23 24 $widgets->privateblog->setting('label',__('Button:'),__('Disconnect')); -
plugins/private/default-templates/private.html
r749 r955 1 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 2 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang=" en" lang="en">3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{tpl:BlogLanguage}}" lang="{{tpl:BlogLanguage}}"> 4 4 <head> 5 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 6 <meta name="MSSmartTagsPreventParsing" content="TRUE" /> 7 7 <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" /> 8 <title>{{tpl:PrivatePageTitle encode_html="1"}} - {{tpl:BlogName encode_html="1"}}</title>8 <title>{{tpl:PrivatePageTitle encode_html="1"}}</title> 9 9 10 10 <style type="text/css"> … … 27 27 input { border-width : 1px; } 28 28 29 p.error {color :#c00}29 p.error {color : #c00; } 30 30 </style> 31 31 </head> 32 32 33 33 <body> 34 34 35 <form action="{{tpl:PrivateReqPage}}" method="post"> 35 36 <h2>{{tpl:PrivatePageTitle}}</h2> 37 36 38 <tpl:IfPrivateMsgError> 37 39 <p class="error">{{tpl:PrivateMsgError}}</p> 38 40 </tpl:IfPrivateMsgError> 41 39 42 {{tpl:PrivateMsg}} 43 40 44 {{tpl:PrivatePassRemember}} 41 <p><label>{{tpl:lang Password:}} <input name="private_pass" id="private_pass" type="password" size="30" maxlength="255" value="" tabindex="1" /></label> <input type="submit" class="submit" value="ok" /></p> 45 46 <p><label>{{tpl:lang Password:}} <input type="password" name="private_pass" id="private_pass" value="" 47 tabindex="1" /></label> <input type="submit" value="ok" /></p> 42 48 43 49 </form> 50 44 51 </body> 45 52 </html> -
plugins/private/index.php
r866 r955 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # This file is part of Private mode, a plugin for Dotclear. 3 # 4 # This file is part of Private mode, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2008, 2009 Osku 6 # 7 # Licensed under the GPL version 2.0 license. 6 # Copyright (c) 2008-2009 Osku and contributors 7 ## Licensed under the GPL version 2.0 license. 8 8 # A copy of this license is available in LICENSE file or at 9 9 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 # 10 11 # -- END LICENSE BLOCK ------------------------------------ 11 12 … … 15 16 $core->blog->settings->setNameSpace('private'); 16 17 17 // Maintenanceis not active by default18 // Private mode is not active by default 18 19 $core->blog->settings->put('private_flag',false,'boolean'); 20 $core->blog->settings->put('private_conauto',false,'boolean'); 19 21 $core->blog->triggerBlog(); 20 22 http::redirect(http::getSelfURI()); … … 27 29 // Getting current parameters 28 30 $private_flag = (boolean)$core->blog->settings->private_flag; 31 $private_conauto = (boolean)$core->blog->settings->private_conauto; 29 32 $blog_private_title = $core->blog->settings->blog_private_title; 30 33 $blog_private_msg = $core->blog->settings->blog_private_msg; … … 48 51 { 49 52 $private_flag = (empty($_POST['private_flag']))?false:true; 53 $private_conauto = (empty($_POST['private_conauto']))?false:true; 50 54 $blog_private_title = $_POST['blog_private_title']; 51 55 $blog_private_msg = $_POST['blog_private_msg']; … … 61 65 62 66 $core->blog->settings->setNamespace('private'); 63 $core->blog->settings->put('private_flag',$private_flag,'boolean'); 67 $core->blog->settings->put('private_flag',$private_flag,'boolean','Protect your blog with a password'); 68 $core->blog->settings->put('private_conauto',$private_conauto,'boolean','Allow automatic connection'); 64 69 $core->blog->settings->put('blog_private_title',$blog_private_title,'string','Private page title'); 65 70 $core->blog->settings->put('blog_private_msg',$blog_private_msg,'string','Private message'); … … 95 100 <?php if (!empty($err)) echo '<p class="error">'.$err.'</p>'; ?> 96 101 97 <div id=" offline_options">102 <div id="private_options"> 98 103 <form method="post" action="plugin.php"> 99 104 <fieldset> 100 105 <legend><?php echo __('Plugin activation'); ?></legend> 106 <div class="two-cols"> 107 <div class="col"> 101 108 <p class="field"> 102 109 <?php echo form::checkbox('private_flag', 1, $private_flag); ?> … … 105 112 <p><label class="required" title="<?php echo __('Required field');?>"> 106 113 <?php echo __('New password:'); ?> 107 <?php echo form::password('blog_private_pwd', 20,255); ?>114 <?php echo form::password('blog_private_pwd',30,255); ?> 108 115 </label></p> 109 116 <p><label class="required" title="<?php echo __('Required field');?>"> 110 117 <?php echo __('Confirm password:'); ?> 111 <?php echo form::password('blog_private_pwd_c', 20,255); ?>118 <?php echo form::password('blog_private_pwd_c',30,255); ?> 112 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> 113 133 </fieldset> 114 134 <fieldset class="constrained"> -
plugins/private/locales/_pot/main.pot
r749 r955 9 9 "Project-Id-Version: PACKAGE VERSION\n" 10 10 "Report-Msgid-Bugs-To: \n" 11 "POT-Creation-Date: 2009-0 2-07 19:49+0100\n"11 "POT-Creation-Date: 2009-03-29 15:10+0200\n" 12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 14 14 "Language-Team: LANGUAGE <LL@li.org>\n" 15 15 "MIME-Version: 1.0\n" 16 "Content-Type: text/plain; charset= CHARSET\n"16 "Content-Type: text/plain; charset=ASCII\n" 17 17 "Content-Transfer-Encoding: 8bit\n" 18 18 19 #: _admin.php:1 8 index.php:92 index.php:9619 #: _admin.php:14 index.php:91 index.php:95 20 20 msgid "Private mode" 21 21 msgstr "" 22 22 23 #: index.php:3 823 #: index.php:35 24 24 msgid "Private blog" 25 25 msgstr "" 26 26 27 #: index.php: 4227 #: index.php:39 28 28 msgid "<p class=\"message\">You need the password to view this blog.</p>" 29 29 msgstr "" 30 30 31 #: index.php:4 731 #: index.php:44 32 32 msgid "No password set." 33 33 msgstr "" 34 34 35 #: index.php: 6035 #: index.php:58 36 36 msgid "No page title." 37 37 msgstr "" 38 38 39 #: index.php:6 439 #: index.php:62 40 40 msgid "No private message." 41 41 msgstr "" 42 42 43 #: index.php:7 443 #: index.php:73 44 44 msgid "Passwords don't match" 45 45 msgstr "" 46 46 47 #: index.php:8 147 #: index.php:80 48 48 msgid "Configuration successfully updated." 49 49 msgstr "" 50 50 51 #: index.php:10 551 #: index.php:104 52 52 msgid "Plugin activation" 53 53 msgstr "" 54 54 55 #: index.php:10 855 #: index.php:109 56 56 msgid "Enable Private mode" 57 57 msgstr "" 58 58 59 #: index.php:111 59 #: index.php:111 index.php:115 index.php:135 index.php:139 60 msgid "Required field" 61 msgstr "" 62 63 #: index.php:112 60 64 msgid "New password:" 61 65 msgstr "" 62 66 63 #: index.php:11 567 #: index.php:116 64 68 msgid "Confirm password:" 65 69 msgstr "" 66 70 67 #: index.php:120 71 #: index.php:123 72 msgid "Propose automatic connection to visitors" 73 msgstr "" 74 75 #: index.php:126 76 msgid "With this option, the password could be stored in a cookie." 77 msgstr "" 78 79 #: index.php:127 80 msgid "But it still remains a choice for the visitor." 81 msgstr "" 82 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." 88 msgstr "" 89 90 #: index.php:134 68 91 msgid "Presentation options" 69 92 msgstr "" 70 93 71 #: index.php:1 2294 #: index.php:136 72 95 msgid "Private page title:" 73 96 msgstr "" 74 97 75 #: index.php:1 2698 #: index.php:140 76 99 msgid "Private message:" 77 100 msgstr "" 78 101 79 #: index.php:1 33102 #: index.php:147 80 103 msgid "Save configuration" 81 104 msgstr "" 82 105 83 #: _public.php:10 9 _public.php:119106 #: _public.php:104 _public.php:114 84 107 msgid "Wrong password" 85 108 msgstr "" 86 109 87 #: _public.php:12 7110 #: _public.php:123 88 111 msgid "Disconnected" 89 112 msgstr "" 90 113 91 #: _public.php:17 2114 #: _public.php:170 92 115 msgid "Enable automatic connection" 93 116 msgstr "" 94 117 95 #: _public.php:190 118 #: _widgets.php:20 _widgets.php:21 119 msgid "Blog logout" 120 msgstr "" 121 122 #: _widgets.php:21 123 msgid "Title:" 124 msgstr "" 125 126 #: _widgets.php:22 127 msgid "Text:" 128 msgstr "" 129 130 #: _widgets.php:23 131 msgid "Button:" 132 msgstr "" 133 134 #: _widgets.php:23 96 135 msgid "Disconnect" 97 136 msgstr "" 98 137 99 138 #: _widgets.php:24 100 msgid "Blog logout"101 msgstr ""102 103 #: _widgets.php:25104 msgid "Title:"105 msgstr ""106 107 #: _widgets.php:26108 139 msgid "Home page only" 109 140 msgstr "" -
plugins/private/locales/fr/main.po
r749 r955 17 17 "Plural-Forms: nplurals=2; plural=(n > 1);\n" 18 18 19 #: _admin.php:1 8index.php:91 index.php:9519 #: _admin.php:14 index.php:91 index.php:95 20 20 msgid "Private mode" 21 21 msgstr "Mode Privé" 22 22 23 #: index.php:3 823 #: index.php:35 24 24 msgid "Private blog" 25 25 msgstr "Blog privé" 26 26 27 #: index.php: 4227 #: index.php:39 28 28 msgid "<p class=\"message\">You need the password to view this blog.</p>" 29 29 msgstr "<p class=\"message\">Vous avez besoin du mot de passe pour visualiser le blog.</p>" 30 30 31 #: index.php:55 31 #: index.php:44 32 msgid "No password set." 33 msgstr "Aucun mot de passe défini" 34 35 #: index.php:58 32 36 msgid "No page title." 33 37 msgstr "Aucun titre pour la page" 34 38 35 #: index.php: 5939 #: index.php:62 36 40 msgid "No private message." 37 41 msgstr "Aucun message pour la page" 38 42 39 #: index.php: 6943 #: index.php:73 40 44 msgid "Passwords don't match" 41 45 msgstr "Les mots de passe ne correspondent pas" 42 46 43 #: index.php: 7647 #: index.php:80 44 48 msgid "Configuration successfully updated." 45 49 msgstr "La configuration a été correctement enregistrée" 46 47 #: index.php:8548 msgid "No password set."49 msgstr "Aucun mot de passe défini"50 50 51 51 #: index.php:104 … … 53 53 msgstr "Activation de l'extension" 54 54 55 #: index.php:10 755 #: index.php:109 56 56 msgid "Enable Private mode" 57 57 msgstr "Activer le mode Privé" 58 58 59 #: index.php:110 59 #: index.php:111 index.php:115 index.php:135 index.php:139 60 msgid "Required field" 61 msgstr "Champ obligatoire" 62 63 #: index.php:112 60 64 msgid "New password:" 65 msgstr "" 66 67 #: index.php:116 68 msgid "Confirm password:" 61 69 msgstr "Nouveau mot de passe:" 62 70 63 #: index.php:1 1464 msgid " Confirm password:"65 msgstr " Confirmez le mot de passe:"71 #: index.php:123 72 msgid "Propose automatic connection to visitors" 73 msgstr "Proposer la connexion automatique aux visiteurs" 66 74 67 #: index.php:119 75 #: index.php:126 76 msgid "With this option, the password could be stored in a cookie." 77 msgstr "Cette option permet la mémorisation du mot de passe dans un cookie." 78 79 #: index.php:127 80 msgid "But it still remains a choice for the visitor." 81 msgstr "Mais ceci reste toutefois à la discrétion du visiteur." 82 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." 88 msgstr "N'oubliez pas d'ajouter un <a href=\"%s\">widget</a> permettant la déconnexion du blog." 89 90 #: index.php:134 68 91 msgid "Presentation options" 69 92 msgstr "Options d'affichage" 70 93 71 #: index.php:1 2194 #: index.php:136 72 95 msgid "Private page title:" 73 msgstr "Titre de la page privée "96 msgstr "Titre de la page privée " 74 97 75 #: index.php:1 2598 #: index.php:140 76 99 msgid "Private message:" 77 msgstr "Message privé "100 msgstr "Message privé " 78 101 79 #: index.php:1 32102 #: index.php:147 80 103 msgid "Save configuration" 81 104 msgstr "Enregistrer la configuration" 82 105 83 #: _public.php: 49106 #: _public.php:104 _public.php:114 84 107 msgid "Wrong password" 85 108 msgstr "Mot de passe incorrect" 86 109 87 #: _public.php: 58110 #: _public.php:123 88 111 msgid "Disconnected" 89 112 msgstr "Déconnecté(e)" 90 113 91 #: _public.php:17 2114 #: _public.php:170 92 115 msgid "Enable automatic connection" 93 116 msgstr "Activer la connexion automatique" 94 117 95 #: _public.php:112 118 #: _widgets.php:20 _widgets.php:21 119 msgid "Blog logout" 120 msgstr "Déconnexion du blog" 121 122 #: _widgets.php:21 123 msgid "Title:" 124 msgstr "Titre:" 125 126 #: _widgets.php:22 127 msgid "Text:" 128 msgstr "Texte" 129 130 #: _widgets.php:23 131 msgid "Button:" 132 msgstr "Bouton" 133 134 #: _widgets.php:23 96 135 msgid "Disconnect" 97 136 msgstr "Se déconnecter" 98 137 99 138 #: _widgets.php:24 100 msgid "Blog logout"101 msgstr "Déconnexion du blog"102 103 #: _widgets.php:25104 msgid "Title:"105 msgstr "Titre:"106 107 #: _widgets.php:26108 139 msgid "Home page only" 109 140 msgstr "Page d'accueil uniquement"
Note: See TracChangeset
for help on using the changeset viewer.