mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 05:13:54 -07:00
Redirect to viewprofile.php if profile.php hasn't arguments (#821)
This commit is contained in:
parent
dc46528918
commit
695d46e31e
2 changed files with 9 additions and 8 deletions
|
@ -18,15 +18,16 @@ $datastore->enqueue(array(
|
||||||
'cat_forums',
|
'cat_forums',
|
||||||
));
|
));
|
||||||
|
|
||||||
if (empty($_GET[POST_USERS_URL]) || $_GET[POST_USERS_URL] == GUEST_UID) {
|
|
||||||
bb_die($lang['NO_USER_ID_SPECIFIED']);
|
|
||||||
}
|
|
||||||
if (!$profiledata = get_userdata($_GET[POST_USERS_URL])) {
|
|
||||||
bb_die($lang['NO_USER_ID_SPECIFIED']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$userdata['session_logged_in']) {
|
if (!$userdata['session_logged_in']) {
|
||||||
redirect(LOGIN_URL . "?redirect={$_SERVER['REQUEST_URI']}");
|
redirect(LOGIN_URL . "?redirect={$_SERVER['REQUEST_URI']}");
|
||||||
|
} else {
|
||||||
|
if (empty($_GET[POST_USERS_URL])) {
|
||||||
|
$_GET[POST_USERS_URL] = $userdata['user_id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$profiledata = get_userdata($_GET[POST_USERS_URL])) {
|
||||||
|
bb_die($lang['NO_USER_ID_SPECIFIED']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$ranks = $datastore->get('ranks')) {
|
if (!$ranks = $datastore->get('ranks')) {
|
||||||
|
|
|
@ -16,7 +16,7 @@ require __DIR__ . '/common.php';
|
||||||
$user->session_start();
|
$user->session_start();
|
||||||
|
|
||||||
set_die_append_msg();
|
set_die_append_msg();
|
||||||
$mode = request_var('mode', '');
|
$mode = request_var('mode', 'viewprofile');
|
||||||
|
|
||||||
switch ($mode) {
|
switch ($mode) {
|
||||||
case 'viewprofile':
|
case 'viewprofile':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue