mhmcr /profile.php

Language PHP Lines 69
MD5 Hash 4e2b87ad08c95ecacacdb75d0e31b9e4 Estimated Cost $1,408 (why?)
Repository https://bitbucket.org/mhell/mhmcr.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
	
	/*
	* MhMCR r01
	* based on WebMCR 1.5
	* by MineHell.ru developers
	*/

	header('Content-Type: text/html;charset=UTF-8');
	require_once('system.php');
	require_once('inc/news.inc.php');
	$cloak = $user->lvl() >= $config['user_level_cloak'];
	$skin = $user->lvl() >= $config['user_level_skin'];
	$static = array();
	$ql = mysql_query("SELECT `name`,`url` FROM ".$db['tables']['static']." ORDER BY `id` DESC;");
	while ($entry = mysql_fetch_assoc($ql))
	{
		if ($entry['url']!='main')
			$static[] = $entry;
	}	
	$opts = array();
	$ql = mysql_query("SELECT * FROM ".$db['tables']['data'].";");
	while ($entry = mysql_fetch_assoc($ql))
	{
		$opts[$entry['property']] = $entry['value'];
	}
	$changed = false;
	$cerror = '';
	if (@$_POST) {
		if (@$_FILES['skin'] && POSTGood('skin') && $skin) {
			POSTUpload('skin', $user->getSkinFName(), 64, 2);
		} else {
			$cerror .= 'Ошибка при загрузке скина. ';
		}
		if (@$_FILES['cloak'] && POSTGood('cloak') && $cloak) {
			POSTUpload('FILE', $user->getCloakFName(), 22, 1.29);
		} else {
			$cerror .= 'Ошибка при загрузке плаща. ';
		}
		if (@$_POST['newpass'] && @$_POST['pass'] && @$_POST['newpass']==@$_POST['newpass2']) {
			$user->changePassword($_POST['newpass'],$_POST['pass'],true);
		} else {
			$cerror .= 'Ошибка при смене пароля. ';
		}
		if (@$_POST['delskin'] && $skin) {
			$user->deleteSkin();
		} else {
			$cerror .= 'Ошибка при удалении скина. ';
		}
		if (@$_POST['delcloak'] && $cloak) {
			$user->deleteCloak();
		} else {
			$cerror .= 'Ошибка при удалении плаща. ';
		}
		$changed = true;
	}
	if (@$_GET['login']) {
		$myprofile = false;
		$userentry = new User(mysql_real_escape_string($_GET['login']),$db['users']['username']);
		$notfound = false;
		if (!$userentry->id()) {
			$notfound = true;
		}
	} else {
		$myprofile = true;
		$userentry = $user;
	}
	include($config['style_dir'].'profile.html');
?>
Back to Top