[782] | 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 |
|
---|
[783] | 11 | if (defined( 'XOOPS_MAINFILE_INCLUDED')|| defined( 'XOOPS_BOOTSTRAP')) :
|
---|
[782] | 12 | class userInfoClass {
|
---|
| 13 | var $is_logon;
|
---|
[788] | 14 | var $login_name;
|
---|
[782] | 15 | var $user_name;
|
---|
| 16 | var $user_id;
|
---|
[788] | 17 | var $user_password;
|
---|
| 18 | var $user_email;
|
---|
| 19 | var $user_homepage;
|
---|
| 20 | var $user_regdate;
|
---|
| 21 | var $user_aim;
|
---|
| 22 | var $user_yim;
|
---|
[782] | 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 |
|
---|
[788] | 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 |
|
---|
[784] | 43 | if(empty($xoopsUser)){
|
---|
| 44 | $this->is_logon = false;
|
---|
| 45 | } else {
|
---|
| 46 | $this->is_logon = true;
|
---|
[788] | 47 | $this->login_name = $xoopsUser->getVar('name');
|
---|
[784] | 48 | $this->user_name = $xoopsUser->getVar('uname');
|
---|
| 49 | if($this->user_name == '') {
|
---|
[788] | 50 | $this->user_name = $this->login_name;
|
---|
[784] | 51 | }
|
---|
| 52 | $this->user_id = $xoopsUser->getVar('uid');
|
---|
[788] | 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');
|
---|
[784] | 59 | $this->user_group = $xoopsUser->getGroups();
|
---|
[788] | 60 |
|
---|
[784] | 61 | $moduleperm_handler =& xoops_gethandler('groupperm');
|
---|
| 62 | if ($moduleperm_handler->checkRight('module_read',
|
---|
[788] | 63 | $mid, $xoopsUser->getGroups())) {
|
---|
[784] | 64 | $this->is_mod_read = true;
|
---|
| 65 | } else {
|
---|
| 66 | $this->is_mod_read = false;
|
---|
| 67 | }
|
---|
[788] | 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 | }
|
---|
[782] | 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)) {
|
---|
[788] | 87 | redirect_header(XOOPS_URL."/user.php",1,_NOPERM);���R�R
|
---|
[782] | 88 | exit();
|
---|
| 89 | */
|
---|
| 90 | }
|
---|
| 91 | endif;
|
---|
| 92 | ?> |
---|