| @@ 20-42 (lines=23) @@ | ||
| 17 | // @param string $permType |
|
| 18 | // @param boolean $redirect |
|
| 19 | // @return |
|
| 20 | function checkBlockgroups( $cid = 0, $permType = 'WFLinkCatPerm', $redirect = false ) |
|
| 21 | { |
|
| 22 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ); |
|
| 23 | global $xoopsUser; |
|
| 24 | ||
| 25 | $groups = is_object( $xoopsUser ) ? $xoopsUser -> getGroups() : XOOPS_GROUP_ANONYMOUS; |
|
| 26 | $gperm_handler = &xoops_gethandler( 'groupperm' ); |
|
| 27 | ||
| 28 | $module_handler = &xoops_gethandler( 'module' ); |
|
| 29 | $module = &$module_handler -> getByDirname( $mydirname ); |
|
| 30 | ||
| 31 | if ( !$gperm_handler -> checkRight( $permType, $cid, $groups, $module -> getVar( 'mid' ) ) ) { |
|
| 32 | if ($redirect == false) { |
|
| 33 | return false; |
|
| 34 | } else { |
|
| 35 | redirect_header( 'index.php', 3, _NOPERM ); |
|
| 36 | exit(); |
|
| 37 | } |
|
| 38 | } |
|
| 39 | unset( $module ); |
|
| 40 | ||
| 41 | return true; |
|
| 42 | } |
|
| 43 | ||
| 44 | // Function: b_mylinks_top_show |
|
| 45 | // Input : $options[0] = date for the most recent links |
|
| @@ 12-34 (lines=23) @@ | ||
| 9 | * Licence: GNU |
|
| 10 | */ |
|
| 11 | ||
| 12 | function checkSearchgroups( $cid = 0, $permType = 'WFLinkCatPerm', $redirect = false ) |
|
| 13 | { |
|
| 14 | $mydirname = basename( dirname( __FILE__ ) ); |
|
| 15 | global $xoopsUser; |
|
| 16 | ||
| 17 | $groups = is_object( $xoopsUser ) ? $xoopsUser -> getGroups() : XOOPS_GROUP_ANONYMOUS; |
|
| 18 | $gperm_handler = &xoops_gethandler( 'groupperm' ); |
|
| 19 | ||
| 20 | $module_handler = &xoops_gethandler( 'module' ); |
|
| 21 | $module = &$module_handler -> getByDirname( $mydirname ); |
|
| 22 | ||
| 23 | if ( !$gperm_handler -> checkRight( $permType, $cid, $groups, $module -> getVar( 'mid' ) ) ) { |
|
| 24 | if ($redirect == false) { |
|
| 25 | return false; |
|
| 26 | } else { |
|
| 27 | redirect_header( 'index.php', 3, _NOPERM ); |
|
| 28 | exit(); |
|
| 29 | } |
|
| 30 | } |
|
| 31 | unset( $module ); |
|
| 32 | ||
| 33 | return true; |
|
| 34 | } |
|
| 35 | ||
| 36 | function wflinks_search( $queryarray, $andor, $limit, $offset, $userid ) |
|
| 37 | { |
|