settings.php 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. /**
  3. * ownCloud - user_ldap
  4. *
  5. * @author Brice Maron
  6. * @copyright 2011 Brice Maron brice __from__ bmaron _DOT_ net
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  10. * License as published by the Free Software Foundation; either
  11. * version 3 of the License, or any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public
  19. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. $l=new OC_L10N('admin_dependencies_chk');
  23. $tmpl = new OC_Template( 'admin_dependencies_chk', 'settings');
  24. $modules = array();
  25. //Possible status are : ok, error, warning
  26. $modules[] =array(
  27. 'status' => function_exists('json_encode') ? 'ok' : 'error',
  28. 'part'=> 'php-json',
  29. 'modules'=> array('core'),
  30. 'message'=> $l->t('The php-json module is needed by the many applications for inter communications'));
  31. $modules[] =array(
  32. 'status' => function_exists('curl_init') ? 'ok' : 'error',
  33. 'part'=> 'php-curl',
  34. 'modules'=> array('bookmarks'),
  35. 'message'=> $l->t('The php-curl modude is needed to fetch the page title when adding a bookmarks'));
  36. $modules[] =array(
  37. 'status' => function_exists('imagepng') ? 'ok' : 'error',
  38. 'part'=> 'php-gd',
  39. 'modules'=> array('gallery'),
  40. 'message'=> $l->t('The php-gd module is needed to create thumbnails of your images'));
  41. $modules[] =array(
  42. 'status' => OC_Helper::canExecute("mp3info") ? 'ok' : 'warning',
  43. 'part'=> 'mp3info',
  44. 'modules'=> array('media'),
  45. 'message'=> $l->t('The program mp3info is useful to discover ID3 tags of your music files'));
  46. $modules[] =array(
  47. 'status' => OC_Helper::canExecute("ldap_bind") ? 'ok' : 'error',
  48. 'part'=> 'php-ldap',
  49. 'modules'=> array('user_ldap'),
  50. 'message'=> $l->t('The php-ldap module is needed connect to your ldap server'));
  51. $modules[] =array(
  52. 'status' => class_exists('ZipArchive') ? 'ok' : 'warning',
  53. 'part'=> 'php-zip',
  54. 'modules'=> array('admin_export','core'),
  55. 'message'=> $l->t('The php-zip module is needed download multiple files at once'));
  56. $modules[] =array(
  57. 'status' => function_exists('mb_detect_encoding') ? 'ok' : 'error',
  58. 'part'=> 'php-mb_multibyte ',
  59. 'modules'=> array('core'),
  60. 'message'=> $l->t('The php-mb_multibyte module is needed to manage correctly the encoding.'));
  61. $modules[] =array(
  62. 'status' => function_exists('ctype_digit') ? 'ok' : 'error',
  63. 'part'=> 'php-ctype',
  64. 'modules'=> array('core'),
  65. 'message'=> $l->t('The php-ctype module is needed validate data.'));
  66. $modules[] =array(
  67. 'status' => ini_get('allow_url_fopen') == '1' ? 'ok' : 'error',
  68. 'part'=> 'allow_url_fopen',
  69. 'modules'=> array('core'),
  70. 'message'=> $l->t('The allow_url_fopen directive of your php.ini should be set to 1 to retrieve knowledge base from OCS servers'));
  71. foreach($modules as $key => $module) {
  72. $enabled = false ;
  73. foreach($module['modules'] as $app) {
  74. if(OC_App::isEnabled($app) || $app=='core'){
  75. $enabled = true;
  76. }
  77. }
  78. if($enabled == false) unset($modules[$key]);
  79. }
  80. OC_UTIL::addStyle('admin_dependencies_chk', 'style');
  81. $tmpl->assign( 'items', $modules );
  82. return $tmpl->fetchPage();