aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions.php58
-rw-r--r--phpBB/includes/page_header.php6
2 files changed, 57 insertions, 7 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 102b786798..19a4b9fc75 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -444,7 +444,7 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat
'META' => '<meta http-equiv="refresh" content="3;url=' . "view$mode.$phpEx$SID&amp;" . $u_url . "=$match_id&amp;start=$start" . '">')
);
- $message = $user->lang['No_longer_watching_' . $mode] . '<br /><br />' . sprintf($user->lang['Click_return_' . $mode], '<a href="' . "view$mode.$phpEx$SID&amp;" . $u_url . "=$match_id&amp;start=$start" . '">', '</a>');
+ $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . "view$mode.$phpEx$SID&amp;" . $u_url . "=$match_id&amp;start=$start" . '">', '</a>');
trigger_error($message);
}
else
@@ -478,7 +478,7 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat
'META' => '<meta http-equiv="refresh" content="3;url=' . "view$mode.$phpEx$SID&amp;" . $u_url . "=$match_id&amp;start=$start" . '">')
);
- $message = $user->lang['You_are_watching_' . $mode] . '<br /><br />' . sprintf($user->lang['Click_return_' . $mode], '<a href="' . "view$mode.$phpEx$SID&amp;" . $u_url . "=$match_id&amp;start=$start" . '">', '</a>');
+ $message = $user->lang['ARE_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . "view$mode.$phpEx$SID&amp;" . $u_url . "=$match_id&amp;start=$start" . '">', '</a>');
trigger_error($message);
}
else
@@ -493,7 +493,7 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat
{
if ($_GET['unwatch'] == $mode)
{
- redirect("login.$phpEx$SID&redirect=view$mode.$phpEx&" . $u_url . "=$match_id&unwatch=forum");
+ login_box(preg_replace('#.*?([a-z]+?\.' . $phpEx . '.*?)$#i', '\1', htmlspecialchars($_SERVER['REQUEST_URI'])));
}
}
else
@@ -505,7 +505,7 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat
if ($can_watch)
{
- $s_watching = ($is_watching) ? '<a href="' . "view$mode." . $phpEx . $SID . '&amp;' . $u_url . "=$match_id&amp;unwatch=$mode&amp;start=$start" . '">' . $user->lang['Stop_watching_' . $mode] . '</a>' : '<a href="' . "view$mode." . $phpEx . $SID . '&amp;' . $u_url . "=$match_id&amp;watch=$mode&amp;start=$start" . '">' . $user->lang['Start_watching_' . $mode] . '</a>';
+ $s_watching = ($is_watching) ? '<a href="' . "view$mode." . $phpEx . $SID . '&amp;' . $u_url . "=$match_id&amp;unwatch=$mode&amp;start=$start" . '">' . $user->lang['STOP_WATCHING_' . strtoupper($mode)] . '</a>' : '<a href="' . "view$mode." . $phpEx . $SID . '&amp;' . $u_url . "=$match_id&amp;watch=$mode&amp;start=$start" . '">' . $user->lang['START_WATCHING_' . strtoupper($mode)] . '</a>';
}
return;
@@ -840,6 +840,56 @@ function validate_optional_fields(&$icq, &$aim, &$msnm, &$yim, &$website, &$loca
return;
}
+// Generate login box or verify password
+function login_box($s_action, $s_hidden_fields = '', $login_explain = '')
+{
+ global $SID, $db, $user, $template, $auth, $phpbb_root_path, $phpEx;
+
+ $err = '';
+ if (isset($_POST['login']))
+ {
+ $autologin = (!empty($_POST['autologin'])) ? TRUE : FALSE;
+ $viewonline = (!empty($_POST['viewonline'])) ? 0 : 1;
+
+ if (($result = $auth->login($_POST['username'], $_POST['password'], $autologin, $viewonline)) === true)
+ {
+ return true;
+ }
+
+ // If we get a non-numeric (e.g. string) value we output an error
+ if (is_string($result))
+ {
+ trigger_error($result, E_USER_ERROR);
+ }
+
+ // If we get an integer zero then we are inactive, else the username/password is wrong
+ $err = ($result === 0) ? $user->lang['ACTIVE_ERROR'] : $user->lang['LOGIN_ERROR'];
+ }
+
+ $template->assign_vars(array(
+ 'LOGIN_ERROR' => $err,
+ 'LOGIN_EXPLAIN' => $login_explain,
+
+ 'U_SEND_PASSWORD' => "ucp.$phpEx$SID&amp;mode=sendpassword",
+ 'U_TERMS_USE' => "ucp.$phpEx$SID&amp;mode=terms",
+ 'U_PRIVACY' => "ucp.$phpEx$SID&amp;mode=privacy",
+
+ 'S_LOGIN_ACTION' => $s_action,
+ 'S_HIDDEN_FIELDS' => $s_hidden_fields)
+ );
+
+ $page_title = $user->lang['LOGIN'];
+ include($phpbb_root_path . 'includes/page_header.'.$phpEx);
+
+ $template->set_filenames(array(
+ 'body' => 'login_body.html')
+ );
+ make_jumpbox('viewforum.'.$phpEx);
+
+ include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
+}
+
+
// Error and message handler, call with trigger_error if reqd
function msg_handler($errno, $msg_text, $errfile, $errline)
{
diff --git a/phpBB/includes/page_header.php b/phpBB/includes/page_header.php
index f16fcd1b05..70bbef9e73 100644
--- a/phpBB/includes/page_header.php
+++ b/phpBB/includes/page_header.php
@@ -38,12 +38,12 @@ if ($config['gzip_compress'])
// Generate logged in/logged out status
if ($user->data['user_id'] != ANONYMOUS)
{
- $u_login_logout = 'login.'.$phpEx. $SID . '&amp;logout=true';
+ $u_login_logout = 'ucp.'.$phpEx. $SID . '&amp;mode=logout';
$l_login_logout = sprintf($user->lang['LOGOUT_USER'], $user->data['username']);
}
else
{
- $u_login_logout = 'login.'.$phpEx . $SID;
+ $u_login_logout = 'ucp.'.$phpEx . $SID . '&amp;mode=login';
$l_login_logout = $user->lang['LOGIN'];
}
@@ -304,7 +304,6 @@ $template->assign_vars(array(
'S_CONTENT_ENCODING' => $user->lang['ENCODING'],
'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'],
'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT'],
- 'S_LOGIN_ACTION' => 'login.'.$phpEx.$SID,
'S_TIMEZONE' => ($user->data['user_dst']) ? sprintf($user->lang['All_times'], $user->lang[$tz], $user->lang['tz']['dst']) : sprintf($user->lang['All_times'], $user->lang[$tz], ''),
'T_STYLESHEET_DATA' => $user->theme['css_data'],
@@ -312,6 +311,7 @@ $template->assign_vars(array(
'NAV_LINKS' => $nav_links_html)
);
+// 'S_LOGIN_ACTION' => 'login.'.$phpEx.$SID,
/*if ($config['send_encoding'])
{