XPressME Integration Kit

Trac

source: trunk/xpressme_integration_kit/class/userInfo_class.php @ 783

Last change on this file since 783 was 783, checked in by toemon, 14 years ago

XOOPS 3 (XOOPS Engine)でXOOPS_MAINFILE_INCLUDEDが定義されていない部分に対応

File size: 1.7 KB
Line 
1<?php
2/*
3 * XPressME - WordPress for XOOPS
4 *
5 * @copyright   XPressME Project http://www.toemon.com
6 * @license             http://www.fsf.org/copyleft/gpl.html GNU public license
7 * @author              toemon
8 * @package             module::xpress
9 */
10
11if (defined( 'XOOPS_MAINFILE_INCLUDED')|| defined( 'XOOPS_BOOTSTRAP')) :
12class userInfoClass {
13        var $is_logon;
14        var $user_name;
15        var $user_id;
16        var $user_group;
17        var $is_mod_read;
18        var $is_mod_admin;
19        function __contructor() //for PHP5
20    {
21        global $xoopsUser;
22        $this->userInfoClass();
23    }
24        function userInfoClass()
25    {
26        global $xoopsUser,$xoopsModule;
27       
28        if(empty($xoopsUser)) $this->is_logon = false;
29        $this->is_logon = true;
30        $this->user_name = $xoopsUser->getVar('uname');
31        if($this->user_name == '') {
32                $this->user_name = $xoopsUser->getVar('name');
33        }
34        $this->user_id = $xoopsUser->getVar('uid');
35        $this->user_group = $xoopsUser->getGroups();
36        $moduleperm_handler =& xoops_gethandler('groupperm');
37        if ($moduleperm_handler->checkRight('module_read',
38                                $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
39                        $this->is_mod_read = true;
40                } else {
41                        $this->is_mod_read = false;
42                }
43                $is_mod_admin = $xoopsUser->isAdmin($xoopsModule->getVar('mid'));
44               
45    }
46/*   
47    if ($xoopsUser) {
48if (!$moduleperm_handler->checkRight('module_read',
49$xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
50redirect_header(XOOPS_URL."/user.php",1,_NOPERM);
51exit();
52}
53$xoopsUserIsAdmin =
54$xoopsUser->isAdmin($xoopsModule->getVar('mid'));
55} else {
56if (!$moduleperm_handler->checkRight('module_read',
57$xoopsModule->getVar('mid'), XOOPS_GROUP_ANONYMOUS)) {
58redirect_header(XOOPS_URL."/user.php",1,_NOPERM);©ƒRƒR
59exit();
60*/
61}
62endif;
63?>
Note: See TracBrowser for help on using the repository browser.