summaryrefslogtreecommitdiffstats
path: root/activate.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-01-03 02:08:28 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-01-03 02:08:28 +0000
commit47b5a2f404ef54ea4365fdcf258301e7d572d198 (patch)
treeea117fd7a07b539e1f86147cf4d699d304c8885e /activate.php
parent959f1e9a9d1eafe3757b5d820b58aaefb8d047e7 (diff)
downloadampache-47b5a2f404ef54ea4365fdcf258301e7d572d198.tar.gz
ampache-47b5a2f404ef54ea4365fdcf258301e7d572d198.tar.bz2
ampache-47b5a2f404ef54ea4365fdcf258301e7d572d198.zip
finished up the registration mojo... think it all works famous last words..
Diffstat (limited to 'activate.php')
-rw-r--r--activate.php46
1 files changed, 23 insertions, 23 deletions
diff --git a/activate.php b/activate.php
index 8508b2c9..61d0d0d5 100644
--- a/activate.php
+++ b/activate.php
@@ -22,34 +22,34 @@
$no_session = true;
require_once( "modules/init.php" );
+
+/* Keep them out if they shouldn't be here */
if(!conf('allow_public_registration') || conf('demo_mode')) {
access_denied();
}
-// Access Control
-echo "<html><head>";
+?>
+<html><head>
show_template('style');
-echo "<head><body>";
-
-
-$username = $_GET['u'];
-$validation = $_GET['act_key'];
-$user = new User($username);
-$val1 = $GLOBALS['user']->get_user_validation($username,$validation);
-if (!$val1){
- $GLOBALS['error']->add_error('no_such_user',_("No user with this name registered"));
- $GLOBALS['error']->print_error('no_such_user');
- echo "</body></html>";
- break;
+<head><body>
+<?php
+
+$username = scrub_in($_GET['u']);
+$validation = scrub_in($_GET['act_key']);
+$val1 = $GLOBALS['user']->get_user_validation($username,$validation);
+
+if (!$val1) {
+ $GLOBALS['error']->add_error('no_such_user',_("No user with this name registered"));
+ $GLOBALS['error']->print_error('no_such_user');
}
-if ($val1 != $validation) {
- $GLOBALS['error']->add_error('validation_failed',_("The validation key used isn't correct."));
- $GLOBALS['error']->print_error('validation_failed');
- echo "</body></html>";
- break;
+elseif ($val1 != $validation) {
+ $GLOBALS['error']->add_error('validation_failed',_("The validation key used isn't correct."));
+ $GLOBALS['error']->print_error('validation_failed');
}
-$activate = $GLOBALS['user']->activate_user($username);
-show_confirmation('User activated','This User ID is activated and can be used','/login.php');
-echo "</body></html>";
-
+else {
+ $activate = $GLOBALS['user']->activate_user($username);
+ show_confirmation(_('User activated'),_('This User ID is activated and can be used'),'/login.php');
+}
?>
+</body>
+</html>