Hi Everyone.
I wonder is it possible to use ccaps with levels like this:
/s2member-files/access-s2member-level2/test.txt
/s2member-files/access-s2member-level2/access-s2member-ccap-man/test.txt
/s2member-files/access-s2member-level2/access-s2member-ccap-woman/test.txt
It works but I need to be sure.
This doesn’t: (checks only man ccap)
/s2member-files/access-s2member-level2/access-s2member-ccap-man/access-s2member-ccap-music/test.txt
Plus, I don’t even know why it works at all: (files-in.inc.php, line 130)
if(preg_match("/(?:^|\/)access[_\-]s2member[_\-]level([0-9]+)\//", $req["file_download"], $m) && strlen($req_level = $m[1]) && (!is_object($user) || empty($user->ID) || !$user->has_cap("access_s2member_level".$req_level)))
{
if /* We only need this section when/if we're actually serving. */($serving)
c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */("file", $req["file_download"], "level", $req_level, $_SERVER["REQUEST_URI"]).exit();
/**/
else /* Else return false. */
return false;
}
/**/
else if(preg_match("/(?:^|\/)access[_\-]s2member[_\-]ccap[_\-](.+?)\//", $req["file_download"], $m) && strlen($req_ccap = preg_replace("/-/", "_", $m[1])) && (!is_object($user) || empty($user->ID) || !$user->has_cap("access_s2member_ccap_".$req_ccap)))
{
if /* We only need this section when/if we're actually serving. */($serving)
c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */("file", $req["file_download"], "ccap", $req_ccap, $_SERVER["REQUEST_URI"]).exit();
/**/
else /* Else return false. */
return false;
}
Greetings.