/lib/pragma/datatransfer/importkit/magmi/magmi-0.8/web/magmi.php

https://bitbucket.org/deniskulikouski/belvg.deniska · PHP · 86 lines · 78 code · 7 blank · 1 comment · 8 complexity · 8b9971facff59197fee21c3dfc415af7 MD5 · raw file

  1. <?php
  2. header('Pragma: public'); // required
  3. header('Expires: 0'); // no cache
  4. header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  5. header('Last-Modified: '.gmdate ('D, d M Y H:i:s', filemtime (__FILE__)).' GMT');
  6. header('Cache-Control: private',false);
  7. require_once("header.php");
  8. require_once("magmi_config.php");
  9. require_once("magmi_statemanager.php");
  10. require_once("fshelper.php");
  11. require_once("magmi_web_utils.php");
  12. $badrights=array();
  13. //checking post install procedure
  14. $postinst="../inc/magmi_postinstall.php";
  15. if(file_exists($postinst))
  16. {
  17. require_once("$postinst");
  18. if(function_exists("magmi_post_install"))
  19. {
  20. $result=magmi_post_install();
  21. if($result["OK"]!=""){?>
  22. <div class="container_12" >
  23. <div class="grid_12 subtitle"><span>Post install procedure</span></div>
  24. <div class="grid_12 col"><h3>Post install output</h3>
  25. <div class="mgupload_info" style="margin-top:5px">
  26. <?php echo $result["OK"]?>
  27. </div></div></div>
  28. <?php }
  29. rename($postinst,$postinst.".".strval(time()));
  30. }
  31. }
  32. foreach(array("../state","../conf","../plugins") as $dirname)
  33. {
  34. if(!FSHelper::isDirWritable($dirname))
  35. {
  36. $badrights[]=$dirname;
  37. }
  38. }
  39. if(count($badrights)==0)
  40. {
  41. $state=Magmi_StateManager::getState();
  42. $mode=getWebParam("run");
  43. if($state=="running" || (isset($mode) && $mode=="import"))
  44. {
  45. require_once("magmi_import_run.php");
  46. }
  47. else
  48. {
  49. Magmi_StateManager::setState("idle",true);
  50. require_once("magmi_config_setup.php");
  51. require_once("magmi_choose_engine.php");
  52. require_once("magmi_run_profile.php");
  53. require_once("magmi_profile_config.php");
  54. }
  55. }
  56. else
  57. {
  58. ?>
  59. <div class="container_12" >
  60. <div class="grid_12">
  61. <div class="magmi_error" style="margin-top:5px">
  62. Directory permissions not compatible with Mass Importer operations
  63. <ul>
  64. <?php foreach($badrights as $dirname){
  65. $trname=str_replace("..","magmi",$dirname);
  66. ?>
  67. <li><?php echo $trname?> not writable!</li>
  68. <?php }?>
  69. </ul>
  70. </div>
  71. </div>
  72. </div>
  73. <?php
  74. }
  75. ?>
  76. <?php require_once("footer.php");?>
  77. <div id="overlay" style="display:none">
  78. <div id="overlaycontent"></div>
  79. </div>