This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
joinus.php
166 lines (148 loc) · 6.66 KB
/
joinus.php
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?php
/*
##########################################################################
# #
# Version 4 / / / #
# -----------__---/__---__------__----__---/---/- #
# | /| / /___) / ) (_ ` / ) /___) / / #
# _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___ #
# Free Content / Management System #
# / #
# #
# #
# Copyright 2005-2011 by webspell.org #
# #
# visit webSPELL.org, webspell.info to get webSPELL for free #
# - Script runs under the GNU GENERAL PUBLIC LICENSE #
# - It's NOT allowed to remove this copyright-tag #
# -- http://www.fsf.org/licensing/licenses/gpl.html #
# #
# Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at), #
# Far Development by Development Team - webspell.org #
# #
# visit webspell.org #
# #
##########################################################################
*/
//options
$showonlygamingsquads = true; //only show gaming squads (=true) or show all squads (=false)?
//php below this line ;)
if(isset($site)) $_language->read_module('joinus');
eval ("\$title_joinus = \"".gettemplate("title_joinus")."\";");
echo $title_joinus;
if(isset($_GET['action'])) $action = $_GET['action'];
else $action = "";
$show = true;
if($action=="save" && isset($_POST['post'])) {
if(isset($_POST['squad'])) $squad = $_POST['squad'];
else $squad = 0;
$nick = $_POST['nick'];
$name = $_POST['name'];
$email = $_POST['email'];
$messenger = $_POST['messenger'];
$age = $_POST['age'];
$city = $_POST['city'];
$clanhistory = $_POST['clanhistory'];
$info = $_POST['info'];
$run=0;
$error = array();
if(!(mb_strlen(trim($nick)))) $error[]=$_language->module['forgot_nickname'];
if(!(mb_strlen(trim($name)))) $error[]=$_language->module['forgot_realname'];
if(! validate_email($email)) $error[]=$_language->module['email_not_valid'];
if(!(mb_strlen(trim($messenger)))) $error[]=$_language->module['forgot_messenger'];
if(!(mb_strlen(trim($age)))) $error[]=$_language->module['forgot_age'];
if(!(mb_strlen(trim($city)))) $error[]=$_language->module['forgot_city'];
if(!(mb_strlen(trim($clanhistory)))) $error[]=$_language->module['forgot_history'];
if($userID) {
$run=1;
}
else {
$CAPCLASS = new Captcha;
if(!$CAPCLASS->check_captcha($_POST['captcha'], $_POST['captcha_hash'])) $error[]=$_language->module['wrong_security_code'];
else $run=1;
}
if(!count($error) and $run) {
$ergebnis=safe_query("SELECT userID FROM ".PREFIX."squads_members WHERE joinmember='1' AND squadID='".$squad."'");
while($ds=mysql_fetch_array($ergebnis)) {
$touser[]=$ds['userID'];
}
if($touser[0] != "") {
$tmp_lang = new Language();
foreach($touser as $id) {
$tmp_lang->set_language(getuserlanguage($id));
$tmp_lang->read_module('joinus');
$message = '[b]'.$tmp_lang->module['someone_want_to_join_your_squad'].' '.mysql_real_escape_string(getsquadname($squad)).'![/b]
'.$tmp_lang->module['nick'].' '.$nick.'
'.$tmp_lang->module['name'].': '.$name.'
'.$tmp_lang->module['age'].': '.$age.'
'.$tmp_lang->module['mail'].': [email]'.$email.'[/email]
'.$tmp_lang->module['messenger'].': '.$messenger.'
'.$tmp_lang->module['city'].': '.$city.'
'.$tmp_lang->module['clan_history'].': '.$clanhistory.'
'.$tmp_lang->module['info'].':
'.$info.'
';
sendmessage($id,$tmp_lang->module['message_title'],$message);
}
}
echo $_language->module['thanks_you_will_get_mail'];
unset($_POST['nick'], $_POST['name'], $_POST['email'],$_POST['messenger'],$_POST['age'],$_POST['city'],$_POST['clanhistory'],$_POST['info']);
$show = false;
}
else {
$fehler=implode('<br />• ',$error);
$show = true;
$showerror = '<div class="errorbox">
<b>'.$_language->module['problems'].':</b><br /><br />
• '.$fehler.'
</div>';
}
}
if($show == true){
if($showonlygamingsquads) $squads=getgamesquads();
else $squads=getsquads();
$bg1 = BG_1;
if($loggedin) {
if(!isset($showerror)) $showerror='';
$res = safe_query("SELECT *, DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW()) - TO_DAYS(birthday)), '%y') 'age' FROM ".PREFIX."user WHERE userID = '$userID'");
$ds = mysql_fetch_assoc($res);
$nickname = getinput($ds['nickname']);
$name = getinput($ds['firstname']." ".$ds['lastname']);
$email = getinput($ds['email']);
$messenger = getinput($ds['icq']);
$age = $ds['age'];
$city = getinput($ds['town']);
if(isset($_POST['clanhistory'])) $clanhistory=getforminput($_POST['clanhistory']);
else $clanhistory='';
if(isset($_POST['info'])) $info=getforminput($_POST['info']);
else $info='';
eval ("\$joinus_loggedin = \"".gettemplate("joinus_loggedin")."\";");
echo $joinus_loggedin;
}
else {
$CAPCLASS = new Captcha;
$captcha = $CAPCLASS->create_captcha();
$hash = $CAPCLASS->get_hash();
$CAPCLASS->clear_oldcaptcha();
if(!isset($showerror)) $showerror='';
if(isset($_POST['nick'])) $nick= getforminput($_POST['nick']);
else $nick='';
if(isset($_POST['name'])) $name= getforminput($_POST['name']);
else $name='';
if(isset($_POST['email'])) $email= getforminput($_POST['email']);
else $email='';
if(isset($_POST['messenger'])) $messenger= getforminput($_POST['messenger']);
else $messenger='';
if(isset($_POST['age'])) $age= getforminput($_POST['age']);
else $age='';
if(isset($_POST['city'])) $city= getforminput($_POST['city']);
else $city='';
if(isset($_POST['clanhistory'])) $clanhistory= getforminput($_POST['clanhistory']);
else $clanhistory='';
if(isset($_POST['info'])) $info= getforminput($_POST['info']);
else $info='';
eval ("\$joinus_notloggedin = \"".gettemplate("joinus_notloggedin")."\";");
echo $joinus_notloggedin;
}
}
?>