mark $session->datetime->time as deprecated and remove its use from core code
This commit is contained in:
parent
5ecc986ec6
commit
60a4a9b140
56 changed files with 94 additions and 92 deletions
|
|
@ -2344,7 +2344,7 @@ sub publish {
|
|||
my $assetIds = $self->session->db->buildArrayRef("select assetId from asset where lineage like ".$self->session->db->quote($self->get("lineage").'%')." $where");
|
||||
my $idList = $self->session->db->quoteAndJoin($assetIds);
|
||||
|
||||
$self->session->db->write("update asset set state='published', stateChangedBy=".$self->session->db->quote($self->session->user->userId).", stateChanged=".$self->session->datetime->time()." where assetId in (".$idList.")");
|
||||
$self->session->db->write("update asset set state='published', stateChangedBy=".$self->session->db->quote($self->session->user->userId).", stateChanged=".time()." where assetId in (".$idList.")");
|
||||
my $cache = WebGUI::Cache->new($self->session);
|
||||
foreach my $id (@{$assetIds}) {
|
||||
# we do the purge directly cuz it's a lot faster than instantiating all these assets
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ sub getEditForm {
|
|||
$tabform->getTab("properties")->readOnly(
|
||||
-label=>$i18n->get('thumbnail'),
|
||||
-hoverHelp=>$i18n->get('Thumbnail description'),
|
||||
-value=>'<a href="'.$self->getFileUrl.'"><img src="'.$self->getThumbnailUrl.'?noCache='.$self->session->datetime->time().'" alt="thumbnail" /></a>'
|
||||
-value=>'<a href="'.$self->getFileUrl.'"><img src="'.$self->getThumbnailUrl.'?noCache='.time().'" alt="thumbnail" /></a>'
|
||||
);
|
||||
my ($x, $y) = $self->getStorageLocation->getSizeInPixels($self->get("filename"));
|
||||
$tabform->getTab("properties")->readOnly(
|
||||
|
|
|
|||
|
|
@ -597,7 +597,7 @@ sub setRatings {
|
|||
if ($ratings->{$category}) {
|
||||
$db->write("insert into MatrixListing_rating
|
||||
(userId, category, rating, timeStamp, listingId, ipAddress, assetId) values (?,?,?,?,?,?,?)",
|
||||
[$session->user->userId,$category,$ratings->{$category},$session->datetime->time(),$self->getId,
|
||||
[$session->user->userId,$category,$ratings->{$category},time(),$self->getId,
|
||||
$session->env->get("HTTP_X_FORWARDED_FOR"),$matrixId]);
|
||||
}
|
||||
my $sql = "from MatrixListing_rating where listingId=? and category=?";
|
||||
|
|
|
|||
|
|
@ -891,7 +891,7 @@ sub insertUserPostRating {
|
|||
[$self->getId,
|
||||
$self->session->user->userId,
|
||||
$self->session->env->getIp,
|
||||
$self->session->datetime->time(),
|
||||
time(),
|
||||
$rating,]
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -414,11 +414,11 @@ sub www_setStatus {
|
|||
$db->write("delete from InOutBoard_status where userId=? and assetId=?", [ $sessionUserId, $self->getId ]);
|
||||
$db->write(
|
||||
"insert into InOutBoard_status (assetId,userId,status,dateStamp,message) values (?,?,?,?,?)",
|
||||
[$self->getId, $sessionUserId, $status, $session->datetime->time(), $message ],
|
||||
[$self->getId, $sessionUserId, $status, time(), $message ],
|
||||
);
|
||||
$db->write(
|
||||
"insert into InOutBoard_statusLog (assetId,userId,createdBy,status,dateStamp,message) values (?,?,?,?,?,?)",
|
||||
[$self->getId, $sessionUserId, $session->user->userId, $status, $session->datetime->time(), $message ],
|
||||
[$self->getId, $sessionUserId, $session->user->userId, $status, time(), $message ],
|
||||
);
|
||||
}
|
||||
else {
|
||||
|
|
@ -452,7 +452,7 @@ sub www_viewReport {
|
|||
-name=>"doit",
|
||||
-value=>"1"
|
||||
);
|
||||
my $startDate = $self->session->datetime->addToDate($self->session->datetime->time(),0,0,-15);
|
||||
my $startDate = $self->session->datetime->addToDate(time(),0,0,-15);
|
||||
$startDate = $self->session->form->date("startDate") if ($self->session->form->process("doit"));
|
||||
$f->date(
|
||||
-name=>"startDate",
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ sub cut {
|
|||
return undef if ($self->getId eq $session->setting->get("defaultPage") || $self->getId eq $session->setting->get("notFoundPage"));
|
||||
$session->db->beginTransaction;
|
||||
$session->db->write("update asset set state='clipboard-limbo' where lineage like ? and state='published'",[$self->get("lineage").'%']);
|
||||
$session->db->write("update asset set state='clipboard', stateChangedBy=?, stateChanged=? where assetId=?", [$session->user->userId, $session->datetime->time(), $self->getId]);
|
||||
$session->db->write("update asset set state='clipboard', stateChangedBy=?, stateChanged=? where assetId=?", [$session->user->userId, time(), $self->getId]);
|
||||
$session->db->commit;
|
||||
$self->{_properties}{state} = "clipboard";
|
||||
foreach my $asset ($self, @{$self->getLineage(['descendants'], {returnObjects => 1})}) {
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ sub exportAsHtml {
|
|||
my $i18n = WebGUI::International->new($self->session, 'Asset');
|
||||
|
||||
# take down when we started to tell the user how long the process took.
|
||||
my $startTime = $session->datetime->time;
|
||||
my $startTime = time;
|
||||
|
||||
# get the export path and ensure it is valid.
|
||||
my $exportPath = $self->exportCheckPath;
|
||||
|
|
@ -298,7 +298,7 @@ sub exportAsHtml {
|
|||
}
|
||||
|
||||
# we're done. give the user a status report.
|
||||
my $timeRequired = $session->datetime->time - $startTime;
|
||||
my $timeRequired = time - $startTime;
|
||||
my $message = sprintf $i18n->get('export information'), $exportedCount, $timeRequired;
|
||||
return $message;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ sub addChild {
|
|||
my $self = shift;
|
||||
my $properties = shift;
|
||||
my $id = shift || $self->session->id->generate();
|
||||
my $now = shift || $self->session->datetime->time();
|
||||
my $now = shift || time();
|
||||
my $options = shift;
|
||||
|
||||
# Check if it is possible to add a child to this asset. If not add it as a sibling of this asset.
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ sub trash {
|
|||
$db->beginTransaction;
|
||||
$outputSub->($i18n->get('Clearing asset tables'));
|
||||
$db->write("update asset set state='trash-limbo' where lineage like ?",[$self->get("lineage").'%']);
|
||||
$db->write("update asset set state='trash', stateChangedBy=?, stateChanged=? where assetId=?",[$session->user->userId, $session->datetime->time(), $self->getId]);
|
||||
$db->write("update asset set state='trash', stateChangedBy=?, stateChanged=? where assetId=?",[$session->user->userId, time(), $self->getId]);
|
||||
$db->commit;
|
||||
|
||||
# Update ourselves since we didn't use update()
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ A hash reference containing a list of properties to associate with the child.
|
|||
=head3 revisionDate
|
||||
|
||||
An epoch date representing the date/time stamp that this revision was
|
||||
created. Defaults to $self->session->datetime->time().
|
||||
created. Defaults to time().
|
||||
|
||||
=head3 options
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ Posts) will know not to send them under certain conditions.
|
|||
sub addRevision {
|
||||
my $self = shift;
|
||||
my $properties = shift || {};
|
||||
my $now = shift || $self->session->datetime->time();
|
||||
my $now = shift || time();
|
||||
my $options = shift;
|
||||
|
||||
my $autoCommitId = $self->getAutoCommitWorkflowId() unless ($options->{skipAutoCommitWorkflows});
|
||||
|
|
@ -573,7 +573,7 @@ sub updateHistory {
|
|||
my $session = $self->session;
|
||||
my $action = shift;
|
||||
my $userId = shift || $session->user->userId || '3';
|
||||
my $dateStamp =$session->datetime->time();
|
||||
my $dateStamp =time();
|
||||
$session->db->write("insert into assetHistory (assetId, userId, actionTaken, dateStamp, url) values (?,?,?,?,?)", [$self->getId, $userId, $action, $dateStamp, $self->get('url')]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ sub _isDuplicateUsername {
|
|||
my ($otherUser) = $self->session->db->quickArray("select count(*) from users where username=".$self->session->db->quote($username));
|
||||
return 0 if !$otherUser;
|
||||
my $i18n = WebGUI::International->new($self->session);
|
||||
$self->error('<li>'.sprintf($i18n->get(77), $username,$username,$username,$self->session->datetime->epochToHuman($self->session->datetime->time(),"%y")).'</li>');
|
||||
$self->error('<li>'.sprintf($i18n->get(77), $username,$username,$username,$self->session->datetime->epochToHuman(time(),"%y")).'</li>');
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -108,11 +108,11 @@ sub _logLogin {
|
|||
[
|
||||
$_[0],
|
||||
$_[1],
|
||||
$self->session->datetime->time(),
|
||||
time(),
|
||||
$self->session->env->getIp,
|
||||
$self->session->env->get("HTTP_USER_AGENT"),
|
||||
$self->session->getId,
|
||||
$self->session->datetime->time(),
|
||||
time(),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ sub createAccountSave {
|
|||
$properties->{ changeUsername } = $setting->get("webguiChangeUsername");
|
||||
$properties->{ changePassword } = $setting->get("webguiChangePassword");
|
||||
$properties->{ identifier } = $self->hashPassword($password);
|
||||
$properties->{ passwordLastUpdated } = $session->datetime->time();
|
||||
$properties->{ passwordLastUpdated } = time();
|
||||
$properties->{ passwordTimeout } = $setting->get("webguiPasswordTimeout");
|
||||
$properties->{ status } = 'Deactivated' if ($setting->get("webguiValidateEmail"));
|
||||
|
||||
|
|
@ -433,16 +433,16 @@ sub editUserFormSave {
|
|||
unless (!$identifier || $identifier eq "password") {
|
||||
$properties->{identifier} = $self->hashPassword($self->session->form->process('authWebGUI.identifier'));
|
||||
if($userData->{identifier} ne $properties->{identifier}){
|
||||
$properties->{passwordLastUpdated} =$self->session->datetime->time();
|
||||
$properties->{passwordLastUpdated} =time();
|
||||
}
|
||||
}
|
||||
$properties->{passwordTimeout} = $self->session->form->interval('authWebGUI.passwordTimeout');
|
||||
$properties->{changeUsername} = $self->session->form->process('authWebGUI.changeUsername');
|
||||
$properties->{changePassword} = $self->session->form->process('authWebGUI.changePassword');
|
||||
if($userId eq "new") {
|
||||
$properties->{passwordLastUpdated} =$self->session->datetime->time();
|
||||
$properties->{passwordLastUpdated} =time();
|
||||
if ($self->session->setting->get("webguiExpirePasswordOnCreation")){
|
||||
$properties->{passwordLastUpdated} =$self->session->datetime->time() - $properties->{passwordTimeout};
|
||||
$properties->{passwordLastUpdated} =time() - $properties->{passwordTimeout};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -753,7 +753,7 @@ sub login {
|
|||
my $userData = $self->getParams;
|
||||
if($self->getSetting("passwordTimeout") && $userData->{passwordTimeout}){
|
||||
my $expireTime = $userData->{passwordLastUpdated} + $userData->{passwordTimeout};
|
||||
if ($self->session->datetime->time() >= $expireTime){
|
||||
if (time() >= $expireTime){
|
||||
my $userId = $self->userId;
|
||||
$self->logout;
|
||||
return $self->resetExpiredPassword($userId);
|
||||
|
|
@ -1031,7 +1031,7 @@ sub profileRecoverPasswordFinish {
|
|||
$self->user( $user );
|
||||
$self->saveParams($userId, $self->authMethod,
|
||||
{ identifier => $self->hashPassword($password),
|
||||
passwordLastUpdated => $self->session->datetime->time });
|
||||
passwordLastUpdated => time });
|
||||
$self->_logSecurityMessage;
|
||||
return $self->SUPER::login;
|
||||
} else {
|
||||
|
|
@ -1182,7 +1182,7 @@ sub emailResetPasswordFinish {
|
|||
$self->user(WebGUI::User->new($self->session, $userId));
|
||||
$self->saveParams($userId, $self->authMethod,
|
||||
{ identifier => $self->hashPassword($password),
|
||||
passwordLastUpdated => $self->session->datetime->time });
|
||||
passwordLastUpdated => time });
|
||||
$self->_logSecurityMessage;
|
||||
|
||||
# delete the emailRecoverPasswordVerificationNumber
|
||||
|
|
@ -1236,7 +1236,7 @@ sub resetExpiredPasswordSave {
|
|||
return $self->resetExpiredPassword($u->userId, "<h1>".$i18n->get(70)."</h1><ul>".$error.'</ul>') if ($error);
|
||||
|
||||
$properties->{identifier} = $self->hashPassword($self->session->form->process("identifier"));
|
||||
$properties->{passwordLastUpdated} =$self->session->datetime->time();
|
||||
$properties->{passwordLastUpdated} =time();
|
||||
|
||||
$self->saveParams($u->userId,$self->authMethod,$properties);
|
||||
$self->_logSecurityMessage();
|
||||
|
|
@ -1314,7 +1314,7 @@ sub updateAccount {
|
|||
$properties->{identifier} = $self->hashPassword($password);
|
||||
$self->_logSecurityMessage();
|
||||
if($userData->{identifier} ne $properties->{identifier}){
|
||||
$properties->{passwordLastUpdated} =$self->session->datetime->time();
|
||||
$properties->{passwordLastUpdated} =time();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ sub definition {
|
|||
|
||||
push(@{$definition}, {
|
||||
defaultValue=>{
|
||||
defaultValue=>$session->datetime->time()
|
||||
defaultValue=>time()
|
||||
},
|
||||
maxlength=>{
|
||||
defaultValue=> 10
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ sub definition {
|
|||
my $definition = shift || [];
|
||||
push(@{$definition}, {
|
||||
defaultValue=>{
|
||||
defaultValue=>$session->datetime->time()
|
||||
defaultValue=>time()
|
||||
},
|
||||
maxlength=>{
|
||||
defaultValue=> 19
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ sub _defaults {
|
|||
my $self = shift;
|
||||
return {
|
||||
groupId=>"new",
|
||||
dateCreated=>$self->session->datetime->time(),
|
||||
dateCreated=>time(),
|
||||
expireOffset=>314496000,
|
||||
karmaThreshold=>1000000000,
|
||||
groupName=>"New Group",
|
||||
|
|
@ -101,7 +101,7 @@ sub _defaults {
|
|||
expireNotify=>0,
|
||||
databaseLinkId=>0,
|
||||
groupCacheTimeout=>3600,
|
||||
lastUpdated=>$self->session->datetime->time(),
|
||||
lastUpdated=>time(),
|
||||
autoAdd=>0,
|
||||
autoDelete=>0,
|
||||
isEditable=>1,
|
||||
|
|
@ -168,10 +168,10 @@ sub addUsers {
|
|||
foreach my $uid (@{$users}) {
|
||||
my ($isIn) = $self->session->db->quickArray("select count(*) from groupings where groupId=? and userId=?", [$self->getId, $uid]);
|
||||
unless ($isIn) {
|
||||
$self->session->db->write("insert into groupings (groupId,userId,expireDate) values (?,?,?)", [$self->getId, $uid, ($self->session->datetime->time()+$expireOffset)]);
|
||||
$self->session->db->write("insert into groupings (groupId,userId,expireDate) values (?,?,?)", [$self->getId, $uid, (time()+$expireOffset)]);
|
||||
$self->session->stow->delete("gotGroupsForUser");
|
||||
} else {
|
||||
$self->userGroupExpireDate($uid,($self->session->datetime->time()+$expireOffset));
|
||||
$self->userGroupExpireDate($uid,(time()+$expireOffset));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -732,14 +732,14 @@ sub getIpUsers {
|
|||
my $IpFilter;
|
||||
return [] unless $IpFilter = $self->ipFilter();
|
||||
|
||||
my $time = $self->session->datetime->time();
|
||||
my $time = time();
|
||||
|
||||
$IpFilter =~ s/\s//g;
|
||||
my @filters = split /;/, $IpFilter;
|
||||
|
||||
my $query = "select userId,lastIP from userSession where expires > ?";
|
||||
|
||||
my $sth = $self->session->db->read($query, [ $self->session->datetime->time() ]);
|
||||
my $sth = $self->session->db->read($query, [ time() ]);
|
||||
my %localCache = ();
|
||||
my @ipUsers = ();
|
||||
while (my ($userId, $lastIP) = $sth->array() ) {
|
||||
|
|
@ -837,7 +837,7 @@ sub getScratchUsers {
|
|||
my $scratchFilter;
|
||||
return [] unless $scratchFilter = $self->scratchFilter();
|
||||
|
||||
my $time = $self->session->datetime->time();
|
||||
my $time = time();
|
||||
|
||||
$scratchFilter =~ s/\s//g;
|
||||
my @filters = split /;/, $scratchFilter;
|
||||
|
|
@ -878,7 +878,7 @@ sub getUserList {
|
|||
my $withoutExpired = shift;
|
||||
my $expireTime = 0;
|
||||
if ($withoutExpired) {
|
||||
$expireTime = $self->session->datetime->time();
|
||||
$expireTime = time();
|
||||
}
|
||||
return $self->session->db->buildHashRef("select users.userId, users.username from users join groupings using(userId) where expireDate > ? and groupId = ? order by username asc", [$expireTime, $self->getId]);
|
||||
}
|
||||
|
|
@ -903,7 +903,7 @@ sub getUsers {
|
|||
my $withoutExpired = shift;
|
||||
my $expireTime = 0;
|
||||
if ($withoutExpired) {
|
||||
$expireTime = $self->session->datetime->time();
|
||||
$expireTime = time();
|
||||
}
|
||||
my @users = $self->session->db->buildArray("select userId from groupings where expireDate > ? and groupId = ?", [$expireTime, $self->getId]);
|
||||
return \@users;
|
||||
|
|
@ -938,7 +938,7 @@ sub getUsersNotIn {
|
|||
|
||||
my $expireTime = 0;
|
||||
if ($withoutExpired) {
|
||||
$expireTime = $self->session->datetime->time();
|
||||
$expireTime = time();
|
||||
}
|
||||
|
||||
my $sql = q{
|
||||
|
|
@ -1496,7 +1496,7 @@ sub set {
|
|||
my $value = shift;
|
||||
$self->get("groupId") unless ($self->{_group}); # precache group stuff
|
||||
$self->{_group}{$name} = $value;
|
||||
$self->session->db->setRow("groups","groupId",{groupId=>$self->getId, $name=>$value, lastUpdated=>$self->session->datetime->time()});
|
||||
$self->session->db->setRow("groups","groupId",{groupId=>$self->getId, $name=>$value, lastUpdated=>time()});
|
||||
$self->clearCaches;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ sub process {
|
|||
my $session = shift;
|
||||
my (@param, $temp, $time);
|
||||
@param = @_;
|
||||
$time = $param[1] ||$session->datetime->time();
|
||||
$time = $param[1] ||time();
|
||||
$temp =$session->datetime->epochToHuman($time,$param[0]);
|
||||
return $temp;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -840,7 +840,7 @@ sub www_editUserSave {
|
|||
}
|
||||
# Display an error telling them the username they are trying to use is not available and suggest alternatives
|
||||
} else {
|
||||
$error = '<ul>' . sprintf($i18n->get(77), $postedUsername, $postedUsername, $postedUsername, $session->datetime->epochToHuman($session->datetime->time(),"%y")).'</ul>';
|
||||
$error = '<ul>' . sprintf($i18n->get(77), $postedUsername, $postedUsername, $postedUsername, $session->datetime->epochToHuman(time(),"%y")).'</ul>';
|
||||
}
|
||||
if ($isSecondary) {
|
||||
return _submenu($session,{workarea => $i18n->get(978)});
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ sub add {
|
|||
[
|
||||
$session->id->generate(), $session->user->userId,
|
||||
$session->var->get("sessionId"), $assetId,
|
||||
$session->datetime->time(),
|
||||
time(),
|
||||
]);
|
||||
return undef;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -950,7 +950,7 @@ sub setToEpoch {
|
|||
}
|
||||
unless ($dt) {
|
||||
$self->session->errorHandler->warn("Could not format date $set for epoch. Returning current time");
|
||||
return $self->time();
|
||||
return $time();
|
||||
}
|
||||
return $dt->epoch;
|
||||
}
|
||||
|
|
@ -959,7 +959,8 @@ sub setToEpoch {
|
|||
|
||||
=head2 time ( )
|
||||
|
||||
Returns an epoch date for now.
|
||||
DEPRECATED - This method is deprecated, and should not be used in new code. Use
|
||||
the perl built in function time().
|
||||
|
||||
=cut
|
||||
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ sub gateway {
|
|||
my $url = $self->session->config->get("gateway").'/'.$pageUrl;
|
||||
$url =~ s/\/+/\//g;
|
||||
if ($self->session->setting->get("preventProxyCache") == 1 and !$skipPreventProxyCache) {
|
||||
$url = $self->append($url,"noCache=".randint(0,1000).':'.$self->session->datetime->time());
|
||||
$url = $self->append($url,"noCache=".randint(0,1000).':'.time());
|
||||
}
|
||||
if ($pairs) {
|
||||
$url = $self->append($url,$pairs);
|
||||
|
|
|
|||
|
|
@ -184,14 +184,14 @@ sub new {
|
|||
$self->session->{_sessionId} = $self->{_var}{sessionId};
|
||||
return $self;
|
||||
}
|
||||
if ($self->{_var}{expires} && $self->{_var}{expires} < $session->datetime->time()) { ##Session expired, start a new one with the same Id
|
||||
if ($self->{_var}{expires} && $self->{_var}{expires} < time()) { ##Session expired, start a new one with the same Id
|
||||
$self->end;
|
||||
$self->start(1,$sessionId);
|
||||
}
|
||||
elsif ($self->{_var}{sessionId} ne "") { ##Fetched an existing session. Update variables with recent data.
|
||||
$self->{_var}{lastPageView} = $session->datetime->time();
|
||||
$self->{_var}{lastPageView} = time();
|
||||
$self->{_var}{lastIP} = $session->env->getIp;
|
||||
$self->{_var}{expires} = $session->datetime->time() + $session->setting->get("sessionTimeout");
|
||||
$self->{_var}{expires} = time() + $session->setting->get("sessionTimeout");
|
||||
$self->session->{_sessionId} = $self->{_var}{sessionId};
|
||||
$session->db->setRow("userSession","sessionId",$self->{_var});
|
||||
return $self;
|
||||
|
|
@ -241,7 +241,7 @@ sub start {
|
|||
$userId = 1 if ($userId eq "");
|
||||
my $sessionId = shift;
|
||||
$sessionId = $self->session->id->generate if ($sessionId eq "");
|
||||
my $time = $self->session->datetime->time();
|
||||
my $time = time();
|
||||
$self->{_var} = {
|
||||
expires => $time + $self->session->setting->get("sessionTimeout"),
|
||||
lastPageView => $time,
|
||||
|
|
|
|||
|
|
@ -544,9 +544,9 @@ sub friends {
|
|||
$myFriends->isEditable(0);
|
||||
$self->uncache;
|
||||
$self->{_user}{"friendsGroup"} = $myFriends->getId;
|
||||
$self->{_user}{"lastUpdated"} = $self->session->datetime->time();
|
||||
$self->{_user}{"lastUpdated"} = time();
|
||||
$self->session->db->write("update users set friendsGroup=?, lastUpdated=? where userId=?",
|
||||
[$myFriends->getId, $self->session->datetime->time(), $self->userId]);
|
||||
[$myFriends->getId, time(), $self->userId]);
|
||||
$self->{_friendsGroup} = $myFriends;
|
||||
}
|
||||
|
||||
|
|
@ -642,7 +642,7 @@ sub getGroups {
|
|||
my $withoutExpired = shift;
|
||||
my $clause = "";
|
||||
if ($withoutExpired) {
|
||||
$clause = "and expireDate>".$self->session->datetime->time();
|
||||
$clause = "and expireDate>".time();
|
||||
}
|
||||
my $gotGroupsForUser = $self->session->stow->get("gotGroupsForUser");
|
||||
if (exists $gotGroupsForUser->{$self->userId}) {
|
||||
|
|
@ -1016,7 +1016,7 @@ sub karma {
|
|||
$self->uncache;
|
||||
$self->{_user}{karma} += $amount;
|
||||
$self->session->db->write("update users set karma=karma+? where userId=?", [$amount, $self->userId]);
|
||||
$self->session->db->write("insert into karmaLog values (?,?,?,?,?)",[$self->userId, $amount, $source, $description, $self->session->datetime->time()]);
|
||||
$self->session->db->write("insert into karmaLog values (?,?,?,?,?)",[$self->userId, $amount, $source, $description, time()]);
|
||||
}
|
||||
return $self->{_user}{karma};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ sub create {
|
|||
my $properties = shift;
|
||||
my $tagId = $session->db->setRow("assetVersionTag","tagId",{
|
||||
tagId=>"new",
|
||||
creationDate=>$session->datetime->time(),
|
||||
creationDate=>time(),
|
||||
createdBy=>$session->user->userId
|
||||
});
|
||||
my $tag = $class->new($session, $tagId);
|
||||
|
|
@ -178,7 +178,7 @@ sub commit {
|
|||
if ($finished) {
|
||||
$self->{_data}{isCommitted} = 1;
|
||||
$self->{_data}{committedBy} = $self->session->user->userId unless ($self->{_data}{committedBy});
|
||||
$self->{_data}{commitDate} = $self->session->datetime->time();
|
||||
$self->{_data}{commitDate} = time();
|
||||
$self->session->db->setRow("assetVersionTag", "tagId", $self->{_data});
|
||||
$self->clearWorking;
|
||||
return 1;
|
||||
|
|
@ -674,7 +674,7 @@ sub set {
|
|||
my $self = shift;
|
||||
my $properties = shift;
|
||||
|
||||
my $now = $self->session->datetime->time();
|
||||
my $now = time();
|
||||
my $startTime = WebGUI::DateTime->new($self->session,$now)->toDatabase;
|
||||
my $endTime = WebGUI::DateTime->new($self->session,'2036-01-01 00:00:00')->toDatabase;
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ See WebGUI::Workflow::Activity::execute() for details.
|
|||
sub execute {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $epoch = $self->session->datetime->time();
|
||||
my $epoch = time();
|
||||
my $getAnArchive = WebGUI::Asset::Wobject::StoryArchive->getIsa($session);
|
||||
ARCHIVE: while (my $archive = $getAnArchive->()) {
|
||||
next ARCHIVE unless $archive && $archive->get("archiveAfter");
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ See WebGUI::Workflow::Activity::execute() for details.
|
|||
|
||||
sub execute {
|
||||
my $self = shift;
|
||||
my $epoch = $self->session->datetime->time();
|
||||
my $epoch = time();
|
||||
my $a = $self->session->db->read("select assetId from asset where className='WebGUI::Asset::Wobject::Collaboration'");
|
||||
while (my ($assetId) = $a->array) {
|
||||
my $cs = WebGUI::Asset->new($self->session, $assetId, "WebGUI::Asset::Wobject::Collaboration");
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ sub execute {
|
|||
return $self->COMPLETE;
|
||||
}
|
||||
|
||||
my @userIds = $self->session->db->buildArray("SELECT a.userId FROM authentication AS a INNER JOIN users AS u ON a.userId = u.userId WHERE a.authMethod = 'WebGUI' AND a.fieldName = 'emailValidationKey' AND u.status = 'Deactivated' AND u.dateCreated < ?", [$self->session->datetime->time - $self->get('interval')]);
|
||||
my @userIds = $self->session->db->buildArray("SELECT a.userId FROM authentication AS a INNER JOIN users AS u ON a.userId = u.userId WHERE a.authMethod = 'WebGUI' AND a.fieldName = 'emailValidationKey' AND u.status = 'Deactivated' AND u.dateCreated < ?", [time - $self->get('interval')]);
|
||||
foreach my $userId (@userIds) {
|
||||
WebGUI::User->new($self->session, $userId)->delete;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ sub execute {
|
|||
my $urlOfSingleAsset = "";
|
||||
|
||||
#By default, we'll make it so that things happen now.
|
||||
my $time = $session->datetime->time();
|
||||
my $time = time();
|
||||
|
||||
#If the type is startTime, we'll wait until the version tag starttime to proceed
|
||||
if($self->get("type") eq "startTime") {
|
||||
|
|
@ -98,7 +98,7 @@ sub execute {
|
|||
my $dt = WebGUI::DateTime->new($session,$time);
|
||||
|
||||
#Get the current UTC time
|
||||
my $now = WebGUI::DateTime->new($session,$session->datetime->time());
|
||||
my $now = WebGUI::DateTime->new($session,time());
|
||||
|
||||
#Workflow is complete if the time has passed.
|
||||
if($now->epoch >= $dt->epoch) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue