Changeset 2507:1e1c8be8d43d
- Timestamp:
- 10/31/13 14:51:46 (10 years ago)
- Branch:
- 2.6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/install/index.php
r2319 r2507 64 64 $u_pwd = !empty($_POST['u_pwd']) ? $_POST['u_pwd'] : null; 65 65 $u_pwd2 = !empty($_POST['u_pwd2']) ? $_POST['u_pwd2'] : null; 66 66 67 67 try 68 68 { … … 77 77 throw new Exception(__('Invalid email address')); 78 78 } 79 79 80 80 if (empty($u_pwd)) { 81 81 throw new Exception(__('No password given')); … … 87 87 throw new Exception(__('Password must contain at least 6 characters.')); 88 88 } 89 89 90 90 # Try to guess timezone 91 91 $default_tz = 'Europe/London'; … … 104 104 } 105 105 } 106 106 107 107 # Create schema 108 108 $_s = new dbStruct($core->con,$core->prefix); 109 109 require dirname(__FILE__).'/../../inc/dbschema/db-schema.php'; 110 110 111 111 $si = new dbStruct($core->con,$core->prefix); 112 112 $changes = $si->synchronize($_s); 113 113 114 114 # Create user 115 115 $cur = $core->con->openCursor($core->prefix.'user'); … … 126 126 $cur->user_options = serialize($core->userDefaults()); 127 127 $cur->insert(); 128 128 129 129 $core->auth->checkUser($u_login); 130 130 131 131 $admin_url = preg_replace('%install/index.php$%','',$_SERVER['REQUEST_URI']); 132 132 $root_url = preg_replace('%/admin/install/index.php$%','',$_SERVER['REQUEST_URI']); 133 133 134 134 # Create blog 135 135 $cur = $core->con->openCursor($core->prefix.'blog'); … … 139 139 $core->addBlog($cur); 140 140 $core->blogDefaults($cur->blog_id); 141 141 142 142 $blog_settings = new dcSettings($core,'default'); 143 143 $blog_settings->addNamespace('system'); … … 146 146 $blog_settings->system->put('public_url',$root_url.'/public'); 147 147 $blog_settings->system->put('themes_url',$root_url.'/themes'); 148 148 149 149 # date and time formats 150 150 $formatDate = __('%A, %B %e %Y'); … … 160 160 } 161 161 $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 165 165 # 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 169 169 # Add Dotclear version 170 170 $cur = $core->con->openCursor($core->prefix.'version'); … … 172 172 $cur->version = (string) DC_VERSION; 173 173 $cur->insert(); 174 174 175 175 # Create first post 176 176 $core->setBlog('default'); 177 177 178 178 $cur = $core->con->openCursor($core->prefix.'post'); 179 179 $cur->user_id = $u_login; … … 188 188 $cur->post_open_tb = 0; 189 189 $post_id = $core->blog->addPost($cur); 190 190 191 191 # Add a comment to it 192 192 $cur = $core->con->openCursor($core->prefix.'comment'); … … 199 199 "view your blog's comments. Then you might remove or edit it.</p>"); 200 200 $core->blog->addComment($cur); 201 201 202 202 # Plugins initialization 203 203 define('DC_CONTEXT_ADMIN',true); 204 204 $core->plugins->loadModules(DC_PLUGINS_ROOT); 205 205 $plugins_install = $core->plugins->installModules(); 206 206 207 207 # Add dashboard module options 208 208 $core->auth->user_prefs->addWorkspace('dashboard'); … … 248 248 <meta name="GOOGLEBOT" content="NOSNIPPET" /> 249 249 <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" /> 252 252 253 253 <script type="text/javascript" src="../js/jquery/jquery.js"></script> … … 264 264 $(this).val(this.value.replace(login_re,'')); 265 265 }); 266 266 267 267 <?php echo "\$('#u_pwd').pwstrength({texts: ['". 268 268 sprintf(__('Password strength: %s'),__('very weak'))."', '". … … 271 271 sprintf(__('Password strength: %s'),__('strong'))."', '". 272 272 sprintf(__('Password strength: %s'),__('very strong'))."']});\n"; ?> 273 273 274 274 $('#u_login').parent().after($('<input type="hidden" name="u_date" value="' + Date().toLocaleString() + '" />')); 275 275 276 276 var password_link = $('<a href="#" id="obfus"><?php echo(__('show')); ?></a>').click(function() { 277 277 $('#password').show(); … … 308 308 echo 309 309 '<h2>'.__('User information').'</h2>'. 310 310 311 311 '<p>'.__('Please provide the following information needed to create the first user.').'</p>'. 312 312 313 313 '<form action="index.php" method="post">'. 314 314 '<fieldset><legend>'.__('User information').'</legend>'. … … 320 320 form::field('u_email',30,255,html::escapeHTML($u_email)).'</p>'. 321 321 '</fieldset>'. 322 322 323 323 '<fieldset><legend>'.__('Username and password').'</legend>'. 324 324 '<p><label for="u_login" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Username:').' '. … … 337 337 form::password('u_pwd2',30,255).'</label></p>'. 338 338 '</fieldset>'. 339 339 340 340 '<p><input type="submit" value="'.__('Save').'" /></p>'. 341 341 '</form>'; … … 361 361 $plugins_install_result .= '</ul></div>'; 362 362 } 363 363 364 364 echo 365 365 '<h2>'.__('All done!').'</h2>'. 366 366 367 367 $plugins_install_result. 368 368 369 369 '<p class="success">'.__('Dotclear has been successfully installed. Here is some useful information you should keep.').'</p>'. 370 370 371 371 '<h3>'.__('Your account').'</h3>'. 372 372 '<ul>'. … … 374 374 '<li>'.__('Password:').' <strong id="password">'.html::escapeHTML($u_pwd).'</strong></li>'. 375 375 '</ul>'. 376 376 377 377 '<h3>'.__('Your blog').'</h3>'. 378 378 '<ul>'. … … 380 380 '<li>'.__('Administration interface:').' <strong>'.html::escapeHTML(http::getHost().$admin_url).'</strong></li>'. 381 381 '</ul>'. 382 382 383 383 '<form action="../auth.php" method="post">'. 384 384 '<p><input type="submit" value="'.__('Manage your blog now').'" />'.
Note: See TracChangeset
for help on using the changeset viewer.