View difference between Paste ID: 5TByzEmm and NkmsEEpc
SHOW: | | - or go back to the newest paste.
1
<?php
2
/**
3
* Codychat
4
*
5
* @package Codychat
6
* @author www.boomcoding.com
7
* @copyright 2017
8
* @terms any use of this script without a legal license is prohibited
9
* all the content of Codychat is the propriety of BoomCoding and Cannot be 
10
* used for another project.
11
*/
12
require_once("config_session.php");
13
if (!isset($_POST['content'], $_POST['snum'])){
14
	die();
15
}
16
if(checkFlood()){
17
	echo 100;
18
	die();
19
}
20
if(muted() || roomMuted()){
21
	die();
22
}
23
24
$snum = escape($_POST['snum']);
25
$content = escape($_POST['content']);
26
$content = wordFilter($content, 1);
27
$content = textFilter($content);
28
$command = explode(' ',trim($content));
29
$count = count($command);
30
31
if(empty($content) && $content !== '0' || !inRoom()){
32
	echo 4;
33
	die();
34
}
35
36
if(substr($command[0], 0, 1) === '/'){	
37
38
	if ( $command[0] == '/topic' && ( boomAllow(8) || boomRole(5) ) ){
39
		$topic = trimCommand($content, '/topic');
40
		changeTopic($topic, $data['user_roomid']);
41
		die();
42
	}
43
	elseif( $command[0] == '/mute' && boomAllow(8)){
44
		$mute = trimCommand($content, '/mute');
45
		$user = nameDetails($mute);
46
		echo muteAccount($user['user_id']);
47
		die();
48
	}
49
	elseif( $command[0] == '/unmute' && boomAllow(8)){
50
		$mute = trimCommand($content, '/unmute');
51
		$user = nameDetails($mute);
52
		echo unmuteAccount($user['user_id']);
53
		die();
54
	}
55
	elseif( $command[0] == '/ban' && boomAllow(9)){
56
		$ban = trimCommand($content, '/ban');
57
		$user = nameDetails($ban);
58
		echo banAccount($user['user_id']);
59
		die();
60
	}
61
	elseif( $command[0] == '/unban' && boomAllow(9)){
62
		$ban = trimCommand($content, '/unban');
63
		$user = nameDetails($ban);
64
		echo unbanAccount($user['user_id']);
65
		die();
66
	}
67
	elseif( $command[0] == '/verify' && boomAllow(9)){
68
		$verify = trimCommand($content, '/verify');
69
		$user = nameDetails($verify);
70
		echo verifyUser($user['user_id']);
71
		die();
72
	}
73
	elseif( $command[0] == '/setuser' && boomAllow(9)){
74
		$torank = trimCommand($content, '/setuser');
75
		$user = nameDetails($torank);
76
		echo changeUserRank($user['user_id'], 1);
77
		die();
78
	}
79
	elseif( $command[0] == '/setvip' && boomAllow(9)){
80
		$torank = trimCommand($content, '/setvip');
81
		$user = nameDetails($torank);
82
		echo changeUserRank($user['user_id'], 2);
83
		die();
84
	}
85
	elseif( $command[0] == '/setdj' && boomAllow(9)){
86
		$torank = trimCommand($content, '/setdj');
87
		$user = nameDetails($torank);
88
		echo changeUserRank($user['user_id'], 3);
89
		die();
90
	}
91
	elseif( $command[0] == '/removedj' && boomAllow(9)){
92
		$torank = trimCommand($content, '/removedj');
93
		$user = nameDetails($torank);
94
		echo changeUserRank($user['user_id'], 1);
95
		die();
96
	}
97
98
99
	elseif( $command[0] == '/setmod' && boomAllow(9)){
100
		$torank = trimCommand($content, '/setmod');
101
		$user = nameDetails($torank);
102
		echo changeUserRank($user['user_id'], 8);
103
		die();
104
	}
105
	elseif( $command[0] == '/setadmin' && boomAllow(10)){
106
		$torank = trimCommand($content, '/setadmin');
107
		$user = nameDetails($torank);
108
		echo changeUserRank($user['user_id'], 9);
109
		die();
110
	}
111
	elseif( $command[0] == '/ignore'){
112
		$toignore = trimCommand($content, '/ignore');
113
		$user = nameDetails($toignore);
114
		echo ignore($user['user_id']);
115
		die();
116
	}
117
	elseif( $command[0] == '/removeignore'){
118
		$toignore = trimCommand($content, '/removeignore');
119
		$user = nameDetails($toignore);
120
		echo removeIgnore($user['user_id']);
121
		die();
122
	}
123
	elseif( $command[0] == '/removefriend'){
124
		$friend = trimCommand($content, '/removefriend');
125
		$user = nameDetails($friend);
126
		echo boomRemoveFriend($user['user_id']);
127
		die();
128
	}
129
	elseif( $command[0] == '/deleteaccount' && boomAllow(10)){
130
		$todel = trimCommand($content, '/deleteaccount');
131
		$user = nameDetails($todel);
132
		echo deleteAccount($user['user_id']);
133
		die();
134
	}
135
	elseif( $command[0] == '/addfriend'){
136
		$friend = trimCommand($content, '/addfriend');
137
		$user = nameDetails($friend);
138
		$response = boomAddFriend($user['user_id']);
139
		if($response == 2 || $response == 1 ){
140
			$response = 1;
141
		}
142
		else if($response == 4){
143
			$response = 2;
144
		}
145
		echo $response;
146
		die();
147
	}
148
	elseif ( $command[0] == '/clear' && ( boomAllow(8) || boomRole(5) ) ){
149
		clearRoom($data['user_roomid']);
150
		die();
151
	}
152
	elseif ( $command[0] == '/seen'){
153
		$search = trimCommand($content, '/seen');
154
		$result = userSeen($search);
155
		echo systemSpecial($result, 'seen');
156
		die();
157
	}
158
	else if($command[0] == '/clearcache' && isOwner()){
159
		boomCacheUpdate();
160
		echo 1;
161
		die();
162
	}
163
	else {
164
		echo 202;
165
		die();
166
	}
167
	
168
}
169
else{
170
	$post_data = array(
171
					'snum'=> $snum,
172
					'color'=> $data['bccolor'] . ' ' . $data['bcbold']
173
				);
174
	postChat($data['user_id'], $data['user_roomid'], $content, $post_data);
175
	$post = getBackMain($data['user_id']);
176
	if(!empty($post)){
177
		echo createLog($data, $post);
178
	}
179
}
180
?>