Minahito
minah****@users*****
2006年 10月 6日 (金) 17:28:14 JST
Index: xoops2jp/html/modules/user/preload/Primary/Primary.class.php diff -u xoops2jp/html/modules/user/preload/Primary/Primary.class.php:1.1.2.7.2.5 xoops2jp/html/modules/user/preload/Primary/Primary.class.php:1.1.2.7.2.6 --- xoops2jp/html/modules/user/preload/Primary/Primary.class.php:1.1.2.7.2.5 Thu Oct 5 19:18:13 2006 +++ xoops2jp/html/modules/user/preload/Primary/Primary.class.php Fri Oct 6 17:28:13 2006 @@ -55,9 +55,18 @@ else { $context->mXoopsUser->setGroups($_SESSION['xoopsUserGroups']); - $identity =& new Legacy_Identity($context->mXoopsUser); - $principal = new Legacy_GenericPrincipal($identity, $_SESSION['xoopsUserGroups']); + $roles = array(); + $roles[] = "Site.RegisteredUser"; + if ($context->mXoopsUser->isAdmin(-1)) { + $roles[] = "Site.Administrator"; + } + if (in_array(XOOPS_GROUP_ADMIN, $_SESSION['xoopsUserGroups'])) { + $roles[] = "Site.Owner"; + } + $identity =& new Legacy_Identity($context->mXoopsUser); + $principal = new Legacy_GenericPrincipal($identity, $roles); + // // Use 'mysession' // @@ -71,7 +80,7 @@ } else { $identity =& new Legacy_AnonymousIdentity(); - $principal = new Legacy_GenericPrincipal($identity, array(XOOPS_GROUP_ANONYMOUS)); + $principal = new Legacy_GenericPrincipal($identity, array("Site.GuestUser")); } } }