Dotclear

Changeset 2507:1e1c8be8d43d


Ignore:
Timestamp:
10/31/13 14:51:46 (10 years ago)
Author:
Dsls
Branch:
2.6
Message:

Made settings date_formats, time_formats, store_plugin_url, store_theme_url global, fixes #1831

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/install/index.php

    r2319 r2507  
    6464     $u_pwd = !empty($_POST['u_pwd']) ? $_POST['u_pwd'] : null; 
    6565     $u_pwd2 = !empty($_POST['u_pwd2']) ? $_POST['u_pwd2'] : null; 
    66       
     66 
    6767     try 
    6868     { 
     
    7777               throw new Exception(__('Invalid email address')); 
    7878          } 
    79            
     79 
    8080          if (empty($u_pwd)) { 
    8181               throw new Exception(__('No password given')); 
     
    8787               throw new Exception(__('Password must contain at least 6 characters.')); 
    8888          } 
    89            
     89 
    9090          # Try to guess timezone 
    9191          $default_tz = 'Europe/London'; 
     
    104104               } 
    105105          } 
    106            
     106 
    107107          # Create schema 
    108108          $_s = new dbStruct($core->con,$core->prefix); 
    109109          require dirname(__FILE__).'/../../inc/dbschema/db-schema.php'; 
    110            
     110 
    111111          $si = new dbStruct($core->con,$core->prefix); 
    112112          $changes = $si->synchronize($_s); 
    113            
     113 
    114114          # Create user 
    115115          $cur = $core->con->openCursor($core->prefix.'user'); 
     
    126126          $cur->user_options = serialize($core->userDefaults()); 
    127127          $cur->insert(); 
    128            
     128 
    129129          $core->auth->checkUser($u_login); 
    130            
     130 
    131131          $admin_url = preg_replace('%install/index.php$%','',$_SERVER['REQUEST_URI']); 
    132132          $root_url = preg_replace('%/admin/install/index.php$%','',$_SERVER['REQUEST_URI']); 
    133            
     133 
    134134          # Create blog 
    135135          $cur = $core->con->openCursor($core->prefix.'blog'); 
     
    139139          $core->addBlog($cur); 
    140140          $core->blogDefaults($cur->blog_id); 
    141            
     141 
    142142          $blog_settings = new dcSettings($core,'default'); 
    143143          $blog_settings->addNamespace('system'); 
     
    146146          $blog_settings->system->put('public_url',$root_url.'/public'); 
    147147          $blog_settings->system->put('themes_url',$root_url.'/themes'); 
    148            
     148 
    149149          # date and time formats 
    150150          $formatDate = __('%A, %B %e %Y'); 
     
    160160          } 
    161161          $blog_settings->system->put('date_format',$formatDate); 
    162           $blog_settings->system->put('date_formats',serialize($date_formats),'string','Date formats examples',true); 
    163           $blog_settings->system->put('time_formats',serialize($time_formats),'string','Time formats examples',true); 
    164            
     162          $blog_settings->system->put('date_formats',serialize($date_formats),'string','Date formats examples',true,true); 
     163          $blog_settings->system->put('time_formats',serialize($time_formats),'string','Time formats examples',true,true); 
     164 
    165165          # Add repository URL for themes and plugins 
    166           $blog_settings->system->put('store_plugin_url','http://update.dotaddict.org/dc2/plugins.xml','string','Plugins XML feed location',true); 
    167           $blog_settings->system->put('store_theme_url','http://update.dotaddict.org/dc2/themes.xml','string','Themes XML feed location',true); 
    168            
     166          $blog_settings->system->put('store_plugin_url','http://update.dotaddict.org/dc2/plugins.xml','string','Plugins XML feed location',true,true); 
     167          $blog_settings->system->put('store_theme_url','http://update.dotaddict.org/dc2/themes.xml','string','Themes XML feed location',true,true); 
     168 
    169169          # Add Dotclear version 
    170170          $cur = $core->con->openCursor($core->prefix.'version'); 
     
    172172          $cur->version = (string) DC_VERSION; 
    173173          $cur->insert(); 
    174            
     174 
    175175          # Create first post 
    176176          $core->setBlog('default'); 
    177            
     177 
    178178          $cur = $core->con->openCursor($core->prefix.'post'); 
    179179          $cur->user_id = $u_login; 
     
    188188          $cur->post_open_tb = 0; 
    189189          $post_id = $core->blog->addPost($cur); 
    190            
     190 
    191191          # Add a comment to it 
    192192          $cur = $core->con->openCursor($core->prefix.'comment'); 
     
    199199               "view your blog's comments. Then you might remove or edit it.</p>"); 
    200200          $core->blog->addComment($cur); 
    201            
     201 
    202202          #  Plugins initialization 
    203203          define('DC_CONTEXT_ADMIN',true); 
    204204          $core->plugins->loadModules(DC_PLUGINS_ROOT); 
    205205          $plugins_install = $core->plugins->installModules(); 
    206            
     206 
    207207          # Add dashboard module options 
    208208          $core->auth->user_prefs->addWorkspace('dashboard'); 
     
    248248  <meta name="GOOGLEBOT" content="NOSNIPPET" /> 
    249249  <title><?php echo __('Dotclear Install'); ?></title> 
    250    
    251      <link rel="stylesheet" href="../style/install.css" type="text/css" media="screen" />  
     250 
     251     <link rel="stylesheet" href="../style/install.css" type="text/css" media="screen" /> 
    252252 
    253253  <script type="text/javascript" src="../js/jquery/jquery.js"></script> 
     
    264264      $(this).val(this.value.replace(login_re,'')); 
    265265    }); 
    266      
     266 
    267267     <?php echo "\$('#u_pwd').pwstrength({texts: ['". 
    268268                    sprintf(__('Password strength: %s'),__('very weak'))."', '". 
     
    271271                    sprintf(__('Password strength: %s'),__('strong'))."', '". 
    272272                    sprintf(__('Password strength: %s'),__('very strong'))."']});\n"; ?> 
    273      
     273 
    274274    $('#u_login').parent().after($('<input type="hidden" name="u_date" value="' + Date().toLocaleString() + '" />')); 
    275      
     275 
    276276    var password_link = $('<a href="#" id="obfus"><?php echo(__('show')); ?></a>').click(function() { 
    277277               $('#password').show(); 
     
    308308     echo 
    309309     '<h2>'.__('User information').'</h2>'. 
    310       
     310 
    311311     '<p>'.__('Please provide the following information needed to create the first user.').'</p>'. 
    312       
     312 
    313313     '<form action="index.php" method="post">'. 
    314314     '<fieldset><legend>'.__('User information').'</legend>'. 
     
    320320     form::field('u_email',30,255,html::escapeHTML($u_email)).'</p>'. 
    321321     '</fieldset>'. 
    322       
     322 
    323323     '<fieldset><legend>'.__('Username and password').'</legend>'. 
    324324     '<p><label for="u_login" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Username:').' '. 
     
    337337     form::password('u_pwd2',30,255).'</label></p>'. 
    338338     '</fieldset>'. 
    339       
     339 
    340340     '<p><input type="submit" value="'.__('Save').'" /></p>'. 
    341341     '</form>'; 
     
    361361          $plugins_install_result .= '</ul></div>'; 
    362362     } 
    363       
     363 
    364364     echo 
    365365     '<h2>'.__('All done!').'</h2>'. 
    366       
     366 
    367367     $plugins_install_result. 
    368       
     368 
    369369     '<p class="success">'.__('Dotclear has been successfully installed. Here is some useful information you should keep.').'</p>'. 
    370       
     370 
    371371     '<h3>'.__('Your account').'</h3>'. 
    372372     '<ul>'. 
     
    374374     '<li>'.__('Password:').' <strong id="password">'.html::escapeHTML($u_pwd).'</strong></li>'. 
    375375     '</ul>'. 
    376       
     376 
    377377     '<h3>'.__('Your blog').'</h3>'. 
    378378     '<ul>'. 
     
    380380     '<li>'.__('Administration interface:').' <strong>'.html::escapeHTML(http::getHost().$admin_url).'</strong></li>'. 
    381381     '</ul>'. 
    382       
     382 
    383383     '<form action="../auth.php" method="post">'. 
    384384     '<p><input type="submit" value="'.__('Manage your blog now').'" />'. 
Note: See TracChangeset for help on using the changeset viewer.

Sites map