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')|| defined( 'XOOPS_BOOTSTRAP')) :
|
---|
12 | class userInfoClass {
|
---|
13 | var $is_logon;
|
---|
14 | var $login_name;
|
---|
15 | var $user_name;
|
---|
16 | var $user_id;
|
---|
17 | var $user_password;
|
---|
18 | var $user_email;
|
---|
19 | var $user_homepage;
|
---|
20 | var $user_regdate;
|
---|
21 | var $user_aim;
|
---|
22 | var $user_yim;
|
---|
23 | var $user_group;
|
---|
24 | var $is_mod_read;
|
---|
25 | var $is_mod_admin;
|
---|
26 | function __contructor() //for PHP5
|
---|
27 | {
|
---|
28 | global $xoopsUser;
|
---|
29 | $this->userInfoClass();
|
---|
30 | }
|
---|
31 | function userInfoClass()
|
---|
32 | {
|
---|
33 | global $xoopsUser,$xoopsModule;
|
---|
34 |
|
---|
35 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
36 | $mid=$xoopsModule->getVar('mid');
|
---|
37 | if (empty($mid) && function_exists('xoops_gethandler')){
|
---|
38 | $module_handler =& xoops_gethandler('module');
|
---|
39 | $module =& $module_handler->getByDirname($mydirname);
|
---|
40 | $mid = $module->getVar('mid');
|
---|
41 | }
|
---|
42 |
|
---|
43 | if(empty($xoopsUser)){
|
---|
44 | $this->is_logon = false;
|
---|
45 | } else {
|
---|
46 | $this->is_logon = true;
|
---|
47 | $this->login_name = $xoopsUser->getVar('name');
|
---|
48 | $this->user_name = $xoopsUser->getVar('uname');
|
---|
49 | if($this->user_name == '') {
|
---|
50 | $this->user_name = $this->login_name;
|
---|
51 | }
|
---|
52 | $this->user_id = $xoopsUser->getVar('uid');
|
---|
53 | $this->user_password = $xoopsUser->getVar('pass');
|
---|
54 | $this->user_email = $xoopsUser->getVar('email');
|
---|
55 | $this->user_homepage = $xoopsUser->getVar('url');
|
---|
56 | $this->user_regdate = $xoopsUser->getVar('user_regdate');
|
---|
57 | $this->user_aim = $xoopsUser->getVar('user_aim');
|
---|
58 | $this->user_yim = $xoopsUser->getVar('user_yim');
|
---|
59 | $this->user_group = $xoopsUser->getGroups();
|
---|
60 |
|
---|
61 | $moduleperm_handler =& xoops_gethandler('groupperm');
|
---|
62 | if ($moduleperm_handler->checkRight('module_read',
|
---|
63 | $mid, $xoopsUser->getGroups())) {
|
---|
64 | $this->is_mod_read = true;
|
---|
65 | } else {
|
---|
66 | $this->is_mod_read = false;
|
---|
67 | }
|
---|
68 | if (in_array(XOOPS_GROUP_ADMIN, $this->user_group)){
|
---|
69 | $this->is_mod_admin = true;
|
---|
70 | } else {
|
---|
71 | $this->is_mod_admin = $xoopsUser->isAdmin($mid);
|
---|
72 | }
|
---|
73 | }
|
---|
74 | }
|
---|
75 | /*
|
---|
76 | if ($xoopsUser) {
|
---|
77 | if (!$moduleperm_handler->checkRight('module_read',
|
---|
78 | $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
|
---|
79 | redirect_header(XOOPS_URL."/user.php",1,_NOPERM);
|
---|
80 | exit();
|
---|
81 | }
|
---|
82 | $xoopsUserIsAdmin =
|
---|
83 | $xoopsUser->isAdmin($xoopsModule->getVar('mid'));
|
---|
84 | } else {
|
---|
85 | if (!$moduleperm_handler->checkRight('module_read',
|
---|
86 | $xoopsModule->getVar('mid'), XOOPS_GROUP_ANONYMOUS)) {
|
---|
87 | redirect_header(XOOPS_URL."/user.php",1,_NOPERM);���R�R
|
---|
88 | exit();
|
---|
89 | */
|
---|
90 | }
|
---|
91 | endif;
|
---|
92 | ?> |
---|