Example #1
0
function sendActivation($id, $logJoin)
{
    require 'variables.php';
    require 'variablesdb.php';
    require_once 'log/KLogger.php';
    $msg = "";
    $logJoin->logInfo('sendActivation: autoApprove=' . $autoApprove);
    $msg .= "autoApprove=" . $autoApprove;
    if ($autoApprove > 0) {
        $sql = "SELECT mail, name, signup from {$playerstable} where player_id = '{$id}'";
        $logJoin->logInfo('sendActivation: sql=' . $sql);
        $result = mysql_query($sql);
        $row = mysql_fetch_array($result);
        $toAddress = $row['mail'];
        $name = $row['name'];
        $signupHash = $row['signup'];
        $msg .= "<br>signupHash=" . $signupHash;
        if (!empty($signupHash)) {
            $link = "http://www." . $leaguename . "/activate.php?id=" . $signupHash;
            $res = sendActivationLinkMail($toAddress, $name, $link);
            $logJoin->logInfo('sendActivation: res=' . $res);
            $update_sql = "UPDATE {$playerstable} SET signupSent=1 WHERE player_id = '" . $id . "'";
            $update_result = mysql_query($update_sql);
            $logJoin->logInfo('sendActivation: update_result=' . $update_result);
            $msg .= "<br>sent activation: toAddress=" . $toAddress . " name=" . $name;
        }
    }
    return $msg;
}
Example #2
0
  for ($i = 0; $i < sizeof($rejectReasonsSelect); $i++) {
    
    $id = $ids[$i];
    $rejectId = $rejectIds[$i];
    $rejectReasonText = $rejectReasonsText[$i];
    $rejectReasonSelect = $rejectReasonsSelect[$i];

    if (!empty($id)) {
      $approveMsg .= "<p>";
      $sql = "SELECT mail, name, signup from $playerstable where player_id = '$id'";
      $result = mysql_query($sql);
      $row = mysql_fetch_array($result);
      $toAddress = $row['mail'];
      $name = $row['name'];
      $link = "http://www.yoursite/activate.php?id=".$row['signup'];
      $res = sendActivationLinkMail($toAddress, $name, $link);
      $approveMsg .= "Activation mail: <b>".$name."</b> - Address: ".$toAddress." - Result: ".$res."<br>";
      $update_sql = "UPDATE $playerstable SET signupSent=1 WHERE player_id = '".$id."'";
      $update_result = mysql_query($update_sql);
      $approveMsg .= "</p>";
    } elseif (!empty($rejectId)) {
      if (!empty($rejectReasonSelect)) {
        $reason = $rejectReasonSelect;
        if (!empty($rejectReasonText)) {
          $reason .= " (".$rejectReasonText.")";
        }
      } else {
       $reason = $rejectReasonText;
      }
      $approveMsg .= "<p>";
      $sql = "UPDATE $playerstable SET rejected=1, rejectReason='".$reason."' WHERE player_id = '$rejectId'";
Example #3
0
                                             }
                                         }
                                     }
                                 }
                                 if (!empty($_FILES['picture']['size']) && !$copywork) {
                                     // echo "<p>Upload failed.</p>";
                                 } else {
                                     $sql = "UPDATE {$playerstable} SET alias = '{$alias1}',  " . "mail = '{$mail1}', icq = '{$icq1}', " . "aim = '{$aim1}', msn = '{$msn1}', country = '{$country1}', nationality = '{$nationality1}', " . "passworddb = '', pwd='{$pwd}', forum='{$forum1}', sendGamesMail = '{$gamesMail1}', " . "uploadSpeed = '{$uploadSpeed1}', downloadSpeed = '{$downloadSpeed1}', " . "sendDeductMail = '{$deductMail1}', " . "sendNewsletter = '{$newsletter1}', " . "message = '{$message1}', versions = '{$versions1}', " . "defaultversion='{$defaultversion1}', favteam1='{$favteam11}', favteam2 = '{$favteam21}', " . "serial5='{$serial5}', hash5='{$hash5}', serial6='{$serial6}', hash6='{$hash6}', invalidEmail=0 WHERE name='{$cookie_name}'";
                                     $result = mysql_query($sql);
                                     $logEdit->logInfo('Profile saved, name=' . $cookie_name . ' pwd=' . $passworddb);
                                     $logEdit->logInfo('sql=' . $sql);
                                     echo "<p>Your changes have been saved.</p>";
                                     echo "<p>You may need to log in again for changes to take effect.</p>";
                                     if ($mail1 != $maildb && $rejected == 0 && $approved == 'no' && $signupSent == 1 && !$inactiveAndBanned) {
                                         $link = "http://www.yoursite/activate.php?id=" . $signup;
                                         $res = sendActivationLinkMail($mail1, $name, $link);
                                         echo "<p>An account activation link has been sent to <b>" . $mail1 . "</b>.</p>";
                                     }
                                 }
                             } else {
                                 echo "<p>The email address you entered is already in use by another account. Please note that only one account per player is allowed.</p>" . $back;
                             }
                         } else {
                             echo "<p>We couldn't find you in the database. Please try again or contact the admin if the problem persists.</p>" . $back;
                         }
                     }
                 }
             }
         }
     }
 }