diff --git a/VERSIONS b/VERSIONS index cf817e5c01f0c28fe9ba7dd618a468f423d561d9..60c9b5d29efa90a2372154d457cef4469a660a87 100644 --- a/VERSIONS +++ b/VERSIONS @@ -1,3 +1,22 @@ +28/10/2015 - v7.3.22 + + - ticket #31941 : Correction compatibilité explorateur de fichier / hébergement mutualisé sans sous-répertoire + + - ticket #27768 : Affichage en mode liste des articles, correctif des problèmes suivant : + * le filtre ne descend pas dans les sous-catégories + * la pagination ne fonctionne pas après une recherche + * la recherche ne se fait que dans le portail + + - ticket #30552 : + - La longueur maxi d'un pseudo passe a 100 caractères + - correction du bug : lors de la mise a jour du pseudo l'abonné se retrouve en invite + + +27/10/2015 - v7.3.21 + + - mise sous test des migrations bases de données + + 26/10/2015 - v7.3.20 - ticket #31732 : correction des popups multiples en cliquant sur les vignettes de notices dans certains navigateurs diff --git a/VERSIONS_HOTLINE/27768 b/VERSIONS_HOTLINE/27768 deleted file mode 100644 index e75809277cf75bbab6d53de36be6c61dca8bfb8e..0000000000000000000000000000000000000000 --- a/VERSIONS_HOTLINE/27768 +++ /dev/null @@ -1,4 +0,0 @@ - - ticket #27768 : Affichage en mode liste des articles, correctif des problèmes suivant : - * le filtre ne descend pas dans les sous-catégories - * la pagination ne fonctionne pas après une recherche - * la recherche ne se fait que dans le portail \ No newline at end of file diff --git a/application/modules/admin/controllers/UsersController.php b/application/modules/admin/controllers/UsersController.php index a47b5f01345f81e889f05e7ff97347a2491695f7..9df3a92f021410bb57b44997b780436602deeeef 100644 --- a/application/modules/admin/controllers/UsersController.php +++ b/application/modules/admin/controllers/UsersController.php @@ -172,8 +172,7 @@ class Admin_UsersController extends ZendAfi_Controller_Action { //------------------------------------------------------------------------------------------------------ function editAction() { $id_user = $this->_request->getParam('id',0); - $user = Class_Users::getLoader()->find($id_user); - + $user = Class_Users::find($id_user); $this->view->titre = "Modifier l'utilisateur: ".$user->getLogin(); if ($this->_request->isPost()) diff --git a/application/modules/admin/views/scripts/users/_form.phtml b/application/modules/admin/views/scripts/users/_form.phtml index 90416b49b38dfd094c2da396bdb3cc315bb202bf..221eb51d64f121ae87be3848c18d45c465ea3748 100644 --- a/application/modules/admin/views/scripts/users/_form.phtml +++ b/application/modules/admin/views/scripts/users/_form.phtml @@ -33,7 +33,7 @@ <tr> <td class="droite">Civilité </td> <td class="gauche"> - <?php + <?php echo $this->formSelect('civilite', $this->user->getCivilite(), null, @@ -52,10 +52,22 @@ <td class="droite"><?php echo $this->traduire('Rôle'); ?> </td> <td class="gauche"> <?php $comboListeRole = new ZendAfi_Acl_AdminControllerRoles(); - if ($this->user->getId() == '1') - echo '<select disabled="disabled"><option selected="selected" value="7">super_admin</option></select><input type="hidden" value="7" name="role" id="role"/>'; - else - print $this->user->getRoleLevel() != 2 ? $comboListeRole->rendCombo($this->user->getRole(),$this->authUser->ROLE_LEVEL) : ZendAfi_Acl_AdminControllerRoles::getLibelleRole(2); ; + if ($this->user->isSuperAdmin()) + echo '<select disabled="disabled"><option selected="selected" value="7">super_admin</option></select><input type="hidden" value="' . ZendAfi_Acl_AdminControllerRoles::SUPER_ADMIN . '" name="role" id="role"/>'; + else + echo $this->user->isAbonne() + ? ZendAfi_Acl_AdminControllerRoles::getLibelleRole($this->user->getRoleLevel()) + : $comboListeRole->rendCombo($this->user->getRole(), $this->authUser->ROLE_LEVEL); + + + if ($this->user->isAbonne()) + echo $this->tag('input','',['type' =>'hidden', + 'value' => ZendAfi_Acl_AdminControllerRoles::ABONNE_SIGB, + 'name' => 'role', + 'id' => 'role']); + + + ?> </td> @@ -64,7 +76,7 @@ <tr> <td class="droite"><?php echo $this->traduire('Groupes'); ?> </td> <td class="gauche"> - <?php + <?php echo $this->getHelper('TreeSelect') ->categoriesNotSelectable() ->treeSelect(implode('-', $this->user->getUserGroupsIds()), @@ -73,7 +85,7 @@ $this->url(['module' => 'admin', 'controller' => 'usergroup', 'action' => 'list.json']), - "form", + "form", "usergroup_categories_ids"); ?> </td> @@ -89,12 +101,12 @@ <input type="hidden" value="'.$this->id_bib.'" name="bib" id="bib"/>'; } else { $bib = new Class_Bib(); - echo $bib->getComboBib($this->user->getIdSite()); + echo $bib->getComboBib($this->user->getIdSite()); } ?> <script type="text/javascript"> formSelectToggleVisibilityForElement("select[name='role']", - "#option_bib", + "#option_bib", ["2", "3", "4"]); formSelectToggleVisibilityForElement("select[name='role']", "#abonne_sigb", "2"); @@ -160,4 +172,3 @@ </table> </form> </div> - diff --git a/ckeditor/core_five_filemanager/connectors/php/filemanager.php b/ckeditor/core_five_filemanager/connectors/php/filemanager.php index 482c7ca1a7291fd715cd69129990f8e2716bd2d8..efe4f4b5ca4c816e7876cfa9607d2e5851f7436e 100644 --- a/ckeditor/core_five_filemanager/connectors/php/filemanager.php +++ b/ckeditor/core_five_filemanager/connectors/php/filemanager.php @@ -24,18 +24,14 @@ header('Content-type: application/json'); * @param string $path */ function opacTraversalProtect ($path) { - $path = (string)$path; - $parts = explode('/', $path); - array_shift($parts); - if (2 > count($parts)) { - exit(); - } - if ('userfiles' != $parts[1]) { - exit(); - } - if (in_array('..', $parts)) { - exit(); - } + $path = (string)$path; + $parts = explode('/', $path); + array_shift($parts); + + if (in_array('..', $parts) + || 2 > count($parts) + || !in_array('userfiles', $parts)) + exit(); } @@ -64,7 +60,7 @@ if(!isset($_GET)) { } else { if(isset($_GET['mode']) && $_GET['mode']!='') { switch($_GET['mode']) { - + default: opacTraversalProtect($_GET['path']); $fm->error($fm->lang('MODE_ERROR')); @@ -78,7 +74,7 @@ if(!isset($_GET)) { break; case 'getfolder': - opacTraversalProtect($_GET['path']); + opacTraversalProtect($_GET['path']); if($fm->getvar('path')) { $response = $fm->getfolder(); } @@ -121,12 +117,12 @@ if(!isset($_GET)) { } else if(isset($_POST['mode']) && $_POST['mode']!='') { switch($_POST['mode']) { - + default: $fm->error($fm->lang('MODE_ERROR')); break; - + case 'add': if($fm->postvar('currentpath')) { opacTraversalProtect($_POST['currentpath']); diff --git a/cosmogramme/php/_init.php b/cosmogramme/php/_init.php index 73576b41de4d994dbe9ff0fb8c098f2c72ae2eec..19dae8187bafcdd1736c8d3db7db0d157f8960b5 100644 --- a/cosmogramme/php/_init.php +++ b/cosmogramme/php/_init.php @@ -1,7 +1,7 @@ <?php error_reporting(E_ERROR | E_PARSE); -define("PATCH_LEVEL","274"); +define("PATCH_LEVEL","275"); define("APPLI","cosmogramme"); define("COSMOPATH", "/var/www/html/vhosts/opac2/www/htdocs"); diff --git a/cosmogramme/sql/patch/patch_273.php b/cosmogramme/sql/patch/patch_273.php index 56dd8d6069eccb6e32edda842c3cd491b1e994ad..80a0ac787095a4dacff694c047f13c3337cada29 100644 --- a/cosmogramme/sql/patch/patch_273.php +++ b/cosmogramme/sql/patch/patch_273.php @@ -1,5 +1,5 @@ <?php // update reviews to attach reviews to notices -$reviews = Class_Cosmogramme_Integration_PhaseReviews::getPhaseWithoutContext(); -$reviews->_execute(); +// $reviews = Class_Cosmogramme_Integration_PhaseReviews::getPhaseWithoutContext(); +// $reviews->_execute(); ?> diff --git a/cosmogramme/sql/patch/patch_275.php b/cosmogramme/sql/patch/patch_275.php new file mode 100644 index 0000000000000000000000000000000000000000..037c4dddd9e20eaee63c5611f968f3b0785984d5 --- /dev/null +++ b/cosmogramme/sql/patch/patch_275.php @@ -0,0 +1,4 @@ +<?php +$adapter = Zend_Db_Table_Abstract::getDefaultAdapter(); +$adapter->query("ALTER TABLE bib_admin_users MODIFY pseudo varchar(100) NULL default ''"); +?> \ No newline at end of file diff --git a/library/startup.php b/library/startup.php index b8a7cca077769709208cd6468ca09acb03daae13..eb6a6c96dc593c0629d2455f64cd2265e31dacab 100644 --- a/library/startup.php +++ b/library/startup.php @@ -64,7 +64,7 @@ function defineConstant($name, $value) { function setupConstants() { defineConstant('BOKEH_MAJOR_VERSION','7.3'); - defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.20'); + defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.22'); defineConstant('BOKEH_REMOTE_FILES', 'http://git.afi-sa.fr/afi/opacce/'); diff --git a/tests/application/modules/admin/controllers/UsersControllerTest.php b/tests/application/modules/admin/controllers/UsersControllerTest.php index 0c892f060deb7f8358e8c62f6fcde8ab0309d38c..ddd36a72a8ee23eb7f3a08c82dbc33ef1dcf9359 100644 --- a/tests/application/modules/admin/controllers/UsersControllerTest.php +++ b/tests/application/modules/admin/controllers/UsersControllerTest.php @@ -115,7 +115,6 @@ class UsersControllerEditMarcusTest extends UsersControllerWithMarcusTestCase { $this->dispatch('/admin/users/edit/id/10', true); } - /** @test **/ public function roleLevelShouldBeSIGBSubscriber() { $this->assertXpathContentContains('//tr/td','abonné identifié SIGB'); @@ -164,6 +163,13 @@ class UsersControllerEditMarcusTest extends UsersControllerWithMarcusTestCase { } + + /** @test **/ + public function testHiddenInputForRole() { + $this->assertXPath("//input[@name='role'][@value=2][@type='hidden']",$this->_response->getBody()); + } + + /** @test **/ public function testSelectedBibIsIdOne() { $this->assertXPath("//input[@name='bib'][@value='1']", $this->_response->getBody()); @@ -239,7 +245,21 @@ class UsersControllerEditMarcusTest extends UsersControllerWithMarcusTestCase { } -class rsControllerEditMarcusAsAdminPortailTest extends UsersControllerWithMarcusTestCase { +class UsersControllerEditMarcusAsAbonPortailTest extends UsersControllerWithMarcusTestCase { + public function setUp() { + parent::setUp(); + } + + + /** @test */ + function comboBibShouldNotBeVisible() { + $this->dispatch('/admin/users/edit/id/10'); + $this->assertNotXPath('//select[@name="bib"]'); + } +} + + +class UsersControllerEditMarcusAsAdminPortailTest extends UsersControllerWithMarcusTestCase { public function setUp() { parent::setUp(); $this->marcus->setRoleLevel(ZendAfi_Acl_AdminControllerRoles::ADMIN_PORTAIL); @@ -262,8 +282,6 @@ class rsControllerEditMarcusAsAdminPortailTest extends UsersControllerWithMarcus } - - class UsersControllerDeleteMarcusTest extends UsersControllerWithMarcusTestCase { public function setUp() { parent::setUp(); @@ -471,6 +489,17 @@ class UsersControllerPostValidDataWithCommOpsysTest extends UsersControllerWithM ->answers(true); } + + /** @test */ + public function idAbonShouldNotBeModified() { + $this->assertEquals('00123',Class_Users::find(10)->getIdabon()); + } + + /** @test */ + public function roleShouldNotBeModified() { + $this->assertEquals(ZendAfi_Acl_AdminControllerRoles::ABONNE_SIGB,Class_Users::find(10)->getRoleLevel()); + } + protected function _postData() { $this->_postEditData(array('username' => 'mdavis', 'password' => 'tutu', diff --git a/tests/application/modules/opac/controllers/ead.xsd b/tests/application/modules/opac/controllers/ead.xsd index 9595a769ba255ed597fa520aedb80e17898ce0a5..e8008b6167c437d810fe269e132d8ea0a5bebf72 100644 --- a/tests/application/modules/opac/controllers/ead.xsd +++ b/tests/application/modules/opac/controllers/ead.xsd @@ -69,7 +69,7 @@ xmlns="urn:isbn:1-931666-22-9" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:import namespace="http://www.w3.org/1999/xlink" - schemaLocation="http://www.loc.gov/standards/xlink/xlink.xsd"/> + schemaLocation="xlink.xsd"/> <xs:attributeGroup name="am.date.normal"> <xs:attribute name="normal"> <xs:simpleType> diff --git a/tests/application/modules/opac/controllers/xlink.xsd b/tests/application/modules/opac/controllers/xlink.xsd new file mode 100644 index 0000000000000000000000000000000000000000..4691efcf3978fb15ebb9ff3a2d8e2bbef73fe2a0 --- /dev/null +++ b/tests/application/modules/opac/controllers/xlink.xsd @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- METS XLink Schema, v. 2, Nov. 15, 2004 --> +<schema targetNamespace="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" elementFormDefault="qualified"> + <!-- global attributes --> + <attribute name="href" type="anyURI"/> + <attribute name="role" type="string"/> + <attribute name="arcrole" type="string"/> + <attribute name="title" type="string"/> + <attribute name="show"> + <simpleType> + <restriction base="string"> + <enumeration value="new"/> + <enumeration value="replace"/> + <enumeration value="embed"/> + <enumeration value="other"/> + <enumeration value="none"/> + </restriction> + </simpleType> + </attribute> + <attribute name="actuate"> + <simpleType> + <restriction base="string"> + <enumeration value="onLoad"/> + <enumeration value="onRequest"/> + <enumeration value="other"/> + <enumeration value="none"/> + </restriction> + </simpleType> + </attribute> + <attribute name="label" type="string"/> + <attribute name="from" type="string"/> + <attribute name="to" type="string"/> + <attributeGroup name="simpleLink"> + <attribute name="type" type="string" fixed="simple" form="qualified"/> + <attribute ref="xlink:href" use="optional"/> + <attribute ref="xlink:role" use="optional"/> + <attribute ref="xlink:arcrole" use="optional"/> + <attribute ref="xlink:title" use="optional"/> + <attribute ref="xlink:show" use="optional"/> + <attribute ref="xlink:actuate" use="optional"/> + </attributeGroup> + <attributeGroup name="extendedLink"> + <attribute name="type" type="string" fixed="extended" form="qualified"/> + <attribute ref="xlink:role" use="optional"/> + <attribute ref="xlink:title" use="optional"/> + </attributeGroup> + <attributeGroup name="locatorLink"> + <attribute name="type" type="string" fixed="locator" form="qualified"/> + <attribute ref="xlink:href" use="required"/> + <attribute ref="xlink:role" use="optional"/> + <attribute ref="xlink:title" use="optional"/> + <attribute ref="xlink:label" use="optional"/> + </attributeGroup> + <attributeGroup name="arcLink"> + <attribute name="type" type="string" fixed="arc" form="qualified"/> + <attribute ref="xlink:arcrole" use="optional"/> + <attribute ref="xlink:title" use="optional"/> + <attribute ref="xlink:show" use="optional"/> + <attribute ref="xlink:actuate" use="optional"/> + <attribute ref="xlink:from" use="optional"/> + <attribute ref="xlink:to" use="optional"/> + </attributeGroup> + <attributeGroup name="resourceLink"> + <attribute name="type" type="string" fixed="resource" form="qualified"/> + <attribute ref="xlink:role" use="optional"/> + <attribute ref="xlink:title" use="optional"/> + <attribute ref="xlink:label" use="optional"/> + </attributeGroup> + <attributeGroup name="titleLink"> + <attribute name="type" type="string" fixed="title" form="qualified"/> + </attributeGroup> + <attributeGroup name="emptyLink"> + <attribute name="type" type="string" fixed="none" form="qualified"/> + </attributeGroup> +</schema> \ No newline at end of file diff --git a/tests/db/UpgradeDBTest.php b/tests/db/UpgradeDBTest.php index a42ea868d7a4b8f47467074be072c63201d6b27d..77195bf2d0dd0415b32b4f4e9c845ebfb3799c14 100644 --- a/tests/db/UpgradeDBTest.php +++ b/tests/db/UpgradeDBTest.php @@ -113,4 +113,31 @@ class UpgradeDB_274_Test extends UpgradeDBTestCase { } } + + + +class UpgradeDB_268_Test extends UpgradeDBTestCase { + protected static $user_backup; + + public function prepare() { + static::$user_backup = $this->query('select id_user, pseudo from bib_admin_users order by id_user limit 1')->fetch(); + } + + + public function tearDown() { + $this->query('update bib_admin_users set pseudo="' . static::$user_backup['pseudo'] . '" where id_user=' . static::$user_backup['id_user']); + } + + + /** @test */ + public function userPseudoCanBeHundredCharsLong() { + $hundred_chars_pseudo = str_pad('pseudo', 100, 'o', STR_PAD_BOTH); + + $this->query('update bib_admin_users set pseudo="' . $hundred_chars_pseudo . '" where id_user=' . static::$user_backup['id_user']); + + $this->assertEquals($hundred_chars_pseudo, + $this->query('select pseudo from bib_admin_users where id_user=' . static::$user_backup['id_user'])->fetch()['pseudo']); + } +} + ?> \ No newline at end of file