在安装时增加用户自己填写密码的功能
This commit is contained in:
@@ -328,7 +328,7 @@ list($prefixVersion, $suffixVersion) = explode('/', $currentVersion);
|
||||
'ip' => '127.0.0.1', 'agent' => $options->generator, 'text' => '欢迎加入 Typecho 大家族', 'type' => 'comment', 'status' => 'approved', 'parent' => 0)));
|
||||
|
||||
/** 初始用户 */
|
||||
$password = substr(uniqid(), 7);
|
||||
$password = empty($config['userPassword']) ? substr(uniqid(), 7) : $config['userPassword'];
|
||||
|
||||
$installDb->query($installDb->insert('table.users')->rows(array('name' => $config['userName'], 'password' => Typecho_Common::hash($password), 'mail' => $config['userMail'],
|
||||
'url' => 'http://www.typecho.org', 'screenName' => $config['userName'], 'group' => 'administrator', 'created' => Typecho_Date::gmtTime())));
|
||||
@@ -463,6 +463,7 @@ list($prefixVersion, $suffixVersion) = explode('/', $currentVersion);
|
||||
Typecho_Cookie::set('__typecho_config', base64_encode(serialize(array_merge(array(
|
||||
'prefix' => _r('dbPrefix'),
|
||||
'userName' => _r('userName'),
|
||||
'userPassword' => _r('userPassword'),
|
||||
'userMail' => _r('userMail'),
|
||||
'adapter' => $adapter,
|
||||
'siteUrl' => _r('userUrl')
|
||||
@@ -546,6 +547,11 @@ Typecho_Db::set(\$db);
|
||||
<p class="description"><?php _e('请填写您的用户名'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label" for="userPassword"><?php _e('登录密码'); ?></label>
|
||||
<input type="password" name="userPassword" id="userPassword" class="text" value="<?php _v('userPassword'); ?>" />
|
||||
<p class="description"><?php _e('请填写您的登录密码, 如果留空系统将为您随机生成一个'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label" for="userMail"><?php _e('邮件地址'); ?></label>
|
||||
<input type="text" name="userMail" id="userMail" class="text" value="<?php _v('userMail', 'webmaster@yourdomain.com'); ?>" />
|
||||
<p class="description"><?php _e('请填写一个您的常用邮箱'); ?></p>
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
<h3 class="warning"><?php _e('系统将为您自动匹配 %s 环境的安装选项', 'BAE'); ?></h3>
|
||||
<li>
|
||||
<label class="typecho-label" for="dbDatabase"><?php _e('数据库名'); ?></label>
|
||||
<input type="text" class="text" id="dbDatabase" name="dbDatabase" value="<?php _v('dbDatabase', 'typecho'); ?>" />
|
||||
<p class="description"><?php _e('请您指定数据库名称'); ?></p>
|
||||
<input type="text" class="text" id="dbDatabase" name="dbDatabase" value="<?php _v('dbDatabase'); ?>" />
|
||||
<p class="description"><?php _e('可以在MySQL服务的管理页面看到您创建的数据库名称'); ?></p>
|
||||
</li>
|
||||
<input type="hidden" name="config" value="array (
|
||||
'host' => getenv('HTTP_BAE_ENV_ADDR_SQL_IP'),
|
||||
|
||||
@@ -19,7 +19,6 @@ update:
|
||||
|
||||
package:
|
||||
@echo 'package'
|
||||
rm -Rf build/mockup/
|
||||
rm -Rf build/tools/
|
||||
rm -Rf build/todo.txt
|
||||
rm -Rf build/usr/plugins/*
|
||||
@@ -62,7 +61,12 @@ install:
|
||||
make update
|
||||
rm -Rf build/tools/
|
||||
rm -Rf build/todo.txt
|
||||
rm -Rf ${DIR}/usr/plugins/*
|
||||
rm -Rf build/usr/plugins/*
|
||||
rm -Rf build/admin/scss
|
||||
rm -Rf build/admin/img/editor
|
||||
rm -Rf build/admin/img/icons
|
||||
mkdir build/usr/uploads/
|
||||
chmod 777 build/usr/uploads/
|
||||
cp -Rf build/* ${DIR}
|
||||
make clear
|
||||
|
||||
|
||||
Reference in New Issue
Block a user