From 96a5c0753c05e5cbcb4eff2270a65b6a46c14023 Mon Sep 17 00:00:00 2001 From: joyqi Date: Mon, 21 Oct 2013 11:22:28 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=9C=A8=E5=AE=89=E8=A3=85=E6=97=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7=E8=87=AA=E5=B7=B1=E5=A1=AB?= =?UTF-8?q?=E5=86=99=E5=AF=86=E7=A0=81=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.php | 8 +++++++- install/Mysql.php | 4 ++-- tools/Makefile | 8 ++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/install.php b/install.php index 7193e7ce..7d05c0ce 100644 --- a/install.php +++ b/install.php @@ -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);

  • + + +

    +
  • +
  • diff --git a/install/Mysql.php b/install/Mysql.php index c947270f..ab872ee2 100644 --- a/install/Mysql.php +++ b/install/Mysql.php @@ -21,8 +21,8 @@

  • - -

    + +

  • Date: Mon, 21 Oct 2013 11:46:12 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=AF=AD=E6=B3=95=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.php b/install.php index f62f58ff..bce78272 100644 --- a/install.php +++ b/install.php @@ -70,7 +70,7 @@ function _engine() { return !empty($_SERVER['HTTP_APPNAME']) // SAE || !!getenv('HTTP_BAE_ENV_APPID') // BAE - || (isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'],'Google App Engine') !== false) // GAE; + || (isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'],'Google App Engine') !== false); // GAE } /**