Verzeichnisstruktur phpBB-1.0.0
- Veröffentlicht
- 15.12.2000
So funktioniert es
|
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
auth.php
001 <?php
002 /***************************************************************************
003 auth.php - description
004 -------------------
005 begin : Sat June 17 2000
006 copyright : (C) 2000 by James Atkinson
007 email : james@totalgeek.org
008
009 $Id: auth.php,v 1.25 2000/12/06 22:33:11 thefinn Exp $
010
011 ***************************************************************************/
012
013 /***************************************************************************
014 *
015 * This program is free software; you can redistribute it and/or modify
016 * it under the terms of the GNU General Public License as published by
017 * the Free Software Foundation; either version 2 of the License, or
018 * (at your option) any later version.
019 *
020 ***************************************************************************/
021 // Make a database connection.
022 if(!$db = @mysql_connect("$dbhost", "$dbuser", "$dbpasswd"))
023 die('<font size=+1>An Error Occured</font><hr>phpBB was unable to connect to the database. <BR>Please check $dbhost, $dbuser, and $dbpasswd in config.php.');
024 if(!@mysql_select_db("$dbname",$db))
025 die("<font size=+1>An Error Occured</font><hr>phpBB was unable to find the database <b>$dbname</b> on your MySQL server. <br>Please make sure you ran the phpBB installation script.");
026
027 if(is_banned($REMOTE_ADDR, "ip", $db))
028 die("You have been banned from this forum. If you have questions please contact the administrator.");
029
030 // Setup forum Options.
031 $sql = "SELECT * FROM config WHERE selected = 1";
032 if($result = mysql_query($sql, $db)) {
033 if($myrow = mysql_fetch_array($result)) {
034 $sitename = $myrow["sitename"];
035 $allow_html = $myrow["allow_html"];
036 $allow_bbcode = $myrow["allow_bbcode"];
037 $allow_sig = $myrow["allow_sig"];
038 $allow_namechange = $myrow["allow_namechange"];
039 $posts_per_page = $myrow["posts_per_page"];
040 $hot_threshold = $myrow["hot_threshold"];
041 $topics_per_page = $myrow["topics_per_page"];
042 $allow_theme_create = $myrow["allow_theme_create"];
043 $override_user_themes = $myrow["override_themes"];
044 $email_sig = stripslashes($myrow["email_sig"]);
045 $email_from = $myrow["email_from"];
046
047 }
048 }
049 // Check for a cookie on the users's machine.
050 // If the cookie exists, build an array of the users info and setup the theme.
051
052 //Old code for the permanent userid cookie..
053
054 if(isset($HTTP_COOKIE_VARS[$cookiename])) {
055 $userdata = get_userdata_from_id($HTTP_COOKIE_VARS["$cookiename"], $db);
056 if(is_banned($userdata[user_id], "username", $db))
057 die("You have been banned from this forum, if you have questions please contact the administrator.");
058 $theme = setuptheme($userdata["user_theme"], $db);
059 if(!$theme == 0) {
060 $bgcolor = $theme["bgcolor"];
061 $table_bgcolor = $theme["table_bgcolor"];
062 $textcolor = $theme["textcolor"];
063 $color1 = $theme["color1"];
064 $color2 = $theme["color2"];
065 $header_image = $theme["header_image"];
066 $newtopic_image = $theme["newtopic_image"];
067 $reply_image = $theme["reply_image"];
068 $linkcolor = $theme["linkcolor"];
069 $vlinkcolor = $theme["vlinkcolor"];
070 $FontFace = $theme["fontface"];
071 $FontSize1 = $theme["fontsize1"];
072 $FontSize2 = $theme["fontsize2"];
073 $FontSize3 = $theme["fontsize3"];
074 $FontSize4 = $theme["fontsize4"];
075 $tablewidth = $theme["tablewidth"];
076 $TableWidth = $tablewidth;
077 $reply_locked_image = $theme["replylocked_image"];
078
079
080 }
081 }
082
083 // new code for the session ID cookie..
084
085 if(isset($HTTP_COOKIE_VARS[$sesscookiename])) {
086 $sessid = $HTTP_COOKIE_VARS[$sesscookiename];
087 $userid = get_userid_from_session($sessid, $sesscookietime, $REMOTE_ADDR, $db);
088
089 if (!$userid) {
090 $user_logged_in = 0;
091 } else {
092 $user_logged_in = 1;
093 update_session_time($sessid, $db);
094
095 $userdata = get_userdata_from_id($userid, $db);
096 if(is_banned($userdata[user_id], "username", $db))
097 die("You have been banned from this forum, contact the system administrator if you have any questions");
098 $theme = setuptheme($userdata["user_theme"], $db);
099 if(!$theme == 0) {
100 $bgcolor = $theme["bgcolor"];
101 $table_bgcolor = $theme["table_bgcolor"];
102 $textcolor = $theme["textcolor"];
103 $color1 = $theme["color1"];
104 $color2 = $theme["color2"];
105 $header_image = $theme["header_image"];
106 $newtopic_image = $theme["newtopic_image"];
107 $reply_image = $theme["reply_image"];
108 $linkcolor = $theme["linkcolor"];
109 $vlinkcolor = $theme["vlinkcolor"];
110 $FontFace = $theme["fontface"];
111 $FontSize1 = $theme["fontsize1"];
112 $FontSize2 = $theme["fontsize2"];
113 $FontSize3 = $theme["fontsize3"];
114 $FontSize4 = $theme["fontsize4"];
115 $tablewidth = $theme["tablewidth"];
116 $TableWidth = $tablewidth;
117 $reply_locked_image = $theme["replylocked_image"];
118
119 }
120 } // if/else
121
122 }
123
124 // Setup the default theme
125
126 if($override_user_themes == 1 || !$theme) {
127 $sql = "SELECT * FROM themes WHERE theme_default = 1";
128 if(!$r = mysql_query($sql, $db))
129 die('<font size=+1>An Error Occured</font><hr>phpBB was unable to connect to the database. <BR>Please check $dbhost, $dbuser, and $dbpasswd in config.php.');
130 if($theme = mysql_fetch_array($r)) {
131 $bgcolor = $theme["bgcolor"];
132 $table_bgcolor = $theme["table_bgcolor"];
133 $textcolor = $theme["textcolor"];
134 $color1 = $theme["color1"];
135 $color2 = $theme["color2"];
136 $header_image = $theme["header_image"];
137 $newtopic_image = $theme["newtopic_image"];
138 $reply_image = $theme["reply_image"];
139 $linkcolor = $theme["linkcolor"];
140 $vlinkcolor = $theme["vlinkcolor"];
141 $FontFace = $theme["fontface"];
142 $FontSize1 = $theme["fontsize1"];
143 $FontSize2 = $theme["fontsize2"];
144 $FontSize3 = $theme["fontsize3"];
145 $FontSize4 = $theme["fontsize4"];
146 $tablewidth = $theme["tablewidth"];
147 $TableWidth = $tablewidth;
148 $reply_locked_image = $theme["replylocked_image"];
149 }
150 }
151
152
153 // Code for the LastVisit cookie..
154
155 if(isset($HTTP_COOKIE_VARS["LastVisit"])) {
156 $userdata["lastvisit"] = $HTTP_COOKIE_VARS["LastVisit"];
157 } else {
158 $value = date("Y-m-d H:i");
159 $time = (time() + 3600 * 24 * 7 * 52); // one year 'til expiry..
160 setcookie("LastVisit", $value, $time, $cookiepath, $cookiedomain, $cookiesecure);
161 }
162
163 list($days, $time) = split(" ", $userdata[lastvisit]);
164 list($hour, $min) = split(":", $time);
165 list($year, $month, $day) = explode("-", $days);
166 $sec = 00;
167 $last_visit = mktime($hour,$min, $sec, $month, $day, $year);
168 $now_time = mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y"));
169
170 if(($now_time - $last_visit) > 600) {
171 $value = date("Y-m-d H:i");
172 $time = (time() + 3600 * 24 * 7 * 52);
173 setcookie("LastVisit", $value, $time, $cookiepath, $cookiedomain, $cookiesecure);
174 }
175 ?>
176