Changeset 13163

Show
Ignore:
Timestamp:
01/05/12 11:59:43 (1 year ago)
Author:
p_lindheimer
Message:

Merged revisions 13090,13103-13104,13106 via svnmerge from
http://www.freepbx.org/v2/svn/modules/branches/2.10

........

r13090 | p_lindheimer | 2011-12-17 12:58:41 -0800 (Sat, 17 Dec 2011) | 1 line


closes #5480 remove packaged files, needs testing!

........

r13103 | p_lindheimer | 2011-12-20 16:04:33 -0800 (Tue, 20 Dec 2011) | 1 line


more tweaks re #5480

........

r13104 | p_lindheimer | 2011-12-20 16:06:11 -0800 (Tue, 20 Dec 2011) | 1 line


oops syntax error re #5480

........

r13106 | p_lindheimer | 2011-12-20 16:19:18 -0800 (Tue, 20 Dec 2011) | 1 line


more tweaks re #5480

........

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.9

    • Property svn:mergeinfo set to /modules/branches/2.10:13090,13103-13104,13106
    • Property svnmerge-integrated changed from /modules/branches/2.10:1-12085,13055,13061,13067,13069 /modules/branches/2.8:1-12454 /modules/branches/bootstrap-2.9:1-10853 to /modules/branches/2.10:1-12085,13055,13061,13067,13069,13090,13097-13100,13103-13104,13106 /modules/branches/2.8:1-12454 /modules/branches/bootstrap-2.9:1-10853
  • modules/branches/2.9/framework/install.php

    r11484 r13163  
    11<?php 
    2  
    32// HELPER FUNCTIONS: 
    43 
     
    7372 */ 
    7473 
    75   $htdocs_source = dirname(__FILE__)."/htdocs/*"; 
    76   $bin_source = dirname(__FILE__)."/bin/*"; 
    77   $agibin_source = dirname(__FILE__)."/agi-bin/*"; 
     74  $base_source = dirname(__FILE__); 
     75  $htdocs_source = $base_source . "/htdocs/*"; 
     76  $bin_source = $base_source . "/bin/*"; 
     77  $agibin_source = $base_source . "/agi-bin/*"; 
    7878 
    7979  if (!file_exists(dirname($htdocs_source))) { 
     
    9191  $agibin_dest = isset($asterisk_conf['astagidir']) ? $asterisk_conf['astagidir']:'/var/lib/asterisk/agi-bin'; 
    9292 
     93  $msg = _("installing files to %s.."); 
     94 
     95  $out = array(); 
     96  outn(sprintf($msg, $htdocs_dest)); 
    9397  exec("cp -rf $htdocs_source $htdocs_dest 2>&1",$out,$ret); 
    9498  if ($ret != 0) { 
    9599    framework_print_errors($htdocs_source, $htdocs_dest, $out); 
     100    out(_("done, see errors below")); 
     101  } else { 
     102    out(_("done")); 
    96103  } 
    97104 
     105 
     106  unset($out); 
     107  outn(sprintf($msg, $bin_dest)); 
    98108  exec("cp -rf $bin_source $bin_dest 2>&1",$out,$ret); 
    99109  if ($ret != 0) { 
    100110    framework_print_errors($bin_source, $bin_dest, $out); 
     111    out(_("done, see errors below")); 
     112  } else { 
     113    out(_("done")); 
    101114  } 
    102115 
     116  unset($out); 
     117  outn(sprintf($msg, $agibin_dest)); 
    103118  exec("cp -rf $agibin_source $agibin_dest 2>&1",$out,$ret); 
    104119  if ($ret != 0) { 
    105120    framework_print_errors($agibin_source, $agibin_dest, $out); 
     121    out(_("done, see errors below")); 
     122  } else { 
     123    out(_("done")); 
    106124  } 
    107125 
     
    126144  } 
    127145 
     146  // We now delete the files, this makes sure that if someone had an unprotected system where they have not enabled 
     147  // the .htaccess files or otherwise allowed direct access, that these files are not around to possibly cause problems 
     148  // 
     149  out(_("framework file install done, removing packages from module")); 
     150 
     151  $base_source = dirname(__FILE__); 
     152  $htdocs_source = $base_source . "/htdocs/*"; 
     153  $bin_source = $base_source . "/bin/*"; 
     154  $agibin_source = $base_source . "/agi-bin/*"; 
     155 
     156  $rem_files[] = $base_source . '/htdocs'; 
     157  $rem_files[] = $base_source . '/bin'; 
     158  $rem_files[] = $base_source . '/agi-bin'; 
     159  $rem_files[] = $base_source . '/upgrades'; 
     160  $rem_files[] = $base_source . '/libfreepbx.install.php'; 
     161    
     162  foreach ($rem_files as $target) { 
     163    unset($out); 
     164    exec("rm -rf $target 2>&1",$out,$ret); 
     165    if ($ret != 0) { 
     166      out(sprintf(_("an error occured removing the packaged file/directory: %s"), $target)); 
     167    } else { 
     168      out(sprintf(_("file/directory: %s removed successfully"), $target)); 
     169    } 
     170  } 
     171 
    128172?>