예제 #1
0
파일: actions.php 프로젝트: pari/rand0m
     exit;
     break;
 case 'sendUserInvitation':
     $fName = get_POST_var("fname");
     $lName = get_POST_var("lname");
     $eMail = get_POST_var("email");
     $msg = get_POST_var("msg");
     $roomid = '';
     $MU = new ManageUsers();
     $MU->userId = $CURRENT_USERID;
     $existingEmail = $MU->checkFor_User_Email_Existence($eMail);
     if ($existingEmail) {
         send_Action_Response('Fail', 'Email already exists !');
         exit;
     }
     $invi_key = $MU->createUnique_InviteID(32);
     $invi_id = $MU->insert_Invitaion($fName, $lName, $msg, $eMail, $USERNAME, $roomid, $invi_key);
     $invi_url = APPURL . "/invitations.php?id=" . $invi_id . "&key=" . $invi_key;
     $subject = "You're invited to join " . APPNAME;
     $message = '<h2>You\'re invited to join ' . APPNAME . ', our group chat system</h2><br/>';
     $message .= 'Hi ' . $fName . ' ' . $lName . ', <br/>';
     $message .= $_SESSION["emplFullName"] . ' just set up an account for you.<br/>';
     $message .= 'All you need to do is choose a username and password.<br/>It only takes a few seconds.';
     $message .= 'Click this link to get started:<br/>';
     $message .= '<a href="' . $invi_url . '">' . $invi_url . '</a><br/>';
     $message .= $_SESSION["emplFullName"] . ' says:<br/>';
     $message .= nl2br($msg);
     $msg_ack = sendMailUsingMailer($eMail, $subject, $message);
     if ($msg_ack == 'Letter is sent') {
         send_Action_Response('Success', $mailack);
     }