Last active
December 21, 2015 01:55
-
-
Save ProtoJazz/bb8a31119f2142fe8e61 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| list($SessionID, $UserID) = explode("|~|", $Enc->decrypt($LoginCookie)); | |
| $DB->query(" | |
| SELECT | |
| SessionID, | |
| Browser, | |
| OperatingSystem, | |
| IP, | |
| LastUpdate, | |
| i.AdminComment | |
| FROM users_sessions | |
| JOIN users_info AS i ON i.UserID = $UserID | |
| WHERE SessionID = '$SessionID'"); | |
| list($ThisSessionID, $Browser, $OperatingSystem, $IP, $LastUpdate, $oldComment) = $DB->next_record(); | |
| $date = date('Y/m/d H:i:s'); | |
| $countryCode = Tools::geoip($IP); | |
| $infoToAdd = $date . " - " . " User sent invite to " . $CurEmail . " from " . $IP . "(" . $countryCode . ")" . " using " . $Browser . "\n" . $infoDump; | |
| $newComment = db_string($oldComment . " " . "\n" . $infoToAdd); | |
| $DB->query(" | |
| INSERT INTO invites | |
| (InviterID, InviteKey, Email, Expires, Reason) | |
| VALUES | |
| ('$LoggedUser[ID]', '$InviteKey', '" . db_string($CurEmail) . "', '$InviteExpires', '$InviteReason')"); | |
| $DB->query(" | |
| UPDATE users_info | |
| SET AdminComment ='$newComment' | |
| WHERE UserID = '$LoggedUser[ID]'"); | |
| if (!check_perms('site_send_unlimited_invites')) { | |
| $DB->query(" | |
| UPDATE users_main | |
| SET Invites = GREATEST(Invites, 1) - 1 | |
| WHERE ID = '$LoggedUser[ID]'"); | |
| $Cache->begin_transaction('user_info_heavy_' . $LoggedUser['ID']); | |
| $Cache->update_row(false, array('Invites' => '-1')); | |
| $Cache->commit_transaction(0); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment