@@ -73,26 +73,26 @@ public function doForgot()
7373 }
7474
7575 $ db = Typecho_Db::get ();
76- $ user = $ db ->fetchRow ($ db ->select ()->from ('table.users ' )->where ('mail = ? ' , $ this ->request ->mail ));
76+ $ userRow = $ db ->fetchRow ($ db ->select ()->from ('table.users ' )->where ('mail = ? ' , $ this ->request ->mail ));
7777
78- if (empty ($ user )) {
78+ if (empty ($ userRow )) {
7979 // 返回没有该用户
8080 $ this ->notice ->set (_t ('该邮箱还没有注册 ' ), 'error ' );
8181 return false ;
8282 }
8383
8484 /* 生成重置密码地址 */
85- $ hashString = $ user ['name ' ] . $ user ['mail ' ] . $ user ['password ' ];
85+ $ hashString = $ userRow ['name ' ] . $ userRow ['mail ' ] . $ userRow ['password ' ];
8686 $ hashValidate = Typecho_Common::hash ($ hashString );
87- $ token = base64_encode ($ user ['uid ' ] . '. ' . $ hashValidate . '. ' . $ this ->options ->gmtTime );
87+ $ token = base64_encode ($ userRow ['uid ' ] . '. ' . $ hashValidate . '. ' . $ this ->options ->gmtTime );
8888 $ url = Typecho_Common::url ('/password/reset?token= ' . $ token , $ this ->options ->index );
8989
9090
9191 /* 发送重置密码地址 */
92- $ param ['to ' ] = $ user ['mail ' ]; // 收件地址
93- $ param ['fromName ' ] = $ user ['name ' ]; // 收件人名称
92+ $ param ['to ' ] = $ userRow ['mail ' ]; // 收件地址
93+ $ param ['fromName ' ] = $ userRow ['name ' ]; // 收件人名称
9494 $ param ['subject ' ] = '密码重置 ' . date ('Y-m-d H:i:s ' );// 邮件标题
95- $ param ['html ' ] = '<p> ' . $ user ['name ' ] . ' 您好,您申请了重置登录密码。</p> '
95+ $ param ['html ' ] = '<p> ' . $ userRow ['name ' ] . ' 您好,您申请了重置登录密码。</p> '
9696 . '<br><p>请在 1 小时内点击此链接以完成重置 <a href=" ' . $ url . '"> ' . $ url . '</a></p> '
9797 . '<br><p>如非本人操作请忽略本条消息!</p> ' ; // 邮件内容
9898 CommentNotifier_Plugin::send ($ param );
@@ -123,9 +123,9 @@ public function doReset()
123123 }
124124
125125 $ db = Typecho_Db::get ();
126- $ user = $ db ->fetchRow ($ db ->select ()->from ('table.users ' )->where ('uid = ? ' , $ uid ));
126+ $ userRow = $ db ->fetchRow ($ db ->select ()->from ('table.users ' )->where ('uid = ? ' , $ uid ));
127127
128- $ hashString = $ user ['name ' ] . $ user ['mail ' ] . $ user ['password ' ];
128+ $ hashString = $ userRow ['name ' ] . $ userRow ['mail ' ] . $ userRow ['password ' ];
129129 $ hashValidate = Typecho_Common::hashValidate ($ hashString , $ hashValidate );
130130
131131 if (!$ hashValidate ) {
@@ -149,7 +149,7 @@ public function doReset()
149149
150150 $ update = $ db ->query ($ db ->update ('table.users ' )
151151 ->rows (array ('password ' => $ password ))
152- ->where ('uid = ? ' , $ user ['uid ' ]));
152+ ->where ('uid = ? ' , $ userRow ['uid ' ]));
153153
154154 if (!$ update ) {
155155 $ this ->notice ->set (_t ('重置密码失败 ' ), 'error ' );
0 commit comments