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 |
|
---|
11 | if (defined( 'XOOPS_MAINFILE_INCLUDED')) :
|
---|
12 | class 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) {
|
---|
48 | if (!$moduleperm_handler->checkRight('module_read',
|
---|
49 | $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
|
---|
50 | redirect_header(XOOPS_URL."/user.php",1,_NOPERM);
|
---|
51 | exit();
|
---|
52 | }
|
---|
53 | $xoopsUserIsAdmin =
|
---|
54 | $xoopsUser->isAdmin($xoopsModule->getVar('mid'));
|
---|
55 | } else {
|
---|
56 | if (!$moduleperm_handler->checkRight('module_read',
|
---|
57 | $xoopsModule->getVar('mid'), XOOPS_GROUP_ANONYMOUS)) {
|
---|
58 | redirect_header(XOOPS_URL."/user.php",1,_NOPERM);©RR
|
---|
59 | exit();
|
---|
60 | */
|
---|
61 | }
|
---|
62 | endif;
|
---|
63 | ?> |
---|