0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

LimeSurveのユーザーパスワードを符号化して更新する方法

Last updated at Posted at 2017-08-21

LimeSurveyにユーザーを大量に追加する場合、パスワードを符号化して登録する方法がある。
具体的には、データベースのユーザー管理テーブルusersの password 列を更新する。

※LimeSurveyはワンタイムパスワードに対応しているので、one_time_pw 列にSQLでパスワードを入力しておく方法でもよい。

符号化のアルゴリズムはSHA2_256で、例えばSQL Serverでは次のように生成する。

--パスワード
DECLARE @HashThis varchar(4000);

--符号化されたパスワード
DECLARE @HashResult varchar(4000);

--初期パスワードを入力
SET @HashThis = 'password'

--SHA2_256で符号化
SET @HashResult = master.dbo.fn_varbintohexstr(HashBytes('SHA2_256', @HashThis));
SELECT @HashResult

-- 先頭の文字列「0x」を削除
SET @HashResult = SUBSTRING(@HashResult,3,LEN(@HashResult));
SELECT @HashResult;


0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?