Esempio n. 1
0
                redirect_header(icms_getPreviousPage('index.php'), 3, _MD_PROFILE_SECURITY_CHECK_FAILED . implode('<br />', icms::$security->getErrors()));
            }
            $controller = new icms_ipf_Controller($profile_videos_handler);
            $controller->handleObjectDeletionFromUserSide();
            break;
        default:
            $clean_start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
            if ($real_uid && $real_uid == $uid) {
                editvideos($videosObj, true);
            }
            if ($clean_uid > 0 || $real_uid > 0) {
                $uid = $clean_uid > 0 ? $clean_uid : $real_uid;
                $videosArray = $profile_videos_handler->getVideos($clean_start, icms::$module->config['videosperpage'], $clean_uid);
                if (count($videosArray) == 0) {
                    $icmsTpl->assign('lang_nocontent', _MD_PROFILE_VIDEOS_NOCONTENT);
                } else {
                    $total_videos_count = $profile_videos_handler->getCount(new icms_db_criteria_Compo(new icms_db_criteria_Item('uid_owner', $uid)));
                    $pagenav = new icms_view_PageNav($total_videos_count, icms::$module->config['videosperpage'], $clean_start, 'start', 'uid=' . $uid);
                    $icmsTpl->assign('profile_videos_pagenav', $pagenav->renderNav());
                    $icmsTpl->assign('profile_videos', $videosArray);
                    unset($total_videos_count, $pagenav);
                }
            } else {
                redirect_header(PROFILE_URL);
            }
            icms_makeSmarty(array('lang_video' => _MD_PROFILE_VIDEOS_VIDEO, 'lang_description' => _MD_PROFILE_VIDEOS_DESCRIPTION, 'lang_actions' => _MD_PROFILE_VIDEOS_ACTIONS, 'actions' => is_object(icms::$user) && ($profile_isAdmin || $real_uid == $uid)));
            break;
    }
}
$icmsTpl->assign('profile_category_path', _MD_PROFILE_VIDEOS);
include_once 'footer.php';
Esempio n. 2
0
					$icmsLocation = substr( ICMS_URL, strpos( ICMS_URL, '://' ) + 3 );
					if (substr($redirect, $pos + 3, strlen($icmsLocation)) != $icmsLocation) {
						$redirect = ICMS_URL;
					} elseif (substr($redirect, $pos + 3, strlen($icmsLocation)+1) == $icmsLocation . '.') {
						$redirect = ICMS_URL;
					}
				}
			}
			icms_makeSmarty(array(
	            'redirect_page' => $redirect,
	            'lang_reset' => 1,
//	            'lang_username' => _USERNAME,
//	            'lang_uname' => isset($_GET['uname']) ? filter_input(INPUT_GET, 'uname') : '',
	            'lang_resetpassword' => _US_RESETPASSWORD,
	            'lang_resetpassinfo' => _US_RESETPASSINFO,
//	            'lang_youremail' => _US_YOUREMAIL,
	            'lang_sendpassword' => _US_SENDPASSWORD,
	            'lang_subresetpassword' => _US_SUBRESETPASSWORD,
	            'lang_currentpass' => _US_CURRENTPASS,
	            'lang_newpass' => _US_NEWPASSWORD,
	            'lang_newpass2' => _US_VERIFYPASS,
	            'resetpassword_token' => icms::$security->createToken(),
	            'icms_pagetitle' => _LOGIN
			));
			include 'footer.php';
		} elseif (!empty($_GET['xoops_redirect'])) {
			$redirect = htmlspecialchars(trim($_GET['xoops_redirect']));
			$isExternal = FALSE;
			if ($pos = strpos($redirect, '://')) {
				$icmsLocation = substr(ICMS_URL, strpos(ICMS_URL, '://') +3);
				if (substr($redirect, $pos + 3, strlen($icmsLocation)) != $icmsLocation) {
					$redirect = ICMS_URL;
Esempio n. 3
0
        redirect_header(icms_getPreviousPage('index.php'), 3, _NOPERM);
    }
} elseif (!icms::$user->isAdmin(0)) {
    if (array_intersect($thisUser->getGroups(), icms::$module->config['view_group_' . ICMS_GROUP_USERS]) != $thisUser->getGroups()) {
        redirect_header(icms_getPreviousPage('index.php'), 3, _NOPERM);
    }
}
icms_loadLanguageFile('core', 'user');
$module_name = icms::$module->getVar('name');
$xoTheme->addStylesheet(PROFILE_URL . 'assets/css/profile' . (@_ADM_USE_RTL == 1 ? '_rtl' : '') . '.css');
icms_makeSmarty(array('module_name' => $module_name, 'icms_pagetitle' => sprintf(_MD_PROFILE_PAGETITLE, $owner_name), 'profile_image' => '<img src="' . PROFILE_URL . 'images/profile-start.gif" alt="' . $module_name . '"/>', 'profile_content' => _MI_PROFILE_MODULEDESC, 'module_is_socialmode' => icms::$module->config['profile_social'], 'profile_module_home' => '<a href="' . PROFILE_URL . 'index.php?uid=' . $uid . '">' . sprintf(_MD_PROFILE_PAGETITLE, $owner_name) . '</a>'));
if (icms::$module->config['profile_social']) {
    $permissions = array();
    $items = array('audio', 'pictures', 'friendship', 'videos', 'tribes', 'profile_usercontributions');
    foreach ($items as $item) {
        $permissions = array_merge($permissions, array($item => $profile_configs_handler->userCanAccessSection($item, $uid)));
    }
    foreach ($permissions as $permission => $value) {
        if (in_array($permission, array('audio', 'pictures', 'friendship', 'videos', 'tribes'))) {
            $icmsTpl->assign('allow_' . $permission, icms::$module->config['enable_' . $permission] && $value);
        } else {
            $icmsTpl->assign('allow_' . $permission, $value);
        }
    }
    icms_makeSmarty(array('lang_photos' => _MD_PROFILE_PHOTOS, 'lang_friends' => _MD_PROFILE_FRIENDS, 'lang_audio' => _MD_PROFILE_AUDIOS, 'lang_videos' => _MD_PROFILE_VIDEOS, 'lang_profile' => _MD_PROFILE_PROFILE, 'lang_tribes' => _MD_PROFILE_TRIBES, 'isOwner' => $isOwner, 'isAnonym' => !is_object(icms::$user), 'isAdmin' => $profile_isAdmin, 'uid' => $uid));
}
if (!is_object(icms::$user) && $uid == 0) {
    include_once PROFILE_ROOT_PATH . 'footer.php';
    exit;
}
$icmsTpl->assign('token', icms::$security->getTokenHTML());
Esempio n. 4
0
            $controller->handleObjectDeletionFromUserSide();
            $icmsTpl->assign('profile_category_path', $picturesObj->getVar('title') . ' > ' . _DELETE);
            break;
        default:
            $clean_start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
            if ($real_uid && $real_uid == $uid) {
                $picturesObj = $profile_pictures_handler->get($clean_pictures_id);
                editpictures($picturesObj, true);
            }
            if ($clean_uid > 0 || $real_uid > 0) {
                $uid = $clean_uid > 0 ? $clean_uid : $real_uid;
                $picturesArray = $profile_pictures_handler->getPictures($clean_start, icms::$module->config['picturesperpage'], $uid);
                if (count($picturesArray) == 0) {
                    $icmsTpl->assign('lang_nocontent', _MD_PROFILE_PICTURES_NOCONTENT);
                } else {
                    $total_pictures_count = $profile_pictures_handler->getCount(new icms_db_criteria_Compo(new icms_db_criteria_Item('uid_owner', $uid)));
                    $pagenav = new icms_view_PageNav($total_pictures_count, icms::$module->config['picturesperpage'], $clean_start, 'start', 'uid=' . $uid);
                    icms_makeSmarty(array('profile_pictures_pagenav' => $pagenav->renderNav(), 'profile_pictures' => $picturesArray, 'rowitems' => icms::$module->config['rowitems'], 'itemwidth' => round(100 / icms::$module->config['rowitems'], 0)));
                    unset($total_pictures_count, $pagenav);
                }
            } else {
                redirect_header(PROFILE_URL);
            }
            $allow_avatar_upload = $isOwner && is_object(icms::$user) && $icmsConfigUser['avatar_allow_upload'] == 1 && icms::$user->getVar('posts') >= $icmsConfigUser['avatar_minposts'];
            $icmsTpl->assign('allow_avatar_upload', $allow_avatar_upload);
            $icmsTpl->assign('lang_avatar', _MD_PROFILE_PICTURES_AVATAR_SET);
            break;
    }
}
$icmsTpl->assign('profile_category_path', _MD_PROFILE_PHOTOS);
include_once 'footer.php';
Esempio n. 5
0
        case 'del':
            $friendshipObj = $profile_friendship_handler->get($clean_friendship_id);
            if (!$friendshipObj->userCanEditAndDelete()) {
                redirect_header(icms_getPreviousPage('friendship.php?uid=' . $clean_uid), 3, _NOPERM);
            }
            if (isset($_POST['confirm'])) {
                if (!icms::$security->check()) {
                    redirect_header(icms_getPreviousPage('friendship.php?uid=' . $clean_uid), 3, _MD_PROFILE_SECURITY_CHECK_FAILED . implode('<br />', icms::$security->getErrors()));
                }
            }
            $controller = new icms_ipf_Controller($profile_friendship_handler);
            $controller->handleObjectDeletionFromUserSide();
            break;
        default:
            if ($clean_uid > 0 || $real_uid > 0) {
                $uid = $clean_uid > 0 ? $clean_uid : $real_uid;
                $friendshipsArray = $profile_friendship_handler->getFriendshipsSorted($uid, $isOwner);
                if (count($friendshipsArray[PROFILE_FRIENDSHIP_STATUS_PENDING]) + count($friendshipsArray[PROFILE_FRIENDSHIP_STATUS_ACCEPTED]) + count($friendshipsArray[PROFILE_FRIENDSHIP_STATUS_REJECTED]) == 0) {
                    $icmsTpl->assign('lang_nocontent', _MD_PROFILE_FRIENDSHIPS_NOCONTENT);
                } else {
                    $icmsTpl->assign('profile_friendships', $friendshipsArray);
                }
            } else {
                redirect_header(PROFILE_URL);
            }
            icms_makeSmarty(array('lang_friendships_pending' => _MD_PROFILE_FRIENDSHIP_PENDING, 'lang_friendships_accepted' => _MD_PROFILE_FRIENDSHIP_ACCEPTED, 'lang_friendships_rejected' => _MD_PROFILE_FRIENDSHIP_REJECTED, 'lang_friendship_accept' => _MD_PROFILE_FRIENDSHIP_ACCEPT, 'lang_friendship_reject' => _MD_PROFILE_FRIENDSHIP_REJECT, 'image_ok' => ICMS_IMAGES_SET_URL . "/actions/button_ok.png", 'image_cancel' => ICMS_IMAGES_SET_URL . "/actions/button_cancel.png", 'rowitems' => icms::$module->config['rowitems'], 'itemwidth' => round(100 / icms::$module->config['rowitems'], 0)));
            break;
    }
}
$icmsTpl->assign('profile_category_path', _MD_PROFILE_FRIENDS);
include_once 'footer.php';
Esempio n. 6
0
                    }
                }
            }
        default:
            if (icms::$user->getVar('uid') != $uid) {
                $friendships = $profile_friendship_handler->getFriendships(0, 1, icms::$user->getVar('uid'), $uid);
                if (count($friendships) == 0) {
                    $friendshipObj = $profile_friendship_handler->get($clean_friendship_id);
                    editfriendship($friendshipObj, $uid, true);
                }
            }
            break;
    }
}
// passing language constants to smarty
icms_makeSmarty(array('lang_delete' => _MD_PROFILE_DELETE, 'lang_editprofile' => _MD_PROFILE_EDITPROFILE, 'lang_selectavatar' => _MD_PROFILE_SELECTAVATAR, 'lang_usercontributions' => _MD_PROFILE_USERCONTRIBUTIONS, 'lang_visitors' => _MD_PROFILE_VISITORS));
// passing user information to smarty
$icmsTpl->assign('user_name_header', $owner_name);
$icmsTpl->assign('uid_owner', $uid);
if ($thisUser->getVar('user_avatar') && $thisUser->getVar('user_avatar') != 'blank.gif' && $thisUser->getVar('user_avatar') != '') {
    $icmsTpl->assign('user_avatar', ICMS_UPLOAD_URL . '/' . $thisUser->getVar('user_avatar'));
} elseif ($icmsConfigUser['avatar_allow_gravatar'] == 1) {
    $icmsTpl->assign('user_avatar', $thisUser->gravatar('G', $icmsConfigUser['avatar_width']));
    $icmsTpl->assign('gravatar', true);
}
$allow_avatar_upload = $isOwner && is_object(icms::$user) && $icmsConfigUser['avatar_allow_upload'] == 1 && icms::$user->getVar('posts') >= $icmsConfigUser['avatar_minposts'];
$icmsTpl->assign('allow_avatar_upload', $allow_avatar_upload);
// visitors
$visitors = $profile_visitors_handler->getVisitors(0, 5, $uid);
$rtn = array();
$i = 0;
Esempio n. 7
0
    $thisUser = icms::handler('icms_member')->getUser($uid);
    if (!is_object($thisUser) || !$thisUser->isActive()) {
        redirect_header('index.php', 3, _US_SELECTNG);
    }
    $xoopsOption['template_main'] = 'system_userinfo.html';
    include ICMS_ROOT_PATH . '/header.php';
    $icmsTpl->assign('user_ownpage', FALSE);
}
if (is_object(icms::$user) && $isAdmin) {
    icms_makeSmarty(array('lang_editprofile' => _US_EDITPROFILE, 'lang_deleteaccount' => _US_DELACCOUNT, 'user_uid' => (int) $thisUser->getVar('uid')));
}
$userrank = $thisUser->rank();
$date = $thisUser->getVar('last_login');
icms_makeSmarty(array('user_avatarurl' => $icmsConfigUser['avatar_allow_gravatar'] == TRUE ? $thisUser->gravatar('G', $icmsConfigUser['avatar_width']) : ICMS_UPLOAD_URL . '/' . $thisUser->getVar('user_avatar'), 'user_websiteurl' => $thisUser->getVar('url', 'E') == '' ? '' : '<a href="' . $thisUser->getVar('url', 'E') . '" rel="external">' . $thisUser->getVar('url') . '</a>', 'lang_website' => _US_WEBSITE, 'user_realname' => $thisUser->getVar('name'), 'lang_realname' => _US_REALNAME, 'lang_avatar' => _US_AVATAR, 'lang_allaboutuser' => sprintf(_US_ALLABOUT, $thisUser->getVar('uname')), 'user_alwopenid' => $icmsConfigAuth['auth_openid'], 'lang_openid', $icmsConfigAuth['auth_openid'] == TRUE ? _US_OPENID_FORM_CAPTION : '', 'lang_email' => _US_EMAIL, 'lang_privmsg' => _US_PM, 'lang_icq' => _US_ICQ, 'user_icq' => $thisUser->getVar('user_icq'), 'lang_aim' => _US_AIM, 'user_aim' => $thisUser->getVar('user_aim'), 'lang_yim' => _US_YIM, 'user_yim' => $thisUser->getVar('user_yim'), 'lang_msnm' => _US_MSNM, 'user_msnm' => $thisUser->getVar('user_msnm'), 'lang_location' => _US_LOCATION, 'user_location' => $thisUser->getVar('user_from'), 'lang_occupation' => _US_OCCUPATION, 'user_occupation' => $thisUser->getVar('user_occ'), 'lang_interest' => _US_INTEREST, 'user_interest' => $thisUser->getVar('user_intrest'), 'lang_extrainfo' => _US_EXTRAINFO, 'user_extrainfo' => icms_core_DataFilter::checkVar($thisUser->getVar('bio', 'N'), 'text', 'output'), 'lang_statistics' => _US_STATISTICS, 'lang_membersince' => _US_MEMBERSINCE, 'user_joindate' => formatTimestamp($thisUser->getVar('user_regdate'), 's'), 'lang_rank' => _US_RANK, 'lang_posts' => _US_POSTS, 'lang_basicInfo' => _US_BASICINFO, 'lang_more' => _US_MOREABOUT, 'lang_myinfo' => _US_MYINFO, 'user_posts' => icms_conv_nr2local($thisUser->getVar('posts')), 'lang_lastlogin' => _US_LASTLOGIN, 'lang_notregistered' => _US_NOTREGISTERED, 'user_pmlink' => is_object(icms::$user) ? "<a href=\"javascript:openWithSelfMain('" . ICMS_URL . "/pmlite.php?send2=1&amp;to_userid=" . (int) $thisUser->getVar('uid') . "', 'pmlite', 800,680);\"><img src=\"" . ICMS_URL . "/images/icons/" . $icmsConfig['language'] . "/pm.gif\" alt=\"" . sprintf(_SENDPMTO, $thisUser->getVar('uname')) . "\" /></a>" : '', 'user_rankimage' => $userrank['image'] ? '<img src="' . $userrank['image'] . '" alt="' . $userrank['title'] . '" />' : '', 'user_ranktitle' => $userrank['title'], 'user_lastlogin' => !empty($date) ? formatTimestamp($thisUser->getVar('last_login'), 'm') : '', 'icms_pagetitle' => sprintf(_US_ALLABOUT, $thisUser->getVar('uname')), 'user_email' => $thisUser->getVar('user_viewemail') == TRUE || is_object(icms::$user) && (icms::$user->isAdmin() || icms::$user->getVar('uid') == $thisUser->getVar('uid')) ? $thisUser->getVar('email', 'E') : '&nbsp;', 'user_openid' => $icmsConfigAuth['auth_openid'] == TRUE && ($thisUser->getVar('user_viewoid') == TRUE || is_object(icms::$user) && (icms::$user->isAdmin() || icms::$user->getVar('uid') == $thisUser->getVar('uid'))) ? $thisUser->getVar('openid', 'E') : '&nbsp;'));
if ($icmsConfigUser['allwshow_sig'] == TRUE && strlen(trim($thisUser->getVar('user_sig', 'N'))) > 0) {
    icms_makeSmarty(array('user_showsignature' => TRUE, 'lang_signature' => _US_SIGNATURE, 'user_signature' => icms_core_DataFilter::checkVar($thisUser->getVar('user_sig', 'N'), 'html', 'output')));
}
$module_handler = icms::handler('icms_module');
$criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('hassearch', 1));
$criteria->add(new icms_db_criteria_Item('isactive', 1));
$mids = array_keys($module_handler->getList($criteria));
foreach ($mids as $mid) {
    if ($gperm_handler->checkRight('module_read', $mid, $groups)) {
        $module = $module_handler->get($mid);
        $results = $module->search('', '', 5, 0, (int) $thisUser->getVar('uid'));
        $count = count($results);
        if (is_array($results) && $count > 0) {
            for ($i = 0; $i < $count; $i++) {
                if (isset($results[$i]['image']) && $results[$i]['image'] != '') {
                    $results[$i]['image'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image'];
                } else {
Esempio n. 8
0
                $tribes['search'] = $profile_tribes_handler->searchTribes($clean_tribes_title);
                $icmsTpl->assign('profile_tribes', $tribes);
                $icmsTpl->assign('lang_tribes_search_title', sprintf(_MD_PROFILE_TRIBES_SEARCH_TITLE, $clean_tribes_title));
                if (count($tribes['search']) == 0) {
                    $icmsTpl->assign('lang_search_noresults', sprintf(_MD_PROFILE_TRIBES_SEARCH_NORESULTS, $clean_tribes_title));
                }
                $icmsTpl->assign('profile_tribes_search', true);
            } elseif ($clean_uid > 0 || $real_uid > 0) {
                $uid = $clean_uid > 0 ? $clean_uid : $real_uid;
                $tribes = array();
                $tribes['own'] = $profile_tribes_handler->getTribes(false, false, $uid);
                $tribes['member'] = $profile_tribes_handler->getMembershipTribes($uid);
                if (count($tribes['own']) + count($tribes['member']) == 0) {
                    $icmsTpl->assign('lang_nocontent', _MD_PROFILE_TRIBES_NOCONTENT);
                } else {
                    $icmsTpl->assign('profile_tribes', $tribes);
                }
                $icmsTpl->assign('profile_tribes_search', true);
            } else {
                redirect_header(PROFILE_URL);
            }
            icms_makeSmarty(array('lang_tribes_own' => _MD_PROFILE_TRIBES_OWN, 'lang_tribes_membership' => _MD_PROFILE_TRIBES_MEMBERSHIPS, 'lang_tribes_search' => _MD_PROFILE_TRIBES_SEARCH, 'lang_tribes_search_submit' => _SEARCH, 'rowitems' => icms::$module->config['rowitems'], 'itemwidth' => round(100 / icms::$module->config['rowitems'], 0)));
            /**
             * Generating meta information for this page
             */
            $icms_metagen = new icms_ipf_Metagen($tribesObj->getVar('title'), $tribesObj->getVar('meta_keywords', 'n'), $tribesObj->getVar('meta_description', 'n'));
            $icms_metagen->createMetaTags();
            break;
    }
}
include_once 'footer.php';
Esempio n. 9
0
            }
            $controller = new icms_ipf_Controller($profile_audio_handler);
            $controller->handleObjectDeletionFromUserSide();
            $icmsTpl->assign('profile_category_path', $audioObj->getVar('title') . ' > ' . _DELETE);
            break;
        default:
            $clean_start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
            if ($real_uid && $real_uid == $uid) {
                editaudio($audioObj, true);
            }
            if ($clean_uid > 0 || $real_uid > 0) {
                $uid = $clean_uid > 0 ? $clean_uid : $real_uid;
                $audiosArray = $profile_audio_handler->getAudios($clean_start, icms::$module->config['audiosperpage'], $uid);
                if (count($audiosArray) == 0) {
                    $icmsTpl->assign('lang_nocontent', _MD_PROFILE_AUDIOS_NOCONTENT);
                } else {
                    $total_audios_count = $profile_audio_handler->getCount(new icms_db_criteria_Compo(new icms_db_criteria_Item('uid_owner', $uid)));
                    $pagenav = new icms_view_PageNav($total_audios_count, icms::$module->config['audiosperpage'], $clean_start, 'start', 'uid=' . $uid);
                    $icmsTpl->assign('profile_audios_pagenav', $pagenav->renderNav());
                    $icmsTpl->assign('profile_audios', $audiosArray);
                    unset($total_audios_count, $pagenav);
                }
            } else {
                redirect_header(PROFILE_URL);
            }
            icms_makeSmarty(array('lang_player' => _MD_PROFILE_AUDIOS_PLAYER, 'lang_author' => _MD_PROFILE_AUDIOS_AUTHOR, 'lang_title' => _MD_PROFILE_AUDIOS_TITLE, 'lang_lastupdated' => _MD_PROFILE_AUDIOS_LASTUPDATED, 'lang_actions' => _MD_PROFILE_AUDIOS_ACTIONS, 'actions' => is_object(icms::$user) && ($profile_isAdmin || $real_uid == $uid)));
            break;
    }
}
$icmsTpl->assign('profile_category_path', _MD_PROFILE_AUDIOS);
include_once 'footer.php';