index.php

Thu, 13 May 2010 09:31:01 -0500

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 13 May 2010 09:31:01 -0500
changeset 0
472198dc918e
permissions
-rwxr-xr-x

Initial commit

0
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
1 <?php
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
2
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3 require_once('recaptchalib.php');
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
4 require_once('config.php');
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
6 if(!array_key_exists('backend', $config))
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
7 die("Please specify a backend in config.php!");
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
8
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
9 if($config['debug'])
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
10 include('backend_'.$config['backend'].'.php');
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
11 else
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
12 @include('backend_'.$config['backend'].'.php');
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
13
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
14 if(class_exists("RegistrationBackend"))
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
15 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
16 $registration_backend = new RegistrationBackend();
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
17 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
18 else
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
19 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
20 echo('Failed to initialize backend "'.$config['backend'].'": ');
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
21
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
22 if(!$config['debug'])
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
23 echo('enable debug in the config for more info.');
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
24 else
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
25 include('backend_'.$config['backend'].'.php');
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
26 die();
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
27 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
28
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
29 header( 'Content-type: text/html; charset=utf-8' );
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
30
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
31 ?>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
32 <html>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
33 <head>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
34 <link rel='stylesheet' href='themes/<?php echo $config['theme']; ?>/style.css' />
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
35 </head>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
36 <body>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
37
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
38 <?php @include('themes/'.$config['theme'].'/header.php'); ?>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
39
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
40 <div id="box">
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
41
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
42 <?php
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
43 if (!$_POST["submit"])
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
44 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
45 ?>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
46
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
47 <h2>Register a <?php echo ucfirst($config['host']); ?> account</h2>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
48 <p>Use the form below to create an account.</p>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
49 <form method="post">
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
50 <table>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
51 <tr><td class="label">Username:</td><td><input type="text" class="edit username" name="username" size="10" />@<?php echo $config['host']; ?></td></tr>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
52 <tr><td class="label">Password:</td><td><input type="password" class="edit" name="password" size="15"/></td></tr>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
53 <tr><td class="label">Re-type password:</td><td><input type="password" class="edit" name="password2" size="15"/></td></tr>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
54 <tr><td colspan="2" style="text-align:center; margin-left:auto; margin-right:auto;" align="center">
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
55 <center>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
56 <div id="captcha">
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
57 <?php echo recaptcha_get_html($config['recaptchaPublicKey'], null, !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'); ?>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
58 </div>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
59 </center>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
60 </td></tr>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
61 <tr><td colspan="2" style="text-align:center;">
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
62 <input type="submit" name="submit" value="Register" />
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
63 </td></tr>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
64 </form>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
65
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
66 <?php
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
67 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
68 else
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
69 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
70 // Process submission
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
71 $resp = recaptcha_check_answer ($config['recaptchaPrivateKey'],
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
72 $_SERVER["REMOTE_ADDR"],
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
73 $_POST["recaptcha_challenge_field"],
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
74 $_POST["recaptcha_response_field"]);
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
75 if ($resp->is_valid)
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
76 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
77 $registration_backend->init($config);
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
78 $user = $_POST['username'];
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
79 $pass = $_POST['password'];
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
80 $pass2 = $_POST['password2'];
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
81
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
82 $ok = true;
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
83
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
84 if (!$user)
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
85 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
86 echo '<p>Sorry, you didn\'t tell us which username you want! Please <a href="./">go back</a> and try again.</p>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
87 $ok = false;
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
88 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
89
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
90 if($pass !== $pass2)
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
91 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
92 echo '<p>The two passwords you typed are not the same, please <a href="./">go back</a> and try more carefully! :-)</p>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
93 $ok = false;
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
94 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
95
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
96 if($ok)
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
97 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
98 if(!mb_check_encoding($user, 'UTF-8') || !mb_check_encoding($pass, 'UTF-8'))
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
99 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
100 echo '<p>Sorry, your browser sent an invalid form entry. Try removing special characters from your username/password.</p>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
101 echo '<p>Alternatively please try a different browser and re-submit <a href="./">the form</a>.</p>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
102 $ok = false;
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
103 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
104 else
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
105 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
106 $user = mb_strtolower($user, 'UTF-8');
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
107 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
108 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
109
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
110 // Check that username is valid for a JID
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
111 if ($ok && strlen($user) > 255)
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
112 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
113 echo '<p>Sorry, the username you entered is waaaaay too long. <a href="./">Please try</a> something shorter!</p>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
114 $ok = false;
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
115 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
116
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
117 if ($ok)
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
118 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
119 if (strcspn($user, "\"&'/:<>@".chr(127)) !== strlen($user))
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
120 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
121 echo '<p>Sorry, that username contains invalid characters (such as &, <, >, / etc.). Please remove them and <a href="./">try again</a>.</p>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
122 echo strcspn($user, "\"&'/:<>@".chr(127))." vs ".strlen($user);
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
123 $ok = false;
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
124 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
125 else if (strpos($user, chr(255).chr(254)) || strpos($user, chr(255.255)))
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
126 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
127 echo '<p>Sorry, that username contains invalid characters. Please remove them and <a href="./">try again</a>.</p>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
128 $ok = false;
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
129 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
130 else
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
131 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
132 $charfreq = array_keys(count_chars($user, 1));
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
133 if (min($charfreq) <= 32)
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
134 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
135 echo '<p>Sorry, that username contains invalid characters. For example you cannot use spaces in a username. Please <a href="./">go back</a>, remove them, and try again.</p>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
136 $ok = false;
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
137 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
138 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
139
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
140 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
141
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
142 if ($ok && (strlen($pass) < 6))
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
143 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
144 echo '<p>Your password isn\'t long enough. It needs to be at least 6 characters long, to make sure that it can\'t be easily guessed. <a href="./">Go back</a> and try again.</p>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
145 $ok = false;
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
146 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
147
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
148 if ($ok)
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
149 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
150 $backend_message = $registration_backend->validate($user, $pass);
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
151 if($backend_message)
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
152 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
153 echo "<p>".htmlentities($backend_message)." Please <a href='./'>go back</a> and try again.</p>";
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
154 $ok = false;
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
155 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
156 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
157
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
158 // Check that username does not already exist
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
159 if ($ok)
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
160 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
161 if($registration_backend->exists($user))
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
162 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
163 echo '<p>A user with that name already exists, please <a href="./">go back</a> and choose a different username.</p>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
164 $ok = false;
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
165 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
166 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
167
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
168 if ($ok)
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
169 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
170 $result = $registration_backend->create($user, $pass);
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
171 if ($result)
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
172 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
173 echo '<p>You successfully registered the Jabber ID<br/><b>'.$_POST["username"].'@'.$config['host'].'</b></p>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
174 echo "<div style='text-align:left;'>";
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
175 echo "<p>If you haven't already, now is a good time to ";
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
176 echo "<a href='http://www.jabber.org/index.php/download-a-client/'>download a client</a> which you can ";
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
177 echo 'use to log into your new account.</p>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
178 echo '<p>Wondering what you can do with your new <a href="'.$config['website'].'">'.$config['host'].'</a> account? ';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
179 echo 'Here are some services at which you can use your Jabber ID:</p>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
180 echo '<ul>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
181 echo '<li><a href="http://identi.ca/">identi.ca</a> - Open microblogging service</li>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
182 echo '<li><a href="http://speeqe.com/">Speeqe</a> - Web-based Jabber chatrooms</li>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
183 echo '</ul>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
184 echo '<p><b>Did you know?</b> <a href="http://www.google.com/talk/">Google Talk</a> is one of the many other ';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
185 echo '<a href="http://xmpp.org/services/">Jabber-compatible services</a>, which ';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
186 echo 'means you can add your Gmail and Google Apps friends directly to your '.ucfirst($config['host']).' contact list!</p>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
187 echo '</div>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
188 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
189 else
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
190 echo '<p>There was a problem creating your account. If the problem persists, please <a href="http://speeqe.com/room/jabber@conference.jabber.org/">contact us</a>.</p>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
191 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
192 $registration_backend->close();
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
193 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
194 else
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
195 {
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
196 echo '<p>Sorry, the CAPTCHA text you entered was incorrect, please <a href="./">go back</a> and try again.</p>';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
197 if($config['debug'])
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
198 echo '('.$resp->error.')';
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
199 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
200 }
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
201 ?>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
202
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
203 </div>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
204 <?php @include('themes/'.$config['theme'].'/footer.php'); ?>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
205 </body>
472198dc918e Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
206 </html>

mercurial