aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/ucp.php
diff options
context:
space:
mode:
authorJames Atkinson <thefinn@users.sourceforge.net>2002-11-21 15:40:21 +0000
committerJames Atkinson <thefinn@users.sourceforge.net>2002-11-21 15:40:21 +0000
commit25a3ef55be2122b7e6b8cea948fa27f34766b088 (patch)
tree8c8599c151b7e5db5230089876592ae207f7003a /phpBB/ucp.php
parent68ee9ffb1fb21e734f2dde3461e991fcc65fed41 (diff)
downloadforums-25a3ef55be2122b7e6b8cea948fa27f34766b088.tar
forums-25a3ef55be2122b7e6b8cea948fa27f34766b088.tar.gz
forums-25a3ef55be2122b7e6b8cea948fa27f34766b088.tar.bz2
forums-25a3ef55be2122b7e6b8cea948fa27f34766b088.tar.xz
forums-25a3ef55be2122b7e6b8cea948fa27f34766b088.zip
Moved profile.php to ucp.php. ucp is really really broken right now, don't even think about trying to use it.
git-svn-id: file:///svn/phpbb/trunk@3075 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/ucp.php')
-rwxr-xr-xphpBB/ucp.php112
1 files changed, 112 insertions, 0 deletions
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
new file mode 100755
index 0000000000..60170cd119
--- /dev/null
+++ b/phpBB/ucp.php
@@ -0,0 +1,112 @@
+<?php
+/***************************************************************************
+ * ucp.php
+ * -------------------
+ * begin : Saturday, Feb 13, 2001
+ * copyright : (C) 2001 The phpBB Group
+ * email : support@phpbb.com
+ *
+ * $Id$
+ *
+ *
+ ***************************************************************************/
+
+/***************************************************************************
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ ***************************************************************************/
+
+define('IN_PHPBB', true);
+$phpbb_root_path = './';
+include($phpbb_root_path . 'extension.inc');
+include($phpbb_root_path . 'common.'.$phpEx);
+
+// Start session management
+$user->start();
+$user->setup();
+$auth->acl($user->data);
+// End session management
+
+// Set default email variables
+$script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($config['script_path']));
+$script_name = ( $script_name != '' ) ? $script_name . '/ucp.'.$phpEx : 'ucp.'.$phpEx;
+$server_name = trim($config['server_name']);
+$server_protocol = ( $config['cookie_secure'] ) ? 'https://' : 'http://';
+$server_port = ( $config['server_port'] <> 80 ) ? ':' . trim($config['server_port']) . '/' : '/';
+
+$server_url = $server_protocol . $server_name . $server_port . $script_name;
+
+// -----------------------
+// Page specific functions
+//
+function gen_rand_string($hash)
+{
+ $chars = array( 'a', 'A', 'b', 'B', 'c', 'C', 'd', 'D', 'e', 'E', 'f', 'F', 'g', 'G', 'h', 'H', 'i', 'I', 'j', 'J', 'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N', 'o', 'O', 'p', 'P', 'q', 'Q', 'r', 'R', 's', 'S', 't', 'T', 'u', 'U', 'v', 'V', 'w', 'W', 'x', 'X', 'y', 'Y', 'z', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0');
+
+ $max_chars = count($chars) - 1;
+ srand( (double) microtime()*1000000);
+
+ $rand_str = '';
+ for($i = 0; $i < 8; $i++)
+ {
+ $rand_str = ( $i == 0 ) ? $chars[rand(0, $max_chars)] : $rand_str . $chars[rand(0, $max_chars)];
+ }
+
+ return ( $hash ) ? md5($rand_str) : $rand_str;
+}
+//
+// End page specific functions
+// ---------------------------
+
+//
+// Start of program proper
+//
+if ( isset($_GET['mode']) || isset($_POST['mode']) )
+{
+ $mode = ( isset($_GET['mode']) ) ? $_GET['mode'] : $_POST['mode'];
+
+ if ( $mode == 'viewprofile' )
+ {
+ include($phpbb_root_path . 'includes/usercp_viewucp.'.$phpEx);
+ exit;
+ }
+ else if ( $mode == 'editprofile' || $mode == 'register' )
+ {
+ if ( !$user->data['user_id'] && $mode == 'editprofile' )
+ {
+ redirect("login.$phpEx$SID&redirect=ucp.$phpEx&mode=editprofile");
+ }
+ else if ( $user->data['user_id'] && $mode == 'register' )
+ {
+ redirect("index.$phpEx$SID");
+ }
+
+ include($phpbb_root_path . 'includes/usercp_register.'.$phpEx);
+ exit;
+ }
+ else if ( $mode == 'sendpassword' )
+ {
+ include($phpbb_root_path . 'includes/usercp_sendpasswd.'.$phpEx);
+ exit;
+ }
+ else if ( $mode == 'activate' )
+ {
+ include($phpbb_root_path . 'includes/usercp_activate.'.$phpEx);
+ exit;
+ }
+ else if ( $mode == 'email' )
+ {
+ include($phpbb_root_path . 'includes/usercp_email.'.$phpEx);
+ exit;
+ }
+}
+else
+{
+ redirect("index.$phpEx$SID");
+}
+
+?> \ No newline at end of file