Dotclear

Changeset 863 for plugins/private


Ignore:
Timestamp:
03/12/09 00:42:32 (15 years ago)
Author:
Osku
Message:

Private Mode : almost 0.7 :

  • New way for managing sessions
  • New options for widget

i-Cette ligne, et les suivantes ci-dessous, seront ignorées--

M _define.php
D LICENSE
M _prepend.php
M _public.php
M _widgets.php
M _admin.php
M index.php

Location:
plugins/private
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • plugins/private/_admin.php

    r611 r863  
    1 <?php /* -*- tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ 
    2 /***************************************************************\ 
    3  *  This is 'Private', a plugin for Dotclear 2                 * 
    4  *                                                             * 
    5  *  Copyright (c) 2008                                         * 
    6  *  Osku and contributors.                                     * 
    7  *                                                             * 
    8  *  This is an open source software, distributed under the GNU * 
    9  *  General Public License (version 2) terms and  conditions.  * 
    10  *                                                             * 
    11  *  You should have received a copy of the GNU General Public  * 
    12  *  License along with 'Private blog' (see LICENSE);           * 
    13  *  if not, write to the Free Software Foundation, Inc.,       * 
    14  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    * 
    15 \***************************************************************/ 
     1<?php 
     2# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# This file is part of Private mode, a plugin for Dotclear. 
     4#  
     5# Copyright (c) 2008, 2009 Osku 
     6#  
     7# Licensed under the GPL version 2.0 license. 
     8# A copy of this license is available in LICENSE file or at 
     9# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     10# -- END LICENSE BLOCK ------------------------------------ 
     11 
    1612if (!defined('DC_CONTEXT_ADMIN')) { return; } 
    1713 
  • plugins/private/_define.php

    r749 r863  
    1 <?php /* -*- tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ 
    2 /***************************************************************\ 
    3  *  This is 'Private', a plugin for Dotclear 2                 * 
    4  *                                                             * 
    5  *  Copyright (c) 2008                                         * 
    6  *  Osku and contributors.                                     * 
    7  *                                                             * 
    8  *  This is an open source software, distributed under the GNU * 
    9  *  General Public License (version 2) terms and  conditions.  * 
    10  *                                                             * 
    11  *  You should have received a copy of the GNU General Public  * 
    12  *  License along with 'Private blog' (see LICENSE);           * 
    13  *  if not, write to the Free Software Foundation, Inc.,       * 
    14  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    * 
    15 \***************************************************************/ 
     1<?php 
     2# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# This file is part of Private mode, a plugin for Dotclear. 
     4#  
     5# Copyright (c) 2008, 2009 Osku 
     6#  
     7# Licensed under the GPL version 2.0 license. 
     8# A copy of this license is available in LICENSE file or at 
     9# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     10# -- END LICENSE BLOCK ------------------------------------ 
     11 
    1612if (!defined('DC_RC_PATH')) { return; } 
    1713 
     
    2016     /* Description*/    "Protect your blog with a password", 
    2117     /* Author */        "Osku", 
    22      /* Version */       '0.6', 
     18     /* Version */       '0.7-gamma', 
    2319     /* Permissions */   'admin' 
    2420); 
  • plugins/private/_prepend.php

    r611 r863  
    1 <?php /* -*- tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ 
    2 /***************************************************************\ 
    3  *  This is 'Private', a plugin for Dotclear 2                 * 
    4  *                                                             * 
    5  *  Copyright (c) 2008                                         * 
    6  *  Osku and contributors.                                     * 
    7  *                                                             * 
    8  *  This is an open source software, distributed under the GNU * 
    9  *  General Public License (version 2) terms and  conditions.  * 
    10  *                                                             * 
    11  *  You should have received a copy of the GNU General Public  * 
    12  *  License along with 'Private blog' (see LICENSE);           * 
    13  *  if not, write to the Free Software Foundation, Inc.,       * 
    14  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    * 
    15 \***************************************************************/ 
     1<?php 
     2# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# This file is part of Private mode, a plugin for Dotclear. 
     4#  
     5# Copyright (c) 2008, 2009 Osku 
     6#  
     7# Licensed under the GPL version 2.0 license. 
     8# A copy of this license is available in LICENSE file or at 
     9# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     10# -- END LICENSE BLOCK ------------------------------------ 
     11 
    1612if (!defined('DC_RC_PATH')) { return; } 
    1713 
  • plugins/private/_public.php

    r749 r863  
    1 <?php /* -*- tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ 
    2 /***************************************************************\ 
    3  *  This is 'Private', a plugin for Dotclear 2                 * 
    4  *                                                             * 
    5  *  Copyright (c) 2008                                         * 
    6  *  Osku and contributors.                                     * 
    7  *                                                             * 
    8  *  This is an open source software, distributed under the GNU * 
    9  *  General Public License (version 2) terms and  conditions.  * 
    10  *                                                             * 
    11  *  You should have received a copy of the GNU General Public  * 
    12  *  License along with 'Private blog' (see LICENSE);           * 
    13  *  if not, write to the Free Software Foundation, Inc.,       * 
    14  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    * 
    15 \***************************************************************/ 
     1<?php 
     2# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# This file is part of Private mode, a plugin for Dotclear. 
     4#  
     5# Copyright (c) 2008, 2009 Osku 
     6#  
     7# Licensed under the GPL version 2.0 license. 
     8# A copy of this license is available in LICENSE file or at 
     9# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     10# -- END LICENSE BLOCK ------------------------------------ 
     11 
    1612if (!defined('DC_RC_PATH')) { return; } 
    1713 
     
    4844          $urlp->registerDefault(array('urlPrivate','callbackbidon')); 
    4945 
    50           $path = str_replace(http::getHost(),'',$core->blog->url); 
    51           if ($core->blog->settings->url_scan == 'query_string') 
    52           { 
    53                $path = str_replace(basename($core->blog->url),'',$path); 
    54           } 
     46          //$path = str_replace(http::getHost(),'',$core->blog->url); 
     47          //if ($core->blog->settings->url_scan == 'query_string') 
     48          //{ 
     49          //   $path = str_replace(basename($core->blog->url),'',$path); 
     50          //} 
    5551          if (!isset($session)) 
    5652          { 
     
    5854                       $core->con, 
    5955                       $core->prefix.'session', 
    60                        'dc_privateblog', 
    61                        $path 
     56                       'dc_privateblog_sess_'.$core->blog->id, 
     57                       '/' 
    6258               ); 
    6359               $session->start(); 
     
    8177          { 
    8278               // Add cookie test 
    83                $cookiepass="dc_blog_private_".$core->blog->id; 
     79               $cookiepass="dc_privateblog_cookie_".$core->blog->id; 
    8480               if (!empty($_COOKIE[$cookiepass])) { 
    8581                    $cookiepassvalue=(($_COOKIE[$cookiepass]) == 
     
    9288                    if ($cookiepassvalue != false) { 
    9389                         $_SESSION['sess_blog_private'] = $_COOKIE[$cookiepass]; 
    94                          setcookie($cookiepass,$_COOKIE[$cookiepass],time()+31536000,'/'); 
     90                         //setcookie($cookiepass,$_COOKIE[$cookiepass],time()+31536000,'/'); 
    9591                         return; 
    9692 
     
    125121               { 
    126122                    $session->destroy(); 
     123                    setcookie($cookiepass,md5($_POST['private_pass']),time()-86400,'/'); 
    127124                    $_ctx->blogpass_error = __('Disconnected'); 
    128125                    $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates'); 
     
    185182               $res = '<div class="blogout">'. 
    186183                    ($w->title ? '<h2>'.html::escapeHTML($w->title).'</h2>' : ''). 
     184                    ($w->text ? $w->text : ''). 
    187185                    '<form action="'.$core->blog->url.'" method="post">'. 
    188186                    '<p class="buttons">'. 
    189187                    '<input type="hidden" name="blogout" id="blogout" value="">'. 
    190                     '<input type="submit" value="'.__('Disconnect').'" class="logout"></p>'. 
     188                    '<input type="submit" value="'.html::escapeHTML($w->label).'" class="logout"></p>'. 
    191189                    '</form></div>'; 
    192190               return $res; 
  • plugins/private/_widgets.php

    r570 r863  
    1 <?php /* -*- tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ 
    2 /***************************************************************\ 
    3  *  This is 'Private', a plugin for Dotclear 2                 * 
    4  *                                                             * 
    5  *  Copyright (c) 2008                                         * 
    6  *  Osku and contributors.                                     * 
    7  *                                                             * 
    8  *  This is an open source software, distributed under the GNU * 
    9  *  General Public License (version 2) terms and  conditions.  * 
    10  *                                                             * 
    11  *  You should have received a copy of the GNU General Public  * 
    12  *  License along with 'Private blog' (see LICENSE);           * 
    13  *  if not, write to the Free Software Foundation, Inc.,       * 
    14  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    * 
    15 \***************************************************************/ 
     1<?php 
     2# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# This file is part of Private mode, a plugin for Dotclear. 
     4#  
     5# Copyright (c) 2008, 2009 Osku 
     6#  
     7# Licensed under the GPL version 2.0 license. 
     8# A copy of this license is available in LICENSE file or at 
     9# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     10# -- END LICENSE BLOCK ------------------------------------ 
     11 
    1612if (!defined('DC_RC_PATH')) { return; } 
    1713 
     
    2420                $widgets->create('privateblog',__('Blog logout'),array('tplPrivate','privateWidgets')); 
    2521                $widgets->privateblog->setting('title',__('Title:'),''); 
     22                $widgets->privateblog->setting('text',__('Text:'),'','textarea'); 
     23                $widgets->privateblog->setting('label',__('Button:'),__('Disconnect')); 
    2624                $widgets->privateblog->setting('homeonly',__('Home page only'),0,'check'); 
    2725        } 
  • plugins/private/index.php

    r694 r863  
    1 <?php /* -*- tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ 
    2 /***************************************************************\ 
    3  *  This is 'Private', a plugin for Dotclear 2                 * 
    4  *                                                             * 
    5  *  Copyright (c) 2008                                         * 
    6  *  Osku and contributors.                                     * 
    7  *                                                             * 
    8  *  This is an open source software, distributed under the GNU * 
    9  *  General Public License (version 2) terms and  conditions.  * 
    10  *                                                             * 
    11  *  You should have received a copy of the GNU General Public  * 
    12  *  License along with 'Private blog' (see LICENSE);           * 
    13  *  if not, write to the Free Software Foundation, Inc.,       * 
    14  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    * 
    15 \***************************************************************/ 
     1<?php 
     2# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# This file is part of Private mode, a plugin for Dotclear. 
     4#  
     5# Copyright (c) 2008, 2009 Osku 
     6#  
     7# Licensed under the GPL version 2.0 license. 
     8# A copy of this license is available in LICENSE file or at 
     9# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     10# -- END LICENSE BLOCK ------------------------------------ 
    1611 
    1712// Setting default parameters if missing configuration 
Note: See TracChangeset for help on using the changeset viewer.

Sites map