From 5dd47fa9e5080fdc159891624546d917c1e4e85a Mon Sep 17 00:00:00 2001 From: Michael Woods Date: Wed, 16 Apr 2014 13:32:54 +0800 Subject: [PATCH 1/2] MDL-41975 repository_alfresco: Ensure Moodle sends GMT time to Alfresco --- lib/alfresco/Service/WebService/AlfrescoWebService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/alfresco/Service/WebService/AlfrescoWebService.php b/lib/alfresco/Service/WebService/AlfrescoWebService.php index b549755b467..898dcdf73db 100644 --- a/lib/alfresco/Service/WebService/AlfrescoWebService.php +++ b/lib/alfresco/Service/WebService/AlfrescoWebService.php @@ -79,8 +79,8 @@ class AlfrescoWebService extends SoapClient // Construct Timestamp Header $timeStamp = $dom->createElementNS($this->wsUtilityNS, "Timestamp"); - $createdDate = date("Y-m-d\TH:i:s\Z", mktime(date("H")+24, date("i"), date("s"), date("m"), date("d"), date("Y"))); - $expiresDate = date("Y-m-d\TH:i:s\Z", mktime(date("H")+25, date("i"), date("s"), date("m"), date("d"), date("Y"))); + $createdDate = gmdate("Y-m-d\TH:i:s\Z", gmmktime(gmdate("H"), gmdate("i"), gmdate("s"), gmdate("m"), gmdate("d"), gmdate("Y"))); + $expiresDate = gmdate("Y-m-d\TH:i:s\Z", gmmktime(gmdate("H")+1, gmdate("i"), gmdate("s"), gmdate("m"), gmdate("d"), gmdate("Y"))); $created = new DOMElement("Created", $createdDate, $this->wsUtilityNS); $expires = new DOMElement("Expires", $expiresDate, $this->wsUtilityNS); $timeStamp->appendChild($created); From ec0efc18e177ab81167cc9e6f2dbd384df35293d Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Wed, 16 Apr 2014 13:38:27 +0800 Subject: [PATCH 2/2] MDL-41975 repository_alfresco: Updating details about Alfresco URL and timestamps --- lib/alfresco/README_MOODLE.txt | 2 ++ repository/alfresco/lang/en/repository_alfresco.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/alfresco/README_MOODLE.txt b/lib/alfresco/README_MOODLE.txt index 83179f07fdb..aaf6400c32c 100644 --- a/lib/alfresco/README_MOODLE.txt +++ b/lib/alfresco/README_MOODLE.txt @@ -34,6 +34,8 @@ - AlfrescoWebService::__soapCall() arguments do not match SoapClient::__soapCall() - AlfrescoWebService::__doRequest() arguments do not match SoapClient::__soapCall() +6. Apply the changes from MDL-41975 in regard with the timestamp + == Alfresco PHP Library == Installation and developer documentation for the Alfresco PHP Library can be found on the Alfresco Wiki. diff --git a/repository/alfresco/lang/en/repository_alfresco.php b/repository/alfresco/lang/en/repository_alfresco.php index fe75bd5beb7..1bcc0e0c981 100644 --- a/repository/alfresco/lang/en/repository_alfresco.php +++ b/repository/alfresco/lang/en/repository_alfresco.php @@ -24,7 +24,7 @@ */ $string['alfresco_url'] = 'Alfresco URL'; -$string['alfrescourltext'] = 'Afresco API url should be: http://yoursite.com/alfresco/api'; +$string['alfrescourltext'] = 'Afresco API URL should be: http://yoursite.com/alfresco/api or http://yoursite.com/alfresco/soapapi for Alfresco 4.2.d or greater.'; $string['alfresco:view'] = 'View alfresco repository'; $string['configplugin'] = 'Alfresco configuration'; $string['notitle'] = 'notitle';