From b5e5dc38493ad0f41e48fed630068e045de493db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Dec 2010 18:15:08 +0000 Subject: [PATCH] Fix: Fix regression by adding "custom" feature making web server hang in infinite loop. --- build/exe/doliwamp/index.php.install | 1170 +++++++++-------- htdocs/admin/commande.php | 144 +- htdocs/admin/dons.php | 137 +- htdocs/admin/expedition.php | 129 +- htdocs/admin/facture.php | 4 +- htdocs/admin/fichinter.php | 135 +- htdocs/admin/fournisseur.php | 257 ++-- htdocs/admin/livraison.php | 129 +- htdocs/admin/modules.php | 2 +- htdocs/admin/perms.php | 2 +- htdocs/admin/project.php | 125 +- htdocs/admin/propale.php | 143 +- htdocs/admin/security.php | 21 +- htdocs/admin/societe.php | 6 +- htdocs/admin/system/modules.php | 36 +- htdocs/categories/class/categorie.class.php | 50 +- htdocs/comm/mailing/cibles.php | 2 +- htdocs/comm/mailing/index.php | 90 +- htdocs/compta/paiement/rapport.php | 159 +-- htdocs/core/class/html.formadmin.class.php | 61 +- htdocs/core/class/interfaces.class.php | 210 +-- htdocs/ecm/docother.php | 2 +- htdocs/exports/class/export.class.php | 2 +- htdocs/imports/class/import.class.php | 2 +- htdocs/imports/import.php | 2 +- .../modules/DolibarrModules.class.php | 6 +- .../modules/barcode/admin/barcode.php | 2 +- .../modules/export/modules_export.php | 49 +- .../modules/import/modules_import.php | 47 +- htdocs/install/etape2.php | 63 +- htdocs/install/fileconf.php | 79 +- htdocs/install/repair.php | 11 +- htdocs/install/upgrade.php | 2 +- htdocs/main.inc.php | 62 +- htdocs/product/admin/produit.php | 69 +- htdocs/product/class/product.class.php | 168 +-- htdocs/public/demo/index.php | 68 +- htdocs/societe/document.php | 2 +- htdocs/user/group/perms.php | 2 +- htdocs/user/perms.php | 37 +- 40 files changed, 1892 insertions(+), 1795 deletions(-) diff --git a/build/exe/doliwamp/index.php.install b/build/exe/doliwamp/index.php.install index a86ae129060..672898e3c12 100644 --- a/build/exe/doliwamp/index.php.install +++ b/build/exe/doliwamp/index.php.install @@ -1,583 +1,589 @@ - -// Arno Esterhuizen -// and Romain Bourdon -// -// icones by Mark James -// -// Modified from WampServer project by Laurent Destailleur (NLTechno) -// for DoliWamp project. - - - -//chemin jusqu'aux fichiers alias -$aliasDir = '../alias/'; -$appDir = '../apps/'; - - - -// we set version of applications -$phpVersion = 'WAMPPHPVERSION'; -if ($phpVersion != phpversion()) $phpVersion .= ' ('.phpversion().')'; -$apacheVersion = 'WAMPAPACHEVERSION'; -if ($apacheVersion != $_SERVER["SERVER_SOFTWARE"]) $apacheVersion .= ' ('.$_SERVER["SERVER_SOFTWARE"].')'; -$mysqlVersion = 'WAMPMYSQLVERSION'; -$apachePort = 'WAMPAPACHEPORT'; - - -// directories to ignore in project list -$projectsListIgnore = array ('.','..'); - - -// texts -$langues = array( - 'en' => array( - 'langue' => 'English', - 'autreLangue1' => 'Español', - 'autreLangueLien1' => 'es', - 'autreLangue2' => 'Français', - 'autreLangueLien2' => 'fr', - 'titreHtml' => 'DoliWamp Homepage', - 'titreConf' => 'Server Configuration', - 'versa' => 'Apache Version :', - 'versp' => 'PHP Version :', - 'versm' => 'MySQL Version :', - 'phpExt' => 'Loaded Extensions : ', - 'titrePage' => 'Tools', - 'txtAlias' => 'Your aliased softwares', - 'txtNoAlias' => 'No Alias found.', - 'txtProjet' => 'Your Softwares', - 'txtNoProjet' => 'No other softwares. To create a new one, just create a directory in \'www\'.', - 'txtApp' => 'Applications', - 'FromLocalNetwork' => 'URL for local access', - 'FromInternet' => 'URL for Internet', - 'NotAvailable' => 'Not available', - 'faq' => 'http://www.en.wampserver.com/faq.php', - 'ipserver' => 'Name/IP Server:', - 'askhelp' => 'Dolibarr Help center' - ), - 'fr' => array( - 'langue' => 'Français', - 'autreLangue1' => 'Español', - 'autreLangueLien1' => 'es', - 'autreLangue2' => 'English', - 'autreLangueLien2' => 'en', - 'titreHtml' => 'Accueil DoliWamp', - 'titreConf' => 'Configuration Serveur', - 'versa' => 'Version de Apache:', - 'versp' => 'Version de PHP:', - 'versm' => 'Version de MySQL:', - 'phpExt' => 'Extensions Chargées: ', - 'titrePage' => 'Outils', - 'txtAlias' => 'Alias d\'applications', - 'txtNoAlias' => 'Aucun alias.', - 'txtProjet' => 'Autres applications (sans alias)', - 'txtNoProjet' => 'Pas d\'autre application. Pour en ajouter une nouvelle, créez simplement un répertoire dans \'www\'.', - 'txtApp' => 'Applications', - 'FromLocalNetwork' => 'URL accès local', - 'FromInternet' => 'URL accès par Internet', - 'NotAvailable' => 'Non disponible', - 'faq' => 'http://www.wampserver.com/faq.php', - 'ipserver' => 'Name/IP Serveur:', - 'askhelp' => 'Centre d\'assistance Dolibarr' - ), - 'es' => array( - 'langue' => 'Español', - 'autreLangue1' => 'English', - 'autreLangueLien1' => 'en', - 'autreLangue2' => 'Français', - 'autreLangueLien2' => 'fr', - 'titreHtml' => 'Inicio DoliWamp', - 'titreConf' => 'Configuración Servidor', - 'versa' => 'Versión de Apache:', - 'versp' => 'Versión de PHP:', - 'versm' => 'Versión de MySQL:', - 'phpExt' => 'Extensiones Cargadas: ', - 'titrePage' => 'Utilidades', - 'txtAlias' => 'Alias de aplicaciones', - 'txtNoAlias' => 'Ningún alias.', - 'txtProjet' => 'Otras aplicaciones (sin alias)', - 'txtNoProjet' => 'Ninguna otra aplicación. Para añadir una nueva, simplemente cree una carpeta en \'www\'.', - 'txtApp' => 'Aplicaciones', - 'FromLocalNetwork' => 'URL for local access', - 'FromInternet' => 'URL for Internet', - 'NotAvailable' => 'Not available', - 'faq' => 'http://www.wampserver.com/faq.php', - 'ipserver' => 'Nombre/IP Servidor', - 'askhelp' => 'Pedir ayuda o soporte' - ) -); - - - -// images -$pngFolder = <<< EOFILE -iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAA3NCSVQICAjb4U/gAAABhlBMVEX//v7//v3///7//fr//fj+/v3//fb+/fT+/Pf//PX+/Pb+/PP+/PL+/PH+/PD+++/+++7++u/9+vL9+vH79+r79+n79uj89tj89Nf889D88sj78sz78sr58N3u7u7u7ev777j67bL67Kv46sHt6uP26cns6d356aP56aD56Jv45pT45pP45ZD45I324av344r344T14J734oT34YD13pD24Hv03af13pP233X025303JL23nX23nHz2pX23Gvn2a7122fz2I3122T12mLz14Xv1JPy1YD12Vz02Fvy1H7v04T011Py03j011b01k7v0n/x0nHz1Ejv0Hnuz3Xx0Gvz00buzofz00Pxz2juz3Hy0TrmznzmzoHy0Djqy2vtymnxzS3xzi/kyG3jyG7wyyXkwJjpwHLiw2Liw2HhwmDdvlXevVPduVThsX7btDrbsj/gq3DbsDzbrT7brDvaqzjapjrbpTraojnboTrbmzrbmjrbl0Tbljrakz3ajzzZjTfZijLZiTJdVmhqAAAAgnRSTlP///////////////////////////////////////8A////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9XzUpQAAAAlwSFlzAAALEgAACxIB0t1+/AAAAB90RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgOLVo0ngAAACqSURBVBiVY5BDAwxECGRlpgNBtpoKCMjLM8jnsYKASFJycnJ0tD1QRT6HromhHj8YMOcABYqEzc3d4uO9vIKCIkULgQIlYq5haao8YMBUDBQoZWIBAnFtAwsHD4kyoEA5l5SCkqa+qZ27X7hkBVCgUkhRXcvI2sk3MCpRugooUCOooWNs4+wdGpuQIlMDFKiWNbO0dXTx9AwICVGuBQqkFtQ1wEB9LhGeAwDSdzMEmZfC0wAAAABJRU5ErkJggg== -EOFILE; -$pngFolderGo = <<< EOFILE -iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJISURBVDjLpZPLS5RhFIef93NmnMIRSynvgRF5KWhRlmWbbotwU9sWLupfCBeBEYhQm2iVq1oF0TKIILIkMgosxBaBkpFDmpo549y+772dFl5bBIG/5eGch9+5KRFhOwrYpmIAk8+O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NReBMUgvQABBDADaAtIIwsEx9f/Dk9pQsH9kHTh8XANKMAIRIIDAhF9ELTiQQH4FaQAZCAsskPNhyRpkK7oBAAEEMSC8GsVGkEaYIlBghcU3gbGzL6YBAAEEJnzCgP6EYs/gcjCGKQI5G4Z9QiswDAAIIAZKszNAgAEAHgFgGSNMTwgAAAAASUVORK5CYII= -EOFILE; -$pngWrench = <<< EOFILE -iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAA3NCSVQICAjb4U/gAAABO1BMVEXu7u7n5+fk5OTi4uLg4ODd3d3X19fV1dXU1NTS0tLPz8+7z+/MzMy6zu65ze65zu7Kysq3zO62zO3IyMjHx8e1yOiyyO2yyOzFxcXExMSyxue0xuexxefDw8OtxeuwxOXCwsLBwcGuxOWsw+q/v7+qweqqwuqrwuq+vr6nv+qmv+m7u7ukvumkvemivOi5ubm4uLicuOebuOeat+e0tLSYtuabtuaatuaXteaZteaatN6Xs+aVs+WTsuaTsuWRsOSrq6uLreKoqKinp6elpaWLqNijo6OFpt2CpNyAo92BotyAo9+dnZ18oNqbm5t4nt57nth7ntp4nt15ndp3nd6ZmZmYmJhym956mtJzm96WlpaVlZVwmNyTk5Nvl9lultuSkpKNjY2Li4uKioqIiIiHh4eGhoZQgtVKfNFdha6iAAAAaXRSTlMA//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////914ivwAAAACXBIWXMAAAsSAAALEgHS3X78AAAAH3RFWHRTb2Z0d2FyZQBNYWNyb21lZGlhIEZpcmV3b3JrcyA4tWjSeAAAAKFJREFUGJVjYIABASc/PwYkIODDxBCNLODEzGiQgCwQxsTlzJCYmAgXiGKVdHFxYEuB8dkTOIS1tRUVocaIWiWI8IiIKKikaoD50kYWrpwmKSkpsRC+lBk3t2NEMgtMu4wpr5aeuHcAjC9vzadjYyjn7w7lK9kK6tqZK4d4wBQECenZW6pHesEdFC9mbK0W7otwsqenqmpMILIn4tIzgpG4ADUpGMOpkOiuAAAAAEl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AIAAAQEAAAEBgAABAgAAAQKAAAEDAAABA -4AAAYAAAAGAgAABgQAAAYGAAAGCAAABgoAAAYMAAAGDgAACAAAAAgCAAAIBAAACAYAAAgIAAAICg -AACAwAAAgOAAAKAAAACgIAAAoEAAAKBgAACggAAAoKAAAKDAAACg4AAAwAAAAMAgAADAQAAAwGAA -AMCAAADAoAAAwMAAAMDgAADgAAAA4CAAAOBAAADgYAAA4IAAAOCgAADgwAAA4OAAQAAAAEAAIABA -AEAAQABgAEAAgABAAKAAQADAAEAA4ABAIAAAQCAgAEAgQABAIGAAQCCAAEAgoABAIMAAQCDgAEBA -AABAQCAAQEBAAEBAYABAQIAAQECgAEBAwABAQOAAQGAAAEBgIABAYEAAQGBgAEBggABAYKAAQGDA -AEBg4ABAgAAAQIAgAECAQABAgGAAQICAAECAoABAgMAAQIDgAECgAABAoCAAQKBAAECgYABAoIAA -QKCgAECgwABAoOAAQMAAAEDAIABAwEAAQMBgAEDAgABAwKAAQMDAAEDA4ABA4AAAQOAgAEDgQABA -4GAAQOCAAEDgoABA4MAAQODgAIAAAACAACAAgABAAIAAYACAAIAAgACgAIAAwACAAOAAgCAAAIAg -IACAIEAAgCBgAIAggACAIKAAgCDAAIAg4ACAQAAAgEAgAIBAQACAQGAAgECAAIBAoACAQMAAgEDg -AIBgAACAYCAAgGBAAIBgYACAYIAAgGCgAIBgwACAYOAAgIAAAICAIACAgEAAgIBgAICAgACAgKAA -gIDAAICA4ACAoAAAgKAgAICgQACAoGAAgKCAAICgoACAoMAAgKDgAIDAAACAwCAAgMBAAIDAYACA -wIAAgMCgAIDAwACAwOAAgOAAAIDgIACA4EAAgOBgAIDggACA4KAAgODAAIDg4ADAAAAAwAAgAMAA -QADAAGAAwACAAMAAoADAAMAAwADgAMAgAADAICAAwCBAAMAgYADAIIAAwCCgAMAgwADAIOAAwEAA -AMBAIADAQEAAwEBgAMBAgADAQKAAwEDAAMBA4ADAYAAAwGAgAMBgQADAYGAAwGCAAMBgoADAYMAA -w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bZGRkZFxSUlqaoqKioqKioqOiowAArq2so6KioqKimlpaWlpaWpqaoqKioqKioqKj -o6L2AACurayjoqKioqKioqKioqKioqKioqKioqKioqOipAgAAK6trKOioqKioqKioqKioqKioqKi -oqKioqKjo6P/AAAArq2so6KioqKioqKioqKioqKioqKioqKjo6OjEwcAAACurayjoqKioqKioqKi -oqKioqKioqKjo6ysrLYHAAAAAK6trKOioqKioqKioqKioqKioqOjrKzs7K2uBwAAAAAArq317Kys -rKysrKysrKysrKzs7fX19a2tEwcAAAAAAACu9v/29vb29vb29vb29vb29vatraWlrgcIAAAAAAAA -AAClpaWlpaWlpaWlpaWlpaVcXGWuEwcIAAAAAAAAAAAAgBAH/wAQAf8AAAB/AAAAPwAAAB8AAAAP -AAAABwAAAAcAAAADAAAAAwAQAAEAHwABAB/AAQAf4AEAH/ABAB/wAAAf8AAAH/ABAB/wAQAf8AEA -H+ABAB+AAQAAAAMAAAADAAAAAwAAAAcAAAAHAAAADwAAAB8AAAA/AAAAf4AAAf8= -EOFILE; - - - -// Ask help -if (isset($_GET['askhelp'])) -{ - print "Sorry, feature not yet available"; - exit(); -} - - -// Show PHPInfo -if (isset($_GET['phpinfo'])) -{ - phpinfo(); - exit(); -} - - -//affichage des images -if (isset($_GET['img'])) -{ - switch ($_GET['img']) - { - case 'pngFolder' : - header("Content-type: image/png"); - echo base64_decode($pngFolder); - exit(); - - case 'pngFolderGo' : - header("Content-type: image/png"); - echo base64_decode($pngFolderGo); - exit(); - - case 'pngLogo' : - header("Content-type: image/png"); - echo base64_decode($pngLogo); - exit(); - - case 'pngPlugin' : - header("Content-type: image/png"); - echo base64_decode($pngPlugin); - exit(); - - case 'pngWrench' : - header("Content-type: image/png"); - echo base64_decode($pngWrench); - exit(); - - case 'favicon' : - header("Content-type: image/x-icon"); - echo base64_decode($favicon); - exit(); - } -} - - - -// Definition de la langue et des textes - -if (isset ($_GET['lang'])) -{ - $langue = $_GET['lang']; -} -elseif (preg_match("/^fr/", $_SERVER['HTTP_ACCEPT_LANGUAGE'])) -{ - $langue = 'fr'; -} -elseif (preg_match("/^es/", $_SERVER['HTTP_ACCEPT_LANGUAGE'])) -{ - $langue = 'es'; -} -else -{ - $langue = 'en'; -} - - -// Read PHP extensions -$loaded_extensions = get_loaded_extensions(); -foreach ($loaded_extensions as $extension) - $phpExtContents .= "
  • ${extension}
  • "; - - - -// Read alias directory -$listoffile=array(); -$aliasarray=array(); -if (is_dir($aliasDir)) -{ - $handle=opendir($aliasDir); - while ($file = readdir($handle)) - { - $listoffiles[]=$file; - } - sort($listoffiles); - - foreach($listoffiles as $file) - { - if (is_file($aliasDir.$file) && preg_match('/\.conf/',$file)) - { - $msg = ''; - - $aliasContents.='http://localhost'.($apachePort != 80?':'.$apachePort:'').'/'.$file.'/http://ipofyourserver'.($apachePort != 80?':'.$apachePort:'').'/'.$file.'/'; - elseif (preg_match('/phpmyadmin/i',$file)) $aliasContents .= $file.'http://localhost'.($apachePort != 80?':'.$apachePort:'').'/'.$file.'/'.$langues[$langue]['NotAvailable'].''; - else $aliasContents .= $file.' '.$langues[$langue]['NotAvailable'].''; - - $aliasarray[]=$file; - } - } - closedir($handle); -} -if (!isset($aliasContents)) - $aliasContents = ''.$langues[$langue]['txtNoAlias'].''; - - -// Read projects in www dir -$listoffiles=array(); -$handle=opendir("."); -while ($file = readdir($handle)) -{ - $listoffiles[]=$file; -} -closedir($handle); - -foreach($listoffiles as $file) -{ - if (is_dir($file) && !in_array($file,$projectsListIgnore) && !in_array($file,$aliasarray)) - { - $projectContents .= 'http://localhost'.($apachePort != 80?':'.$apachePort:'').'/'.$file.'/)'.''.$langues[$langue]['NotAvailable'].''; - } -} - -if (!isset($projectContents)) - $projectContents = ''.$langues[$langue]['txtNoProjet'].''; - - - -$nameServer=getenv("COMPUTERNAME"); -$ipServer=$nameServer; - - - -$pageContents = <<< EOPAGE - - - - - - {$langues[$langue]['titreHtml']} - - - - - - - - - -
    - - - -
    -
    -

    {$langues[$langue]['titreConf']}

    - -
    -
    {$langues[$langue]['versa']}
    -
    ${apacheVersion}  
    -
    {$langues[$langue]['versp']}
    -
    ${phpVersion}  
    -
    {$langues[$langue]['phpExt']}
    -
    -
      - ${phpExtContents} -
    -
    -
    {$langues[$langue]['versm']}
    -
    ${mysqlVersion}  
    -
    {$langues[$langue]['ipserver']}
    -
    ${ipServer}  
    -
    - -

    {$langues[$langue]['txtApp']}

    - - - ${aliasContents} - ${projectContents} -
    - {$langues[$langue]['txtApp']} - - {$langues[$langue]['FromLocalNetwork']} - - {$langues[$langue]['FromInternet']} -
    - -

    {$langues[$langue]['titrePage']}

    - - - - - - -EOPAGE; - -echo $pageContents; + +// Arno Esterhuizen +// and Romain Bourdon +// +// icones by Mark James +// +// Modified from WampServer project by Laurent Destailleur (NLTechno) +// for DoliWamp project. + + + +//chemin jusqu'aux fichiers alias +$aliasDir = '../alias/'; +$appDir = '../apps/'; + + + +// we set version of applications +$phpVersion = 'WAMPPHPVERSION'; +if ($phpVersion != phpversion()) $phpVersion .= ' ('.phpversion().')'; +$apacheVersion = 'WAMPAPACHEVERSION'; +if ($apacheVersion != $_SERVER["SERVER_SOFTWARE"]) $apacheVersion .= ' ('.$_SERVER["SERVER_SOFTWARE"].')'; +$mysqlVersion = 'WAMPMYSQLVERSION'; +$apachePort = 'WAMPAPACHEPORT'; + + +// directories to ignore in project list +$projectsListIgnore = array ('.','..'); + + +// texts +$langues = array( + 'en' => array( + 'langue' => 'English', + 'autreLangue1' => 'Español', + 'autreLangueLien1' => 'es', + 'autreLangue2' => 'Français', + 'autreLangueLien2' => 'fr', + 'titreHtml' => 'DoliWamp Homepage', + 'titreConf' => 'Server Configuration', + 'versa' => 'Apache Version :', + 'versp' => 'PHP Version :', + 'versm' => 'MySQL Version :', + 'phpExt' => 'Loaded Extensions : ', + 'titrePage' => 'Tools', + 'txtAlias' => 'Your aliased softwares', + 'txtNoAlias' => 'No Alias found.', + 'txtProjet' => 'Your Softwares', + 'txtNoProjet' => 'No other softwares. To create a new one, just create a directory in \'www\'.', + 'txtApp' => 'Applications', + 'FromLocalNetwork' => 'URL for local access', + 'FromInternet' => 'URL for Internet', + 'NotAvailable' => 'Not available', + 'faq' => 'http://www.en.wampserver.com/faq.php', + 'ipserver' => 'Name/IP Server:', + 'askhelp' => 'Dolibarr Help center' + ), + 'fr' => array( + 'langue' => 'Français', + 'autreLangue1' => 'Español', + 'autreLangueLien1' => 'es', + 'autreLangue2' => 'English', + 'autreLangueLien2' => 'en', + 'titreHtml' => 'Accueil DoliWamp', + 'titreConf' => 'Configuration Serveur', + 'versa' => 'Version de Apache:', + 'versp' => 'Version de PHP:', + 'versm' => 'Version de MySQL:', + 'phpExt' => 'Extensions Chargées: ', + 'titrePage' => 'Outils', + 'txtAlias' => 'Alias d\'applications', + 'txtNoAlias' => 'Aucun alias.', + 'txtProjet' => 'Autres applications (sans alias)', + 'txtNoProjet' => 'Pas d\'autre application. Pour en ajouter une nouvelle, créez simplement un répertoire dans \'www\'.', + 'txtApp' => 'Applications', + 'FromLocalNetwork' => 'URL accès local', + 'FromInternet' => 'URL accès par Internet', + 'NotAvailable' => 'Non disponible', + 'faq' => 'http://www.wampserver.com/faq.php', + 'ipserver' => 'Name/IP Serveur:', + 'askhelp' => 'Centre d\'assistance Dolibarr' + ), + 'es' => array( + 'langue' => 'Español', + 'autreLangue1' => 'English', + 'autreLangueLien1' => 'en', + 'autreLangue2' => 'Français', + 'autreLangueLien2' => 'fr', + 'titreHtml' => 'Inicio DoliWamp', + 'titreConf' => 'Configuración Servidor', + 'versa' => 'Versión de Apache:', + 'versp' => 'Versión de PHP:', + 'versm' => 'Versión de MySQL:', + 'phpExt' => 'Extensiones Cargadas: ', + 'titrePage' => 'Utilidades', + 'txtAlias' => 'Alias de aplicaciones', + 'txtNoAlias' => 'Ningún alias.', + 'txtProjet' => 'Otras aplicaciones (sin alias)', + 'txtNoProjet' => 'Ninguna otra aplicación. Para añadir una nueva, simplemente cree una carpeta en \'www\'.', + 'txtApp' => 'Aplicaciones', + 'FromLocalNetwork' => 'URL for local access', + 'FromInternet' => 'URL for Internet', + 'NotAvailable' => 'Not available', + 'faq' => 'http://www.wampserver.com/faq.php', + 'ipserver' => 'Nombre/IP Servidor', + 'askhelp' => 'Pedir ayuda o soporte' + ) +); + + + +// images +$pngFolder = <<< EOFILE +iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAA3NCSVQICAjb4U/gAAABhlBMVEX//v7//v3///7//fr//fj+/v3//fb+/fT+/Pf//PX+/Pb+/PP+/PL+/PH+/PD+++/+++7++u/9+vL9+vH79+r79+n79uj89tj89Nf889D88sj78sz78sr58N3u7u7u7ev777j67bL67Kv46sHt6uP26cns6d356aP56aD56Jv45pT45pP45ZD45I324av344r344T14J734oT34YD13pD24Hv03af13pP233X025303JL23nX23nHz2pX23Gvn2a7122fz2I3122T12mLz14Xv1JPy1YD12Vz02Fvy1H7v04T011Py03j011b01k7v0n/x0nHz1Ejv0Hnuz3Xx0Gvz00buzofz00Pxz2juz3Hy0TrmznzmzoHy0Djqy2vtymnxzS3xzi/kyG3jyG7wyyXkwJjpwHLiw2Liw2HhwmDdvlXevVPduVThsX7btDrbsj/gq3DbsDzbrT7brDvaqzjapjrbpTraojnboTrbmzrbmjrbl0Tbljrakz3ajzzZjTfZijLZiTJdVmhqAAAAgnRSTlP///////////////////////////////////////8A////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9XzUpQAAAAlwSFlzAAALEgAACxIB0t1+/AAAAB90RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgOLVo0ngAAACqSURBVBiVY5BDAwxECGRlpgNBtpoKCMjLM8jnsYKASFJycnJ0tD1QRT6HromhHj8YMOcABYqEzc3d4uO9vIKCIkULgQIlYq5haao8YMBUDBQoZWIBAnFtAwsHD4kyoEA5l5SCkqa+qZ27X7hkBVCgUkhRXcvI2sk3MCpRugooUCOooWNs4+wdGpuQIlMDFKiWNbO0dXTx9AwICVGuBQqkFtQ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D09o/h+X3gXG4YmteA0ACCCsLghPbPkfm9b5PzK5439Sdg9eAwACCEyANMBwaFwTGIMMAOEQIBuGA6Mb/qMbABBAEAOQnIyMo1M74Tgiqf2/b3gVhgEAAQQmQuKa/8ekdYMxyLCgmEYMHJXc9t87FNMAgACCGgBxIkgzyDaQU5FxQGQN2AUBUXX/vULKwdgjsOQ/SC9AAKEEYlB03f+oFJABdSjYP6L6P0guIqkVjt0DisEGAAQQigEgG0AhHxBVi4L9wqvBBiEHtqs/xACAAAIbEBBd/x+Eg2ObwH4FORmGfYCaQRikCUS7B5YBNReBMUgvQABBDADaAtIIwsEx9f/Dk9pQsH9kHTh8XANKMAIRIIDAhF9ELTiQQH4FaQAZCAsskPNhyRpkK7oBAAEEMSC8GsVGkEaYIlBghcU3gbGzL6YBAAEEJnzCgP6EYs/gcjCGKQI5G4Z9QiswDAAIIAZKszNAgAEAHgFgGSNMTwgAAAAASUVORK5CYII= +EOFILE; +$pngWrench = <<< EOFILE +iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAA3NCSVQICAjb4U/gAAABO1BMVEXu7u7n5+fk5OTi4uLg4ODd3d3X19fV1dXU1NTS0tLPz8+7z+/MzMy6zu65ze65zu7Kysq3zO62zO3IyMjHx8e1yOiyyO2yyOzFxcXExMSyxue0xuexxefDw8OtxeuwxOXCwsLBwcGuxOWsw+q/v7+qweqqwuqrwuq+vr6nv+qmv+m7u7ukvumkvemivOi5ubm4uLicuOebuOeat+e0tLSYtuabtuaatuaXteaZteaatN6Xs+aVs+WTsuaTsuWRsOSrq6uLreKoqKinp6elpaWLqNijo6OFpt2CpNyAo92BotyAo9+dnZ18oNqbm5t4nt57nth7ntp4nt15ndp3nd6ZmZmYmJhym956mtJzm96WlpaVlZVwmNyTk5Nvl9lultuSkpKNjY2Li4uKioqIiIiHh4eGhoZQgtVKfNFdha6iAAAAaXRSTlMA//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////914ivwAAA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vr66ubEwAAAAAAAAAAABOt9ezr6+vr66NbB67t9Ovr6+vro5sTAAAAAAAAAAAAB670 +6+vr6+vro1sHru3s66urq6ujmxMAAAAAAAAAAAAHrezrq6urq6ujWgCu7eyro6Ojo6NaEwAAAAAA +AAAAAAfsq6ujo6Ojq6NaAK6t7Kujo6Ojo1oTAAAAAAAAAAAAB6Ojo6Ojo6Ojo5sArq3so6Ojo6Oj +WhMAAAAAAAAAAAijo6Ojo6Ojo6OirQCureyjo6Ojo6JaEwAAAAAAAAetWpqjo6Ojo6Ojo5r/AK6t +rKOioqKiolpbZGRkZFxSUlqaoqKioqKioqOiowAArq2so6KioqKimlpaWlpaWpqaoqKioqKioqKj +o6L2AACurayjoqKioqKioqKioqKioqKioqKioqKioqOipAgAAK6trKOioqKioqKioqKioqKioqKi +oqKioqKjo6P/AAAArq2so6KioqKioqKioqKioqKioqKioqKjo6OjEwcAAACurayjoqKioqKioqKi +oqKioqKioqKjo6ysrLYHAAAAAK6trKOioqKioqKioqKioqKioqOjrKzs7K2uBwAAAAAArq317Kys +rKysrKysrKysrKzs7fX19a2tEwcAAAAAAACu9v/29vb29vb29vb29vb29vatraWlrgcIAAAAAAAA +AAClpaWlpaWlpaWlpaWlpaVcXGWuEwcIAAAAAAAAAAAAgBAH/wAQAf8AAAB/AAAAPwAAAB8AAAAP +AAAABwAAAAcAAAADAAAAAwAQAAEAHwABAB/AAQAf4AEAH/ABAB/wAAAf8AAAH/ABAB/wAQAf8AEA +H+ABAB+AAQAAAAMAAAADAAAAAwAAAAcAAAAHAAAADwAAAB8AAAA/AAAAf4AAAf8= +EOFILE; + + + +// Ask help +if (isset($_GET['askhelp'])) +{ + print "Sorry, feature not yet available"; + exit(); +} + + +// Show PHPInfo +if (isset($_GET['phpinfo'])) +{ + phpinfo(); + exit(); +} + + +//affichage des images +if (isset($_GET['img'])) +{ + switch ($_GET['img']) + { + case 'pngFolder' : + header("Content-type: image/png"); + echo base64_decode($pngFolder); + exit(); + + case 'pngFolderGo' : + header("Content-type: image/png"); + echo base64_decode($pngFolderGo); + exit(); + + case 'pngLogo' : + header("Content-type: image/png"); + echo base64_decode($pngLogo); + exit(); + + case 'pngPlugin' : + header("Content-type: image/png"); + echo base64_decode($pngPlugin); + exit(); + + case 'pngWrench' : + header("Content-type: image/png"); + echo base64_decode($pngWrench); + exit(); + + case 'favicon' : + header("Content-type: image/x-icon"); + echo base64_decode($favicon); + exit(); + } +} + + + +// Definition de la langue et des textes + +if (isset ($_GET['lang'])) +{ + $langue = $_GET['lang']; +} +elseif (preg_match("/^fr/", $_SERVER['HTTP_ACCEPT_LANGUAGE'])) +{ + $langue = 'fr'; +} +elseif (preg_match("/^es/", $_SERVER['HTTP_ACCEPT_LANGUAGE'])) +{ + $langue = 'es'; +} +else +{ + $langue = 'en'; +} + + +// Read PHP extensions +$loaded_extensions = get_loaded_extensions(); +foreach ($loaded_extensions as $extension) + $phpExtContents .= "
  • ${extension}
  • "; + + + +// Read alias directory +$listoffile=array(); +$aliasarray=array(); +if (is_dir($aliasDir)) +{ + $handle=opendir($aliasDir); + if (is_resource($handle)) + { + while ($file = readdir($handle)) + { + $listoffiles[]=$file; + } + } + sort($listoffiles); + + foreach($listoffiles as $file) + { + if (is_file($aliasDir.$file) && preg_match('/\.conf/',$file)) + { + $msg = ''; + + $aliasContents.='http://localhost'.($apachePort != 80?':'.$apachePort:'').'/'.$file.'/http://ipofyourserver'.($apachePort != 80?':'.$apachePort:'').'/'.$file.'/'; + elseif (preg_match('/phpmyadmin/i',$file)) $aliasContents .= $file.'http://localhost'.($apachePort != 80?':'.$apachePort:'').'/'.$file.'/'.$langues[$langue]['NotAvailable'].''; + else $aliasContents .= $file.' '.$langues[$langue]['NotAvailable'].''; + + $aliasarray[]=$file; + } + } + closedir($handle); +} +if (!isset($aliasContents)) + $aliasContents = ''.$langues[$langue]['txtNoAlias'].''; + + +// Read projects in www dir +$listoffiles=array(); +$handle=opendir("."); +if (is_resource($handle)) +{ + while ($file = readdir($handle)) + { + $listoffiles[]=$file; + } + closedir($handle); +} + +foreach($listoffiles as $file) +{ + if (is_dir($file) && !in_array($file,$projectsListIgnore) && !in_array($file,$aliasarray)) + { + $projectContents .= 'http://localhost'.($apachePort != 80?':'.$apachePort:'').'/'.$file.'/)'.''.$langues[$langue]['NotAvailable'].''; + } +} + +if (!isset($projectContents)) + $projectContents = ''.$langues[$langue]['txtNoProjet'].''; + + + +$nameServer=getenv("COMPUTERNAME"); +$ipServer=$nameServer; + + + +$pageContents = <<< EOPAGE + + + + + + {$langues[$langue]['titreHtml']} + + + + + + + + + +
    + + + +
    +
    +

    {$langues[$langue]['titreConf']}

    + +
    +
    {$langues[$langue]['versa']}
    +
    ${apacheVersion}  
    +
    {$langues[$langue]['versp']}
    +
    ${phpVersion}  
    +
    {$langues[$langue]['phpExt']}
    +
    +
      + ${phpExtContents} +
    +
    +
    {$langues[$langue]['versm']}
    +
    ${mysqlVersion}  
    +
    {$langues[$langue]['ipserver']}
    +
    ${ipServer}  
    +
    + +

    {$langues[$langue]['txtApp']}

    + + + ${aliasContents} + ${projectContents} +
    + {$langues[$langue]['txtApp']} + + {$langues[$langue]['FromLocalNetwork']} + + {$langues[$langue]['FromInternet']} +
    + +

    {$langues[$langue]['titrePage']}

    + + + + + + +EOPAGE; + +echo $pageContents; ?> \ No newline at end of file diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 60c1793c3ec..16e255cb374 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -208,7 +208,7 @@ clearstatcache(); $dir = "../includes/modules/commande/"; $handle = opendir($dir); -if ($handle) +if (is_resource($handle)) { $var=true; @@ -330,84 +330,86 @@ clearstatcache(); $handle=opendir($dir); $var=true; -while (($file = readdir($handle))!==false) +if (is_resource($handle)) { - if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_') - { - $name = substr($file, 4, dol_strlen($file) -16); - $classname = substr($file, 0, dol_strlen($file) -12); + while (($file = readdir($handle))!==false) + { + if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_') + { + $name = substr($file, 4, dol_strlen($file) -16); + $classname = substr($file, 0, dol_strlen($file) -12); - $var=!$var; - print "\n "; - print "$name"; - print "\n \n"; - require_once($dir.$file); - $module = new $classname($db); - print $module->description; - print "\n"; + $var=!$var; + print "\n "; + print "$name"; + print "\n \n"; + require_once($dir.$file); + $module = new $classname($db); + print $module->description; + print "\n"; - // Activated - print "\n"; - if (in_array($name, $def)) - { - if ($conf->global->COMMANDE_ADDON_PDF != "$name") - { - print ''; - print img_picto($langs->trans("Activated"),'on'); - print ''; - } - else - { - print img_picto($langs->trans("Activated"),'on'); - } - } - else - { - print ''; - print img_picto($langs->trans("Disabled"),'off'); - print ''; - } - print ""; + // Activated + print "\n"; + if (in_array($name, $def)) + { + if ($conf->global->COMMANDE_ADDON_PDF != "$name") + { + print ''; + print img_picto($langs->trans("Activated"),'on'); + print ''; + } + else + { + print img_picto($langs->trans("Activated"),'on'); + } + } + else + { + print ''; + print img_picto($langs->trans("Disabled"),'off'); + print ''; + } + print ""; - // Defaut - print ""; - if ($conf->global->COMMANDE_ADDON_PDF == "$name") - { - print img_picto($langs->trans("Yes"),'on'); - } - else - { - print ''; - print img_picto($langs->trans("No"),'off'); - print ''; - } - print ''; + // Defaut + print ""; + if ($conf->global->COMMANDE_ADDON_PDF == "$name") + { + print img_picto($langs->trans("Yes"),'on'); + } + else + { + print ''; + print img_picto($langs->trans("No"),'off'); + print ''; + } + print ''; - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); - $htmltooltip.='
    '.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur; - $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
    '.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
    '.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
    '.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - //$htmltooltip.='
    '.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1); - //$htmltooltip.='
    '.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); - $htmltooltip.='
    '.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip.='
    '.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur; + $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + $htmltooltip.='
    '.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); + $htmltooltip.='
    '.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); + $htmltooltip.='
    '.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); + //$htmltooltip.='
    '.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1); + //$htmltooltip.='
    '.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); + $htmltooltip.='
    '.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); - print ''; - print $html->textwithpicto('',$htmltooltip,1,0); - print ''; - print ''; - print ''.img_object($langs->trans("Preview"),'order').''; - print ''; + print ''; + print $html->textwithpicto('',$htmltooltip,1,0); + print ''; + print ''; + print ''.img_object($langs->trans("Preview"),'order').''; + print ''; - print "\n"; - } + print "\n"; + } + } + closedir($handle); } -closedir($handle); - print ''; //Autres Options diff --git a/htdocs/admin/dons.php b/htdocs/admin/dons.php index 82c67bd5935..9c3f51b5f7f 100644 --- a/htdocs/admin/dons.php +++ b/htdocs/admin/dons.php @@ -177,84 +177,87 @@ clearstatcache(); $handle=opendir($dir); $var=True; -while (($file = readdir($handle))!==false) +if (is_resource($handle)) { - if (preg_match('/\.modules\.php$/i',$file)) + while (($file = readdir($handle))!==false) { - $var = !$var; - $name = substr($file, 0, dol_strlen($file) -12); - $classname = substr($file, 0, dol_strlen($file) -12); + if (preg_match('/\.modules\.php$/i',$file)) + { + $var = !$var; + $name = substr($file, 0, dol_strlen($file) -12); + $classname = substr($file, 0, dol_strlen($file) -12); - require_once($dir.'/'.$file); - $module=new $classname($db); + require_once($dir.'/'.$file); + $module=new $classname($db); - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - if ($module->isEnabled()) - { - print ''; - echo $module->name; - print ''; - print ''; - print $module->description; - print ''; + if ($module->isEnabled()) + { + print ''; + echo $module->name; + print ''; + print ''; + print $module->description; + print ''; - // Active - if (in_array($name, $def)) - { - print "\n"; - if ($conf->global->DON_ADDON_MODEL == $name) - { - print img_picto($langs->trans("Enabled"),'on'); - } - else - { - print ' '; - print ''; - print ''.img_picto($langs->trans("Enabled"),'on').''; - } - print ''; - } - else - { - print "\n"; - print ''.img_picto($langs->trans("Disabled"),'off').''; - print ""; - } + // Active + if (in_array($name, $def)) + { + print "\n"; + if ($conf->global->DON_ADDON_MODEL == $name) + { + print img_picto($langs->trans("Enabled"),'on'); + } + else + { + print ' '; + print ''; + print ''.img_picto($langs->trans("Enabled"),'on').''; + } + print ''; + } + else + { + print "\n"; + print ''.img_picto($langs->trans("Disabled"),'off').''; + print ""; + } - // Defaut - print ""; - if ($conf->global->DON_ADDON_MODEL == "$name") - { - print img_picto($langs->trans("Default"),'on'); - } - else - { - print ''.img_picto($langs->trans("Disabled"),'off').''; - } - print ''; + // Defaut + print ""; + if ($conf->global->DON_ADDON_MODEL == "$name") + { + print img_picto($langs->trans("Default"),'on'); + } + else + { + print ''.img_picto($langs->trans("Disabled"),'off').''; + } + print ''; - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); - $htmltooltip.='
    '.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur; - $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
    '.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - print ''; - print $html->textwithpicto('',$htmltooltip,1,0); - print ''; - print ''; - print ''.img_object($langs->trans("Preview"),'generic').''; - print ''; + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip.='
    '.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur; + $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + $htmltooltip.='
    '.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); + print ''; + print $html->textwithpicto('',$htmltooltip,1,0); + print ''; + print ''; + print ''.img_object($langs->trans("Preview"),'generic').''; + print ''; - print "\n"; - } + print "\n"; + } + } } + closedir($handle); } -closedir($handle); print ''; diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index f3a3131026c..fbf78737668 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -304,75 +304,78 @@ if(is_dir($dir)) $handle=opendir($dir); $var=true; - while (($file = readdir($handle))!==false) - { - if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,15) == 'pdf_expedition_') - { - $name = substr($file, 15, dol_strlen($file) - 27); - $classname = substr($file, 0, dol_strlen($file) - 12); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,15) == 'pdf_expedition_') + { + $name = substr($file, 15, dol_strlen($file) - 27); + $classname = substr($file, 0, dol_strlen($file) - 12); - $var=!$var; - print ""; - print $name; - print "\n"; - require_once($dir.$file); - $module = new $classname(); + $var=!$var; + print ""; + print $name; + print "\n"; + require_once($dir.$file); + $module = new $classname(); - print $module->description; - print ''; + print $module->description; + print ''; - // Active - if (in_array($name, $def)) - { - print "\n"; - if ($conf->global->EXPEDITION_ADDON_PDF != $name) - { - print ''; - print img_picto($langs->trans("Activated"),'on'); - print ''; - } - else - { - print img_picto($langs->trans("Activated"),'on'); - } - print ""; - } - else - { - print "\n"; - print ''.img_picto($langs->trans("Disabled"),'off').''; - print ""; - } + // Active + if (in_array($name, $def)) + { + print "\n"; + if ($conf->global->EXPEDITION_ADDON_PDF != $name) + { + print ''; + print img_picto($langs->trans("Activated"),'on'); + print ''; + } + else + { + print img_picto($langs->trans("Activated"),'on'); + } + print ""; + } + else + { + print "\n"; + print ''.img_picto($langs->trans("Disabled"),'off').''; + print ""; + } - // Default - print ""; - if ($conf->global->EXPEDITION_ADDON_PDF == $name) - { - print img_picto($langs->trans("Default"),'on'); - } - else - { - print ''.img_picto($langs->trans("Disabled"),'off').''; - } - print ''; + // Default + print ""; + if ($conf->global->EXPEDITION_ADDON_PDF == $name) + { + print img_picto($langs->trans("Default"),'on'); + } + else + { + print ''.img_picto($langs->trans("Disabled"),'off').''; + } + print ''; - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); - $htmltooltip.='
    '.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; - $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - print ''; - print $html->textwithpicto('',$htmltooltip,1,0); - print ''; - print ''; - print ''.img_object($langs->trans("Preview"),'sending').''; - print ''; + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip.='
    '.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + print ''; + print $html->textwithpicto('',$htmltooltip,1,0); + print ''; + print ''; + print ''.img_object($langs->trans("Preview"),'sending').''; + print ''; - print ''; - } - } - closedir($handle); + print ''; + } + } + closedir($handle); + } } else { diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 510e9b8d3c4..4909750b5b3 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -258,7 +258,7 @@ foreach ($conf->file->dol_document_root as $dirroot) if (is_dir($dir)) { $handle = opendir($dir); - if ($handle) + if (is_resource($handle)) { while (($file = readdir($handle))!==false) { @@ -414,7 +414,7 @@ foreach ($conf->file->dol_document_root as $dirroot) if (is_dir($dir)) { $handle=opendir($dir); - if ($handle) + if (is_resource($handle)) { while (($file = readdir($handle))!==false) { diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index d2724d3cb28..5ebd52b5a45 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -197,7 +197,7 @@ print "\n"; clearstatcache(); $handle = opendir($dir); -if ($handle) +if (is_resource($handle)) { $var=true; @@ -304,79 +304,82 @@ clearstatcache(); $var=true; $handle=opendir($dir); -while (($file = readdir($handle))!==false) +if (is_resource($handle)) { - if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_') - { - $name = substr($file, 4, dol_strlen($file) -16); - $classname = substr($file, 0, dol_strlen($file) -12); + while (($file = readdir($handle))!==false) + { + if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_') + { + $name = substr($file, 4, dol_strlen($file) -16); + $classname = substr($file, 0, dol_strlen($file) -12); - $var=!$var; + $var=!$var; - print ''; - echo "$name"; - print "\n"; - require_once($dir.$file); - $module = new $classname(); - print $module->description; - print ''; + print ''; + echo "$name"; + print "\n"; + require_once($dir.$file); + $module = new $classname(); + print $module->description; + print ''; - // Active - if (in_array($name, $def)) - { - print "\n"; - if ($conf->global->FICHEINTER_ADDON_PDF != "$name") - { - print ''; - print img_picto($langs->trans("Enabled"),'on'); - print ''; - } - else - { - print img_picto($langs->trans("Enabled"),'on'); - } - print ""; - } - else - { - print "\n"; - print ''.img_picto($langs->trans("Disabled"),'off').''; - print ""; - } + // Active + if (in_array($name, $def)) + { + print "\n"; + if ($conf->global->FICHEINTER_ADDON_PDF != "$name") + { + print ''; + print img_picto($langs->trans("Enabled"),'on'); + print ''; + } + else + { + print img_picto($langs->trans("Enabled"),'on'); + } + print ""; + } + else + { + print "\n"; + print ''.img_picto($langs->trans("Disabled"),'off').''; + print ""; + } - // Defaut - print ""; - if ($conf->global->FICHEINTER_ADDON_PDF == "$name") - { - print img_picto($langs->trans("Default"),'on'); - } - else - { - print ''.img_picto($langs->trans("Disabled"),'off').''; - } - print ''; + // Defaut + print ""; + if ($conf->global->FICHEINTER_ADDON_PDF == "$name") + { + print img_picto($langs->trans("Default"),'on'); + } + else + { + print ''.img_picto($langs->trans("Disabled"),'off').''; + } + print ''; - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); - $htmltooltip.='
    '.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; - $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
    '.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
    '.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
    '.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - $htmltooltip.='
    '.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); - print ''; - print $html->textwithpicto('',$htmltooltip,1,0); - print ''; - print ''; - print ''.img_object($langs->trans("Preview"),'intervention').''; - print ''; + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip.='
    '.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + $htmltooltip.='
    '.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); + $htmltooltip.='
    '.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); + $htmltooltip.='
    '.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); + $htmltooltip.='
    '.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + print ''; + print $html->textwithpicto('',$htmltooltip,1,0); + print ''; + print ''; + print ''.img_object($langs->trans("Preview"),'intervention').''; + print ''; - print ''; - } + print ''; + } + } + closedir($handle); } -closedir($handle); print ''; diff --git a/htdocs/admin/fournisseur.php b/htdocs/admin/fournisseur.php index 4c732e567c6..fe2d577478c 100644 --- a/htdocs/admin/fournisseur.php +++ b/htdocs/admin/fournisseur.php @@ -232,7 +232,7 @@ print "\n"; clearstatcache(); $handle = opendir($dir); -if ($handle) +if (is_resource($handle)) { $var=true; @@ -356,77 +356,80 @@ clearstatcache(); $handle=opendir($dir); $var=true; -while (($file = readdir($handle))!==false) +if (is_resource($handle)) { - if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_') - { - $name = substr($file, 4, dol_strlen($file) -16); - $classname = substr($file, 0, dol_strlen($file) -12); + while (($file = readdir($handle))!==false) + { + if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_') + { + $name = substr($file, 4, dol_strlen($file) -16); + $classname = substr($file, 0, dol_strlen($file) -12); - $var=!$var; - print "\n $name"; - print "\n \n"; - require_once($dir.$file); - $module = new $classname($db,$specimenthirdparty); - print $module->description; - print "\n"; + $var=!$var; + print "\n $name"; + print "\n \n"; + require_once($dir.$file); + $module = new $classname($db,$specimenthirdparty); + print $module->description; + print "\n"; - // Active - if (in_array($name, $def)) - { - print ''."\n"; - if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name") - { - print ''; - print img_picto($langs->trans("Enabled"),'on'); - print ''; - } - else - { - print img_picto($langs->trans("Enabled"),'on'); - } - print ""; - } - else - { - print ''."\n"; - print ''.img_picto($langs->trans("Disabled"),'off').''; - print ""; - } + // Active + if (in_array($name, $def)) + { + print ''."\n"; + if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name") + { + print ''; + print img_picto($langs->trans("Enabled"),'on'); + print ''; + } + else + { + print img_picto($langs->trans("Enabled"),'on'); + } + print ""; + } + else + { + print ''."\n"; + print ''.img_picto($langs->trans("Disabled"),'off').''; + print ""; + } - // Defaut - print ''; - if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") - { - print img_picto($langs->trans("Default"),'on'); - } - else - { - print ''.img_picto($langs->trans("Disabled"),'on').''; - } - print ''; + // Defaut + print ''; + if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") + { + print img_picto($langs->trans("Default"),'on'); + } + else + { + print ''.img_picto($langs->trans("Disabled"),'on').''; + } + print ''; - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); - $htmltooltip.='
    '.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; - $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
    '.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
    '.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - print ''; - print $html->textwithpicto('',$htmltooltip,1,0); - print ''; - print ''; - print ''.img_object($langs->trans("Preview"),'order').''; - print ''; + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip.='
    '.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + $htmltooltip.='
    '.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); + $htmltooltip.='
    '.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); + print ''; + print $html->textwithpicto('',$htmltooltip,1,0); + print ''; + print ''; + print ''.img_object($langs->trans("Preview"),'order').''; + print ''; - print "\n"; - } + print "\n"; + } + } + + closedir($handle); } -closedir($handle); - print '
    '; /* @@ -476,73 +479,77 @@ clearstatcache(); $handle=opendir($dir); $var=true; -while (($file = readdir($handle)) !== false) +if (is_resource($handle)) { - if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_') - { - $name = substr($file, 4, dol_strlen($file) -16); - $classname = substr($file, 0, dol_strlen($file) -12); + while (($file = readdir($handle)) !== false) + { + if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_') + { + $name = substr($file, 4, dol_strlen($file) -16); + $classname = substr($file, 0, dol_strlen($file) -12); - $var=!$var; - print "\n $name"; - print "\n \n"; - require_once($dir.$file); - $module = new $classname($db,$specimenthirdparty); - print $module->description; - print "\n"; + $var=!$var; + print "\n $name"; + print "\n \n"; + require_once($dir.$file); + $module = new $classname($db,$specimenthirdparty); + print $module->description; + print "\n"; - // Active - if (in_array($name, $def)) - { - print "\n"; - if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name") - { - print ''; - print img_picto($langs->trans("Enabled"),'on'); - print ''; - } - else - { - print img_picto($langs->trans("Enabled"),'on'); - } - print ""; - } - else - { - print "\n"; - print ''.img_picto($langs->trans("Disabled"),'off').''; - print ""; - } + // Active + if (in_array($name, $def)) + { + print "\n"; + if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name") + { + print ''; + print img_picto($langs->trans("Enabled"),'on'); + print ''; + } + else + { + print img_picto($langs->trans("Enabled"),'on'); + } + print ""; + } + else + { + print "\n"; + print ''.img_picto($langs->trans("Disabled"),'off').''; + print ""; + } - // Defaut - print ""; - if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$name") - { - print img_picto($langs->trans("Default"),'on'); - } - else - { - print ''.img_picto($langs->trans("Disabled"),'on').''; - } - print ''; + // Defaut + print ""; + if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$name") + { + print img_picto($langs->trans("Default"),'on'); + } + else + { + print ''.img_picto($langs->trans("Disabled"),'on').''; + } + print ''; - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); - $htmltooltip.='
    '.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; - $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
    '.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
    '.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - print ''; - print $html->textwithpicto('',$htmltooltip,1,0); - print ''; - print ''; - print ''.img_object($langs->trans("Preview"),'bill').''; - print ''; + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip.='
    '.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + $htmltooltip.='
    '.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); + $htmltooltip.='
    '.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); + print ''; + print $html->textwithpicto('',$htmltooltip,1,0); + print ''; + print ''; + print ''.img_object($langs->trans("Preview"),'bill').''; + print ''; - print "\n"; - } + print "\n"; + } + } + close($handle); } print '
    '; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index c49aa69c2a2..5601967e539 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -207,7 +207,7 @@ clearstatcache(); $handle = opendir($dir); $var=true; -if ($handle) +if (is_resource($handle)) { $var=true; while (($file = readdir($handle))!==false) @@ -329,74 +329,77 @@ if(is_dir($dir)) $handle=opendir($dir); $var=true; - while (($file = readdir($handle))!==false) - { - if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_') - { - $name = substr($file, 4, dol_strlen($file) - 16); - $classname = substr($file, 0, dol_strlen($file) - 12); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_') + { + $name = substr($file, 4, dol_strlen($file) - 16); + $classname = substr($file, 0, dol_strlen($file) - 12); - $var=!$var; - print ""; - print $name; - print "\n"; - require_once($dir.$file); - $module = new $classname($db); + $var=!$var; + print ""; + print $name; + print "\n"; + require_once($dir.$file); + $module = new $classname($db); - print $module->description; - print ''; + print $module->description; + print ''; - // Activ - if (in_array($name, $def)) - { - print "\n"; - if ($conf->global->LIVRAISON_ADDON_PDF != "$name") - { - print ''; - print img_picto($langs->trans("Enabled"),'on'); - print ''; - } - else - { - print img_picto($langs->trans("Enabled"),'on'); - } - print ""; - } - else - { - print "\n"; - print ''.img_picto($langs->trans("Disabled"),'off').''; - print ""; - } + // Activ + if (in_array($name, $def)) + { + print "\n"; + if ($conf->global->LIVRAISON_ADDON_PDF != "$name") + { + print ''; + print img_picto($langs->trans("Enabled"),'on'); + print ''; + } + else + { + print img_picto($langs->trans("Enabled"),'on'); + } + print ""; + } + else + { + print "\n"; + print ''.img_picto($langs->trans("Disabled"),'off').''; + print ""; + } - // Defaut - print ""; - if ($conf->global->LIVRAISON_ADDON_PDF == "$name") - { - print img_picto($langs->trans("Default"),'on'); - } - else - { - print ''.img_picto($langs->trans("Disabled"),'off').''; - } - print ''; + // Defaut + print ""; + if ($conf->global->LIVRAISON_ADDON_PDF == "$name") + { + print img_picto($langs->trans("Default"),'on'); + } + else + { + print ''.img_picto($langs->trans("Disabled"),'off').''; + } + print ''; - // Info - $htmltooltip = ''.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); - $htmltooltip.='
    '.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; - $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - print ''; - print $html->textwithpicto('',$htmltooltip,1,0); - print ''; - print ''; - print ''.img_object($langs->trans("Preview"),'sending').''; - print ''; + // Info + $htmltooltip = ''.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip.='
    '.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + print ''; + print $html->textwithpicto('',$htmltooltip,1,0); + print ''; + print ''; + print ''.img_object($langs->trans("Preview"),'sending').''; + print ''; - print ''; - } - } - closedir($handle); + print ''; + } + } + closedir($handle); + } } else { diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 32d58b2e44d..d6135379df6 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -91,7 +91,7 @@ foreach ($conf->file->dol_document_root as $dirroot) //print $dir."\n
    "; dol_syslog("Scan directory ".$dir." for modules"); $handle=@opendir($dir); - if ($handle) + if (is_resource($handle)) { while (($file = readdir($handle))!==false) { diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 2fc34f8790a..71619df5e72 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -84,7 +84,7 @@ foreach ($conf->file->dol_document_root as $dirroot) // Load modules attributes in arrays (name, numero, orders) from dir directory //print $dir."\n
    "; $handle=@opendir($dir); - if ($handle) + if (is_resource($handle)) { while (($file = readdir($handle))!==false) { diff --git a/htdocs/admin/project.php b/htdocs/admin/project.php index 1dd5c833a10..2116edba57a 100644 --- a/htdocs/admin/project.php +++ b/htdocs/admin/project.php @@ -173,7 +173,7 @@ print "\n"; clearstatcache(); $handle = opendir($dir); -if ($handle) +if (is_resource($handle)) { $var=true; @@ -294,73 +294,76 @@ clearstatcache(); $handle=opendir($dir); $var=true; -while (($file = readdir($handle))!==false) +if (is_resource($handle)) { - if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_') - { - $name = substr($file, 4, dol_strlen($file) -16); - $classname = substr($file, 0, dol_strlen($file) -12); + while (($file = readdir($handle))!==false) + { + if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_') + { + $name = substr($file, 4, dol_strlen($file) -16); + $classname = substr($file, 0, dol_strlen($file) -12); - $var=!$var; - print "\n $name"; - print "\n \n"; - require_once($dir.$file); - $module = new $classname($db); - print $module->description; - print "\n"; + $var=!$var; + print "\n $name"; + print "\n \n"; + require_once($dir.$file); + $module = new $classname($db); + print $module->description; + print "\n"; - // Active - if (in_array($name, $def)) - { - print "\n"; - if ($conf->global->PROJECT_ADDON_PDF != "$name") - { - print ''; - print img_picto($langs->trans("Enabled"),'on'); - print ''; - } - else - { - print img_picto($langs->trans("Enabled"),'on'); - } - print ""; - } - else - { - print "\n"; - print ''.img_picto($langs->trans("Disabled"),'off').''; - print ""; - } + // Active + if (in_array($name, $def)) + { + print "\n"; + if ($conf->global->PROJECT_ADDON_PDF != "$name") + { + print ''; + print img_picto($langs->trans("Enabled"),'on'); + print ''; + } + else + { + print img_picto($langs->trans("Enabled"),'on'); + } + print ""; + } + else + { + print "\n"; + print ''.img_picto($langs->trans("Disabled"),'off').''; + print ""; + } - // Defaut - print ""; - if ($conf->global->PROJECT_ADDON_PDF == "$name") - { - print img_picto($langs->trans("Default"),'on'); - } - else - { - print ''.img_picto($langs->trans("Disabled"),'off').''; - } - print ''; + // Defaut + print ""; + if ($conf->global->PROJECT_ADDON_PDF == "$name") + { + print img_picto($langs->trans("Default"),'on'); + } + else + { + print ''.img_picto($langs->trans("Disabled"),'off').''; + } + print ''; - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); - $htmltooltip.='
    '.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; - $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - print ''; - print $html->textwithpicto('',$htmltooltip,1,0); - print ''; - print ''; - print ''.img_object($langs->trans("Preview"),'order').''; - print ''; + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip.='
    '.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + print ''; + print $html->textwithpicto('',$htmltooltip,1,0); + print ''; + print ''; + print ''.img_object($langs->trans("Preview"),'order').''; + print ''; - print "\n"; - } + print "\n"; + } + } + closedir($handle); } -closedir($handle); print '
    '; diff --git a/htdocs/admin/propale.php b/htdocs/admin/propale.php index 0a26070b043..a89e0cd5575 100644 --- a/htdocs/admin/propale.php +++ b/htdocs/admin/propale.php @@ -212,7 +212,7 @@ foreach ($conf->file->dol_document_root as $dirroot) if (is_dir($dir)) { $handle = opendir($dir); - if ($handle) + if (is_resource($handle)) { while (($file = readdir($handle))!==false) { @@ -333,85 +333,88 @@ clearstatcache(); $handle=opendir($dir); $var=true; -while (($file = readdir($handle))!==false) +if (is_resource($handle)) { - if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,12) == 'pdf_propale_') - { - $name = substr($file, 12, dol_strlen($file) - 24); - $classname = substr($file, 0, dol_strlen($file) -12); + while (($file = readdir($handle))!==false) + { + if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,12) == 'pdf_propale_') + { + $name = substr($file, 12, dol_strlen($file) - 24); + $classname = substr($file, 0, dol_strlen($file) -12); - $var=!$var; - print "\n "; - print $name; - print "\n \n"; - require_once($dir.$file); - $module = new $classname($db); - print $module->description; - print ''; + $var=!$var; + print "\n "; + print $name; + print "\n \n"; + require_once($dir.$file); + $module = new $classname($db); + print $module->description; + print ''; - // Activate - print "\n"; - if (in_array($name, $def)) - { - if ($conf->global->PROPALE_ADDON_PDF != "$name") - { - print ''; - print img_picto($langs->trans("Activated"),'on'); - print ''; - } - else - { - print img_picto($langs->trans("Activated"),'on'); - } - } - else - { - print ''; - print img_picto($langs->trans("Disabled"),'off'); - print ''; - } - print ""; + // Activate + print "\n"; + if (in_array($name, $def)) + { + if ($conf->global->PROPALE_ADDON_PDF != "$name") + { + print ''; + print img_picto($langs->trans("Activated"),'on'); + print ''; + } + else + { + print img_picto($langs->trans("Activated"),'on'); + } + } + else + { + print ''; + print img_picto($langs->trans("Disabled"),'off'); + print ''; + } + print ""; - // Default - print ""; - if ($conf->global->PROPALE_ADDON_PDF == "$name") - { - print img_picto($langs->trans("Yes"),'on'); - } - else - { - print ''; - print img_picto($langs->trans("No"),'off'); - print ''; - } - print ''; + // Default + print ""; + if ($conf->global->PROPALE_ADDON_PDF == "$name") + { + print img_picto($langs->trans("Yes"),'on'); + } + else + { + print ''; + print img_picto($langs->trans("No"),'off'); + print ''; + } + print ''; - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); - $htmltooltip.='
    '.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur; - $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
    '.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
    '.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
    '.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - //$htmltooltip.='
    '.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1); - //$htmltooltip.='
    '.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); - $htmltooltip.='
    '.$langs->trans("WatermarkOnDraftProposal").': '.yn($module->option_draft_watermark,1,1); + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip.='
    '.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur; + $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + $htmltooltip.='
    '.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); + $htmltooltip.='
    '.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); + $htmltooltip.='
    '.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); + //$htmltooltip.='
    '.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1); + //$htmltooltip.='
    '.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); + $htmltooltip.='
    '.$langs->trans("WatermarkOnDraftProposal").': '.yn($module->option_draft_watermark,1,1); - print ''; - print $html->textwithpicto('',$htmltooltip,1,0); - print ''; - print ''; - print ''.img_object($langs->trans("Preview"),'propal').''; - print ''; + print ''; + print $html->textwithpicto('',$htmltooltip,1,0); + print ''; + print ''; + print ''.img_object($langs->trans("Preview"),'propal').''; + print ''; - print "\n"; - } + print "\n"; + } + } + closedir($handle); } -closedir($handle); print ''; print '
    '; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index b92ffb81ab6..fca513f23d6 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -218,20 +218,23 @@ $dir = "../includes/modules/security/generate"; clearstatcache(); $handle=opendir($dir); $i=1; -while (($file = readdir($handle))!==false) +if (is_resource($handle)) { - if (preg_match('/(modGeneratePass[a-z]+)\.class\.php/i',$file,$reg)) + while (($file = readdir($handle))!==false) { - // Chargement de la classe de numerotation - $classname = $reg[1]; - require_once($dir.'/'.$file); + if (preg_match('/(modGeneratePass[a-z]+)\.class\.php/i',$file,$reg)) + { + // Chargement de la classe de numerotation + $classname = $reg[1]; + require_once($dir.'/'.$file); - $obj = new $classname($db,$conf,$langs,$user); - $arrayhandler[$obj->id]=$obj; - $i++; + $obj = new $classname($db,$conf,$langs,$user); + $arrayhandler[$obj->id]=$obj; + $i++; + } } + closedir($handle); } -closedir($handle); print ''; print ''; diff --git a/htdocs/admin/societe.php b/htdocs/admin/societe.php index a16f3b9d19c..adbbf93e87d 100644 --- a/htdocs/admin/societe.php +++ b/htdocs/admin/societe.php @@ -188,7 +188,7 @@ clearstatcache(); $dir = "../includes/modules/societe/"; $handle = opendir($dir); -if ($handle) +if (is_resource($handle)) { $var = true; @@ -259,7 +259,7 @@ clearstatcache(); $dir = "../includes/modules/societe/"; $handle = opendir($dir); -if ($handle) +if (is_resource($handle)) { $var = true; while (($file = readdir($handle))!==false) @@ -348,7 +348,7 @@ foreach ($conf->file->dol_document_root as $dirroot) if (is_dir($dir)) { $handle=opendir($dir); - if ($handle) + if (is_resource($handle)) { while (($file = readdir($handle))!==false) { diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 740b2ec0a27..985e30ca415 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -55,24 +55,28 @@ foreach($conf->file->dol_document_root as $searchdir) if (preg_match('/custom$/i',$searchdir)) $dirtoscan = $searchdir . "/modules/"; else $dirtoscan = $searchdir . "/includes/modules/"; $handle=opendir($dirtoscan); - while (($file = readdir($handle))!==false) - { - if (is_readable($dirtoscan.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') - { - $modName = substr($file, 0, dol_strlen($file) - 10); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (is_readable($dirtoscan.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') + { + $modName = substr($file, 0, dol_strlen($file) - 10); - if ($modName) - { - include_once($dirtoscan.$file); - $objMod = new $modName($db); + if ($modName) + { + include_once($dirtoscan.$file); + $objMod = new $modName($db); - $modules[$objMod->numero]=$objMod; - $modules_names[$objMod->numero]=$objMod->name; - $modules_files[$objMod->numero]=$file; - $picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic'; - } - } - } + $modules[$objMod->numero]=$objMod; + $modules_names[$objMod->numero]=$objMod->name; + $modules_files[$objMod->numero]=$file; + $picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic'; + } + } + } + close($handle); + } } print '
    '; print ''; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 3f5ae455806..59cb16b76fc 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1097,35 +1097,37 @@ class Categorie if (file_exists($dir)) { $handle=opendir($dir); + if (is_resource($handle)) + { + while (($file = readdir($handle)) != false) + { + if (is_file($dir.$file)) + { + $nbphoto++; + $photo = $file; - while (($file = readdir($handle)) != false) - { - if (is_file($dir.$file)) - { - $nbphoto++; - $photo = $file; + // On determine nom du fichier vignette + $photo_vignette=''; + if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$photo,$regs)) + { + $photo_vignette=preg_replace('/'.$regs[0].'/i','',$photo).'_small'.$regs[0]; + } - // On determine nom du fichier vignette - $photo_vignette=''; - if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$photo,$regs)) - { - $photo_vignette=preg_replace('/'.$regs[0].'/i','',$photo).'_small'.$regs[0]; - } + // Objet + $obj=array(); + $obj['photo']=$photo; + if ($photo_vignette && is_file($dirthumb.$photo_vignette)) $obj['photo_vignette']=$photo_vignette; + else $obj['photo_vignette']=""; - // Objet - $obj=array(); - $obj['photo']=$photo; - if ($photo_vignette && is_file($dirthumb.$photo_vignette)) $obj['photo_vignette']=$photo_vignette; - else $obj['photo_vignette']=""; + $tabobj[$nbphoto-1]=$obj; - $tabobj[$nbphoto-1]=$obj; + // On continue ou on arrete de boucler + if ($nbmax && $nbphoto >= $nbmax) break; + } + } - // On continue ou on arrete de boucler - if ($nbmax && $nbphoto >= $nbmax) break; - } - } - - closedir($handle); + closedir($handle); + } } return $tabobj; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index ebd011d9865..18f399067f5 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -236,7 +236,7 @@ if ($mil->fetch($_REQUEST["id"]) >= 0) if (is_dir($dir)) { $handle=opendir($dir); - if ($handle) + if (is_resource($handle)) { while (($file = readdir($handle))!==false) { diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 8dc78f8a7fc..d3b37bcb595 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -73,69 +73,71 @@ $dir=DOL_DOCUMENT_ROOT."/includes/modules/mailings"; $handle=opendir($dir); $var=True; -while (($file = readdir($handle))!==false) +if (is_resource($handle)) { - if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') + while (($file = readdir($handle))!==false) { - if (preg_match("/(.*)\.(.*)\.(.*)/i",$file,$reg)) + if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') { - $modulename=$reg[1]; - if ($modulename == 'example') continue; - - // Chargement de la classe - $file = $dir."/".$modulename.".modules.php"; - $classname = "mailing_".$modulename; - require_once($file); - $mailmodule = new $classname($db); - - $qualified=1; - foreach ($mailmodule->require_module as $key) + if (preg_match("/(.*)\.(.*)\.(.*)/i",$file,$reg)) { - if (! $conf->$key->enabled || (! $user->admin && $mailmodule->require_admin)) + $modulename=$reg[1]; + if ($modulename == 'example') continue; + + // Chargement de la classe + $file = $dir."/".$modulename.".modules.php"; + $classname = "mailing_".$modulename; + require_once($file); + $mailmodule = new $classname($db); + + $qualified=1; + foreach ($mailmodule->require_module as $key) { - $qualified=0; - //print "Les pr�requis d'activation du module mailing ne sont pas respect�s. Il ne sera pas actif"; - break; + if (! $conf->$key->enabled || (! $user->admin && $mailmodule->require_admin)) + { + $qualified=0; + //print "Les pr�requis d'activation du module mailing ne sont pas respect�s. Il ne sera pas actif"; + break; + } } - } - // Si le module mailing est qualifi� - if ($qualified) - { - $var = !$var; - - foreach ($mailmodule->getSqlArrayForStats() as $sql) + // Si le module mailing est qualifi� + if ($qualified) { - print ''; + $var = !$var; - $result=$db->query($sql); - if ($result) + foreach ($mailmodule->getSqlArrayForStats() as $sql) { - $num = $db->num_rows($result); + print ''; - $i = 0; - - while ($i < $num ) + $result=$db->query($sql); + if ($result) { - $obj = $db->fetch_object($result); - print ''; } - else - { - dol_print_error($db); - } - print ''; } } } } + closedir($handle); } -closedir($handle); - print "
    '.img_object('',$mailmodule->picto).' '.$obj->label.''.$obj->nb.''; - $i++; - } + $num = $db->num_rows($result); - $db->free($result); + $i = 0; + + while ($i < $num ) + { + $obj = $db->fetch_object($result); + print ''.img_object('',$mailmodule->picto).' '.$obj->label.''.$obj->nb.''; + $i++; + } + + $db->free($result); + } + else + { + dol_print_error($db); + } + print '

    "; diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index f575e9caac4..fe25de6f5ac 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -37,9 +37,9 @@ $dir = $conf->facture->dir_output.'/payments'; $socid=0; if ($user->societe_id > 0) { - $action = ''; - $socid = $user->societe_id; - $dir = $conf->facture->dir_output.'/payments/private/'.$user->id; + $action = ''; + $socid = $user->societe_id; + $dir = $conf->facture->dir_output.'/payments/private/'.$user->id; } $year = $_GET["year"]; @@ -52,30 +52,30 @@ if (! $year) { $year=date("Y"); } if ($_POST["action"] == 'builddoc') { - $rap = new pdf_paiement($db); + $rap = new pdf_paiement($db); - $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($_REQUEST['lang_id']); - } + $outputlangs = $langs; + if (! empty($_REQUEST['lang_id'])) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); + } - // We save charset_output to restore it because write_file can change it if needed for - // output format that does not support UTF8. - $sav_charset_output=$outputlangs->charset_output; - if ($rap->write_file($dir, $_POST["remonth"], $_POST["reyear"], $outputlangs) > 0) - { - $outputlangs->charset_output=$sav_charset_output; - } - else - { - $outputlangs->charset_output=$sav_charset_output; - dol_syslog("Erreur dans commande_pdf_create"); - dol_print_error($db,$obj->error); - } + // We save charset_output to restore it because write_file can change it if needed for + // output format that does not support UTF8. + $sav_charset_output=$outputlangs->charset_output; + if ($rap->write_file($dir, $_POST["remonth"], $_POST["reyear"], $outputlangs) > 0) + { + $outputlangs->charset_output=$sav_charset_output; + } + else + { + $outputlangs->charset_output=$sav_charset_output; + dol_syslog("Erreur dans commande_pdf_create"); + dol_print_error($db,$obj->error); + } - $year = $_POST["reyear"]; + $year = $_POST["reyear"]; } @@ -98,28 +98,28 @@ $syear = date("Y", time()); print '"; print '\n"; print ''; @@ -133,51 +133,58 @@ $linkforyear=array(); $found=0; if (is_dir($dir)) { - $handle=opendir($dir); - while (($file = readdir($handle))!==false) - { - if (is_dir($dir.'/'.$file) && ! preg_match('/^\./',$file)) - { - $found=1; - $linkforyear[]=$file; - } - } + $handle=opendir($dir); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (is_dir($dir.'/'.$file) && ! preg_match('/^\./',$file)) + { + $found=1; + $linkforyear[]=$file; + } + } + } } asort($linkforyear); foreach($linkforyear as $cursoryear) { - print ''.$cursoryear.'  '; + print ''.$cursoryear.'  '; } if ($year) { - if (is_dir($dir.'/'.$year)) - { - $handle=opendir($dir.'/'.$year); + if (is_dir($dir.'/'.$year)) + { + $handle=opendir($dir.'/'.$year); - if ($found) print '
    '; - print '
    '; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - $var=true; - while (($file = readdir($handle))!==false) - { - if (preg_match('/^payment/i',$file)) - { - $var=!$var; - $tfile = $dir . '/'.$year.'/'.$file; - $relativepath = $year.'/'.$file; - print "".''; - print ''; - print ''; - } - } - print '
    '.$langs->trans("Reporting").''.$langs->trans("Size").''.$langs->trans("Date").'
    '.img_pdf().' '.$file.''.dol_print_size(dol_filesize($tfile)).''.dol_print_date(dol_filemtime($tfile),"dayhour").'
    '; - } + if ($found) print '
    '; + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $var=true; + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (preg_match('/^payment/i',$file)) + { + $var=!$var; + $tfile = $dir . '/'.$year.'/'.$file; + $relativepath = $year.'/'.$file; + print "".''; + print ''; + print ''; + } + } + close($handle); + } + print '
    '.$langs->trans("Reporting").''.$langs->trans("Size").''.$langs->trans("Date").'
    '.img_pdf().' '.$file.''.dol_print_size(dol_filesize($tfile)).''.dol_print_date(dol_filemtime($tfile),"dayhour").'
    '; + } } $db->close(); diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 940cd229581..92a39caff52 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -135,25 +135,29 @@ class FormAdmin $menuarray=array(); $handle=opendir($dirmenu); - while (($file = readdir($handle))!==false) + if (is_resource($handle)) { - if (is_file($dirmenu."/".$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') + while (($file = readdir($handle))!==false) { - if (preg_match('/lib\.php$/i',$file)) continue; // We exclude library files - $filelib=preg_replace('/\.php$/i','',$file); - $prefix=''; - if (preg_match('/^eldy|^iphone/i',$file)) $prefix='0'; // 0=Recommanded, 1=Experimental, 2=Other - else $prefix='2'; + if (is_file($dirmenu."/".$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') + { + if (preg_match('/lib\.php$/i',$file)) continue; // We exclude library files + $filelib=preg_replace('/\.php$/i','',$file); + $prefix=''; + if (preg_match('/^eldy|^iphone/i',$file)) $prefix='0'; // 0=Recommanded, 1=Experimental, 2=Other + else $prefix='2'; - if ($file == $selected) - { - $menuarray[$prefix.'_'.$file]=''; - } - else - { - $menuarray[$prefix.'_'.$file]=''; + if ($file == $selected) + { + $menuarray[$prefix.'_'.$file]=''; + } + else + { + $menuarray[$prefix.'_'.$file]=''; + } } } + close($handle); } ksort($menuarray); @@ -194,20 +198,23 @@ class FormAdmin foreach($dirmenuarray as $dirmenu) { $handle=opendir($dirmenu); - while (($file = readdir($handle))!==false) - { - if (is_file($dirmenu."/".$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') - { - $filelib=preg_replace('/(_backoffice|_frontoffice)?\.php$/i','',$file); - if (preg_match('/^default/i',$filelib)) continue; - if (preg_match('/^empty/i',$filelib)) continue; - if (preg_match('/\.lib/i',$filelib)) continue; + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (is_file($dirmenu."/".$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') + { + $filelib=preg_replace('/(_backoffice|_frontoffice)?\.php$/i','',$file); + if (preg_match('/^default/i',$filelib)) continue; + if (preg_match('/^empty/i',$filelib)) continue; + if (preg_match('/\.lib/i',$filelib)) continue; - $menuarray[$filelib]=1; - } - $menuarray['all']=1; - } - closedir($handle); + $menuarray[$filelib]=1; + } + $menuarray['all']=1; + } + closedir($handle); + } } ksort($menuarray); diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 0a8bb49d4aa..eb045d7d00a 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -76,86 +76,88 @@ class Interfaces $handle=opendir($dir); $modules = array(); $nbfile = $nbtotal = $nbok = $nbko = 0; + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (is_readable($dir."/".$file) && preg_match('/^interface_([^_]+)_(.+)\.class\.php$/i',$file,$reg)) + { + $nbfile++; - while (($file = readdir($handle))!==false) - { - if (is_readable($dir."/".$file) && preg_match('/^interface_([^_]+)_(.+)\.class\.php$/i',$file,$reg)) - { - $nbfile++; + $modName = "Interface".ucfirst($reg[2]); + //print "file=$file"; print "modName=$modName"; exit; + if (in_array($modName,$modules)) + { + $langs->load("errors"); + dol_syslog("Interface::run_triggers action=".$action." ".$langs->trans("ErrorDuplicateTrigger",$modName,"/htdocs/includes/triggers/"),LOG_ERR); + continue; + } - $modName = "Interface".ucfirst($reg[2]); - //print "file=$file"; print "modName=$modName"; exit; - if (in_array($modName,$modules)) - { - $langs->load("errors"); - dol_syslog("Interface::run_triggers action=".$action." ".$langs->trans("ErrorDuplicateTrigger",$modName,"/htdocs/includes/triggers/"),LOG_ERR); - continue; - } + // Check if trigger file is disabled by name + if (preg_match('/NORUN$/i',$file)) + { + continue; + } + // Check if trigger file is for a particular module + $qualified=true; + if (strtolower($reg[1]) != 'all') + { + $module=preg_replace('/^mod/i','',$reg[1]); + $constparam='MAIN_MODULE_'.strtoupper($module); + if (empty($conf->global->$constparam)) $qualified=false; + } - // Check if trigger file is disabled by name - if (preg_match('/NORUN$/i',$file)) - { - continue; - } - // Check if trigger file is for a particular module - $qualified=true; - if (strtolower($reg[1]) != 'all') - { - $module=preg_replace('/^mod/i','',$reg[1]); - $constparam='MAIN_MODULE_'.strtoupper($module); - if (empty($conf->global->$constparam)) $qualified=false; - } + if (! $qualified) + { + dol_syslog("Interfaces::run_triggers action=".$action." Triggers for file '".$file."' need module to be enabled",LOG_INFO); + continue; + } - if (! $qualified) - { - dol_syslog("Interfaces::run_triggers action=".$action." Triggers for file '".$file."' need module to be enabled",LOG_INFO); - continue; - } + include_once($dir."/".$file); + $objMod = new $modName($this->db); + $i=0; + if ($objMod) + { + // Bypass if workflow module is enabled and if the trigger asked to be disable in such case + if ($conf->workflow->enabled && ! empty($objMod->disabled_if_workflow)) + { + dol_syslog("Interfaces::run_triggers action=".$action." Bypass triggers for file '".$file."'",LOG_INFO); + continue; + } - include_once($dir."/".$file); - $objMod = new $modName($this->db); - $i=0; - if ($objMod) - { - // Bypass if workflow module is enabled and if the trigger asked to be disable in such case - if ($conf->workflow->enabled && ! empty($objMod->disabled_if_workflow)) - { - dol_syslog("Interfaces::run_triggers action=".$action." Bypass triggers for file '".$file."'",LOG_INFO); - continue; - } + dol_syslog("Interfaces::run_triggers action=".$action." Launch triggers for file '".$file."'",LOG_INFO); - dol_syslog("Interfaces::run_triggers action=".$action." Launch triggers for file '".$file."'",LOG_INFO); - - $modules[$i] = $modName; - //dol_syslog("Interfaces::run_triggers Launch triggers for file '".$file."'",LOG_INFO); - $result=$objMod->run_trigger($action,$object,$user,$langs,$conf); - if ($result > 0) - { - // Action OK - $nbtotal++; - $nbok++; - } - if ($result == 0) - { - // Aucune action faite - $nbtotal++; - } - if ($result < 0) - { - // Action KO - $nbtotal++; - $nbko++; - $this->errors[]=$objMod->error; - } - $i++; - } - else - { - dol_syslog("Interfaces::run_triggers action=".$action." Failed to instantiate trigger for file '".$file."'",LOG_ERROR); - } - } - } - closedir($handle); + $modules[$i] = $modName; + //dol_syslog("Interfaces::run_triggers Launch triggers for file '".$file."'",LOG_INFO); + $result=$objMod->run_trigger($action,$object,$user,$langs,$conf); + if ($result > 0) + { + // Action OK + $nbtotal++; + $nbok++; + } + if ($result == 0) + { + // Aucune action faite + $nbtotal++; + } + if ($result < 0) + { + // Action KO + $nbtotal++; + $nbko++; + $this->errors[]=$objMod->error; + } + $i++; + } + else + { + dol_syslog("Interfaces::run_triggers action=".$action." Failed to instantiate trigger for file '".$file."'",LOG_ERROR); + } + } + } + closedir($handle); + } } if ($nbko) @@ -191,37 +193,39 @@ class Interfaces if (!is_dir($dir)) continue; $handle=opendir($dir); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (is_readable($dir.'/'.$file) && preg_match('/^interface_([^_]+)_(.+)\.class\.php/',$file,$reg)) + { + $modName = 'Interface'.ucfirst($reg[2]); + //print "file=$file"; print "modName=$modName"; exit; + if (in_array($modName,$modules)) + { + $langs->load("errors"); + print '
    '.$langs->trans("Error").' : '.$langs->trans("ErrorDuplicateTrigger",$modName,"/htdocs/includes/triggers/").'
    '; + $objMod = new $modName($db); - while (($file = readdir($handle))!==false) - { - if (is_readable($dir.'/'.$file) && preg_match('/^interface_([^_]+)_(.+)\.class\.php/',$file,$reg)) - { - $modName = 'Interface'.ucfirst($reg[2]); - //print "file=$file"; print "modName=$modName"; exit; - if (in_array($modName,$modules)) - { - $langs->load("errors"); - print '
    '.$langs->trans("Error").' : '.$langs->trans("ErrorDuplicateTrigger",$modName,"/htdocs/includes/triggers/").'
    '; - $objMod = new $modName($db); + $modules[$i] = $modName; + $files[$i] = $file; + $orders[$i] = $objMod->family; // Tri par famille + $i++; + } + else + { + include_once($dir.'/'.$file); + $objMod = new $modName($db); - $modules[$i] = $modName; - $files[$i] = $file; - $orders[$i] = $objMod->family; // Tri par famille - $i++; - } - else - { - include_once($dir.'/'.$file); - $objMod = new $modName($db); - - $modules[$i] = $modName; - $files[$i] = $file; - $orders[$i] = $objMod->family; // Tri par famille - $i++; - } - } - } - closedir($handle); + $modules[$i] = $modName; + $files[$i] = $file; + $orders[$i] = $objMod->family; // Tri par famille + $i++; + } + } + } + closedir($handle); + } } asort($orders); diff --git a/htdocs/ecm/docother.php b/htdocs/ecm/docother.php index 8f8ba0c0777..cb5048ae7bf 100644 --- a/htdocs/ecm/docother.php +++ b/htdocs/ecm/docother.php @@ -127,7 +127,7 @@ $errorlevel=error_reporting(); error_reporting(0); $handle=opendir($upload_dir); error_reporting($errorlevel); -if ($handle) +if (is_resource($handle)) { $i=0; while (($file = readdir($handle))!==false) diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 1d2b1b1df02..5e9dbf4b47c 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -78,7 +78,7 @@ class Export // Search available exports $handle=@opendir($dir); - if ($handle) + if (is_resource($handle)) { $var=True; $i=0; diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index cd828131738..1d18487b9a5 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -70,7 +70,7 @@ class Import // Search available exports $handle=@opendir($dir); - if ($handle) + if (is_resource($handle)) { // Recherche des exports disponibles $var=True; diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index a354b452674..128f1fa8a87 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -551,7 +551,7 @@ if ($step == 3 && $datatoimport) $dir = $conf->import->dir_temp; $newdir=utf8_check($dir)?utf8_decode($dir):$dir; // opendir need ISO $handle=@opendir($newdir); - if ($handle) + if (is_resource($handle)) { //print ''; //print ''; diff --git a/htdocs/includes/modules/DolibarrModules.class.php b/htdocs/includes/modules/DolibarrModules.class.php index 2a54fed179e..0943ee3fd81 100644 --- a/htdocs/includes/modules/DolibarrModules.class.php +++ b/htdocs/includes/modules/DolibarrModules.class.php @@ -501,7 +501,7 @@ class DolibarrModules // Run llx_mytable.sql files $handle=@opendir($dir); // Dir may not exists - if ($handle) + if (is_resource($handle)) { while (($file = readdir($handle))!==false) { @@ -516,7 +516,7 @@ class DolibarrModules // Run llx_mytable.key.sql files $handle=@opendir($dir); // Dir may not exist - if ($handle) + if (is_resource($handle)) { while (($file = readdir($handle))!==false) { @@ -531,7 +531,7 @@ class DolibarrModules // Run data_xxx.sql files $handle=@opendir($dir); // Dir may not exist - if ($handle) + if (is_resource($handle)) { while (($file = readdir($handle))!==false) { diff --git a/htdocs/includes/modules/barcode/admin/barcode.php b/htdocs/includes/modules/barcode/admin/barcode.php index 47e095b2cb8..9ff1ee8fbfc 100644 --- a/htdocs/includes/modules/barcode/admin/barcode.php +++ b/htdocs/includes/modules/barcode/admin/barcode.php @@ -89,7 +89,7 @@ foreach ($conf->file->dol_document_root as $dirroot) $dir = $dirroot . "/includes/modules/barcode/"; $handle=@opendir($dir); - if ($handle) + if (is_resource($handle)) { while (($file = readdir($handle))!==false) { diff --git a/htdocs/includes/modules/export/modules_export.php b/htdocs/includes/modules/export/modules_export.php index f32917a4988..814e45ccdab 100644 --- a/htdocs/includes/modules/export/modules_export.php +++ b/htdocs/includes/modules/export/modules_export.php @@ -64,33 +64,36 @@ class ModeleExports // Recherche des fichiers drivers exports disponibles $var=True; $i=0; - while (($file = readdir($handle))!==false) - { - if (preg_match("/^export_(.*)\.modules\.php$/i",$file,$reg)) - { - $moduleid=$reg[1]; + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (preg_match("/^export_(.*)\.modules\.php$/i",$file,$reg)) + { + $moduleid=$reg[1]; - // Chargement de la classe - $file = $dir."/export_".$moduleid.".modules.php"; - $classname = "Export".ucfirst($moduleid); + // Chargement de la classe + $file = $dir."/export_".$moduleid.".modules.php"; + $classname = "Export".ucfirst($moduleid); - require_once($file); - $module = new $classname($db); + require_once($file); + $module = new $classname($db); - // Picto - $this->picto[$module->id]=$module->picto; - // Driver properties - $this->driverlabel[$module->id]=$module->getDriverLabel(); - $this->driverdesc[$module->id]=$module->getDriverDesc(); - $this->driverversion[$module->id]=$module->getDriverVersion(); - // If use an external lib - $this->liblabel[$module->id]=$module->getLibLabel(); - $this->libversion[$module->id]=$module->getLibVersion(); - - $i++; - } - } + // Picto + $this->picto[$module->id]=$module->picto; + // Driver properties + $this->driverlabel[$module->id]=$module->getDriverLabel(); + $this->driverdesc[$module->id]=$module->getDriverDesc(); + $this->driverversion[$module->id]=$module->getDriverVersion(); + // If use an external lib + $this->liblabel[$module->id]=$module->getLibLabel(); + $this->libversion[$module->id]=$module->getLibVersion(); + $i++; + } + } + close($handle); + } return $this->driverlabel; } diff --git a/htdocs/includes/modules/import/modules_import.php b/htdocs/includes/modules/import/modules_import.php index 43f588332f1..3db3aa1ff06 100644 --- a/htdocs/includes/modules/import/modules_import.php +++ b/htdocs/includes/modules/import/modules_import.php @@ -64,32 +64,35 @@ class ModeleImports // Recherche des fichiers drivers imports disponibles $var=True; $i=0; - while (($file = readdir($handle))!==false) - { - if (preg_match("/^import_(.*)\.modules\.php/i",$file,$reg)) - { - $moduleid=$reg[1]; + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (preg_match("/^import_(.*)\.modules\.php/i",$file,$reg)) + { + $moduleid=$reg[1]; - // Chargement de la classe - $file = $dir."/import_".$moduleid.".modules.php"; - $classname = "Import".ucfirst($moduleid); + // Chargement de la classe + $file = $dir."/import_".$moduleid.".modules.php"; + $classname = "Import".ucfirst($moduleid); - require_once($file); - $module = new $classname($db); + require_once($file); + $module = new $classname($db); - // Picto - $this->picto[$module->id]=$module->picto; - // Driver properties - $this->driverlabel[$module->id]=$module->getDriverLabel(); - $this->driverdesc[$module->id]=$module->getDriverDesc(); - $this->driverversion[$module->id]=$module->getDriverVersion(); - // If use an external lib - $this->liblabel[$module->id]=$module->getLibLabel(); - $this->libversion[$module->id]=$module->getLibVersion(); + // Picto + $this->picto[$module->id]=$module->picto; + // Driver properties + $this->driverlabel[$module->id]=$module->getDriverLabel(); + $this->driverdesc[$module->id]=$module->getDriverDesc(); + $this->driverversion[$module->id]=$module->getDriverVersion(); + // If use an external lib + $this->liblabel[$module->id]=$module->getLibLabel(); + $this->libversion[$module->id]=$module->getLibVersion(); - $i++; - } - } + $i++; + } + } + } return array_keys($this->driverlabel); } diff --git a/htdocs/install/etape2.php b/htdocs/install/etape2.php index 5d25fecd3d6..57adf24f3ad 100644 --- a/htdocs/install/etape2.php +++ b/htdocs/install/etape2.php @@ -149,15 +149,18 @@ if ($_POST["action"] == "set") dolibarr_install_syslog("Open tables directory ".$dir." handle=".$handle,LOG_DEBUG); $tablefound = 0; $tabledata=array(); - while (($file = readdir($handle))!==false) - { - if (preg_match('/\.sql$/i',$file) && preg_match('/^llx_/i',$file) && ! preg_match('/\.key\.sql$/i',$file)) - { - $tablefound++; - $tabledata[]=$file; - } - } - closedir($handle); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (preg_match('/\.sql$/i',$file) && preg_match('/^llx_/i',$file) && ! preg_match('/\.key\.sql$/i',$file)) + { + $tablefound++; + $tabledata[]=$file; + } + } + closedir($handle); + } // Sort list of sql files on alphabetical order (load order is important) sort($tabledata); @@ -255,15 +258,18 @@ if ($_POST["action"] == "set") dolibarr_install_syslog("Open keys directory ".$dir." handle=".$handle,LOG_DEBUG); $tablefound = 0; $tabledata=array(); - while (($file = readdir($handle))!==false) - { - if (preg_match('/\.sql$/i',$file) && preg_match('/^llx_/i',$file) && preg_match('/\.key\.sql$/i',$file)) - { - $tablefound++; - $tabledata[]=$file; - } - } - closedir($handle); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (preg_match('/\.sql$/i',$file) && preg_match('/^llx_/i',$file) && preg_match('/\.key\.sql$/i',$file)) + { + $tablefound++; + $tabledata[]=$file; + } + } + closedir($handle); + } // Sort list of sql files on alphabetical order (load order is important) sort($tabledata); @@ -474,15 +480,18 @@ if ($_POST["action"] == "set") dolibarr_install_syslog("Open directory data ".$dir." handle=".$handle,LOG_DEBUG); $tablefound = 0; $tabledata=array(); - while (($file = readdir($handle))!==false) - { - if (preg_match('/\.sql$/i',$file) && preg_match('/^llx_/i',$file)) - { - $tablefound++; - $tabledata[]=$file; - } - } - closedir($handle); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (preg_match('/\.sql$/i',$file) && preg_match('/^llx_/i',$file)) + { + $tablefound++; + $tabledata[]=$file; + } + } + closedir($handle); + } // Sort list of data files on alphabetical order (load order is important) sort($tabledata); diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 4e30c87efe1..8a426c05874 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -250,50 +250,53 @@ if (1 == 2) { // Disabled during install process because HTTPS may not be yet $defaultype=! empty($dolibarr_main_db_type)?$dolibarr_main_db_type:($force_install_type?$force_install_type:'mysqli'); - // Scan les drivers + $modules = array(); + $nbok = $nbko = 0; + $option=''; + + // Scan les drivers $dir=DOL_DOCUMENT_ROOT.'/lib/databases'; $handle=opendir($dir); - $modules = array(); - $nbok = $nbko = 0; - $option=''; + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (is_readable($dir."/".$file) && preg_match('/^(.*)\.lib\.php/i',$file,$reg)) + { + $type=$reg[1]; - while (($file = readdir($handle))!==false) - { - if (is_readable($dir."/".$file) && preg_match('/^(.*)\.lib\.php/i',$file,$reg)) - { - $type=$reg[1]; + // Version min de la base + $versionbasemin=array(); + if ($type=='mysql') { $versionbasemin=array(3,1,0); $testfunction='mysql_connect'; } + if ($type=='mysqli') { $versionbasemin=array(4,1,0); $testfunction='mysqli_connect'; } + if ($type=='pgsql') { $versionbasemin=array(8,1,0); $testfunction='pg_connect'; } + if ($type=='mssql') { $versionbasemin=array(2000); $testfunction='mssql_connect'; } - // Version min de la base - $versionbasemin=array(); - if ($type=='mysql') { $versionbasemin=array(3,1,0); $testfunction='mysql_connect'; } - if ($type=='mysqli') { $versionbasemin=array(4,1,0); $testfunction='mysqli_connect'; } - if ($type=='pgsql') { $versionbasemin=array(8,1,0); $testfunction='pg_connect'; } - if ($type=='mssql') { $versionbasemin=array(2000); $testfunction='mssql_connect'; } + // Remarques + $note=''; + if ($type=='mysql') $note='(Mysql >= '.versiontostring($versionbasemin).')'; + if ($type=='mysqli') $note='(Mysql >= '.versiontostring($versionbasemin).')'; + if ($type=='pgsql') $note='(Postgresql >= '.versiontostring($versionbasemin).')'; + if ($type=='mssql') $note='(SQL Server >= '.versiontostring($versionbasemin).')'; - // Remarques - $note=''; - if ($type=='mysql') $note='(Mysql >= '.versiontostring($versionbasemin).')'; - if ($type=='mysqli') $note='(Mysql >= '.versiontostring($versionbasemin).')'; - if ($type=='pgsql') $note='(Postgresql >= '.versiontostring($versionbasemin).')'; - if ($type=='mssql') $note='(SQL Server >= '.versiontostring($versionbasemin).')'; + // Switch to mysql if mysqli is not present + if ($defaultype=='mysqli' && !function_exists('mysqli_connect')) $defaultype = 'mysql'; - // Switch to mysql if mysqli is not present - if ($defaultype=='mysqli' && !function_exists('mysqli_connect')) $defaultype = 'mysql'; - - // Affiche ligne dans liste - $option.=''; - } - } + // Affiche ligne dans liste + $option.=''; + } + } + } ?> '; - } - } - } - - closedir($handle); + print ''; + } + } + } + closedir($handle); + } } else { diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 99352de45df..4b14070037b 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2462,10 +2462,13 @@ class Product extends CommonObject if (file_exists($dir_osencoded)) { $handle=opendir($dir_osencoded); - while (($file = readdir($handle)) != false) + if (is_resource($handle)) { - if (! utf8_check($file)) $file=utf8_encode($file); // To be sure data is stored in UTF8 in memory - if (dol_is_file($dir.$file)) return true; + while (($file = readdir($handle)) != false) + { + if (! utf8_check($file)) $file=utf8_encode($file); // To be sure data is stored in UTF8 in memory + if (dol_is_file($dir.$file)) return true; + } } } return false; @@ -2502,100 +2505,103 @@ class Product extends CommonObject if (file_exists($dir_osencoded)) { $handle=opendir($dir_osencoded); - while (($file = readdir($handle)) != false) - { - $photo=''; + if (is_resource($handle)) + { + while (($file = readdir($handle)) != false) + { + $photo=''; - if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory + if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory - if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$dir.$file)) - { - $nbphoto++; - $photo = $file; - $viewfilename = $file; + if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$dir.$file)) + { + $nbphoto++; + $photo = $file; + $viewfilename = $file; - if ($size == 1) { // Format vignette - // On determine nom du fichier vignette - $photo_vignette=''; - if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$photo,$regs)) { - $photo_vignette=preg_replace('/'.$regs[0].'/i','',$photo)."_small".$regs[0]; - if (! dol_is_file($dirthumb.$photo_vignette)) $photo_vignette=''; - } + if ($size == 1) { // Format vignette + // On determine nom du fichier vignette + $photo_vignette=''; + if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$photo,$regs)) { + $photo_vignette=preg_replace('/'.$regs[0].'/i','',$photo)."_small".$regs[0]; + if (! dol_is_file($dirthumb.$photo_vignette)) $photo_vignette=''; + } - // Get filesize of original file - $imgarray=dol_getImageSize($dir.$photo); + // Get filesize of original file + $imgarray=dol_getImageSize($dir.$photo); - if ($nbbyrow && $nbphoto == 1) $return.= '
    "; - if ($conf->$module->enabled) - { - $var=!$var; - print "
    "; + print $object->description; - print $object->description; + print ''; - print ''; + $const = "PRODUCT_SPECIAL_".strtoupper($file); - $const = "PRODUCT_SPECIAL_".strtoupper($file); + if ($conf->global->$const) + { + print img_tick(); + print ''; + print ''.$langs->trans("Disable").''; + } + else + { + print ' '; + print ''.$langs->trans("Activate").''; + } - if ($conf->global->$const) - { - print img_tick(); - print ''; - print ''.$langs->trans("Disable").''; - } - else - { - print ' '; - print ''.$langs->trans("Activate").''; - } - - print '
    '; + if ($nbbyrow && $nbphoto == 1) $return.= '
    '; - if ($nbbyrow && ($nbphoto % $nbbyrow == 1)) $return.= ''; - if ($nbbyrow) $return.= ''; + if ($nbbyrow) $return.= ''; - if ($nbbyrow && ($nbphoto % $nbbyrow == 0)) $return.= ''; + if ($nbbyrow) $return.= ''; + if ($nbbyrow && ($nbphoto % $nbbyrow == 0)) $return.= ''; - } + } - if ($size == 0) { // Format origine - $return.= ''; + if ($size == 0) { // Format origine + $return.= ''; - if ($showfilename) $return.= '
    '.$viewfilename; - if ($showaction) - { - if ($user->rights->produit->creer || $user->rights->service->creer) - { - // Link to resize - $return.= ''.img_picto($langs->trans("Resize"),DOL_URL_ROOT.'/theme/common/transform-crop-and-resize','',1).'   '; + if ($showfilename) $return.= '
    '.$viewfilename; + if ($showaction) + { + if ($user->rights->produit->creer || $user->rights->service->creer) + { + // Link to resize + $return.= ''.img_picto($langs->trans("Resize"),DOL_URL_ROOT.'/theme/common/transform-crop-and-resize','',1).'   '; - // Link to delete - $return.= ''; - $return.= img_delete().''; - } - } - } + // Link to delete + $return.= ''; + $return.= img_delete().''; + } + } + } - // On continue ou on arrete de boucler ? - if ($nbmax && $nbphoto >= $nbmax) break; - } - } + // On continue ou on arrete de boucler ? + if ($nbmax && $nbphoto >= $nbmax) break; + } + } + } if ($nbbyrow && $size==1) { @@ -2632,7 +2638,7 @@ class Product extends CommonObject $dir_osencoded=dol_osencode($dir); $handle=@opendir($dir_osencoded); - if ($handle) + if (is_resource($handle)) { while (($file = readdir($handle)) != false) { diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 6ca09e9fade..652a704a11a 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -81,52 +81,54 @@ foreach ($dirlist as $dirroot) // Charge tableaux modules, nom, numero, orders depuis repertoire dir $handle=opendir($dir); - while (($file = readdir($handle))!==false) + if (is_resource($handle)) { - //print "$i ".$file."\n
    "; - if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') + while (($file = readdir($handle))!==false) { - $modName = substr($file, 0, dol_strlen($file) - 10); - - if ($modName) + //print "$i ".$file."\n
    "; + if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') { - include_once($dir.$file); - $objMod = new $modName($db); + $modName = substr($file, 0, dol_strlen($file) - 10); - if ($objMod->numero > 0) + if ($modName) { - $j = $objMod->numero; - } - else - { - $j = 1000 + $i; - } + include_once($dir.$file); + $objMod = new $modName($db); - $modulequalified=1; + if ($objMod->numero > 0) + { + $j = $objMod->numero; + } + else + { + $j = 1000 + $i; + } - // We discard modules that does not respect constraint on menu handlers - if ($objMod->needtopmenu && sizeof($objMod->needtopmenu) && ! in_array($conf->top_menu,$objMod->needtopmenu)) $modulequalified=0; + $modulequalified=1; - // We discard modules according to features level (PS: if module is activated we always show it) - $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod))); - if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && ! $conf->global->$const_name) $modulequalified=0; - if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0; + // We discard modules that does not respect constraint on menu handlers + if ($objMod->needtopmenu && sizeof($objMod->needtopmenu) && ! in_array($conf->top_menu,$objMod->needtopmenu)) $modulequalified=0; - if ($modulequalified) - { - $modules[$i] = $objMod; - $filename[$i]= $modName; - $orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module - //print "x".$modName." ".$orders[$i]."\n
    "; - $categ[$objMod->special]++; // Array of all different modules categories - $dirmod[$i] = $dirroot; - $j++; - $i++; + // We discard modules according to features level (PS: if module is activated we always show it) + $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod))); + if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && ! $conf->global->$const_name) $modulequalified=0; + if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0; + + if ($modulequalified) + { + $modules[$i] = $objMod; + $filename[$i]= $modName; + $orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module + //print "x".$modName." ".$orders[$i]."\n
    "; + $categ[$objMod->special]++; // Array of all different modules categories + $dirmod[$i] = $dirroot; + $j++; + $i++; + } } } } } - } asort($orders); diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index d8e23dff30c..fb1159f1630 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -212,7 +212,7 @@ if ($socid > 0) error_reporting(0); $handle=opendir($courrier_dir); error_reporting($errorlevel); - if ($handle) + if (is_resource($handle)) { $i=0; while (($file = readdir($handle))!==false) diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 2a0d183a28a..467f93b6dfc 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -101,7 +101,7 @@ if ($_GET["id"]) // Load modules attributes in arrays (name, numero, orders) from dir directory //print $dir."\n
    "; $handle=@opendir($dir); - if ($handle) + if (is_resource($handle)) { while (($file = readdir($handle))!==false) { diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 3fcb950170c..c91b01888da 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -128,26 +128,29 @@ foreach($listdir as $dirroot) $dir=$dirroot."/includes/modules/"; $handle=opendir($dir); - while (($file = readdir($handle))!==false) - { - if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') - { - $modName = substr($file, 0, dol_strlen($file) - 10); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') + { + $modName = substr($file, 0, dol_strlen($file) - 10); - if ($modName) - { - include_once($dir.$file); - $objMod = new $modName($db); - if ($objMod->rights_class) { + if ($modName) + { + include_once($dir.$file); + $objMod = new $modName($db); + if ($objMod->rights_class) { - $ret=$objMod->insert_permissions(0); + $ret=$objMod->insert_permissions(0); - $modules[$objMod->rights_class]=$objMod; - //print "modules[".$objMod->rights_class."]=$objMod;"; - } - } - } - } + $modules[$objMod->rights_class]=$objMod; + //print "modules[".$objMod->rights_class."]=$objMod;"; + } + } + } + } + } } $db->commit();
    '; + if ($nbbyrow && ($nbphoto % $nbbyrow == 1)) $return.= '
    '; - $return.= "\n"; - $return.= ''; + $return.= "\n"; + $return.= ''; - // Show image (width height=$maxheight) - // Si fichier vignette disponible et image source trop grande, on utilise la vignette, sinon on utilise photo origine - $alt=$langs->transnoentitiesnoconv('File').': '.$pdir.$photo; - $alt.=' - '.$langs->transnoentitiesnoconv('Size').': '.$imgarray['width'].'x'.$imgarray['height']; - if ($photo_vignette && $imgarray['height'] > $maxheight) { - $return.= ''; - $return.= ''; - } - else { - $return.= ''; - $return.= ''; - } + // Show image (width height=$maxheight) + // Si fichier vignette disponible et image source trop grande, on utilise la vignette, sinon on utilise photo origine + $alt=$langs->transnoentitiesnoconv('File').': '.$pdir.$photo; + $alt.=' - '.$langs->transnoentitiesnoconv('Size').': '.$imgarray['width'].'x'.$imgarray['height']; + if ($photo_vignette && $imgarray['height'] > $maxheight) { + $return.= ''; + $return.= ''; + } + else { + $return.= ''; + $return.= ''; + } - $return.= ''; + $return.= ''; - if ($showfilename) $return.= '
    '.$viewfilename; - if ($showaction) - { - $return.= '
    '; - // On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites - if ($photo_vignette && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i',$photo) && ($product->imgWidth > $maxWidth || $product->imgHeight > $maxHeight)) - { - $return.= ''.img_refresh($langs->trans('GenerateThumb')).'  '; - } - if ($user->rights->produit->creer || $user->rights->service->creer) - { - // Link to resize - $return.= ''.img_picto($langs->trans("Resize"),DOL_URL_ROOT.'/theme/common/transform-crop-and-resize','',1).'   '; + if ($showfilename) $return.= '
    '.$viewfilename; + if ($showaction) + { + $return.= '
    '; + // On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites + if ($photo_vignette && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i',$photo) && ($product->imgWidth > $maxWidth || $product->imgHeight > $maxHeight)) + { + $return.= ''.img_refresh($langs->trans('GenerateThumb')).'  '; + } + if ($user->rights->produit->creer || $user->rights->service->creer) + { + // Link to resize + $return.= ''.img_picto($langs->trans("Resize"),DOL_URL_ROOT.'/theme/common/transform-crop-and-resize','',1).'   '; - // Link to delete - $return.= ''; - $return.= img_delete().''; - } - } - $return.= "\n"; + // Link to delete + $return.= ''; + $return.= img_delete().''; + } + } + $return.= "\n"; - if ($nbbyrow) $return.= '