Skip to content

Commit 3fe6c08

Browse files
author
John Mertic
committed
Release 6.1.4
1 parent 3730925 commit 3fe6c08

File tree

1,471 files changed

+81338
-142462
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,471 files changed

+81338
-142462
lines changed

ModuleInstall/ModuleInstaller.php

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,10 @@ function install($base_dir, $is_upgrade = false, $previous_version = ''){
224224
$rac = new RepairAndClear();
225225
$rac->repairAndClearAll($selectedActions, $installed_modules,true, false);
226226
$this->rebuild_relationships();
227-
UpdateSystemTabs('Add',$tab_modules);
228-
229-
//clear the unified_search_module.php file
230-
require_once('modules/Home/UnifiedSearchAdvanced.php');
231-
UnifiedSearchAdvanced::unlinkUnifiedSearchModulesFile();
232-
233227
$this->log('<br><b>' . translate('LBL_MI_COMPLETE') . '</b>');
228+
229+
UpdateSystemTabs('Add',$tab_modules);
230+
234231
}else{
235232
die("No \$installdefs Defined In $this->base_dir/manifest.php");
236233
}
@@ -340,9 +337,7 @@ function uninstall_new_files($cp, $backup_path){
340337
//if it's not a sugar file then we remove it otherwise we can't restor it
341338
if(!$this->ms->sugarFileExists($to)){
342339
$GLOBALS['log']->debug('ModuleInstaller[uninstall_new_file] deleting file ' . $to);
343-
if(file_exists($to)) {
344-
unlink($to);
345-
}
340+
unlink($to);
346341
}else{
347342
$GLOBALS['log']->fatal('ModuleInstaller[uninstall_new_file] Could not remove file ' . $to . ' as no backup file was found to restore to');
348343
}
@@ -1266,10 +1261,6 @@ function uninstall($base_dir){
12661261

12671262
UpdateSystemTabs('Restore',$installed_modules);
12681263

1269-
//clear the unified_search_module.php file
1270-
require_once('modules/Home/UnifiedSearchAdvanced.php');
1271-
UnifiedSearchAdvanced::unlinkUnifiedSearchModulesFile();
1272-
12731264
$this->log('<br><b>' . translate('LBL_MI_COMPLETE') . '</b>');
12741265
if(!$this->silent){
12751266
update_progress_bar('install', $total_steps, $total_steps);
@@ -1298,7 +1289,6 @@ function rebuild_vardefs(){
12981289
$this->merge_files('Ext/Vardefs/', 'vardefs.ext.php');
12991290
sugar_cache_reset();
13001291
}
1301-
13021292
function rebuild_layoutdefs(){
13031293
$this->log(translate('LBL_MI_REBUILDING') . " Layoutdefs...");
13041294
$this->merge_files('Ext/Layoutdefs/', 'layoutdefs.ext.php');
@@ -1312,12 +1302,12 @@ function rebuild_menus(){
13121302

13131303
function rebuild_dashletcontainers(){
13141304
$this->log(translate('LBL_MI_REBUILDING') . " DC Actions...");
1315-
$this->merge_files('Ext/DashletContainer/Containers/', 'dcactions.ext.php');
1305+
$this->merge_files('Ext/DashletContainer/Containers', 'dcactions.ext.php');
13161306
}
13171307

13181308
function rebuild_modules(){
13191309
$this->log(translate('LBL_MI_REBUILDING') . " Modules...");
1320-
$this->merge_files('Ext/Include/', 'modules.ext.php', '', true);
1310+
$this->merge_files('Ext/Include', 'modules.ext.php', '', true);
13211311
}
13221312

13231313
function rebuild_administration(){
@@ -1410,14 +1400,18 @@ function merge_files($path, $name, $filter = '', $application = false){
14101400
if (substr($entry, 0, 9) == '_override') {
14111401
$override[] = $entry;
14121402
} else {
1413-
$file = file_get_contents($module_install . '/' . $entry);
1403+
$fp = sugar_fopen($module_install . '/' . $entry, 'r');
1404+
$file = fread($fp , filesize($module_install . '/' . $entry));
14141405
$GLOBALS['log']->debug(get_class($this)."->merge_files(): found {$module_install}{$entry}") ;
1406+
fclose($fp);
14151407
$extension .= "\n". str_replace(array('<?php', '?>', '<?PHP', '<?'), array('','', '' ,'') , $file);
14161408
}
14171409
}
14181410
}
14191411
foreach ($override as $entry) {
1420-
$file = file_get_contents($module_install . '/' . $entry);
1412+
$fp = sugar_fopen($module_install . '/' . $entry, 'r');
1413+
$file = fread($fp , filesize($module_install . '/' . $entry));
1414+
fclose($fp);
14211415
$extension .= "\n". str_replace(array('<?php', '?>', '<?PHP', '<?'), array('','', '' ,'') , $file);
14221416
}
14231417
}
@@ -1452,7 +1446,9 @@ function merge_files($path, $name, $filter = '', $application = false){
14521446
if((empty($filter) || substr_count($entry, $filter) > 0) && is_file($module_install.'/'.$entry)
14531447
&& $entry != '.' && $entry != '..' && strtolower(substr($entry, -4)) == ".php")
14541448
{
1455-
$file = file_get_contents($module_install . '/' . $entry);
1449+
$fp = sugar_fopen($module_install . '/' . $entry, 'r');
1450+
$file = fread($fp , filesize($module_install . '/' . $entry));
1451+
fclose($fp);
14561452
$extension .= "\n". str_replace(array('<?php', '?>', '<?PHP', '<?'), array('','', '' ,'') , $file);
14571453
}
14581454
}
@@ -1628,7 +1624,6 @@ private function dir_get_files($path, $base_path){
16281624
private function dir_file_count($path){
16291625
//if its a file then it has at least 1 file in the directory
16301626
if(is_file($path)) return 1;
1631-
if(!is_dir($path)) return 0;
16321627
$d = dir($path);
16331628
$count = 0;
16341629
while ($e = $d->read()){
@@ -1997,7 +1992,7 @@ function disable_relationships($action = 'disable'){
19971992
$path ='custom/Extension/' . $relationship['module']. '/Ext/Layoutdefs';
19981993
}
19991994
}
2000-
1995+
20011996
if(!empty($relationship['module_layoutdefs']) && file_exists($path . '/'. $this->id_name . '.php')){
20021997
mkdir_recursive($path . '/'.DISABLED_PATH, true);
20031998
rename( $path . '/'. $this->id_name . '.php', $path . '/'.DISABLED_PATH.'/'. $this->id_name . '.php');

ModuleInstall/PackageManager/PackageManager.php

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ function authenticate($username, $password, $systemname='', $terms_checked = tru
233233
}
234234

235235
function setCredentials($username, $password, $systemname){
236-
236+
237237
$admin = new Administration();
238238
$admin->retrieveSettings();
239239
$admin->saveSetting(CREDENTIAL_CATEGORY, CREDENTIAL_USERNAME, $username);
@@ -244,7 +244,7 @@ function setCredentials($username, $password, $systemname){
244244
}
245245

246246
function getCredentials(){
247-
247+
248248
$admin = new Administration();
249249
$admin->retrieveSettings(CREDENTIAL_CATEGORY, true);
250250
$credentials = array();
@@ -619,7 +619,7 @@ function getUITextForType( $type ){
619619
}
620620

621621
function getImageForType( $type ){
622-
622+
623623
$icon = "";
624624
switch( $type ){
625625
case "full":
@@ -664,7 +664,7 @@ function getPackagesInStaging($view = 'module'){
664664
$alreadyProcessed["$val"] = true;
665665
}
666666
}
667-
667+
668668
$upgrades_available = 0;
669669
$packages = array();
670670
$mod_strings = return_module_language($current_language, "Administration");
@@ -703,7 +703,7 @@ function getPackagesInStaging($view = 'module'){
703703

704704
//check dependencies first
705705
if(!empty($dependencies)){
706-
706+
707707
$uh = new UpgradeHistory();
708708
$not_found = $uh->checkDependencies($dependencies);
709709
if(!empty($not_found) && count($not_found) > 0){
@@ -736,7 +736,7 @@ function getPackagesInStaging($view = 'module'){
736736
$c = count($fileS);
737737
$fileName = (isset($fileS[$c-1]) && !empty($fileS[$c-1])) ? $fileS[$c-1] : $fileS[$c-2];
738738
$upload_file = $sugar_config['upload_dir'].$fileName;
739-
739+
740740
$upgrade_content = urlencode($upgrade_content);
741741
$upload_content = urlencode($upload_file);
742742
$packages[] = array('name' => $name, 'version' => $version, 'published_date' => $published_date, 'description' => $description, 'uninstallable' =>$uninstallable, 'type' => $type, 'file_install' => fileToHash($file_install), 'file' => fileToHash($upgrade_content), 'upload_file' => $upload_content);
@@ -751,7 +751,9 @@ function getLicenseFromFile($file){
751751
$base_tmp_upgrade_dir = "$base_upgrade_dir/temp";
752752
$license_file = $this->extractFile($file, 'LICENSE.txt', $base_tmp_upgrade_dir);
753753
if(is_file($license_file)){
754-
$contents = file_get_contents($license_file);
754+
$fh = sugar_fopen($license_file, 'r');
755+
$contents = fread($fh, filesize($license_file));
756+
fclose($fh);
755757
return $contents;
756758
}else{
757759
return null;
@@ -854,15 +856,15 @@ function getinstalledPackages($types = array('module', 'langpack')){
854856
} else {
855857
$file_uninstall = fileToHash( $file_uninstall );
856858
}
857-
859+
858860
$packages[] = array(
859-
'name' => $name,
860-
'version' => $version,
861-
'type' => $type,
862-
'published_date' => $date_entered,
863-
'description' => $description,
864-
'uninstallable' =>$uninstallable,
865-
'file_install' => $file_uninstall ,
861+
'name' => $name,
862+
'version' => $version,
863+
'type' => $type,
864+
'published_date' => $date_entered,
865+
'description' => $description,
866+
'uninstallable' =>$uninstallable,
867+
'file_install' => $file_uninstall ,
866868
'file' => fileToHash($filename),
867869
'enabled' => $enabled_string
868870
);

ModuleInstall/PackageManager/PackageManagerDisplay.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,9 @@ function buildTreeView($div_id, $isAlive = true){
324324
function getLicenseDisplay($license_file, $form_action, $next_step, $zipFile, $type, $manifest, $modify_field){
325325
global $current_language;
326326
$mod_strings = return_module_language($current_language, "Administration");
327-
$contents = sugar_file_get_contents($license_file);
327+
$fh = sugar_fopen($license_file, 'r');
328+
$contents = fread($fh, filesize($license_file));
329+
fclose($fh);
328330
$div_id = urlencode($zipFile);
329331
$display = "<form name='delete{$zipFile}' action='{$form_action}' method='POST'>";
330332
$display .= "<input type='hidden' name='current_step' value='{$next_step}'>";

ModuleInstall/PackageManager/tpls/PackageManagerScripts.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
********************************************************************************/
3636
3737
*}
38-
<script type="text/javascript" src="{sugar_getjspath file='include/javascript/sugar_grp_yui_widgets.js'}"></script>
3938
{literal}
39+
<script type="text/javascript" src="include/javascript/sugar_grp_yui_widgets.js"></script>
4040
<script>
4141
/*
4242
* a reference to an instance of PackageManagerGrid

README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This repository represents the Sugar CE source code from the latest stable version of SugarCRM. Check out the SugarCRM Dev wiki at https://github.com/sugarcrm/sugarcrm_dev/wiki for more details on how to fork this repository and submit pull requests to SugarCRM.

Zend/Crypt.php

Lines changed: 0 additions & 167 deletions
This file was deleted.

0 commit comments

Comments
 (0)