Dotclear


Ignore:
Timestamp:
08/16/12 14:13:27 (13 years ago)
Author:
Dsls <dsls@…>
Branch:
sexy
Message:

Entries passwords will be a dedicated plugin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/public/lib.urlhandlers.php

    r876 r877  
    315315               { 
    316316                    $post_id = $_ctx->posts->post_id; 
    317                     $post_password = $_ctx->posts->post_password; 
    318                      
    319                     # Password protected entry 
    320                     if ($post_password != '' && !$_ctx->preview) 
    321                     { 
    322                          # Get passwords cookie 
    323                          if (isset($_COOKIE['dc_passwd'])) { 
    324                               $pwd_cookie = unserialize($_COOKIE['dc_passwd']); 
    325                          } else { 
    326                               $pwd_cookie = array(); 
    327                          } 
    328                           
    329                          # Check for match 
    330                          if ((!empty($_POST['password']) && $_POST['password'] == $post_password) 
    331                          || (isset($pwd_cookie[$post_id]) && $pwd_cookie[$post_id] == $post_password)) 
    332                          { 
    333                               $pwd_cookie[$post_id] = $post_password; 
    334                               setcookie('dc_passwd',serialize($pwd_cookie),0,'/'); 
    335                          } 
    336                          else 
    337                          { 
    338                               self::serveDocument('password-form.html','text/html',false); 
    339                               return; 
    340                          } 
    341                     } 
    342                      
    343317                    # The entry 
    344318                    self::serveDocument('post.html'); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map