(no commit message)
[mailer.git] / 0.2.1 / inc / modules / login.php
1 <?php\r
2 /************************************************************************\r
3  * MXChange v0.2.1                                    Start: 10/15/2003 *\r
4  * ===============                              Last change: 04/18/2004 *\r
5  *                                                                      *\r
6  * -------------------------------------------------------------------- *\r
7  * File              : login.php                                        *\r
8  * -------------------------------------------------------------------- *\r
9  * Short description : Login area for members                           *\r
10  * -------------------------------------------------------------------- *\r
11  * Kurzbeschreibung  : Login-Bereich für Mitglieder                     *\r
12  * -------------------------------------------------------------------- *\r
13  *                                                                      *\r
14  * -------------------------------------------------------------------- *\r
15  * Copyright (c) 2003 - 2007 by Roland Haeder                           *\r
16  * For more information visit: http://www.mxchange.org                  *\r
17  *                                                                      *\r
18  * This program is free software; you can redistribute it and/or modify *\r
19  * it under the terms of the GNU General Public License as published by *\r
20  * the Free Software Foundation; either version 2 of the License, or    *\r
21  * (at your option) any later version.                                  *\r
22  *                                                                      *\r
23  * This program is distributed in the hope that it will be useful,      *\r
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *\r
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *\r
26  * GNU General Public License for more details.                         *\r
27  *                                                                      *\r
28  * You should have received a copy of the GNU General Public License    *\r
29  * along with this program; if not, write to the Free Software          *\r
30  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *\r
31  * MA  02110-1301  USA                                                  *\r
32  ************************************************************************/\r
33 \r
34 // Some security stuff...\r
35 if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))\r
36 {\r
37         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";\r
38         require($INC);\r
39 }\r
40  elseif (!IS_LOGGED_IN())\r
41 {\r
42         $URL = URL."/modules.php?module=index";\r
43         if ($check == "mem_only") $URL .= "&msg=".urlencode(LANG_MEM_ONLY_1.$GLOBALS['module'].LANG_MEM_ONLY_2);\r
44         LOAD_URL($URL);\r
45 }\r
46 \r
47 if ($status != "CONFIRMED")\r
48 {\r
49         // If the status is different than confirmed move the user away from here\r
50         switch ($status)\r
51         {\r
52         case "LOCKED":\r
53                 $ERROR = CODE_ID_LOCKED;\r
54                 break;\r
55 \r
56         case "UNCONFIRMED":\r
57                 $ERROR = CODE_ID_UNCONFIRMED;\r
58                 break;\r
59 \r
60         default:\r
61                 $ERROR = CODE_UNKNOWN_STATUS;\r
62                 break;\r
63         }\r
64         $URL = URL."/modules.php?module=index&login=".$ERROR;\r
65         LOAD_URL($URL);\r
66 }\r
67 \r
68 // Recheck if he got logged out because bad cookies\r
69 if (!IS_LOGGED_IN())\r
70 {\r
71         $URL = URL."/modules.php?module=index";\r
72         LOAD_URL($URL);\r
73 }\r
74 \r
75 // Load adverstising template\r
76 define('__MEMBER_ADVERT', LOAD_TEMPLATE("member_banner", true));\r
77 \r
78 // Disable block mode by default\r
79 $BLOCK_MODE = false;\r
80 \r
81 // Generate a tableset for the menu title and content\r
82 LOAD_TEMPLATE("member_header");\r
83 \r
84 // Adding your title's template here...\r
85 OUTPUT_HTML ("<TR>\r
86   <TD class=\"member_menu\">");\r
87 \r
88 // Adding the main content module here\r
89 if (empty($GLOBALS['action']))\r
90 {\r
91         if (empty($GLOBALS['what'])) $GLOBALS['what'] = "welcome";\r
92 }\r
93  else\r
94 {\r
95         $act = SQL_ESCAPE($GLOBALS['action']);\r
96 }\r
97 \r
98 // Add the member's menu here...\r
99 if (($CONFIG['member_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true)))\r
100 {\r
101         ADD_MENU("member", GET_ACTION("member", $GLOBALS['what']), $GLOBALS['what']);\r
102 }\r
103 \r
104 OUTPUT_HTML ("   </TD>\r
105   <TD valign=\"top\" align=\"center\" rowspan=\"3\" class=\"member_content\">");\r
106 \r
107 $INC_ACTION = sprintf(PATH."inc/modules/member/action-%s.php", $act);\r
108 if ((file_exists($INC_ACTION)) && (is_readable($INC_ACTION)) && (VALIDATE_MENU_ACTION("member", GET_ACTION("member", $GLOBALS['what']), $GLOBALS['what'])))\r
109 {\r
110         // Requested module is available so we load it\r
111         include ($INC_ACTION);\r
112 }\r
113  else\r
114 {\r
115         // Invalid module specified or not found...\r
116         LOAD_URL("modules.php?module=login");\r
117 }\r
118 \r
119 if (($CONFIG['member_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true)))\r
120 {\r
121         OUTPUT_HTML ("  <BR></TD>\r
122 </TR>\r
123 <TR>\r
124   <TD align=\"center\" valign=\"top\" class=\"member_advert\">");\r
125 \r
126         // Some advertising stuff?\r
127         LOAD_TEMPLATE("member_advert");\r
128 }\r
129 \r
130 OUTPUT_HTML ("  </TD>\r
131 </TR>");\r
132 \r
133 // Load same template for "Goto TOP"\r
134 LOAD_TEMPLATE("member_goto_top");\r
135 \r
136 // Footer template (Thanx to Mr. Glaus!)\r
137 LOAD_TEMPLATE("member_footer");\r
138 \r
139 //\r
140 ?>\r