Move session->env->getIp into session->request->address
This commit is contained in:
parent
565cf955d7
commit
005b9da1ac
20 changed files with 49 additions and 48 deletions
|
|
@ -830,7 +830,7 @@ sub hasRated {
|
|||
return 1 if $self->isPoster;
|
||||
my $flag = 0;
|
||||
if ($self->session->user->isVisitor) {
|
||||
($flag) = $self->session->db->quickArray("select count(*) from Post_rating where assetId=? and ipAddress=?",[$self->getId, $self->session->env->getIp]);
|
||||
($flag) = $self->session->db->quickArray("select count(*) from Post_rating where assetId=? and ipAddress=?",[$self->getId, $self->session->request->address]);
|
||||
} else {
|
||||
($flag) = $self->session->db->quickArray("select count(*) from Post_rating where assetId=? and userId=?",[$self->getId, $self->session->user->userId]);
|
||||
}
|
||||
|
|
@ -895,7 +895,7 @@ sub insertUserPostRating {
|
|||
$self->session->db->write("insert into Post_rating (assetId,userId,ipAddress,dateOfRating,rating) values (?,?,?,?,?)",
|
||||
[$self->getId,
|
||||
$self->session->user->userId,
|
||||
$self->session->env->getIp,
|
||||
$self->session->request->address,
|
||||
time(),
|
||||
$rating,]
|
||||
);
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ sub _hasVoted {
|
|||
my $self = shift;
|
||||
my ($hasVoted) = $self->session->db->quickArray("select count(*) from Poll_answer
|
||||
where assetId=".$self->session->db->quote($self->getId)." and ((userId=".$self->session->db->quote($self->session->user->userId)."
|
||||
and userId<>'1') or (userId=".$self->session->db->quote($self->session->user->userId)." and ipAddress='".$self->session->env->getIp."'))");
|
||||
and userId<>'1') or (userId=".$self->session->db->quote($self->session->user->userId)." and ipAddress='".$self->session->request->address."'))");
|
||||
return $hasVoted;
|
||||
}
|
||||
|
||||
|
|
@ -545,7 +545,7 @@ sub www_vote {
|
|||
my $self = shift;
|
||||
my $u;
|
||||
if ($self->session->form->process("answer") ne "" && $self->session->user->isInGroup($self->get("voteGroup")) && !($self->_hasVoted())) {
|
||||
$self->setVote($self->session->form->process("answer"),$self->session->user->userId,$self->session->env->getIp);
|
||||
$self->setVote($self->session->form->process("answer"),$self->session->user->userId,$self->session->request->address);
|
||||
if ($self->session->setting->get("useKarma")) {
|
||||
$self->session->user->karma($self->get("karmaPerVote"),"Poll (".$self->getId.")","Voted on this poll.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2045,7 +2045,7 @@ sub responseId {
|
|||
my $ignoreRevisionDate = $opts{ignoreRevisionDate};
|
||||
|
||||
my $user = WebGUI::User->new( $self->session, $userId );
|
||||
my $ip = $self->session->env->getIp;
|
||||
my $ip = $self->session->request->address;
|
||||
|
||||
my $responseId = $self->{responseId};
|
||||
return $responseId if $responseId;
|
||||
|
|
@ -2178,7 +2178,7 @@ sub canTakeSurvey {
|
|||
}
|
||||
|
||||
my $maxResponsesPerUser = $self->maxResponsesPerUser;
|
||||
my $ip = $self->session->env->getIp;
|
||||
my $ip = $self->session->request->address;
|
||||
my $userId = $self->session->user->userId();
|
||||
my $takenCount = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -565,7 +565,7 @@ sub editThingDataSave {
|
|||
if ($thingDataId eq "new"){
|
||||
$thingData{dateCreated} = time();
|
||||
$thingData{createdById} = $session->user->userId;
|
||||
$thingData{ipAddress} = $session->env->getIp;
|
||||
$thingData{ipAddress} = $session->request->address;
|
||||
}
|
||||
else {
|
||||
%thingData = $session->db->quickHash("select * from ".$session->db->dbh->quote_identifier("Thingy_".$thingId)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue