Can edit permission for modules stored on an alternate document root directory.

This commit is contained in:
Laurent Destailleur 2009-05-04 18:01:47 +00:00
parent 4220aa58eb
commit 6c232bef62
3 changed files with 458 additions and 433 deletions

View File

@ -1,5 +1,21 @@
English Dolibarr changelog English Dolibarr changelog
***** Changelog for 2.7 compared to 2.6 *****
For users:
- New: Add filter on status in emailing selector for Dolibarr users.
For translators:
- Update some language files.
For developers:
- Removed some deprecated files.
- Creation of directory in module descriptor is simpler.
- Can use an alternate document_root directory to develop with
sources on two repositories.
***** Changelog for 2.6 compared to 2.5 ***** ***** Changelog for 2.6 compared to 2.5 *****
For users: For users:

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -19,10 +19,10 @@
*/ */
/** /**
\file htdocs/admin/perms.php * \file htdocs/admin/perms.php
\ingroup core * \ingroup core
\brief Page d'administration/configuration des permissions par defaut * \brief Page d'administration/configuration des permissions par defaut
\version $Id$ * \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -75,12 +75,19 @@ print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
// Charge les modules soumis a permissions
$db->begin(); $db->begin();
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/"; // Charge les modules soumis a permissions
$handle=opendir($dir);
$modules = array(); $modules = array();
foreach ($conf->dol_document_root as $dirroot)
{
$dir = $dirroot . "/includes/modules/";
// Load modules attributes in arrays (name, numero, orders) from dir directory
//print $dir."\n<br>";
$handle=@opendir($dir);
if ($handle)
{
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, strlen($file) - 10) == '.class.php') if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, strlen($file) - 10) == '.class.php')
@ -89,7 +96,7 @@ while (($file = readdir($handle))!==false)
if ($modName) if ($modName)
{ {
include_once("../includes/modules/$file"); include_once($dir."/".$file);
$objMod = new $modName($db); $objMod = new $modName($db);
if ($objMod->rights_class) { if ($objMod->rights_class) {
@ -101,6 +108,8 @@ while (($file = readdir($handle))!==false)
} }
} }
} }
}
}
$db->commit(); $db->commit();