在Lifetype 1.02版時曾對summary的註冊功能做了一些小修改。
主要的原因是因為校內的server資源有限,因此無法提供外面的人註冊使用。
但是我又很懶,不想把註冊功能關閉讓我一個一個幫老師們註冊。
於是我就對LT做了一些小小的修改,讓校內的IP可以自由註冊,但外部的IP則出現停止註冊的說明。詳細的修改如下:
動手前,請先將summary.php備份
首先假設校內(或是單位內)使用的ip範圍,以10.10.10.0/24為例
打開summary.php找到下面這段
if( !$config->getValue( 'summary_disable_registration' )) {
$_actionMap["RegisterStep0"] = "doReadAgreement";
$_actionMap["RegisterStep1"] = "doUserRegister";
$_actionMap["RegisterStep2"] = "doUserCreation";
$_actionMap["RegisterStep3"] = "doBlogRegistration";
$_actionMap["RegisterStep4"] = "ChooseBlogTemplateAction";
$_actionMap["RegisterStep5"] = "doFinishRegister";
}
把它換成
if( !$config->getValue( 'summary_disable_registration' )) {
$ip = (getenv(HTTP_X_FORWARDED_FOR))?getenv(HTTP_X_FORWARDED_FOR):getenv(REMOTE_ADDR);
$Filter1 = ereg("10.10.10", $ip);
if ($Filter1 == "1") {
$_actionMap["RegisterStep0"] = "doReadAgreement";
$_actionMap["RegisterStep1"] = "doUserRegister";
$_actionMap["RegisterStep2"] = "doUserCreation";
$_actionMap["RegisterStep3"] = "doBlogRegistration";
$_actionMap["RegisterStep4"] = "ChooseBlogTemplateAction";
$_actionMap["RegisterStep5"] = "doFinishRegister";
} else {
$_actionMap["RegisterStep0"] = "SummaryRegistrationDisabledAction";
$_actionMap["RegisterStep1"] = "SummaryRegistrationDisabledAction";
$_actionMap["RegisterStep2"] = "SummaryRegistrationDisabledAction";
$_actionMap["RegisterStep3"] = "SummaryRegistrationDisabledAction";
$_actionMap["RegisterStep4"] = "SummaryRegistrationDisabledAction";
$_actionMap["RegisterStep5"] = "SummaryRegistrationDisabledAction";
}
}
存檔就完工了。
再提醒一次,修改前一定要備份阿,
留言列表