You should have received a copy of the GNU General Public License along with GlobalBan. If not, see <http://www.gnu.org/licenses/>. */ // Start a Session session_start(); // Check if ALL cookies exist, if they do proceed to have them as "logged in" (remember me feature) // Otherwise, check the session to see if they have logged in "this" session if (isset($_COOKIE['gbu']) && isset($_COOKIE['gbp']) || isset($_SESSION['accessLevel']) && isset($_SESSION['name'])) { if (!isset($_SESSION['accessLevel']) && !isset($_SESSION['name']) && $page != "logout") { // Do a database verify before registering values require_once ROOTDIR . "/include/database/class.UserQueries.php"; require_once ROOTDIR . "/include/objects/class.User.php"; $userQuery = new UserQueries(); $user = new User(); $user = $userQuery->getUserInfo($_COOKIE['gbu']); // Place stuff into user object // Make sure we have a valid user object if (isset($user)) { // Check if md5 encrypted passwords match // If they do, auto log them in // Also make sure that the user is active if ($user->getPassword() == $_COOKIE['gbp'] && $user->getActive() == 1) { // Register Session Values $_SESSION['name'] = $_COOKIE['gbu']; // Username $_SESSION['password'] = $_COOKIE['gbp']; // md5 encrypted $_SESSION['accessLevel'] = $user->getAccessLevel(); $_SESSION['steamId'] = $user->getSteamId(); // Steam ID of logged in user
// We are updating ban information if ($config->enableSmfIntegration) { $username = $user_info['username']; } else { $username = $_SESSION['name']; } if (!$fullPowerLevelEditUser || $fullPower) { $ModifiedBy = $username; } if ($member) { $pending = 1; } else { $pending = 0; } $userQueries = new UserQueries(); $user = $userQueries->getUserInfo($admin_banner); // Get add date of ban $addDate = $banQueries->getBanAddDate($banId); $lengthInSec = $length->getLengthInSeconds(); $newExpireDate = $addDate + $lengthInSec; // Update ban $banQueries->updateWebBanWithLength($length->getLength(), $length->getTimeScale(), $newExpireDate, $reason, $pending, $admin_banner, $ModifiedBy, $serverId, $bannedUser, $user->getSteamId(), $banId, $comments, $bannedPost); // Email $subject = $LAN_PROCESSWEBBANUPDATE_001 . " " . $bannedUser . " " . $LAN_PROCESSWEBBANUPDATE_010 . " " . $username; $body = "<html><body><br/><h2>" . $subject . "</h2><br/><br/>"; $body .= $LAN_PROCESSWEBBANUPDATE_002 . " <b>"; if ($member) { $body .= $LAN_PROCESSWEBBANUPDATE_003; } else { if ($admin) { $body .= $LAN_PROCESSWEBBANUPDATE_004;
* they can also enable or diable a ban completely and are able to change * ny bans at their whim. */ include_once ROOTDIR . "/include/database/class.UserQueries.php"; // Admin Variables $banManager = false; // Allowed to do everything regarding bans $admin = false; // Can only add (by-passes pending) $member = false; // Can only add pending $fullPower = false; // Allowed EVERYTHING regarding the server $userQuery = new UserQueries(); $user = new User(); $user = $userQuery->getUserInfo($user_info['username']); // Place stuff into user object // Only do this if they are active if ($user->getActive() == 1) { // Member if (in_array($config->memberGroup, $user_info['groups'])) { $member = true; } // Admin if (in_array($config->adminGroup, $user_info['groups'])) { $admin = true; } // Ban Manager if (in_array($config->banManagerGroup, $user_info['groups'])) { $banManager = true; }
} // Get the list of servers $serverList = $serverQueries->getServers(); // List of Reasons $banReasons = $reasonQueries->getReasonList(); // Get the total number of demos $demoCount = $demoQueries->getNumberOfDemos($searchText); // Get Demos $demoList = $demoQueries->getDemoList($startRange, $demoCount, $sortBy, $sortDirection, $searchText); $userQueries = new UserQueries(); if ($config->enableSmfIntegration) { $username = $user_info['username']; } else { $username = $_SESSION['name']; } $user = $userQueries->getUserInfo($username); ?> <script type="text/javascript"> function formVerify() { var errorFound = false; // Validate Steam ID var regex = /^STEAM_[01]:[01]:\d{0,10}$/; var steamId = document.getElementById("steamdId").value; if(!steamId.match(regex)) { document.getElementById("steamIdError").style.display = ""; errorFound = true; } else { document.getElementById("steamIdError").style.display = "none"; }
(at your option) any later version. GlobalBan is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GlobalBan. If not, see <http://www.gnu.org/licenses/>. */ require_once ROOTDIR . "/include/database/class.UserQueries.php"; require_once ROOTDIR . "/include/objects/class.User.php"; $lan_file = ROOTDIR . '/languages/' . $LANGUAGE . '/lan_profile.php'; include file_exists($lan_file) ? $lan_file : ROOTDIR . "/languages/English/lan_profile.php"; $userQueries = new UserQueries(); $user = $userQueries->getUserInfo($_SESSION['name']); // Get current logged in user's info // Boolean values of whether post values are valid $valid = array("username" => true, "steamId" => true, "email" => true, "curPassword" => true, "cpassword" => true, "npassword" => true, "vpassword" => true); // ********************************************* // If the user is updating their general profile // ********************************************* if (!empty($_POST['generalProfile']) && isset($_POST['generalProfile'])) { $generalChangesMade = false; $generalErrors = false; $username = $_POST['username']; // Check if user name was changed if ($user->getName() != addslashes($username)) { // Determine if NEW username already exists if (!$userQueries->usernameExist($username) && !empty($username)) { $valid['username'] = true;
// Members are not allowed to IP ban if ($admin || $banManager || $fullPower) { ?> <input type="button" value="<?php echo $LANUPDATEBAN_031; ?> " onclick="confirmIpBan()"><?php } } } else { echo $LANUPDATEBAN_005; ?> <?php echo $bannedUser->getSteamId(); } $userEdit = $userQuery->getUserInfo($bannedUser->getModifiedBy()); $fullPowerLevelEditUser = false; if ($userEdit->getAccessLevel() == 1) { $fullPowerLevelEditUser = true; } ?> </td> </tr> <tr> <td class="rowColor1" width="1%" nowrap><?php echo $LANUPDATEBAN_006; ?> </td> <?php if ($fullPowerLevelEditUser && !$fullPower) { ?>