Example #1
0
     $membersize = 1;
 }
 // validate all members
 $errorString = "";
 if ($_POST['token'] != $_SESSION['token']) {
     $errorString[] = "Invalid token! (what are you doing??)<br />";
 }
 $token_age = time() - $_SESSION['token_time'];
 // force to resubmit after 5 minutes
 if ($token_age > 300) {
     $errorString[] = "Timout value exceeded, resubmit<br />";
 }
 for ($i = 1; $i < $membersize + 1; $i++) {
     $uid = false;
     // first check email for existing user
     if (!is_rfc3696_valid_email_address($_POST["invite-email-{$i}"]) && !empty($_POST["invite-email-{$i}"])) {
         $errorString[] = "Not a valid email address for number {$i}<br />";
     }
     if (email_exists($_POST["invite-email-{$i}"]) && !empty($_POST["invite-email-{$i}"])) {
         // $errorString .= "<b>Error:</b> Email address already in use for number $i<br />";
         // user is already registered, take that user_id by storing it in temp array
         $uid = get_userid_by_email($_POST["invite-email-{$i}"]);
         $existing_users[$uid] = $_POST["invite-email-{$i}"];
     }
     // ignore empty field sets
     if (empty($_POST["invite-name-{$i}"]) && !empty($_POST["invite-email-{$i}"]) && !$uid) {
         $errorString[] = "Name is mandatory, but only email given for number {$i}<br />";
     } elseif (!empty($_POST["invite-name-{$i}"])) {
         if (!is_valid_real_name($_POST["invite-name-{$i}"])) {
             $errorString[] = "Invalid name for number {$i}<br />";
         } elseif (realname_exists($_POST["invite-name-{$i}"])) {
Example #2
0
 }
 $token_age = time() - $_SESSION['token_time'];
 // force to resubmit after 5 minutes
 if ($token_age > 300) {
     $errorString[] = "Timout value exceeded, resubmit<br />";
 }
 if ($_POST['realname'] != $user->data['real_name'] && !is_valid_real_name($_POST['realname']) && $_POST['realname'] != "") {
     $errorString[] = "Invalid name";
 }
 if (!is_curr_password($_POST['curpassword'], $user)) {
     $errorString[] = "Current password not correct";
 }
 if (!is_valid_password($_POST['passwordx'], $_POST['password2']) && ($_POST['passwordx'] != "" || $_POST['password2'] != "")) {
     $errorString[] = "Passwords do not match or are not of required length";
 }
 if ($_POST['email'] != $user->data['email'] && !is_rfc3696_valid_email_address($_POST['email']) && $_POST['email'] != "") {
     $errorString[] = "Invalid email address";
 }
 if ($_POST['email'] != $user->data['email'] && email_exists($_POST['email'], true)) {
     $errorString[] = "Email address already in use";
 }
 if ($_POST['name_format'] != $user->data['name_format']) {
     if ($_POST['name_format'] > 4 || $_POST['name_format'] < 1) {
         $errorString[] = "Invalid name format! (what are you doing?)";
     }
 }
 if (!is_valid_amount($_POST['amount']) && strtolower($_POST['amount']) != "always" && $_POST['amount'] != "" && $_POST['amount'] != "0" && $_POST['email_notify']) {
     $errorString[] = "Invalid notify amount";
 }
 if (!empty($errorString)) {
     $editprofile = true;
Example #3
0
 $errorString = "";
 if (!is_valid_name($_POST['username'])) {
     $errorString[] = "Invalid username";
 }
 if (!is_valid_real_name($_POST['realname'])) {
     $errorString[] = "Invalid name";
 } elseif (username_exists($_POST['username'])) {
     $errorString[] = "Username already in use";
 }
 /* elseif (realname_exists($_POST['realname'])) {
    $errorString[] = "Name already in use";
    } */
 if (!is_valid_password($_POST['password'], $_POST['password2'])) {
     $errorString[] = "Passwords do not match or are not of required length";
 }
 if (!is_rfc3696_valid_email_address($_POST['email'])) {
     $errorString[] = "Invalid email address";
 }
 if (email_exists($_POST['email'], true)) {
     $errorString[] = "Email address already in use";
 }
 if (!empty($_POST['code']) && !regcode_exists($_POST['code'])) {
     $errorString[] = "Supplied registration code is not recognized or expired.";
 }
 /* if (!is_valid_group($_POST['group_id'])) {
    $errorString .= "Invalid group! (how is this possible?) <br />";
    } */
 if (!empty($errorString)) {
     $showregisterform = true;
 } else {
     // no errors, register user