Dotclear


Ignore:
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • .hgtags

    r279 r369  
    11ec077f3c6b20bc6f7f40a113acaff0220457a2c4 2.3.0 
     24e0137ddb12474d62b88c4966d5895a391b6d382 2.3.1 
  • CHANGELOG

    r343 r372  
    33* handling of postgres non default schemas (db_prefix = 'schema.prefix') 
    44 
    5 Dotclear 2.3.1 - ongoing dev 
     5Dotclear 2.3.1 - 2001-06-14 
    66=========================================================== 
    77* Updated makefile for cleaner distrib. 
     
    99* Misc JS & CSS cleaning. 
    1010* Import/Export preferences-related bugfix. 
     11* Administrative mail address is now configurable. 
     12* Security: one minor fix and changes for two potential problems. Thanks to Jeremie Boutoille 
    1113 
    1214Dotclear 2.3.0 - 2011-05-16 
  • admin/auth.php

    r356 r372  
    2323$dlang = http::getAcceptLanguage(); 
    2424$dlang = ($dlang == '' ? 'en' : $dlang); 
    25 if ($dlang != 'en') 
     25if ($dlang != 'en' && preg_match('/^[a-z]{2}(-[a-z]{2})?$/',$dlang)) 
    2626{ 
    2727     l10n::set(dirname(__FILE__).'/../locales/'.$dlang.'/main'); 
     
    9090          $page_url.'?akey='.$recover_key; 
    9191           
    92           $headers[] = 'From: dotclear@'.$_SERVER['HTTP_HOST']; 
     92          $headers[] = 'From: '.(defined('DC_ADMIN_MAILFROM') && DC_ADMIN_MAILFROM ? DC_ADMIN_MAILFROM : 'dotclear@local'); 
    9393          $headers[] = 'Content-Type: text/plain; charset=UTF-8;'; 
    9494           
     
    126126} 
    127127# Change password and retry to log 
    128 elseif ($change_pwd and $data = unserialize(base64_decode($_POST['login_data']))) 
    129 { 
     128elseif ($change_pwd) 
     129{ 
     130     try 
     131     { 
     132          $tmp_data = explode('/',$_POST['login_data']); 
     133          if (count($tmp_data) != 3) { 
     134               throw new Exception(); 
     135          } 
     136          $data = array( 
     137               'user_id'=>base64_decode($tmp_data[0]), 
     138               'cookie_admin'=>$tmp_data[1], 
     139               'user_remember'=>$tmp_data[2]=='1' 
     140          ); 
     141          if ($data['user_id'] === false) { 
     142               throw new Exception(); 
     143          } 
     144           
    130145     # Check login informations 
    131146     $check_user = false; 
     
    142157     } 
    143158      
    144      try 
    145      { 
    146159          if (!$core->auth->allowPassChange() || !$check_user) { 
    147160               $change_pwd = false; 
     
    166179          $_SESSION['sess_browser_uid'] = http::browserUID(DC_MASTER_KEY); 
    167180           
    168           if (!empty($data['blog_id'])) { 
    169                $_SESSION['sess_blog_id'] = $data['blog_id']; 
    170           } 
    171            
    172           if (!empty($data['user_remember'])) 
     181          if ($data['user_remember']) 
    173182          { 
    174183               setcookie('dc_admin',$data['cookie_admin'],strtotime('+15 days'),'','',DC_ADMIN_SSL); 
     
    193202     if ($check_user && $core->auth->mustChangePassword()) 
    194203     { 
    195           $login_data = base64_encode(serialize(array( 
    196                'user_id'=>$user_id, 
    197                'cookie_admin'=>$cookie_admin, 
    198                'blog_id'=>(!empty($_POST['blog']) ? $_POST['blog'] : ''), 
    199                'user_remember'=>!empty($_POST['user_remember']) 
    200           ))); 
     204          $login_data = join('/',array( 
     205               base64_encode($user_id), 
     206               $cookie_admin, 
     207               empty($_POST['user_remember'])?'0':'1' 
     208          )); 
    201209           
    202210          if (!$core->auth->allowPassChange()) { 
  • admin/install/wizard.php

    r270 r363  
    100100          $admin_url = preg_replace('%install/wizard.php$%','',$_SERVER['REQUEST_URI']); 
    101101          writeConfigValue('DC_ADMIN_URL',http::getHost().$admin_url,$full_conf); 
     102          writeConfigValue('DC_ADMIN_MAILFROM','dotclear@'.$_SERVER['HTTP_HOST'],$full_conf); 
    102103          writeConfigValue('DC_MASTER_KEY',md5(uniqid()),$full_conf); 
    103104           
  • inc/config.php.in

    r270 r362  
    4040define('DC_ADMIN_URL',''); 
    4141 
     42// Admin mail from address. For password recovery and such. 
     43define('DC_ADMIN_MAILFROM',''); 
     44 
    4245// Cookie's name 
    4346define('DC_SESSION_NAME','dcxd'); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map