Skip to content
Snippets Groups Projects
Commit 89c6f03f authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge branch 'hotline-master' into 'master'

Hotline master

See merge request !2420
parents 24f55d9e a5a1b9ea
Branches
Tags
1 merge request!2420Hotline master
Pipeline #2994 passed with stage
in 25 minutes and 57 seconds
22/11/2017 - v7.11.11
- ticket #49315 : AFI Multimedia : correction de l'enregistrement des notes de postes.
- ticket #65552 : AFI Multimedia : correction de la frire chronologique des réservations.
20/11/2017 - v7.11.10
- ticket #65756 : ajout du connecteur bibliothèque numérique Omeka
......
......@@ -237,16 +237,6 @@ class Class_FileManager extends Class_Entity {
}
public function isAuthorized($path) {
if (!Class_Users::isCurrentUserCanAccesBackend()
|| false === strpos($path, USERFILESURL))
return false;
$parts = explode('/', $path);
return !in_array('..', $parts);
}
public function isDir() {
return $this->getDir();
}
......
......@@ -28,8 +28,8 @@ class Multimedia_DeviceLoader extends Storm_Model_Loader {
public function fromJsonModelWithGroup($json_model, $device_group) {
if (!$model = $this->findByIdOrigineAndLocation($json_model->id, $device_group->getLocation()))
$model = $this->newInstance()->setIdOrigine($this->getIdOrigineWithLocation($json_model->id, $device_group->getLocation()));
$note = isset($json_model->note)
? $json_model->note
$note = isset($json_model->notes)
? $json_model->notes
: '';
$model
......
......@@ -46,18 +46,19 @@ class ZendAfi_View_Helper_TagTimeline extends ZendAfi_View_Helper_BaseHelper {
json_encode(['startDatetime' => $this->_getFirstDate($nodes),
'range' => $this->_getDaysToLastNode($nodes),
'rangeAlign' => 'current',
'minGridSize' => 40,
'minGridSize' => 70,
'minuteInterval' => 15,
'scale' => 'days',
'rows' => count($nodes_data) + 1,
'langsDir' => Class_Url::baseUrl() . '/public/opac/java/jquery.timeline-master/dist/langs/',
'httpLnaguage' => true])));
return $this->_tag('div',
$this->_tag('ul',
implode($nodes_data),
['class' => 'timeline-events']),
['id' => $instance->getId()])
. $this->_tag('div', '', ['class' => 'timeline-event-view']);
return
$this->_tag('div', '', ['class' => 'timeline-event-view'])
. $this->_tag('div',
$this->_tag('ul',
implode($nodes_data),
['class' => 'timeline-events']),
['id' => $instance->getId()]);
}
......@@ -98,7 +99,7 @@ class ZendAfi_View_Helper_TagTimeline extends ZendAfi_View_Helper_BaseHelper {
->getArrayCopy();
$today = $this->getTimeSource()->time();
$max = ($max = max($timestamps) > $today)
$max = (($max = max($timestamps)) > $today)
? $max
: $today;
......
......@@ -82,7 +82,7 @@ class Bokeh_Engine {
function setupConstants() {
defineConstant('BOKEH_MAJOR_VERSION','7.11');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.10');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.11');
defineConstant('BOKEH_REMOTE_FILES', 'http://git.afi-sa.fr/afi/opacce/');
......
......@@ -115,7 +115,7 @@ l66WXceACmsgGWEdHMB7ZPUd4HqR5bdE1Xnr1Q0Z9IIku6Naxt/yy0P5Gv+ZlW7U
$this->fixture('Class_Multimedia_Device', ['id' => 34, 'id_origine' => '1-34']);
$this->fixture('Class_Multimedia_DeviceGroup', ['id' => 1, 'id_origine' => '1-64', 'libelle'=>'groupe Y']);
$datas = '[{"libelle":"Groupe 1", "id":2, "site":{"id":1,"libelle":"Site 1","admin_url":"192.168.2.92"}, "postes":[{"id":1, "libelle":"Poste 1", "os":"Windows XP", "maintenance":"1", "note":"Le clavier a perdu des touches."}, {"id":2, "libelle":"Poste 2", "os":"Ubuntu Lucid Lynx", "maintenance":"0"}]}]';
$datas = '[{"libelle":"Groupe 1", "id":2, "site":{"id":1,"libelle":"Site 1","admin_url":"192.168.2.92"}, "postes":[{"id":1, "libelle":"Poste 1", "os":"Windows XP", "maintenance":"1", "notes":"Le clavier a perdu des touches."}, {"id":2, "libelle":"Poste 2", "os":"Ubuntu Lucid Lynx", "maintenance":"0"}]}]';
$this->postDispatch(
'/push/multimedia/config',
......
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class FileManagerTest extends ModelTestCase {
protected
$_filemanager,
$_admin;
public function setUp() {
parent::setUp();
$this->_filemanager = new Class_FileManager();
$this->_admin = $this->fixture('Class_Users',
['id' => 2,
'login' => 'admin',
'password' => 'admin']);
$this->_admin->beModoBib()->save();
$this->_guest = $this->fixture('Class_Users',
['id' => 3,
'login' => 'guest',
'password' => 'guest']);
$this->_guest->beInvite()->save();
}
/** @test */
public function withoutAuthenticationUserfilesShouldNotBeAuthorized() {
$this->assertFalse($this->_filemanager->isAuthorized(USERFILESURL . 'images/bokeh.png'));
}
/** @test */
public function asModoBibUserfilesShouldBeAuthorized() {
ZendAfi_Auth::getInstance()->logUser($this->_admin);
$this->assertTrue($this->_filemanager->isAuthorized(USERFILESURL . 'images/bokeh.png'));
}
/** @test */
public function asGuestUserfilesShouldNotBeAuthorized() {
ZendAfi_Auth::getInstance()->logUser($this->_guest);
$this->assertFalse($this->_filemanager->isAuthorized(USERFILESURL . 'images/bokeh.png'));
}
}
class FileManagerAsAdminTest extends ModelTestCase {
protected $_filemanager;
public function setUp() {
parent::setUp();
$this->_filemanager = new Class_FileManager();
$this->_admin = $this->fixture('Class_Users',
['id' => 2,
'login' => 'admin',
'password' => 'admin']);
$this->_admin->beAdminPortail()->save();
ZendAfi_Auth::getInstance()->logUser($this->_admin);
}
/** @test */
public function rootShouldNotBeAuthorized() {
$this->assertFalse($this->_filemanager->isAuthorized('/'));
}
/** @test */
public function upperDirectoryShouldNotBeAuthorized() {
$this->assertFalse($this->_filemanager->isAuthorized(USERFILESURL . '../'));
}
/**
* @test
* @see http://forge.afi-sa.fr/issues/32417
*/
public function filenameContainingTwoDotsShouldBeAuthorized() {
$this->assertTrue($this->_filemanager->isAuthorized(USERFILESURL . '/Spectacle_14_nov..pdf'));
}
}
?>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment