function WriteAuditTrailOnLogout($usr) { global $Language; ew_WriteAuditTrail("log", ew_StdCurrentDateTime(), ew_ScriptName(), $usr, $Language->Phrase("AuditTrailLogout"), ew_CurrentUserIP(), "", "", "", ""); }
function ew_WriteAuditTrailOnLogInOut($usr, $logtype) { ew_WriteAuditTrail("log", ew_StdCurrentDateTime(), ew_ScriptName(), $usr, $logtype, ew_CurrentUserIP(), "", "", "", ""); }
function EditRow() { global $Security, $Language; $sFilter = $this->KeyFilter(); $sFilter = $this->ApplyUserIDFilters($sFilter); $conn =& $this->Connection(); $this->CurrentFilter = $sFilter; $sSql = $this->SQL(); $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; $rs = $conn->Execute($sSql); $conn->raiseErrorFn = ''; if ($rs === FALSE) { return FALSE; } if ($rs->EOF) { $this->setFailureMessage($Language->Phrase("NoRecord")); // Set no record message $EditRow = FALSE; // Update Failed } else { // Save old values $rsold =& $rs->fields; $this->LoadDbValues($rsold); $rsnew = array(); // name $this->name->SetDbValueDef($rsnew, $this->name->CurrentValue, "", $this->name->ReadOnly); // email $this->_email->SetDbValueDef($rsnew, $this->_email->CurrentValue, "", $this->_email->ReadOnly); // joined $this->joined->SetDbValueDef($rsnew, ew_CurrentUserIP(), 0); $rsnew['joined'] =& $this->joined->DbValue; // facebook $this->facebook->SetDbValueDef($rsnew, $this->facebook->CurrentValue, NULL, $this->facebook->ReadOnly); // twitter $this->twitter->SetDbValueDef($rsnew, $this->twitter->CurrentValue, NULL, $this->twitter->ReadOnly); // twitch $this->twitch->SetDbValueDef($rsnew, $this->twitch->CurrentValue, NULL, $this->twitch->ReadOnly); // skype $this->skype->SetDbValueDef($rsnew, $this->skype->CurrentValue, NULL, $this->skype->ReadOnly); // birthday $this->birthday->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->birthday->CurrentValue, 5), NULL, $this->birthday->ReadOnly); // profession $this->profession->SetDbValueDef($rsnew, $this->profession->CurrentValue, NULL, $this->profession->ReadOnly); // game_type $this->game_type->SetDbValueDef($rsnew, $this->game_type->CurrentValue, NULL, $this->game_type->ReadOnly); // division $this->division->SetDbValueDef($rsnew, $this->division->CurrentValue, NULL, $this->division->ReadOnly); // has_expansion $this->has_expansion->SetDbValueDef($rsnew, $this->has_expansion->CurrentValue, "", $this->has_expansion->ReadOnly); // notes $this->notes->SetDbValueDef($rsnew, $this->notes->CurrentValue, NULL, $this->notes->ReadOnly); // Call Row Updating event $bUpdateRow = $this->Row_Updating($rsold, $rsnew); if ($bUpdateRow) { $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; if (count($rsnew) > 0) { $EditRow = $this->Update($rsnew, "", $rsold); } else { $EditRow = TRUE; } // No field to update $conn->raiseErrorFn = ''; if ($EditRow) { } } else { if ($this->getSuccessMessage() != "" || $this->getFailureMessage() != "") { // Use the message, do nothing } elseif ($this->CancelMessage != "") { $this->setFailureMessage($this->CancelMessage); $this->CancelMessage = ""; } else { $this->setFailureMessage($Language->Phrase("UpdateCancelled")); } $EditRow = FALSE; } } // Call Row_Updated event if ($EditRow) { $this->Row_Updated($rsold, $rsnew); } $rs->Close(); return $EditRow; }
function AutoLogin() { if (@$_COOKIE[EW_PROJECT_NAME]['AutoLogin'] == "autologin") { $usr = ew_Decrypt(@$_COOKIE[EW_PROJECT_NAME]['Username']); $pwd = ew_Decrypt(@$_COOKIE[EW_PROJECT_NAME]['Password']); $AutoLogin = $this->ValidateUser($usr, $pwd, TRUE); if ($AutoLogin) { ew_WriteAuditTrail("log", ew_StdCurrentDateTime(), ew_ScriptName(), $usr, $GLOBALS["Language"]->Phrase("AuditTrailAutoLogin"), ew_CurrentUserIP(), "", "", "", ""); } } else { $AutoLogin = FALSE; } return $AutoLogin; }