集中的に質問ですが、ご容赦を。
WebSignup によるユーザー登録を組み込もうとしています。
まず、基本動作を知るために、選択してインストールした sample を試してみ
ました。下記 (a),(b) が WebSignup のドキュメントです。
(a) 公開側 ......... Sign Up for Full Site Priveleges
(b) マネージャ側 ... Request an Acount (5)
(a) で入力を済ませ、送られてきたメールを確認すると、
Hello custar
Here are your login details for My MODx Site:
Username: custar
Password: custar
Once you log into My MODx Site at ., you can change your password.
Regards,
Site Administrator
となっています。気になるのは、[+surl+] 部分が置換されていないことです。
Administration > System configuration > User settings
では、以下のように設定されています。
Web Signup e-mail:
----
Hello [+uid+]
Here are your login details for [+sname+]:
Username: [+uid+]
Password: [+pwd+]
Once you log into [+sname+] at [+surl+], you can change your password.
Regards,
Site Administrator
----
[+sname+] - Name of your web site,
[+saddr+] - Your web site email address,
[+surl+] - Your site url,
[+uid+] - User’s Login name or id,
[+pwd+] - User’s password,
[+ufn+] - User’s full name.
元になっているソースでは、
// Send new password to the user
function webLoginSendNewPassword($email,$uid,$pwd,$ufn){
global $modx;
$mailto = $modx->config['mailto'];
...(中略)...
$message = str_replace("[+surl+]",dirname(PHP_SELF),$message); <-- ★ここ!
if(!mail($email, $emailsubject, $message, "From: ".$emailsender."\r\n"."X-Mailer: Content Manager - PHP/".phpversion())) {
return webLoginAlert("Error while sending mail to $mailto",1);
}
return true;
}
となっており、[+surl+] を dirname(PHP_SELF) で置換している部分は、正し
いのでしょうか? おかしんじゃない?と思っています。
登録した人がログインページに導かれるよう、ログインページの URL で置き換
わるのが望ましいのですが? どうしたらいいのやら。