Merge branch 'dashboards2' of bitbucket.org:colosa/processmaker into dashboards2
This commit is contained in:
@@ -293,16 +293,16 @@ class MessageEventDefinition
|
||||
|
||||
$messageEventDefinitionUid = \ProcessMaker\Util\Common::generateUID();
|
||||
|
||||
if (isset($arrayData["MSGED_VARIABLES"])) {
|
||||
$arrayData["MSGED_VARIABLES"] = serialize($arrayData["MSGED_VARIABLES"]);
|
||||
}
|
||||
|
||||
$messageEventDefinition->fromArray($arrayData, \BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
$messageEventDefinition->setMsgedUid($messageEventDefinitionUid);
|
||||
$messageEventDefinition->setPrjUid($projectUid);
|
||||
$messageEventDefinition->setMsgedUsrUid("00000000000000000000000000000001"); //admin
|
||||
|
||||
if (isset($arrayData["MSGED_VARIABLES"])) {
|
||||
$messageEventDefinition->setMsgedVariables(serialize($arrayData["MSGED_VARIABLES"]));
|
||||
}
|
||||
|
||||
if ($messageEventDefinition->validate()) {
|
||||
$cnn->begin();
|
||||
|
||||
@@ -375,7 +375,7 @@ class MessageEventDefinition
|
||||
}
|
||||
|
||||
if (isset($arrayData["MSGED_VARIABLES"])) {
|
||||
$messageEventDefinition->setMsgedVariables(serialize($arrayData["MSGED_VARIABLES"]));
|
||||
$arrayData["MSGED_VARIABLES"] = serialize($arrayData["MSGED_VARIABLES"]);
|
||||
}
|
||||
|
||||
$messageEventDefinition->fromArray($arrayData, \BasePeer::TYPE_FIELDNAME);
|
||||
@@ -632,4 +632,3 @@ class MessageEventDefinition
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -116,6 +116,12 @@ class PmPdo implements \OAuth2\Storage\AuthorizationCodeInterface,
|
||||
|
||||
public function setAccessToken($access_token, $client_id, $user_id, $expires, $scope = null)
|
||||
{
|
||||
//Delete expired Access and Refresh Token
|
||||
foreach (array($this->config["access_token_table"], $this->config["refresh_token_table"]) as $value) {
|
||||
$stmt = $this->db->prepare(sprintf("DELETE FROM %s WHERE EXPIRES < %s", $value, "'" . date("Y-m-d H:i:s") . "'"));
|
||||
$result = $stmt->execute();
|
||||
}
|
||||
|
||||
// convert expires to datestring
|
||||
$expires = date('Y-m-d H:i:s', $expires);
|
||||
|
||||
@@ -177,10 +183,8 @@ class PmPdo implements \OAuth2\Storage\AuthorizationCodeInterface,
|
||||
$access_token->load($token);
|
||||
|
||||
$stmt = $this->db->prepare(sprintf('DELETE FROM %s WHERE ACCESS_TOKEN = :token', $this->config['access_token_table']));
|
||||
$stmt->execute(compact('token'));
|
||||
|
||||
$stmt = $this->db->prepare(sprintf("DELETE FROM %s WHERE EXPIRES < %s", $this->config["refresh_token_table"], "'" . date("Y-m-d H:i:s") . "'"));
|
||||
return $stmt->execute(compact('token'));
|
||||
return $stmt->execute(compact("token"));
|
||||
}
|
||||
|
||||
/* OAuth2_Storage_UserCredentialsInterface */
|
||||
|
||||
Reference in New Issue
Block a user