-4

PHP ファイルに基づいて実行される統合パッケージを含む phpBB2 フォーラムがあります。これらのファイルの 1 つで、特定のページにアクセスできるユーザーの特権は次のように決定されます。

// only mods and admins will be able to see this control panel.
    if ($userdata['user_level'] < ADMIN)
    //message_die(GENERAL_ERROR,'No permission. If you are looking for the claims browser, it has been integrated into the forums.');
}
else
{
    $mod_privileges = true;
    $template->assign_block_vars("is_auth", array());
    #$template->assign_block_vars("is_auth2", array());
}

そして、フォーラムの特定のユーザー (アカウントのユーザー ID で識別されます。たとえば、9000 とします) のアクセス許可をこの PHP ファイルに追加する方法を探しています。私たちの phpBB フォーラム。

適切な変更はこのようなものでしょうか?

// only mods and admins will be able to see this control panel.
if ($userdata['user_level'] < ADMIN) xor (&phpbb_user_id!==['9000'])
{
    //message_die(GENERAL_ERROR,'No permission. If you are looking for the claims browser, it has been integrated into the forums.');
}
4

2 に答える 2

5

私はそれを理解したと信じています:

if ($userdata['user_id'] != 9000 && $userdata['user_level'] < ADMIN)

これは意図したとおりに機能します。

于 2013-09-08T00:33:05.110 に答える
1

あなたの状態は

if ($userdata['user_level'] < ADMIN) || ($phpbb_user_id!=='9000') {

}
于 2013-09-07T06:51:00.827 に答える