| @@ 356-371 (lines=16) @@ | ||
| 353 | * |
|
| 354 | * @return boolean : array with userids and uname |
|
| 355 | */ |
|
| 356 | public static function sf_userIsAdmin() |
|
| 357 | { |
|
| 358 | global $xoopsUser; |
|
| 359 | ||
| 360 | $result = false; |
|
| 361 | ||
| 362 | $smartModule = sf_getModuleInfo(); |
|
| 363 | $module_id = $smartModule->getVar('mid'); |
|
| 364 | ||
| 365 | if (!empty($xoopsUser)) { |
|
| 366 | $groups = $xoopsUser->getGroups(); |
|
| 367 | $result = in_array(XOOPS_GROUP_ADMIN, $groups) || $xoopsUser->isAdmin($module_id); |
|
| 368 | } |
|
| 369 | ||
| 370 | return $result; |
|
| 371 | } |
|
| 372 | ||
| 373 | /** |
|
| 374 | * Checks if a user has access to a selected faq. If no item permissions are |
|
| @@ 216-231 (lines=16) @@ | ||
| 213 | * |
|
| 214 | * @return boolean : array with userids and uname |
|
| 215 | */ |
|
| 216 | function sf_userIsAdmin() |
|
| 217 | { |
|
| 218 | global $xoopsUser; |
|
| 219 | ||
| 220 | $result = false; |
|
| 221 | ||
| 222 | $smartModule = sf_getModuleInfo(); |
|
| 223 | $module_id = $smartModule->getVar('mid'); |
|
| 224 | ||
| 225 | if (!empty($xoopsUser)) { |
|
| 226 | $groups = $xoopsUser->getGroups(); |
|
| 227 | $result = in_array(XOOPS_GROUP_ADMIN, $groups) || $xoopsUser->isAdmin($module_id); |
|
| 228 | } |
|
| 229 | ||
| 230 | return $result; |
|
| 231 | } |
|
| 232 | ||
| 233 | /** |
|
| 234 | * Checks if a user has access to a selected faq. If no item permissions are |
|