0
0
Fork 0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2025-03-16 14:23:33 +00:00

Merge branch 'hotfix' of https://github.com/salesagility/SuiteCRM into fix/5723-bean-save-return-value

# Conflicts:
#	modules/AM_ProjectTemplates/AM_ProjectTemplates.php
#	modules/AOS_Contracts/AOS_Contracts.php
#	modules/AOS_Products/AOS_Products.php
#	modules/AOS_Quotes/AOS_Quotes.php
#	modules/Project/Project.php
This commit is contained in:
p.ernst 2018-07-17 15:41:35 +01:00
commit 9b2c6b38a0
3223 changed files with 217250 additions and 195374 deletions
.gitignore.travis.ymlHandleAjaxCall.php
ModuleInstall
README.mdRoboFile.phpSugarSecurity.phpTreeData.php
XTemplate
Zend
bower.json
build
campaign_tracker.phpcodeception.ymlcodecov.ymlcomposer.jsoncron.php
custom
data

5
.gitignore vendored
View file

@ -100,4 +100,7 @@ browserstack.err
cache/
custom/**/
.sass-cache/
.php_cs.cache
.php_cs.cache
# Ignore testing environment
build/tmp/

View file

@ -1,34 +1,87 @@
language: php
php:
- '5.5'
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
matrix:
fast_finish: true
jobs:
include:
- stage: codecoverage
if: type IN (pull_request) OR branch in (master, develop)
php: 7.0
script: ./vendor/bin/codecept run install --env travis-ci-hub -f -vvv -d; ./vendor/bin/robo -vvv code:coverage; cat codeception.yml; bash <(curl -s https://codecov.io/bash) -f tests/_output/coverage.xml
sudo: required
dist: trusty
services:
- mysql
addons:
chrome: stable
env:
- INSTANCE_URL=http://localhost/ DATABASE_DRIVER=MYSQL DATABASE_NAME=automated_tests DATABASE_HOST=localhost DATABASE_USER=automated_tests DATABASE_PASSWORD=automated_tests INSTANCE_ADMIN_USER=admin INSTANCE_ADMIN_PASSWORD=admin1
before_install:
# Install chrome driver#
- whereis google-chrome-stable
- wget https://chromedriver.storage.googleapis.com/2.36/chromedriver_linux64.zip
- unzip -o chromedriver_linux64.zip
- ./chromedriver --url-base=/wd/hub &
install:
- composer self-update && composer --version
before_script:
# Set up MySQL
- mysql -e "CREATE DATABASE automated_tests;"
- mysql -u root -e "CREATE USER 'automated_tests'@'localhost' IDENTIFIED BY 'automated_tests';"
- mysql -u root -e "GRANT ALL PRIVILEGES ON automated_tests.* TO 'automated_tests'@'localhost';"
- phpenv config-rm xdebug.ini
# Install apache - images with PHP 7 or above
- sudo apt-get update
- sudo apt-get install apache2 libapache2-mod-fastcgi
# Enable php-fpm - images with PHP 7 or above
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf 2>/dev/null || true
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- sudo a2enmod rewrite actions fastcgi alias
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
- sudo chown -R travis:travis /var/lib/apache2/fastcgi
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# Configure apache virtual hosts - images with PHP 7 or above
- sudo cp -f build/travis-ci-apache /etc/apache2/sites-available/000-default.conf
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
- sudo service apache2 restart
# Install composer
- composer install
- ./vendor/bin/codecept build
# Additional PHP config
- phpenv config-add travis.php.ini
script:
- \[ -f "config_si.php" \] || cp tests/travis_config_si.php config_si.php
- php tests/testinstall.php
- ./vendor/bin/codecept run -f unit --steps -vvv --debug
# Run the silent installer or the wizard installer ?
- echo "using install wizard"
- ./vendor/bin/codecept run install --env travis-ci-hub -f -vvv -d
- ./build/push_output.sh
# set the log level to error
- echo "\$sugar_config['logger']['level']='error';" >> config_override.php
# Install OAuth2 demo data
- mysql -u root -D automated_tests -v -e "source tests/_data/api_data.sql"
# Install demo user data
- mysql -u root -D automated_tests -v -e "source tests/_data/demo_users.sql"
# Run the unit tests
# Run API functional tests
# RUN Basic Acceptance test
- ./vendor/bin/codecept run -f unit --steps -v && ./vendor/bin/codecept run api --steps -f -v && sudo chmod -R 777 . && ./vendor/bin/codecept run acceptance --env travis-ci-hub -f -v;
after_script:
- ./build/push_output.sh
- cat suitecrm.log
- sudo cat /var/log/apache2/error.log
- echo $TRAVIS_COMMIT_RANGE
branches:
only:

View file

@ -1,5 +1,7 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@ -43,16 +45,15 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
*/
require_once('include/entryPoint.php');
require_once('ModuleInstall/PackageManager/PackageController.php');
if(!is_admin($GLOBALS['current_user'])){
sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
if (!is_admin($GLOBALS['current_user'])) {
sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
}
$requestedMethod = $_REQUEST['method'];
$pmc = new PackageController();
if(method_exists($pmc, $requestedMethod)) {
echo $pmc->$requestedMethod();
}
else {
if (method_exists($pmc, $requestedMethod)) {
echo $pmc->$requestedMethod();
} else {
echo 'no method';
}
// sugar_cleanup();

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,7 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@ -38,40 +40,41 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
********************************************************************************/
class ModuleScanner{
private $manifestMap = array(
'pre_execute'=>'pre_execute',
'install_mkdirs'=>'mkdir',
'install_copy'=>'copy',
'install_images'=>'image_dir',
'install_menus'=>'menu',
'install_userpage'=>'user_page',
'install_dashlets'=>'dashlets',
'install_administration'=>'administration',
'install_connectors'=>'connectors',
'install_vardefs'=>'vardefs',
'install_layoutdefs'=>'layoutdefs',
'install_layoutfields'=>'layoutfields',
'install_relationships'=>'relationships',
'install_languages'=>'language',
class ModuleScanner
{
private $manifestMap = array(
'pre_execute'=>'pre_execute',
'install_mkdirs'=>'mkdir',
'install_copy'=>'copy',
'install_images'=>'image_dir',
'install_menus'=>'menu',
'install_userpage'=>'user_page',
'install_dashlets'=>'dashlets',
'install_administration'=>'administration',
'install_connectors'=>'connectors',
'install_vardefs'=>'vardefs',
'install_layoutdefs'=>'layoutdefs',
'install_layoutfields'=>'layoutfields',
'install_relationships'=>'relationships',
'install_languages'=>'language',
'install_logichooks'=>'logic_hooks',
'post_execute'=>'post_execute',
'post_execute'=>'post_execute',
);
);
/**
* config settings
* @var array
*/
private $config = array();
private $config_hash;
/**
* config settings
* @var array
*/
private $config = array();
private $config_hash;
private $blackListExempt = array();
private $classBlackListExempt = array();
private $blackListExempt = array();
private $classBlackListExempt = array();
// Bug 56717 - adding hbs extension to the whitelist - rgonzalez
private $validExt = array('png', 'gif', 'jpg', 'css', 'js', 'php', 'txt', 'html', 'htm', 'tpl', 'pdf', 'md5', 'xml', 'hbs');
private $classBlackList = array(
private $validExt = array('png', 'gif', 'jpg', 'css', 'js', 'php', 'txt', 'html', 'htm', 'tpl', 'pdf', 'md5', 'xml', 'hbs');
private $classBlackList = array(
// Class names specified here must be in lowercase as the implementation
// of the tokenizer converts all tokens to lowercase.
'reflection',
@ -87,13 +90,13 @@ class ModuleScanner{
'reflector',
'reflectionexception',
'lua',
'ziparchive',
'splfileinfo',
'splfileobject',
'pclzip',
'ziparchive',
'splfileinfo',
'splfileobject',
'pclzip',
);
private $blackList = array(
private $blackList = array(
'popen',
'proc_open',
'escapeshellarg',
@ -101,12 +104,12 @@ class ModuleScanner{
'proc_close',
'proc_get_status',
'proc_nice',
'passthru',
'passthru',
'clearstatcache',
'disk_free_space',
'disk_total_space',
'diskfreespace',
'dir',
'dir',
'fclose',
'feof',
'fflush',
@ -136,7 +139,7 @@ class ModuleScanner{
'is_link',
'is_readable',
'is_uploaded_file',
'opendir',
'opendir',
'parse_ini_string',
'pathinfo',
'pclose',
@ -146,75 +149,75 @@ class ModuleScanner{
'realpath_cache_size',
'realpath',
'rewind',
'readdir',
'readdir',
'set_file_buffer',
'tmpfile',
'umask',
'ini_set',
'set_time_limit',
'eval',
'exec',
'system',
'shell_exec',
'passthru',
'chgrp',
'chmod',
'chwown',
'file_put_contents',
'file',
'fileatime',
'filectime',
'filegroup',
'fileinode',
'filemtime',
'fileowner',
'fileperms',
'fopen',
'is_executable',
'is_writable',
'is_writeable',
'lchgrp',
'lchown',
'linkinfo',
'lstat',
'mkdir',
'eval',
'exec',
'system',
'shell_exec',
'passthru',
'chgrp',
'chmod',
'chwown',
'file_put_contents',
'file',
'fileatime',
'filectime',
'filegroup',
'fileinode',
'filemtime',
'fileowner',
'fileperms',
'fopen',
'is_executable',
'is_writable',
'is_writeable',
'lchgrp',
'lchown',
'linkinfo',
'lstat',
'mkdir',
'mkdir_recursive',
'parse_ini_file',
'rmdir',
'parse_ini_file',
'rmdir',
'rmdir_recursive',
'stat',
'tempnam',
'touch',
'unlink',
'getimagesize',
'call_user_func',
'call_user_func_array',
'create_function',
'stat',
'tempnam',
'touch',
'unlink',
'getimagesize',
'call_user_func',
'call_user_func_array',
'create_function',
//mutliple files per function call
'copy',
//mutliple files per function call
'copy',
'copy_recursive',
'link',
'rename',
'symlink',
'move_uploaded_file',
'chdir',
'chroot',
'create_cache_directory',
'mk_temp_dir',
'write_array_to_file',
'write_encoded_file',
'create_custom_directory',
'sugar_rename',
'sugar_chown',
'sugar_fopen',
'sugar_mkdir',
'sugar_file_put_contents',
'sugar_file_put_contents_atomic',
'sugar_chgrp',
'sugar_chmod',
'sugar_touch',
'link',
'rename',
'symlink',
'move_uploaded_file',
'chdir',
'chroot',
'create_cache_directory',
'mk_temp_dir',
'write_array_to_file',
'write_encoded_file',
'create_custom_directory',
'sugar_rename',
'sugar_chown',
'sugar_fopen',
'sugar_mkdir',
'sugar_file_put_contents',
'sugar_file_put_contents_atomic',
'sugar_chgrp',
'sugar_chmod',
'sugar_touch',
// Functions that have callbacks can circumvent our security measures.
// List retrieved through PHP's XML documentation, and running the
@ -396,28 +399,26 @@ class ModuleScanner{
'xml_set_processing_instruction_handler',
'xml_set_start_namespace_decl_handler',
'xml_set_unparsed_entity_decl_handler',
'simplexml_load_file',
'simplexml_load_string',
'simplexml_load_file',
'simplexml_load_string',
// unzip
'unzip',
'unzip_file',
// unzip
'unzip',
'unzip_file',
);
private $methodsBlackList = array('setlevel', 'put' => array('sugarautoloader'), 'unlink' => array('sugarautoloader'));
public function printToWiki(){
echo "'''Default Extensions'''<br>";
foreach($this->validExt as $b){
echo '#' . $b . '<br>';
}
echo "'''Default Black Listed Functions'''<br>";
foreach($this->blackList as $b){
echo '#' . $b . '<br>';
}
}
public function printToWiki()
{
echo "'''Default Extensions'''<br>";
foreach ($this->validExt as $b) {
echo '#' . $b . '<br>';
}
echo "'''Default Black Listed Functions'''<br>";
foreach ($this->blackList as $b) {
echo '#' . $b . '<br>';
}
}
public function __construct()
{
@ -441,7 +442,6 @@ class ModuleScanner{
}
foreach ($params as $param => $constName) {
if (!$disableConfigOverride && isset($this->config[$param]) && is_array($this->config[$param])) {
$this->{$param} = array_merge($this->{$param}, $this->config[$param]);
}
@ -454,160 +454,182 @@ class ModuleScanner{
$this->{$param} = array_merge($this->{$param}, $value);
}
}
}
}
private $issues = array();
private $pathToModule = '';
private $issues = array();
private $pathToModule = '';
/**
*returns a list of issues
*/
public function getIssues(){
return $this->issues;
}
/**
*returns a list of issues
*/
public function getIssues()
{
return $this->issues;
}
/**
*returns true or false if any issues were found
*/
public function hasIssues(){
return !empty($this->issues);
}
/**
*returns true or false if any issues were found
*/
public function hasIssues()
{
return !empty($this->issues);
}
/**
*Ensures that a file has a valid extension
*/
public function isValidExtension($file)
{
$file = strtolower($file);
$pi = pathinfo($file);
/**
*Ensures that a file has a valid extension
*/
public function isValidExtension($file)
{
$file = strtolower($file);
$pi = pathinfo($file);
//make sure they don't override the files.md5
if(empty($pi['extension']) || $pi['basename'] == 'files.md5') {
return false;
}
return in_array($pi['extension'], $this->validExt);
//make sure they don't override the files.md5
if (empty($pi['extension']) || $pi['basename'] == 'files.md5') {
return false;
}
return in_array($pi['extension'], $this->validExt);
}
}
public function isConfigFile($file)
{
$real = realpath($file);
if ($real == realpath("config.php")) {
return true;
}
if (file_exists("config_override.php") && $real == realpath("config_override.php")) {
return true;
}
return false;
}
public function isConfigFile($file)
{
$real = realpath($file);
if($real == realpath("config.php")) {
return true;
}
if(file_exists("config_override.php") && $real == realpath("config_override.php")) {
return true;
}
return false;
}
/**
*Scans a directory and calls on scan file for each file
**/
public function scanDir($path)
{
static $startPath = '';
if (empty($startPath)) {
$startPath = $path;
}
if (!is_dir($path)) {
return false;
}
$d = dir($path);
while ($e = $d->read()) {
$next = $path . '/' . $e;
if (is_dir($next)) {
if (substr($e, 0, 1) == '.') {
continue;
}
$this->scanDir($next);
} else {
$issues = $this->scanFile($next);
}
}
return true;
}
/**
*Scans a directory and calls on scan file for each file
**/
public function scanDir($path){
static $startPath = '';
if(empty($startPath))$startPath = $path;
if(!is_dir($path))return false;
$d = dir($path);
while($e = $d->read()){
$next = $path . '/' . $e;
if(is_dir($next)){
if(substr($e, 0, 1) == '.')continue;
$this->scanDir($next);
}else{
$issues = $this->scanFile($next);
}
}
return true;
}
/**
* Check if the file contents looks like PHP
* @param string $contents File contents
* @return boolean
*/
public function isPHPFile($contents)
{
if(stripos($contents, '<?php') !== false) return true;
for($tag=0;($tag = stripos($contents, '<?', $tag)) !== false;$tag++) {
if(strncasecmp(substr($contents, $tag, 13), '<?xml version', 13) == 0) {
/**
* Check if the file contents looks like PHP
* @param string $contents File contents
* @return boolean
*/
public function isPHPFile($contents)
{
if (stripos($contents, '<?php') !== false) {
return true;
}
for ($tag=0;($tag = stripos($contents, '<?', $tag)) !== false;$tag++) {
if (strncasecmp(substr($contents, $tag, 13), '<?xml version', 13) == 0) {
// <?xml version is OK, skip it
$tag++;
continue;
}
// found <?, it's PHP
return true;
}
return false;
}
}
return false;
}
/**
* Given a file it will open it's contents and check if it is a PHP file (not safe to just rely on extensions) if it finds <?php tags it will use the tokenizer to scan the file
* $var() and ` are always prevented then whatever is in the blacklist.
* It will also ensure that all files are of valid extension types
*
*/
public function scanFile($file){
$issues = array();
if(!$this->isValidExtension($file)){
$issues[] = translate('ML_INVALID_EXT');
$this->issues['file'][$file] = $issues;
return $issues;
}
if($this->isConfigFile($file)){
$issues[] = translate('ML_OVERRIDE_CORE_FILES');
$this->issues['file'][$file] = $issues;
return $issues;
}
$contents = file_get_contents($file);
if(!$this->isPHPFile($contents)) return $issues;
$tokens = @token_get_all($contents);
$checkFunction = false;
$possibleIssue = '';
$lastToken = false;
foreach($tokens as $index=>$token){
if(is_string($token[0])){
switch($token[0]){
case '`':
$issues['backtick'] = translate('ML_INVALID_FUNCTION') . " '`'";
case '(':
if($checkFunction)$issues[] = $possibleIssue;
break;
}
$checkFunction = false;
$possibleIssue = '';
}else{
$token['_msi'] = token_name($token[0]);
switch($token[0]){
case T_WHITESPACE: continue;
case T_EVAL:
if(in_array('eval', $this->blackList) && !in_array('eval', $this->blackListExempt))
$issues[]= translate('ML_INVALID_FUNCTION') . ' eval()';
break;
case T_STRING:
$token[1] = strtolower($token[1]);
if($lastToken !== false && $lastToken[0] == T_NEW) {
if(!in_array($token[1], $this->classBlackList))break;
if(in_array($token[1], $this->classBlackListExempt))break;
/**
* Given a file it will open it's contents and check if it is a PHP file (not safe to just rely on extensions) if it finds <?php tags it will use the tokenizer to scan the file
* $var() and ` are always prevented then whatever is in the blacklist.
* It will also ensure that all files are of valid extension types
*
*/
public function scanFile($file)
{
$issues = array();
if (!$this->isValidExtension($file)) {
$issues[] = translate('ML_INVALID_EXT');
$this->issues['file'][$file] = $issues;
return $issues;
}
if ($this->isConfigFile($file)) {
$issues[] = translate('ML_OVERRIDE_CORE_FILES');
$this->issues['file'][$file] = $issues;
return $issues;
}
$contents = file_get_contents($file);
if (!$this->isPHPFile($contents)) {
return $issues;
}
$tokens = @token_get_all($contents);
$checkFunction = false;
$possibleIssue = '';
$lastToken = false;
foreach ($tokens as $index=>$token) {
if (is_string($token[0])) {
switch ($token[0]) {
case '`':
$issues['backtick'] = translate('ML_INVALID_FUNCTION') . " '`'";
// no break
case '(':
if ($checkFunction) {
$issues[] = $possibleIssue;
}
break;
}
$checkFunction = false;
$possibleIssue = '';
} else {
$token['_msi'] = token_name($token[0]);
switch ($token[0]) {
case T_WHITESPACE: continue;
case T_EVAL:
if (in_array('eval', $this->blackList) && !in_array('eval', $this->blackListExempt)) {
$issues[]= translate('ML_INVALID_FUNCTION') . ' eval()';
}
break;
case T_STRING:
$token[1] = strtolower($token[1]);
if ($lastToken !== false && $lastToken[0] == T_NEW) {
if (!in_array($token[1], $this->classBlackList)) {
break;
}
if (in_array($token[1], $this->classBlackListExempt)) {
break;
}
} elseif ($token[0] == T_DOUBLE_COLON) {
if(!in_array($lastToken[1], $this->classBlackList))break;
if(in_array($lastToken[1], $this->classBlackListExempt))break;
if (!in_array($lastToken[1], $this->classBlackList)) {
break;
}
if (in_array($lastToken[1], $this->classBlackListExempt)) {
break;
}
} else {
//if nothing else fit, lets check the last token to see if this is a possible method call
if ($lastToken !== false &&
($lastToken[0] == T_OBJECT_OPERATOR || $lastToken[0] == T_DOUBLE_COLON))
{
($lastToken[0] == T_OBJECT_OPERATOR || $lastToken[0] == T_DOUBLE_COLON)) {
// check static blacklist for methods
if(!empty($this->methodsBlackList[$token[1]])) {
if($this->methodsBlackList[$token[1]] == '*') {
if (!empty($this->methodsBlackList[$token[1]])) {
if ($this->methodsBlackList[$token[1]] == '*') {
$issues[]= translate('ML_INVALID_METHOD') . ' ' .$token[1]. '()';
break;
} else {
if($lastToken[0] == T_DOUBLE_COLON && $index > 2 && $tokens[$index-2][0] == T_STRING) {
if ($lastToken[0] == T_DOUBLE_COLON && $index > 2 && $tokens[$index-2][0] == T_STRING) {
$classname = strtolower($tokens[$index-2][1]);
if(in_array($classname, $this->methodsBlackList[$token[1]])) {
if (in_array($classname, $this->methodsBlackList[$token[1]])) {
$issues[]= translate('ML_INVALID_METHOD') . ' ' .$classname . '::' . $token[1]. '()';
break;
}
@ -615,40 +637,42 @@ class ModuleScanner{
}
}
//this is a method call, check the black list
if(in_array($token[1], $this->methodsBlackList)){
if (in_array($token[1], $this->methodsBlackList)) {
$issues[]= translate('ML_INVALID_METHOD') . ' ' .$token[1]. '()';
}
break;
}
if(!in_array($token[1], $this->blackList))break;
if(in_array($token[1], $this->blackListExempt))break;
if (!in_array($token[1], $this->blackList)) {
break;
}
if (in_array($token[1], $this->blackListExempt)) {
break;
}
}
case T_VARIABLE:
$checkFunction = true;
$possibleIssue = translate('ML_INVALID_FUNCTION') . ' ' . $token[1] . '()';
break;
// no break
case T_VARIABLE:
$checkFunction = true;
$possibleIssue = translate('ML_INVALID_FUNCTION') . ' ' . $token[1] . '()';
break;
default:
$checkFunction = false;
$possibleIssue = '';
default:
$checkFunction = false;
$possibleIssue = '';
}
if ($token[0] != T_WHITESPACE)
{
$lastToken = $token;
}
}
}
if ($token[0] != T_WHITESPACE) {
$lastToken = $token;
}
}
}
if (!empty($issues)) {
$this->issues['file'][$file] = $issues;
}
}
if(!empty($issues)){
$this->issues['file'][$file] = $issues;
}
return $issues;
}
return $issues;
}
/**
* checks files.md5 file to see if the file is from sugar
@ -704,37 +728,37 @@ class ModuleScanner{
return join("/", $res);
}
/**
*This function will scan the Manifest for disabled actions specified in $GLOBALS['sugar_config']['moduleInstaller']['disableActions']
*if $GLOBALS['sugar_config']['moduleInstaller']['disableRestrictedCopy'] is set to false or not set it will call on scanCopy to ensure that it is not overriding files
*/
/**
*This function will scan the Manifest for disabled actions specified in $GLOBALS['sugar_config']['moduleInstaller']['disableActions']
*if $GLOBALS['sugar_config']['moduleInstaller']['disableRestrictedCopy'] is set to false or not set it will call on scanCopy to ensure that it is not overriding files
*/
public function scanManifest($manifestPath)
{
$issues = array();
if(!file_exists($manifestPath)){
$this->issues['manifest'][$manifestPath] = translate('ML_NO_MANIFEST');
return $issues;
}
$fileIssues = $this->scanFile($manifestPath);
//if the manifest contains malicious code do not open it
if(!empty($fileIssues)){
return $fileIssues;
}
$this->lockConfig();
list($manifest, $installdefs) = MSLoadManifest($manifestPath);
$fileIssues = $this->checkConfig($manifestPath);
if(!empty($fileIssues)){
return $fileIssues;
}
$issues = array();
if (!file_exists($manifestPath)) {
$this->issues['manifest'][$manifestPath] = translate('ML_NO_MANIFEST');
return $issues;
}
$fileIssues = $this->scanFile($manifestPath);
//if the manifest contains malicious code do not open it
if (!empty($fileIssues)) {
return $fileIssues;
}
$this->lockConfig();
list($manifest, $installdefs) = MSLoadManifest($manifestPath);
$fileIssues = $this->checkConfig($manifestPath);
if (!empty($fileIssues)) {
return $fileIssues;
}
//scan for disabled actions
if(isset($this->config['disableActions'])){
foreach($this->config['disableActions'] as $action){
if(isset($installdefs[$this->manifestMap[$action]])){
$issues[] = translate('ML_INVALID_ACTION_IN_MANIFEST') . $this->manifestMap[$action];
}
}
}
//scan for disabled actions
if (isset($this->config['disableActions'])) {
foreach ($this->config['disableActions'] as $action) {
if (isset($installdefs[$this->manifestMap[$action]])) {
$issues[] = translate('ML_INVALID_ACTION_IN_MANIFEST') . $this->manifestMap[$action];
}
}
}
// now lets scan for files that will override our files
if (empty($this->config['disableRestrictedCopy']) && isset($installdefs['copy'])) {
@ -759,7 +783,7 @@ class ModuleScanner{
if (!empty($issues)) {
$this->issues['manifest'][$manifestPath] = $issues;
}
}
}
/**
* Takes in where the file will is specified to be copied from and to
@ -793,80 +817,78 @@ class ModuleScanner{
if (is_file($to) && $this->sugarFileExists($to)) {
$this->issues['copy'][$from] = translate('ML_OVERRIDE_CORE_FILES') . '(' . $to . ')';
}
}
/**
*Main external function that takes in a path to a package and then scans
*that package's manifest for disabled actions and then it scans the PHP files
*for restricted function calls
*
*/
public function scanPackage($path){
$this->pathToModule = $path;
$this->scanManifest($path . '/manifest.php');
if(empty($this->config['disableFileScan'])){
$this->scanDir($path);
}
}
/**
*Main external function that takes in a path to a package and then scans
*that package's manifest for disabled actions and then it scans the PHP files
*for restricted function calls
*
*/
public function scanPackage($path)
{
$this->pathToModule = $path;
$this->scanManifest($path . '/manifest.php');
if (empty($this->config['disableFileScan'])) {
$this->scanDir($path);
}
}
/**
*This function will take all issues of the current instance and print them to the screen
**/
public function displayIssues($package='Package'){
echo '<h2>'.str_replace('{PACKAGE}' , $package ,translate('ML_PACKAGE_SCANNING')). '</h2><BR><h2 class="error">' . translate('ML_INSTALLATION_FAILED') . '</h2><br><p>' .str_replace('{PACKAGE}' , $package ,translate('ML_PACKAGE_NOT_CONFIRM')). '</p><ul><li>'. translate('ML_OBTAIN_NEW_PACKAGE') . '<li>' . translate('ML_RELAX_LOCAL').
/**
*This function will take all issues of the current instance and print them to the screen
**/
public function displayIssues($package='Package')
{
echo '<h2>'.str_replace('{PACKAGE}', $package, translate('ML_PACKAGE_SCANNING')). '</h2><BR><h2 class="error">' . translate('ML_INSTALLATION_FAILED') . '</h2><br><p>' .str_replace('{PACKAGE}', $package, translate('ML_PACKAGE_NOT_CONFIRM')). '</p><ul><li>'. translate('ML_OBTAIN_NEW_PACKAGE') . '<li>' . translate('ML_RELAX_LOCAL').
'</ul></p><br>' . translate('ML_SUGAR_LOADING_POLICY') . ' <a href=" http://kb.sugarcrm.com/custom/module-loader-restrictions-for-sugar-open-cloud/">' . translate('ML_SUGAR_KB') . '</a>.'.
'<br>' . translate('ML_AVAIL_RESTRICTION'). ' <a href=" http://developers.sugarcrm.com/wordpress/2009/08/14/module-loader-restrictions/">' . translate('ML_SUGAR_DZ') . '</a>.<br><br>';
foreach($this->issues as $type=>$issues){
echo '<div class="error"><h2>'. ucfirst($type) .' ' . translate('ML_ISSUES') . '</h2> </div>';
echo '<div id="details' . $type . '" >';
foreach($issues as $file=>$issue){
$file = str_replace($this->pathToModule . '/', '', $file);
echo '<div style="position:relative;left:10px"><b>' . $file . '</b></div><div style="position:relative;left:20px">';
if(is_array($issue)){
foreach($issue as $i){
echo "$i<br>";
}
}else{
echo "$issue<br>";
}
echo "</div>";
}
echo '</div>';
foreach ($this->issues as $type=>$issues) {
echo '<div class="error"><h2>'. ucfirst($type) .' ' . translate('ML_ISSUES') . '</h2> </div>';
echo '<div id="details' . $type . '" >';
foreach ($issues as $file=>$issue) {
$file = str_replace($this->pathToModule . '/', '', $file);
echo '<div style="position:relative;left:10px"><b>' . $file . '</b></div><div style="position:relative;left:20px">';
if (is_array($issue)) {
foreach ($issue as $i) {
echo "$i<br>";
}
} else {
echo "$issue<br>";
}
echo "</div>";
}
echo '</div>';
}
echo "<br><input class='button' onclick='document.location.href=\"index.php?module=Administration&action=UpgradeWizard&view=module\"' type='button' value=\"" . translate('LBL_UW_BTN_BACK_TO_MOD_LOADER') . "\" />";
}
}
echo "<br><input class='button' onclick='document.location.href=\"index.php?module=Administration&action=UpgradeWizard&view=module\"' type='button' value=\"" . translate('LBL_UW_BTN_BACK_TO_MOD_LOADER') . "\" />";
}
/**
* Lock config settings
*/
public function lockConfig()
{
if(empty($this->config_hash)) {
$this->config_hash = md5(serialize($GLOBALS['sugar_config']));
}
}
/**
* Check if config was modified. Return
* @param string $file
* @return array Errors if something wrong, false if no problems
*/
public function checkConfig($file)
{
$config_hash_after = md5(serialize($GLOBALS['sugar_config']));
if($config_hash_after != $this->config_hash) {
$this->issues['file'][$file] = array(translate('ML_CONFIG_OVERRIDE'));
return $this->issues;
}
return false;
}
/**
* Lock config settings
*/
public function lockConfig()
{
if (empty($this->config_hash)) {
$this->config_hash = md5(serialize($GLOBALS['sugar_config']));
}
}
/**
* Check if config was modified. Return
* @param string $file
* @return array Errors if something wrong, false if no problems
*/
public function checkConfig($file)
{
$config_hash_after = md5(serialize($GLOBALS['sugar_config']));
if ($config_hash_after != $this->config_hash) {
$this->issues['file'][$file] = array(translate('ML_CONFIG_OVERRIDE'));
return $this->issues;
}
return false;
}
}
/**
@ -877,6 +899,6 @@ class ModuleScanner{
*/
function MSLoadManifest($manifest_file)
{
include( $manifest_file );
return array($manifest, $installdefs);
include($manifest_file);
return array($manifest, $installdefs);
}

View file

@ -39,24 +39,26 @@
require_once('include/ListView/ListViewSmarty.php');
class ListViewPackages extends ListViewSmarty{
var $secondaryDisplayColumns;
class ListViewPackages extends ListViewSmarty
{
public $secondaryDisplayColumns;
/**
* Constructor Call ListViewSmarty
*/
function __construct(){
public function __construct()
{
parent::__construct();
}
/**
* @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
*/
function ListViewPackages(){
public function ListViewPackages()
{
$deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
if(isset($GLOBALS['log'])) {
if (isset($GLOBALS['log'])) {
$GLOBALS['log']->deprecated($deprecatedMessage);
}
else {
} else {
trigger_error($deprecatedMessage, E_USER_DEPRECATED);
}
self::__construct();
@ -69,7 +71,8 @@ class ListViewPackages extends ListViewSmarty{
* @param data the data to display on the page
* @param file the template file to parse
*/
function setup($data, $file, $where, $params = Array(), $offset = 0, $limit = -1, $filter_fields = Array(), $id_field = 'id', $id=NULL) {
public function setup($data, $file, $where, $params = Array(), $offset = 0, $limit = -1, $filter_fields = Array(), $id_field = 'id', $id=NULL)
{
$this->data = $data;
$this->tpl = $file;
}
@ -77,7 +80,8 @@ class ListViewPackages extends ListViewSmarty{
/**
* Override the display method
*/
function display($end = true){
public function display($end = true)
{
global $odd_bg, $even_bg, $app_strings;
$this->ss->assign('rowColor', array('oddListRow', 'evenListRow'));
$this->ss->assign('bgColor', array($odd_bg, $even_bg));

View file

@ -39,352 +39,372 @@
require_once('ModuleInstall/PackageManager/PackageManagerDisplay.php');
require_once('ModuleInstall/PackageManager/PackageManager.php');
class PackageController{
var $_pm;
class PackageController
{
public $_pm;
/**
* Constructor: this class is called from the the ajax call and handles invoking the correct
* functionality on the server.
*/
function __construct(){
$this->_pm = new PackageManager();
}
/**
* Constructor: this class is called from the the ajax call and handles invoking the correct
* functionality on the server.
*/
public function __construct()
{
$this->_pm = new PackageManager();
}
/**
* @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
/**
* @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
*/
public function PackageController()
{
$deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
if (isset($GLOBALS['log'])) {
$GLOBALS['log']->deprecated($deprecatedMessage);
} else {
trigger_error($deprecatedMessage, E_USER_DEPRECATED);
}
self::__construct();
}
public function performBasicSearch()
{
$json = getJSONobj();
$search_term = '';
$node_id = '';
if (isset($_REQUEST['search_term'])) {
$search_term = nl2br($_REQUEST['search_term']);
}
if (isset($_REQUEST['node_id'])) {
$node_id = nl2br($_REQUEST['node_id']);
}
$xml = PackageManager::getPackages($node_id);
echo 'result = ' . $json->encode(array('packages' => $xml));
}
/**
* Retrieve a list of packages which belong to the corresponding category
*
* @param category_id this is passed via POST and is the category id of packages
* we wish to retrieve
* @return packages xml string consisting of the packages and releases which belong to
* the category
*/
public function getPackages()
{
$json = getJSONobj();
$category_id = '';
if (isset($_REQUEST['category_id'])) {
$category_id = nl2br($_REQUEST['category_id']);
}
$xml = PackageManager::getPackages($category_id);
echo 'result = ' . $json->encode(array('package_output' => $xml));
}
/**
* Obtain a list of releases from the server. This function is currently used for generating the patches/langpacks for upgrade wizard
* as well as during installation
*/
public function getReleases()
{
$json = getJSONobj();
$category_id = '';
$package_id = '';
$types = '';
if (isset($_REQUEST['category_id'])) {
$category_id = nl2br($_REQUEST['category_id']);
}
if (isset($_REQUEST['package_id'])) {
$package_id = nl2br($_REQUEST['package_id']);
}
if (isset($_REQUEST['types'])) {
$types = nl2br($_REQUEST['types']);
}
$types = explode(',', $types);
$filter = array();
$count = count($types);
$index = 1;
$type_str = '';
foreach ($types as $type) {
$type_str .= "'".$type."'";
if ($index < $count) {
$type_str .= ",";
}
$index++;
}
$filter = array('type' => $type_str);
$filter = PackageManager::toNameValueList($filter);
$releases = PackageManager::getReleases($category_id, $package_id, $filter);
$nodes = array();
$release_map = array();
foreach ($releases['packages'] as $release) {
$release = PackageManager::fromNameValueList($release);
$nodes[] = array('description' => $release['description'], 'version' => $release['version'], 'build_number' => $release['build_number'], 'id' => $release['id']);
$release_map[$release['id']] = array('package_id' => $release['package_id'], 'category_id' => $release['category_id']);
}
$_SESSION['ML_PATCHES'] = $release_map;
echo 'result = ' . $json->encode(array('releases' => $nodes));
}
/**
* Obtain a promotion from the depot
*/
public function getPromotion()
{
$json = getJSONobj();
$header = PackageManager::getPromotion();
echo 'result = ' . $json->encode(array('promotion' => $header));
}
/**
* Download the given release
*
* @param category_id this is passed via POST and is the category id of the release we wish to download
* @param package_id this is passed via POST and is the package id of the release we wish to download
* @param release_id this is passed via POST and is the release id of the release we wish to download
* @return bool true is successful in downloading, false otherwise
*/
public function download()
{
global $sugar_config;
$json = getJSONobj();
$package_id = '';
$category_id = '';
$release_id = '';
if (isset($_REQUEST['package_id'])) {
$package_id = nl2br($_REQUEST['package_id']);
}
if (isset($_REQUEST['category_id'])) {
$category_id = nl2br($_REQUEST['category_id']);
}
if (isset($_REQUEST['release_id'])) {
$release_id = nl2br($_REQUEST['release_id']);
}
$GLOBALS['log']->debug("PACKAGE ID: ".$package_id);
$GLOBALS['log']->debug("CATEGORY ID: ".$category_id);
$GLOBALS['log']->debug("RELEASE ID: ".$release_id);
$result = $this->_pm->download($category_id, $package_id, $release_id);
$GLOBALS['log']->debug("RESULT: ".print_r($result, true));
$success = 'false';
if ($result != null) {
$GLOBALS['log']->debug("Performing Setup");
$this->_pm->performSetup($result, 'module', false);
$GLOBALS['log']->debug("Complete Setup");
$success = 'true';
}
echo 'result = ' . $json->encode(array('success' => $success));
}
/**
* Retrieve a list of categories that are subcategories to the selected category
*
* @param id - the id of the parent_category, -1 if this is the root
* @return array - a list of categories/nodes which are underneath this node
*/
function PackageController(){
$deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
if(isset($GLOBALS['log'])) {
$GLOBALS['log']->deprecated($deprecatedMessage);
}
else {
trigger_error($deprecatedMessage, E_USER_DEPRECATED);
}
self::__construct();
}
public function getCategories()
{
$json = getJSONobj();
$node_id = '';
if (isset($_REQUEST['category_id'])) {
$node_id = nl2br($_REQUEST['category_id']);
}
$GLOBALS['log']->debug("NODE ID: ".$node_id);
$nodes = PackageManager::getCategories($node_id);
echo 'result = ' . $json->encode(array('nodes' => $nodes));
}
public function getNodes()
{
$json = getJSONobj();
$category_id = '';
if (isset($_REQUEST['category_id'])) {
$category_id = nl2br($_REQUEST['category_id']);
}
$GLOBALS['log']->debug("CATEGORY ID: ".$category_id);
$nodes = PackageManager::getModuleLoaderCategoryPackages($category_id);
$GLOBALS['log']->debug(var_export($nodes, true));
echo 'result = ' . $json->encode(array('nodes' => $nodes));
}
function performBasicSearch(){
$json = getJSONobj();
$search_term = '';
$node_id = '';
if(isset($_REQUEST['search_term'])) {
$search_term = nl2br($_REQUEST['search_term']);
}
if(isset($_REQUEST['node_id'])) {
$node_id = nl2br($_REQUEST['node_id']);
}
$xml = PackageManager::getPackages($node_id);
echo 'result = ' . $json->encode(array('packages' => $xml));
}
/**
* Check the SugarDepot for updates for the given type as passed in via POST
* @param type the type to check for
* @return array return an array of releases for each given installed object if an update is found
*/
public function checkForUpdates()
{
$json = getJSONobj();
$type = '';
if (isset($_REQUEST['type'])) {
$type = nl2br($_REQUEST['type']);
}
$pm = new PackageManager();
$updates = $pm->checkForUpdates();
$nodes = array();
$release_map = array();
if (!empty($updates)) {
foreach ($updates as $update) {
$update = PackageManager::fromNameValueList($update);
$nodes[] = array('label' => $update['name'], 'description' => $update['description'], 'version' => $update['version'], 'build_number' => $update['build_number'], 'id' => $update['id'], 'type' => $update['type']);
$release_map[$update['id']] = array('package_id' => $update['package_id'], 'category_id' => $update['category_id'], 'type' => $update['type']);
}
}
//patches
$filter = array(array('name' => 'type', 'value' => "'patch'"));
$releases = $pm->getReleases('', '', $filter);
if (!empty($releases['packages'])) {
foreach ($releases['packages'] as $update) {
$update = PackageManager::fromNameValueList($update);
$nodes[] = array('label' => $update['name'], 'description' => $update['description'], 'version' => $update['version'], 'build_number' => $update['build_number'], 'id' => $update['id'], 'type' => $update['type']);
$release_map[$update['id']] = array('package_id' => $update['package_id'], 'category_id' => $update['category_id'], 'type' => $update['type']);
}
}
$_SESSION['ML_PATCHES'] = $release_map;
echo 'result = ' . $json->encode(array('updates' => $nodes));
}
/**
* Retrieve a list of packages which belong to the corresponding category
*
* @param category_id this is passed via POST and is the category id of packages
* we wish to retrieve
* @return packages xml string consisting of the packages and releases which belong to
* the category
*/
function getPackages(){
$json = getJSONobj();
$category_id = '';
public function getLicenseText()
{
$json = getJSONobj();
$file = '';
if (isset($_REQUEST['file'])) {
$file = hashToFile($_REQUEST['file']);
}
$GLOBALS['log']->debug("FILE : ".$file);
echo 'result = ' . $json->encode(array('license_display' => PackageManagerDisplay::buildLicenseOutput($file)));
}
if(isset($_REQUEST['category_id'])) {
$category_id = nl2br($_REQUEST['category_id']);
}
$xml = PackageManager::getPackages($category_id);
echo 'result = ' . $json->encode(array('package_output' => $xml));
}
/**
* build the list of modules that are currently in the staging area waiting to be installed
*/
public function getPackagesInStaging()
{
$packages = $this->_pm->getPackagesInStaging('module');
$json = getJSONobj();
/**
* Obtain a list of releases from the server. This function is currently used for generating the patches/langpacks for upgrade wizard
* as well as during installation
*/
function getReleases(){
$json = getJSONobj();
$category_id = '';
$package_id = '';
$types = '';
if(isset($_REQUEST['category_id'])) {
$category_id = nl2br($_REQUEST['category_id']);
}
if(isset($_REQUEST['package_id'])) {
$package_id = nl2br($_REQUEST['package_id']);
}
if(isset($_REQUEST['types'])) {
$types = nl2br($_REQUEST['types']);
}
$types = explode(',', $types);
echo 'result = ' . $json->encode(array('packages' => $packages));
}
$filter = array();
$count = count($types);
$index = 1;
$type_str = '';
foreach($types as $type){
$type_str .= "'".$type."'";
if($index < $count)
$type_str .= ",";
$index++;
}
/**
* build the list of modules that are currently in the staging area waiting to be installed
*/
public function performInstall()
{
$file = '';
if (isset($_REQUEST['file'])) {
$file = hashToFile($_REQUEST['file']);
}
if (!empty($file)) {
$this->_pm->performInstall($file);
}
$json = getJSONobj();
$filter = array('type' => $type_str);
$filter = PackageManager::toNameValueList($filter);
$releases = PackageManager::getReleases($category_id, $package_id, $filter);
$nodes = array();
$release_map = array();
foreach($releases['packages'] as $release){
$release = PackageManager::fromNameValueList($release);
$nodes[] = array('description' => $release['description'], 'version' => $release['version'], 'build_number' => $release['build_number'], 'id' => $release['id']);
$release_map[$release['id']] = array('package_id' => $release['package_id'], 'category_id' => $release['category_id']);
}
$_SESSION['ML_PATCHES'] = $release_map;
echo 'result = ' . $json->encode(array('releases' => $nodes));
}
echo 'result = ' . $json->encode(array('result' => 'success'));
}
/**
* Obtain a promotion from the depot
*/
function getPromotion(){
$json = getJSONobj();
public function authenticate()
{
$json = getJSONobj();
$username = '';
$password = '';
$servername = '';
$terms_checked = '';
if (isset($_REQUEST['username'])) {
$username = nl2br($_REQUEST['username']);
}
if (isset($_REQUEST['password'])) {
$password = nl2br($_REQUEST['password']);
}
if (isset($_REQUEST['servername'])) {
$servername = $_REQUEST['servername'];
}
if (isset($_REQUEST['terms_checked'])) {
$terms_checked = $_REQUEST['terms_checked'];
if ($terms_checked == 'on') {
$terms_checked = true;
}
}
$header = PackageManager::getPromotion();
if (!empty($username) && !empty($password)) {
$password = md5($password);
$result = PackageManager::authenticate($username, $password, $servername, $terms_checked);
if (!is_array($result) && $result == true) {
$status = 'success';
} else {
$status = $result['faultstring'];
}
} else {
$status = 'failed';
}
echo 'result = ' . $json->encode(array('promotion' => $header));
}
echo 'result = ' . $json->encode(array('status' => $status));
}
/**
* Download the given release
*
* @param category_id this is passed via POST and is the category id of the release we wish to download
* @param package_id this is passed via POST and is the package id of the release we wish to download
* @param release_id this is passed via POST and is the release id of the release we wish to download
* @return bool true is successful in downloading, false otherwise
*/
function download(){
global $sugar_config;
$json = getJSONobj();
$package_id = '';
$category_id = '';
$release_id = '';
if(isset($_REQUEST['package_id'])) {
$package_id = nl2br($_REQUEST['package_id']);
}
if(isset($_REQUEST['category_id'])) {
$category_id = nl2br($_REQUEST['category_id']);
}
if(isset($_REQUEST['release_id'])) {
$release_id = nl2br($_REQUEST['release_id']);
}
$GLOBALS['log']->debug("PACKAGE ID: ".$package_id);
$GLOBALS['log']->debug("CATEGORY ID: ".$category_id);
$GLOBALS['log']->debug("RELEASE ID: ".$release_id);
$result = $this->_pm->download($category_id, $package_id, $release_id);
$GLOBALS['log']->debug("RESULT: ".print_r($result,true));
$success = 'false';
if($result != null){
$GLOBALS['log']->debug("Performing Setup");
$this->_pm->performSetup($result, 'module', false);
$GLOBALS['log']->debug("Complete Setup");
$success = 'true';
}
echo 'result = ' . $json->encode(array('success' => $success));
}
public function getDocumentation()
{
$json = getJSONobj();
$package_id = '';
$release_id = '';
/**
* Retrieve a list of categories that are subcategories to the selected category
*
* @param id - the id of the parent_category, -1 if this is the root
* @return array - a list of categories/nodes which are underneath this node
*/
function getCategories(){
$json = getJSONobj();
$node_id = '';
if(isset($_REQUEST['category_id'])) {
$node_id = nl2br($_REQUEST['category_id']);
}
$GLOBALS['log']->debug("NODE ID: ".$node_id);
$nodes = PackageManager::getCategories($node_id);
echo 'result = ' . $json->encode(array('nodes' => $nodes));
}
if (isset($_REQUEST['package_id'])) {
$package_id = nl2br($_REQUEST['package_id']);
}
if (isset($_REQUEST['release_id'])) {
$release_id = nl2br($_REQUEST['release_id']);
}
function getNodes(){
$json = getJSONobj();
$category_id = '';
if(isset($_REQUEST['category_id'])) {
$category_id = nl2br($_REQUEST['category_id']);
}
$GLOBALS['log']->debug("CATEGORY ID: ".$category_id);
$nodes = PackageManager::getModuleLoaderCategoryPackages($category_id);
$GLOBALS['log']->debug(var_export($nodes, true));
echo 'result = ' . $json->encode(array('nodes' => $nodes));
}
$documents = PackageManager::getDocumentation($package_id, $release_id);
$GLOBALS['log']->debug("DOCUMENTS: ".var_export($documents, true));
echo 'result = ' . $json->encode(array('documents' => $documents));
}
/**
* Check the SugarDepot for updates for the given type as passed in via POST
* @param type the type to check for
* @return array return an array of releases for each given installed object if an update is found
*/
function checkForUpdates(){
$json = getJSONobj();
$type = '';
if(isset($_REQUEST['type'])) {
$type = nl2br($_REQUEST['type']);
}
$pm = new PackageManager();
$updates = $pm->checkForUpdates();
$nodes = array();
$release_map = array();
if(!empty($updates)){
foreach($updates as $update){
$update = PackageManager::fromNameValueList($update);
$nodes[] = array('label' => $update['name'], 'description' => $update['description'], 'version' => $update['version'], 'build_number' => $update['build_number'], 'id' => $update['id'], 'type' => $update['type']);
$release_map[$update['id']] = array('package_id' => $update['package_id'], 'category_id' => $update['category_id'], 'type' => $update['type']);
}
}
//patches
$filter = array(array('name' => 'type', 'value' => "'patch'"));
$releases = $pm->getReleases('', '', $filter);
if(!empty($releases['packages'])){
foreach($releases['packages'] as $update){
$update = PackageManager::fromNameValueList($update);
$nodes[] = array('label' => $update['name'], 'description' => $update['description'], 'version' => $update['version'], 'build_number' => $update['build_number'], 'id' => $update['id'], 'type' => $update['type']);
$release_map[$update['id']] = array('package_id' => $update['package_id'], 'category_id' => $update['category_id'], 'type' => $update['type']);
}
}
$_SESSION['ML_PATCHES'] = $release_map;
echo 'result = ' . $json->encode(array('updates' => $nodes));
}
public function downloadedDocumentation()
{
$json = getJSONobj();
$document_id = '';
function getLicenseText(){
$json = getJSONobj();
$file = '';
if(isset($_REQUEST['file'])) {
$file = hashToFile($_REQUEST['file']);
}
$GLOBALS['log']->debug("FILE : ".$file);
echo 'result = ' . $json->encode(array('license_display' => PackageManagerDisplay::buildLicenseOutput($file)));
}
if (isset($_REQUEST['document_id'])) {
$document_id = nl2br($_REQUEST['document_id']);
}
$GLOBALS['log']->debug("Downloading Document: ".$document_id);
PackageManagerComm::downloadedDocumentation($document_id);
echo 'result = ' . $json->encode(array('result' => 'true'));
}
/**
* build the list of modules that are currently in the staging area waiting to be installed
*/
function getPackagesInStaging(){
$packages = $this->_pm->getPackagesInStaging('module');
$json = getJSONobj();
/**
* Remove metadata files such as foo-manifest
* Enter description here ...
* @param unknown_type $file
* @param unknown_type $meta
*/
protected function rmMetaFile($file, $meta)
{
$metafile = pathinfo($file, PATHINFO_DIRNAME)."/". pathinfo($file, PATHINFO_FILENAME)."-$meta.php";
if (file_exists($metafile)) {
unlink($metafile);
}
}
echo 'result = ' . $json->encode(array('packages' => $packages));
}
public function remove()
{
$json = getJSONobj();
$file = '';
/**
* build the list of modules that are currently in the staging area waiting to be installed
*/
function performInstall(){
$file = '';
if(isset($_REQUEST['file'])) {
$file = hashToFile($_REQUEST['file']);
}
if(!empty($file)){
$this->_pm->performInstall($file);
}
$json = getJSONobj();
echo 'result = ' . $json->encode(array('result' => 'success'));
}
function authenticate(){
$json = getJSONobj();
$username = '';
$password = '';
$servername = '';
$terms_checked = '';
if(isset($_REQUEST['username'])) {
$username = nl2br($_REQUEST['username']);
}
if(isset($_REQUEST['password'])) {
$password = nl2br($_REQUEST['password']);
}
if(isset($_REQUEST['servername'])) {
$servername = $_REQUEST['servername'];
}
if(isset($_REQUEST['terms_checked'])) {
$terms_checked = $_REQUEST['terms_checked'];
if($terms_checked == 'on')
$terms_checked = true;
}
if(!empty($username) && !empty($password)){
$password = md5($password);
$result = PackageManager::authenticate($username, $password, $servername, $terms_checked);
if(!is_array($result) && $result == true)
$status = 'success';
else
$status = $result['faultstring'];
}else{
$status = 'failed';
}
echo 'result = ' . $json->encode(array('status' => $status));
}
function getDocumentation(){
$json = getJSONobj();
$package_id = '';
$release_id = '';
if(isset($_REQUEST['package_id'])) {
$package_id = nl2br($_REQUEST['package_id']);
}
if(isset($_REQUEST['release_id'])) {
$release_id = nl2br($_REQUEST['release_id']);
}
$documents = PackageManager::getDocumentation($package_id, $release_id);
$GLOBALS['log']->debug("DOCUMENTS: ".var_export($documents, true));
echo 'result = ' . $json->encode(array('documents' => $documents));
}
function downloadedDocumentation(){
$json = getJSONobj();
$document_id = '';
if(isset($_REQUEST['document_id'])) {
$document_id = nl2br($_REQUEST['document_id']);
}
$GLOBALS['log']->debug("Downloading Document: ".$document_id);
PackageManagerComm::downloadedDocumentation($document_id);
echo 'result = ' . $json->encode(array('result' => 'true'));
}
/**
* Remove metadata files such as foo-manifest
* Enter description here ...
* @param unknown_type $file
* @param unknown_type $meta
*/
protected function rmMetaFile($file, $meta)
{
$metafile = pathinfo($file, PATHINFO_DIRNAME)."/". pathinfo($file, PATHINFO_FILENAME)."-$meta.php";
if(file_exists($metafile)) {
unlink($metafile);
}
}
function remove(){
$json = getJSONobj();
$file = '';
if(isset($_REQUEST['file'])) {
$file = urldecode(hashToFile($_REQUEST['file']));
}
$GLOBALS['log']->debug("FILE TO REMOVE: ".$file);
if(!empty($file)){
unlink($file);
foreach(array("manifest", "icon") as $meta) {
$this->rmMetaFile($file, $meta);
}
}
echo 'result = ' . $json->encode(array('result' => 'true'));
}
if (isset($_REQUEST['file'])) {
$file = urldecode(hashToFile($_REQUEST['file']));
}
$GLOBALS['log']->debug("FILE TO REMOVE: ".$file);
if (!empty($file)) {
unlink($file);
foreach (array("manifest", "icon") as $meta) {
$this->rmMetaFile($file, $meta);
}
}
echo 'result = ' . $json->encode(array('result' => 'true'));
}
}

File diff suppressed because it is too large Load diff

View file

@ -43,108 +43,120 @@ require_once('ModuleInstall/PackageManager/PackageManagerDownloader.php');
define("HTTPS_URL", "https://depot.sugarcrm.com/depot/SugarDepotSoap.php");
define("ACTIVE_STATUS", "ACTIVE");
class PackageManagerComm{
/**
* Initialize the soap client and store in the $GLOBALS object for use
*
* @param login designates whether we want to try to login after we initialize or not
*/
function initialize($login = true){
if(empty($GLOBALS['SugarDepot'])){
class PackageManagerComm
{
/**
* Initialize the soap client and store in the $GLOBALS object for use
*
* @param login designates whether we want to try to login after we initialize or not
*/
public function initialize($login = true)
{
if (empty($GLOBALS['SugarDepot'])) {
$GLOBALS['log']->debug('USING HTTPS TO CONNECT TO HEARTBEAT');
$soap_client = new nusoapclient(HTTPS_URL, false);
$ping = $soap_client->call('sugarPing', array());
$GLOBALS['SugarDepot'] = $soap_client;
}
//if we do not have a session, then try to login
if($login && empty($_SESSION['SugarDepotSessionID'])){
if ($login && empty($_SESSION['SugarDepotSessionID'])) {
PackageManagerComm::login();
}
}
}
/**
* Check for errors in the response or error_str
*/
function errorCheck(){
if(!empty($GLOBALS['SugarDepot']->error_str)){
$GLOBALS['log']->fatal($GLOBALS['SugarDepot']->error_str);
$GLOBALS['log']->fatal($GLOBALS['SugarDepot']->response);
}
}
/**
* Check for errors in the response or error_str
*/
public function errorCheck()
{
if (!empty($GLOBALS['SugarDepot']->error_str)) {
$GLOBALS['log']->fatal($GLOBALS['SugarDepot']->error_str);
$GLOBALS['log']->fatal($GLOBALS['SugarDepot']->response);
}
}
/**
* Set the credentials for use during login
*
* @param username Mambo username
* @param password Mambo password
* @param download_key User's download key
*/
function setCredentials($username, $password, $download_key){
/**
* Set the credentials for use during login
*
* @param username Mambo username
* @param password Mambo password
* @param download_key User's download key
*/
public function setCredentials($username, $password, $download_key)
{
$_SESSION['SugarDepotUsername'] = $username;
$_SESSION['SugarDepotPassword'] = $password;
$_SESSION['SugarDepotDownloadKey'] = $download_key;
}
}
/**
* Clears out the session so we can reauthenticate.
*/
function clearSession(){
$_SESSION['SugarDepotSessionID'] = null;
unset($_SESSION['SugarDepotSessionID']);
}
/////////////////////////////////////////////////////////
////////// BEGIN: Base Functions for Communicating with the depot
/**
* Login to the depot
*
* @return true if successful, false otherwise
*/
function login($terms_checked = true){
if(empty($_SESSION['SugarDepotSessionID'])){
global $license;
$GLOBALS['log']->debug("Begin SugarDepot Login");
PackageManagerComm::initialize(false);
require('sugar_version.php');
require('config.php');
$credentials = PackageManager::getCredentials();
if(empty($license))loadLicense();
$info = sugarEncode('2813', serialize(getSystemInfo(true)));
$pm = new PackageManager();
$installed = $pm->buildInstalledReleases();
$installed = base64_encode(serialize($installed));
$params = array('installed_modules' => $installed, 'terms_checked' => $terms_checked, 'system_name' => $credentials['system_name']);
$terms_version = (!empty($_SESSION['SugarDepot_TermsVersion']) ? $_SESSION['SugarDepot_TermsVersion'] : '');
if(!empty($terms_version))
$params['terms_version'] = $terms_version;
/**
* Clears out the session so we can reauthenticate.
*/
public function clearSession()
{
$_SESSION['SugarDepotSessionID'] = null;
unset($_SESSION['SugarDepotSessionID']);
}
/////////////////////////////////////////////////////////
////////// BEGIN: Base Functions for Communicating with the depot
/**
* Login to the depot
*
* @return true if successful, false otherwise
*/
public function login($terms_checked = true)
{
if (empty($_SESSION['SugarDepotSessionID'])) {
global $license;
$GLOBALS['log']->debug("Begin SugarDepot Login");
PackageManagerComm::initialize(false);
require('sugar_version.php');
require('config.php');
$credentials = PackageManager::getCredentials();
if (empty($license)) {
loadLicense();
}
$info = sugarEncode('2813', serialize(getSystemInfo(true)));
$pm = new PackageManager();
$installed = $pm->buildInstalledReleases();
$installed = base64_encode(serialize($installed));
$params = array('installed_modules' => $installed, 'terms_checked' => $terms_checked, 'system_name' => $credentials['system_name']);
$terms_version = (!empty($_SESSION['SugarDepot_TermsVersion']) ? $_SESSION['SugarDepot_TermsVersion'] : '');
if (!empty($terms_version)) {
$params['terms_version'] = $terms_version;
}
$result = $GLOBALS['SugarDepot']->call('depotLogin', array(array('user_name' => $credentials['username'], 'password' => $credentials['password']),'info'=>$info, 'params' => $params));
PackageManagerComm::errorCheck();
if(!is_array($result))
$_SESSION['SugarDepotSessionID'] = $result;
$GLOBALS['log']->debug("End SugarDepot Login");
return $result;
}
else
return $_SESSION['SugarDepotSessionID'];
}
$result = $GLOBALS['SugarDepot']->call('depotLogin', array(array('user_name' => $credentials['username'], 'password' => $credentials['password']),'info'=>$info, 'params' => $params));
PackageManagerComm::errorCheck();
if (!is_array($result)) {
$_SESSION['SugarDepotSessionID'] = $result;
}
$GLOBALS['log']->debug("End SugarDepot Login");
return $result;
} else {
return $_SESSION['SugarDepotSessionID'];
}
}
/**
* Logout from the depot
*/
function logout(){
/**
* Logout from the depot
*/
public function logout()
{
PackageManagerComm::initialize();
$result = $GLOBALS['SugarDepot']->call('depotLogout', array('session_id' => $_SESSION['SugarDepotSessionID']));
}
}
/**
* Get all promotions from the depot
*/
function getPromotion(){
/**
* Get all promotions from the depot
*/
public function getPromotion()
{
PackageManagerComm::initialize();
//check for fault first and then return
$name_value_list = $GLOBALS['SugarDepot']->call('depotGetPromotion', array('session_id' => $_SESSION['SugarDepotSessionID']));
return $name_value_list;
}
}
/**
* A generic function which given a category_id some filter will
@ -155,10 +167,11 @@ class PackageManagerComm{
* @return categories_and_packages
* @see categories_and_packages
*/
function getCategoryPackages($category_id, $filter = array()){
public function getCategoryPackages($category_id, $filter = array())
{
PackageManagerComm::initialize();
//check for fault
return $GLOBALS['SugarDepot']->call('depotGetCategoriesPackages', array('session_id' => $_SESSION['SugarDepotSessionID'], 'category_id' => $category_id, 'filter' => $filter));
return $GLOBALS['SugarDepot']->call('depotGetCategoriesPackages', array('session_id' => $_SESSION['SugarDepotSessionID'], 'category_id' => $category_id, 'filter' => $filter));
}
/**
@ -169,7 +182,8 @@ class PackageManagerComm{
* @return categories_and_packages
* @see categories_and_packages
*/
function getCategories($category_id, $filter = array()){
public function getCategories($category_id, $filter = array())
{
PackageManagerComm::initialize();
//check for fault
return $GLOBALS['SugarDepot']->call('depotGetCategories', array('session_id' => $_SESSION['SugarDepotSessionID'], 'category_id' => $category_id, 'filter' => $filter));
@ -183,10 +197,11 @@ class PackageManagerComm{
* @return packages
* @see packages
*/
function getPackages($category_id, $filter = array()){
public function getPackages($category_id, $filter = array())
{
PackageManagerComm::initialize();
//check for fault
return $GLOBALS['SugarDepot']->call('depotGetPackages', array('session_id' => $_SESSION['SugarDepotSessionID'], 'category_id' => $category_id, 'filter' => $filter));
return $GLOBALS['SugarDepot']->call('depotGetPackages', array('session_id' => $_SESSION['SugarDepotSessionID'], 'category_id' => $category_id, 'filter' => $filter));
}
/**
@ -197,10 +212,11 @@ class PackageManagerComm{
* @return packages
* @see packages
*/
function getReleases($category_id, $package_id, $filter = array()){
public function getReleases($category_id, $package_id, $filter = array())
{
PackageManagerComm::initialize();
//check for fault
return $GLOBALS['SugarDepot']->call('depotGetReleases', array('session_id' => $_SESSION['SugarDepotSessionID'], 'category_id' => $category_id, 'package_id' => $package_id, 'filter' => $filter));
//check for fault
return $GLOBALS['SugarDepot']->call('depotGetReleases', array('session_id' => $_SESSION['SugarDepotSessionID'], 'category_id' => $category_id, 'package_id' => $package_id, 'filter' => $filter));
}
/**
@ -212,10 +228,11 @@ class PackageManagerComm{
* @return download
* @see download
*/
function download($category_id, $package_id, $release_id){
public function download($category_id, $package_id, $release_id)
{
PackageManagerComm::initialize();
//check for fault
return $GLOBALS['SugarDepot']->call('depotDownloadRelease', array('session_id' => $_SESSION['SugarDepotSessionID'], 'category_id' => $category_id, 'package_id' => $package_id, 'release_id' => $release_id));
//check for fault
return $GLOBALS['SugarDepot']->call('depotDownloadRelease', array('session_id' => $_SESSION['SugarDepotSessionID'], 'category_id' => $category_id, 'package_id' => $package_id, 'release_id' => $release_id));
}
/**
@ -226,10 +243,11 @@ class PackageManagerComm{
* @param release_id the release we want to download
* @return the filename to download
*/
function addDownload($category_id, $package_id, $release_id){
public function addDownload($category_id, $package_id, $release_id)
{
PackageManagerComm::initialize();
//check for fault
return $GLOBALS['SugarDepot']->call('depotAddDownload', array('session_id' => $_SESSION['SugarDepotSessionID'], 'category_id' => $category_id, 'package_id' => $package_id, 'release_id' => $release_id, 'download_key' => '123'));
//check for fault
return $GLOBALS['SugarDepot']->call('depotAddDownload', array('session_id' => $_SESSION['SugarDepotSessionID'], 'category_id' => $category_id, 'package_id' => $package_id, 'release_id' => $release_id, 'download_key' => '123'));
}
/**
@ -238,11 +256,12 @@ class PackageManagerComm{
* @param filename the file to download
* @return path to downloaded file
*/
static public function performDownload($filename){
public static function performDownload($filename)
{
PackageManagerComm::initialize();
//check for fault
$GLOBALS['log']->debug("Performing download from depot: Session ID: ".$_SESSION['SugarDepotSessionID']." Filename: ".$filename);
return PackageManagerDownloader::download($_SESSION['SugarDepotSessionID'], $filename);
//check for fault
$GLOBALS['log']->debug("Performing download from depot: Session ID: ".$_SESSION['SugarDepotSessionID']." Filename: ".$filename);
return PackageManagerDownloader::download($_SESSION['SugarDepotSessionID'], $filename);
}
/**
@ -253,15 +272,17 @@ class PackageManagerComm{
*
* @return documents
*/
function getDocumentation($package_id, $release_id){
PackageManagerComm::initialize();
//check for fault
return $GLOBALS['SugarDepot']->call('depotGetDocumentation', array('session_id' => $_SESSION['SugarDepotSessionID'], 'package_id' => $package_id, 'release_id' => $release_id));
public function getDocumentation($package_id, $release_id)
{
PackageManagerComm::initialize();
//check for fault
return $GLOBALS['SugarDepot']->call('depotGetDocumentation', array('session_id' => $_SESSION['SugarDepotSessionID'], 'package_id' => $package_id, 'release_id' => $release_id));
}
function getTermsAndConditions(){
PackageManagerComm::initialize(false);
return $GLOBALS['SugarDepot']->call('depotTermsAndConditions',array());
public function getTermsAndConditions()
{
PackageManagerComm::initialize(false);
return $GLOBALS['SugarDepot']->call('depotTermsAndConditions', array());
}
/**
@ -269,42 +290,45 @@ class PackageManagerComm{
*
* @param document_id the document the user has clicked on
*/
function downloadedDocumentation($document_id){
PackageManagerComm::initialize();
//check for fault
$GLOBALS['log']->debug("Logging Document: ".$document_id);
$GLOBALS['SugarDepot']->call('depotDownloadedDocumentation', array('session_id' => $_SESSION['SugarDepotSessionID'], 'document_id' => $document_id));
public function downloadedDocumentation($document_id)
{
PackageManagerComm::initialize();
//check for fault
$GLOBALS['log']->debug("Logging Document: ".$document_id);
$GLOBALS['SugarDepot']->call('depotDownloadedDocumentation', array('session_id' => $_SESSION['SugarDepotSessionID'], 'document_id' => $document_id));
}
/**
* Send the list of installed objects, could be patches, or modules, .. to the depot and allow the depot to send back
* a list of corresponding updates
*
* @param objects_to_check an array of name_value_lists which contain the appropriate values
* which will allow the depot to check for updates
*
* @return array of name_value_lists of corresponding updates
*/
function checkForUpdates($objects_to_check){
PackageManagerComm::initialize();
//check for fault
return $GLOBALS['SugarDepot']->call('depotCheckForUpdates', array('session_id' => $_SESSION['SugarDepotSessionID'], 'objects' => $objects_to_check));
}
/**
* Ping the server to determine if we have established proper communication
/**
* Send the list of installed objects, could be patches, or modules, .. to the depot and allow the depot to send back
* a list of corresponding updates
*
* @return true if we can communicate with the server and false otherwise
* @param objects_to_check an array of name_value_lists which contain the appropriate values
* which will allow the depot to check for updates
*
* @return array of name_value_lists of corresponding updates
*/
public function checkForUpdates($objects_to_check)
{
PackageManagerComm::initialize();
//check for fault
return $GLOBALS['SugarDepot']->call('depotCheckForUpdates', array('session_id' => $_SESSION['SugarDepotSessionID'], 'objects' => $objects_to_check));
}
/**
* Ping the server to determine if we have established proper communication
*
* @return true if we can communicate with the server and false otherwise
*/
function isAlive(){
public function isAlive()
{
PackageManagerComm::initialize(false);
$status = $GLOBALS['SugarDepot']->call('sugarPing', array());
if(empty($status) || $GLOBALS['SugarDepot']->getError() || $status != ACTIVE_STATUS){
if (empty($status) || $GLOBALS['SugarDepot']->getError() || $status != ACTIVE_STATUS) {
return false;
}else{
} else {
return true;
}
}
////////// END: Base Functions for Communicating with the depot
}
////////// END: Base Functions for Communicating with the depot
////////////////////////////////////////////////////////
}

View file

@ -44,7 +44,8 @@ require_once('include/ytree/Tree.php');
require_once('include/ytree/Node.php');
require_once('ModuleInstall/PackageManager/ListViewPackages.php');
class PackageManagerDisplay{
class PackageManagerDisplay
{
/**
* A Static method to Build the display for the package manager
@ -56,8 +57,9 @@ class PackageManagerDisplay{
* @param String active_form - the form to display first
* @return String - a string of html which will be used to display the forms
*/
static function buildPackageDisplay($form1, $hidden_fields, $form_action, $types = array('module'), $active_form = 'form1', $install = false){
global $current_language;
public static function buildPackageDisplay($form1, $hidden_fields, $form_action, $types = array('module'), $active_form = 'form1', $install = false)
{
global $current_language;
$mod_strings = return_module_language($current_language, "Administration");
global $app_strings;
@ -75,67 +77,65 @@ class PackageManagerDisplay{
$show_login = $result['show_login'];
$mi_errors = ModuleInstaller::getErrors();
$error_html = "";
if(!empty($mi_errors)){
$error_html = "<tr><td><span>";
foreach($mi_errors as $error){
$error_html .= "<font color='red'>".$error."</font><br>";
}
$error_html .= "</span></td></tr>";
}
if (!empty($mi_errors)) {
$error_html = "<tr><td><span>";
foreach ($mi_errors as $error) {
$error_html .= "<font color='red'>".$error."</font><br>";
}
$error_html .= "</span></td></tr>";
}
$form2 = "<table class='tabForm' width='100%' cellpadding='0' cellspacing='0' width='100%' border='0'>";
$form2 .= $error_html;
if(!$isAlive)
$form2 .= "<tr><td><span id='span_display_html'>".$header_text."</span></td></tr>";
if (!$isAlive) {
$form2 .= "<tr><td><span id='span_display_html'>".$header_text."</span></td></tr>";
}
$form2 .= "</table>";
$tree = null;
//if($isAlive){
$tree = PackageManagerDisplay::buildTreeView('treeview', $isAlive);
$tree->tree_style= 'include/ytree/TreeView/css/check/tree.css';
$ss->assign('TREEHEADER',$tree->generate_header());
$tree = PackageManagerDisplay::buildTreeView('treeview', $isAlive);
$tree->tree_style= 'include/ytree/TreeView/css/check/tree.css';
$ss->assign('TREEHEADER', $tree->generate_header());
//}
//$form2 .= PackageManagerDisplay::buildLoginPanel($mod_strings);
$form2 .= "<table class='tabForm' cellpadding='0' cellspacing='0' width='100%' border='0'>";
$form2 .= "<tr><td></td><td align='left'>";
if($isAlive){
$form2 .= "<input type='button' id='modifCredentialsBtn' class='button' onClick='PackageManager.showLoginDialog(true);' value='".$mod_strings['LBL_MODIFY_CREDENTIALS']."'>";
}else{
if ($isAlive) {
$form2 .= "<input type='button' id='modifCredentialsBtn' class='button' onClick='PackageManager.showLoginDialog(true);' value='".$mod_strings['LBL_MODIFY_CREDENTIALS']."'>";
} else {
$form2 .= "<input type='button' id='modifCredentialsBtn' class='button' onClick='PackageManager.showLoginDialog(true);' value='".$mod_strings['LBL_MODIFY_CREDENTIALS']."'style='display:none;'>";
}
$form2 .= "</td><td align='left'><div id='workingStatusDiv' style='display:none;'>".SugarThemeRegistry::current()->getImage("sqsWait","border='0' align='bottom'",null,null,'.gif',"Loading")."</div></td><td align='right'>";
$form2 .= "</td><td align='left'><div id='workingStatusDiv' style='display:none;'>".SugarThemeRegistry::current()->getImage("sqsWait", "border='0' align='bottom'", null, null, '.gif', "Loading")."</div></td><td align='right'>";
if($isAlive){
if ($isAlive) {
$form2 .= "<span><a class=\"listViewTdToolsS1\" id='href_animate' onClick=\"PackageManager.toggleDiv('span_animate_server_div', 'catview');\"><span id='span_animate_server_div'><img src='".SugarThemeRegistry::current()->getImageURL('basic_search.gif')."' width='8' height='8' border='0'>&nbsp;Collapse</span></a></span>";
}else{
} else {
$form2 .= "<span><a class=\"listViewTdToolsS1\" id='href_animate' onClick=\"PackageManager.toggleDiv('span_animate_server_div', 'catview');\"><span id='span_animate_server_div' style='display:none;'><img src='".SugarThemeRegistry::current()->getImageURL('basic_search.gif')."' width='8' height='8' border='0'>&nbsp;Collapse</span></a></span>";
}
$form2 .= "</td></tr></table>";
$form2 = ''; //Commenting out the form as part of sugar depot hiding.
$form2 = ''; //Commenting out the form as part of sugar depot hiding.
$ss->assign('installation', ($install ? 'true' : 'false'));
$mod_strings = return_module_language($current_language, "Administration");
$mod_strings = return_module_language($current_language, "Administration");
$ss->assign('MOD', $mod_strings);
$ss->assign('module_load', 'true');
if (UploadStream::getSuhosinStatus() == false)
{
$ss->assign('module_load', 'true');
if (UploadStream::getSuhosinStatus() == false) {
$ss->assign('ERR_SUHOSIN', true);
}
else
{
} else {
$ss->assign('scripts', PackageManagerDisplay::getDisplayScript($install));
}
$show_login = false; //hiding install from sugar
$ss->assign('MODULE_SELECTOR', PackageManagerDisplay::buildGridOutput($tree, $mod_strings, $isAlive, $show_login));
$ss->assign('FORM_2_PLACE_HOLDER', $form2);
$ss->assign('MODULE_SELECTOR', PackageManagerDisplay::buildGridOutput($tree, $mod_strings, $isAlive, $show_login));
$ss->assign('FORM_2_PLACE_HOLDER', $form2);
$ss->assign('MOD', $mod_strings);
$descItemsInstalled = $mod_strings['LBL_UW_DESC_MODULES_INSTALLED'];
$ss->assign('INSTALLED_PACKAGES_HOLDER', PackageManagerDisplay::buildInstalledGrid($mod_strings, $types));
$str = $ss->fetch('ModuleInstall/PackageManager/tpls/PackageForm.tpl');
return $str;
$str = $ss->fetch('ModuleInstall/PackageManager/tpls/PackageForm.tpl');
return $str;
}
/**
@ -148,8 +148,9 @@ class PackageManagerDisplay{
* @param String active_form - the form to display first
* @return String - a string of html which will be used to display the forms
*/
function buildPatchDisplay($form1, $hidden_fields, $form_action, $types = array('module'), $active_form = 'form1'){
global $current_language;
public function buildPatchDisplay($form1, $hidden_fields, $form_action, $types = array('module'), $active_form = 'form1')
{
global $current_language;
$mod_strings = return_module_language($current_language, "Administration");
$ss = new Sugar_Smarty();
$ss->assign('FORM_1_PLACE_HOLDER', $form1);
@ -164,47 +165,50 @@ class PackageManagerDisplay{
$show_login = $result['show_login'];
$display = 'none';
//if($isAlive){
$display = 'block';
$display = 'block';
//}
$form2 = "<table class='tabForm' width='100%' cellpadding='0' cellspacing='0' width='100%' border='0'>";
if(!$isAlive)
$form2 .= "<tr><td><span id='span_display_html'>".$header_text."</span></td></tr>";
if (!$isAlive) {
$form2 .= "<tr><td><span id='span_display_html'>".$header_text."</span></td></tr>";
}
$form2 .= "</table>";
$form2 .= "<table width='100%'><tr><td align='left'>";
if($show_login){
$form2 .= "<input type='button' class='button' onClick='PackageManager.showLoginDialog(true);' value='".$mod_strings['LBL_MODIFY_CREDENTIALS']."'>";
if ($show_login) {
$form2 .= "<input type='button' class='button' onClick='PackageManager.showLoginDialog(true);' value='".$mod_strings['LBL_MODIFY_CREDENTIALS']."'>";
}
$form2 .= "</td><td align='right'><div id='workingStatusDiv' style='display:none;'>".SugarThemeRegistry::current()->getImage("sqsWait","border='0' align='bottom'",null,null,'.gif',"Loading")."</div></td></tr><tr><td colspan='2'>";
$form2 .= "</td><td align='right'><div id='workingStatusDiv' style='display:none;'>".SugarThemeRegistry::current()->getImage("sqsWait", "border='0' align='bottom'", null, null, '.gif', "Loading")."</div></td></tr><tr><td colspan='2'>";
$loginViewStyle = ($isAlive ? 'none' : 'block');
$selectViewStyle = ($isAlive ? 'block' : 'none');
$form2 .= "<div id='selectView' style='display:".$selectViewStyle."'>";
$form2 .= " <div id='patch_downloads' class='ygrid-mso' style='height:205px; display: ".$display.";'></div>";
$form2 .= "</div>";
if(!$show_login)
$loginViewStyle = 'none';
//$form2 .= "<div id='loginView' style='display:".$loginViewStyle."'>";
//$form2 .= PackageManagerDisplay::buildLoginPanel($mod_strings, $isAlive);
//$form2 .= "</div>";
$selectViewStyle = ($isAlive ? 'block' : 'none');
$form2 .= "<div id='selectView' style='display:".$selectViewStyle."'>";
$form2 .= " <div id='patch_downloads' class='ygrid-mso' style='height:205px; display: ".$display.";'></div>";
$form2 .= "</div>";
if (!$show_login) {
$loginViewStyle = 'none';
}
//$form2 .= "<div id='loginView' style='display:".$loginViewStyle."'>";
//$form2 .= PackageManagerDisplay::buildLoginPanel($mod_strings, $isAlive);
//$form2 .= "</div>";
$form2 .= "</td></tr></table>";
$form2 = '';
$packages = array();
$releases = array();
if($isAlive){
$filter = array();
$count = count($types);
$index = 1;
$type_str = '"';
foreach($types as $type){
$type_str .= "'".$type."'";
if($index < $count)
$type_str .= ",";
$index++;
}
$type_str .= '"';
$filter = array('type' => $type_str);
$filter = PackageManager::toNameValueList($filter);
if ($isAlive) {
$filter = array();
$count = count($types);
$index = 1;
$type_str = '"';
foreach ($types as $type) {
$type_str .= "'".$type."'";
if ($index < $count) {
$type_str .= ",";
}
$index++;
}
$type_str .= '"';
$filter = array('type' => $type_str);
$filter = PackageManager::toNameValueList($filter);
$pm = new PackageManager();
/*if(in_array('patch', $types)){
$releases = $pm->getReleases('3', '3', $filter);
@ -212,49 +216,51 @@ class PackageManagerDisplay{
$releases = $pm->getReleases('', '', $filter);
}*/
}
if($form_action == 'install.php' && (empty($releases) || count($releases['packages']) == 0)){
//return false;
if ($form_action == 'install.php' && (empty($releases) || count($releases['packages']) == 0)) {
//return false;
}
$tree = PackageManagerDisplay::buildTreeView('treeview', $isAlive);
$tree->tree_style= 'include/ytree/TreeView/css/check/tree.css';
$ss->assign('TREEHEADER',$tree->generate_header());
$ss->assign('module_load', 'false');
$ss->assign('MODULE_SELECTOR', PackageManagerDisplay::buildGridOutput($tree, $mod_strings, $isAlive, $show_login));
$ss->assign('TREEHEADER', $tree->generate_header());
$ss->assign('module_load', 'false');
$ss->assign('MODULE_SELECTOR', PackageManagerDisplay::buildGridOutput($tree, $mod_strings, $isAlive, $show_login));
$ss->assign('FORM_2_PLACE_HOLDER', $form2);
$ss->assign('scripts', PackageManagerDisplay::getDisplayScript(false, 'patch', $releases, $types, $isAlive));
$str = $ss->fetch('ModuleInstall/PackageManager/tpls/PackageForm.tpl');
return $str;
}
static function buildInstalledGrid($mod_strings, $types = array('modules')){
$descItemsInstalled = $mod_strings['LBL_UW_DESC_MODULES_INSTALLED'];
$output = '<table width="100%" border="0" cellspacing="0" cellpadding="0" ><tr><td align="left">'.$descItemsInstalled.'</td>';
$output .= '</td></tr></table>';
$output .= "<table width='100%'><tr><td ><div id='installed_grid' class='ygrid-mso' style='height:205px;'></div></td></tr></table>";
return $output;
public static function buildInstalledGrid($mod_strings, $types = array('modules'))
{
$descItemsInstalled = $mod_strings['LBL_UW_DESC_MODULES_INSTALLED'];
$output = '<table width="100%" border="0" cellspacing="0" cellpadding="0" ><tr><td align="left">'.$descItemsInstalled.'</td>';
$output .= '</td></tr></table>';
$output .= "<table width='100%'><tr><td ><div id='installed_grid' class='ygrid-mso' style='height:205px;'></div></td></tr></table>";
return $output;
}
function buildLoginPanel($mod_strings, $display_cancel){
public function buildLoginPanel($mod_strings, $display_cancel)
{
$credentials = PackageManager::getCredentials();
$output = "<div id='login_panel'><div class='hd'><b>".$mod_strings['HDR_LOGIN_PANEL']."</b></div>";
$output = "<div id='login_panel'><div class='hd'><b>".$mod_strings['HDR_LOGIN_PANEL']."</b></div>";
$output .= "<div class='bd'><form><table><tr><td>".$mod_strings['LBL_USERNAME']."</td><td><input type='text' name='login_panel_username' id='login_panel_username' value='".$credentials['username']."'></td><td><a target='blank'>".$mod_strings['LNK_NEW_ACCOUNT']."</a></td>";
$output .= "</tr><tr><td>".$mod_strings['LBL_PASSWORD']."</td><td><input type='password' name='login_panel_password' id='login_panel_password'></td><td></td>";
$terms = PackageManager::getTermsAndConditions();
$output .= "</tr><tr><td colspan='6' valign='top'><b>".$mod_strings['LBL_TERMS_AND_CONDITIONS']."</b><br><textarea readonly cols=80 rows=8>" . $terms['terms'] . '</textarea></td>';
$_SESSION['SugarDepot_TermsVersion'] = (!empty($terms['version']) ? $terms['version'] : '');
$terms = PackageManager::getTermsAndConditions();
$output .= "</tr><tr><td colspan='6' valign='top'><b>".$mod_strings['LBL_TERMS_AND_CONDITIONS']."</b><br><textarea readonly cols=80 rows=8>" . $terms['terms'] . '</textarea></td>';
$_SESSION['SugarDepot_TermsVersion'] = (!empty($terms['version']) ? $terms['version'] : '');
$output .= "</td></tr><tr><td colspan='6'><input class='checkbox' type='checkbox' name='cb_terms' id='cb_terms' onclick='if(this.checked){this.form.panel_login_button.disabled=false;}else{this.form.panel_login_button.disabled=true;}'>".$mod_strings['LBL_ACCEPT_TERMS']."</td></tr><tr>";
$output .= "</td></tr><tr><td colspan='6'><input class='checkbox' type='checkbox' name='cb_terms' id='cb_terms' onclick='if(this.checked){this.form.panel_login_button.disabled=false;}else{this.form.panel_login_button.disabled=true;}'>".$mod_strings['LBL_ACCEPT_TERMS']."</td></tr><tr>";
$output .= "<td align='left'>";
$output .= "<input type='button' id='panel_login_button' name='panel_login_button' value='Login' class='button' onClick='PackageManager.authenticate(this.form.login_panel_username.value, this.form.login_panel_password.value, \"\",\"" . $terms['version'] . "\");' disabled>";
if($display_cancel){
$output .= "&nbsp;<input type='button' id='panel_cancel_button' value='Cancel' class='button' onClick='PackageManager.showLoginDialog(false);'>";
if ($display_cancel) {
$output .= "&nbsp;<input type='button' id='panel_cancel_button' value='Cancel' class='button' onClick='PackageManager.showLoginDialog(false);'>";
}
$output .= "</td><td></td></tr>";
$output .= "<tr></td><td></td></tr>";
$output .= "</table></div>";
$output .= "<tr></td><td></td></tr>";
$output .= "</table></div>";
$output .= "<div class='ft'></div></form></div>";
return $output;
}
@ -266,55 +272,59 @@ class PackageManagerDisplay{
* @param Array mod_strings - the local mod strings to display
* @return String - a string of html
*/
static function buildGridOutput($tree, $mod_strings, $display = true, $show_login = true){
$output = "<div id='catview'>";
$loginViewStyle = ($display ? 'none' : 'block');
$selectViewStyle = ($display ? 'block' : 'none');
$output .= "<div id='selectView' style='display:".$selectViewStyle."'>";
//if($display){
$output .= "<table border=0 width='100%' class='moduleTitle'><tr><td width='100%' valign='top'>";
$output .= "<div id='treeview'>";
$output .= $tree->generate_nodes_array();
$output .= "</div>";
$output .= "</td></tr>";
$output .= "<tr><td width='100%'>";
$output .= "<div id='tabs1'></div>";
$output .= "</td></tr>";
$output .= "<tr><td width='100%' align='left'>";
$output .= "<input type='button' class='button' value='Download Selected' onClick='PackageManager.download();'>";
$output .= "</td></tr></table>";
public static function buildGridOutput($tree, $mod_strings, $display = true, $show_login = true)
{
$output = "<div id='catview'>";
$loginViewStyle = ($display ? 'none' : 'block');
$selectViewStyle = ($display ? 'block' : 'none');
$output .= "<div id='selectView' style='display:".$selectViewStyle."'>";
//if($display){
$output .= "<table border=0 width='100%' class='moduleTitle'><tr><td width='100%' valign='top'>";
$output .= "<div id='treeview'>";
$output .= $tree->generate_nodes_array();
$output .= "</div>";
$output .= "</td></tr>";
$output .= "<tr><td width='100%'>";
$output .= "<div id='tabs1'></div>";
$output .= "</td></tr>";
$output .= "<tr><td width='100%' align='left'>";
$output .= "<input type='button' class='button' value='Download Selected' onClick='PackageManager.download();'>";
$output .= "</td></tr></table>";
// }
$output .= "</div>";
if(!$show_login)
$loginViewStyle = 'none';
$output .= "</div>";
if (!$show_login) {
$loginViewStyle = 'none';
}
// $output .= "<div id='loginView' style='display:".$loginViewStyle."'>";
// jchi ,#24296 :commented code because we are currently not using depot, in the future this may change so you can put this code back in.
//$output .= PackageManagerDisplay::buildLoginPanel($mod_strings, $display);
//$output .= "</div>";
//$output .= "<table width='100%' class='moduleTitle' border=1><tr><td><div id='patch_downloads' class='ygrid-mso' style='height:205px;'></div></td></tr></table>";
$output .= "</div>";
// jchi ,#24296 :commented code because we are currently not using depot, in the future this may change so you can put this code back in.
//$output .= PackageManagerDisplay::buildLoginPanel($mod_strings, $display);
//$output .= "</div>";
//$output .= "<table width='100%' class='moduleTitle' border=1><tr><td><div id='patch_downloads' class='ygrid-mso' style='height:205px;'></div></td></tr></table>";
$output .= "</div>";
return $output;
}
return $output;
}
/**
* A Static method used to build the initial treeview when the page is first displayed
*
* @param String div_id - this div in which to display the tree
* @return Tree - the tree that is built
*/
static function buildTreeView($div_id, $isAlive = true){
/**
* A Static method used to build the initial treeview when the page is first displayed
*
* @param String div_id - this div in which to display the tree
* @return Tree - the tree that is built
*/
public static function buildTreeView($div_id, $isAlive = true)
{
$tree = new Tree($div_id);
$nodes = array();
if($isAlive)
$nodes = PackageManager::getCategories('');
if ($isAlive) {
$nodes = PackageManager::getCategories('');
}
foreach($nodes as $arr_node){
foreach ($nodes as $arr_node) {
$node = new Node($arr_node['id'], $arr_node['label']);
$node->dynamicloadfunction = 'PackageManager.loadDataForNodeForPackage';
$node->expanded = false;
$node->dynamic_load = true;
$node->set_property('href',"javascript:PackageManager.catClick('treeview');");
$node->set_property('href', "javascript:PackageManager.catClick('treeview');");
$tree->add_node($node);
$node->set_property('description', $arr_node['description']);
}
@ -333,8 +343,9 @@ class PackageManagerDisplay{
* @param String modify_field - the field to update when the radio button is changed
* @return String - a form used to display the license
*/
function getLicenseDisplay($license_file, $form_action, $next_step, $zipFile, $type, $manifest, $modify_field){
global $current_language;
public function getLicenseDisplay($license_file, $form_action, $next_step, $zipFile, $type, $manifest, $modify_field)
{
global $current_language;
$mod_strings = return_module_language($current_language, "Administration");
$contents = sugar_file_get_contents($license_file);
$div_id = urlencode($zipFile);
@ -371,139 +382,146 @@ class PackageManagerDisplay{
return $display;
}
/**
* A Static method used to generate the javascript for the page
*
* @return String - the javascript required for the page
*/
static function getDisplayScript($install = false, $type = 'module', $releases = null, $types = array(), $isAlive = true){
/**
* A Static method used to generate the javascript for the page
*
* @return String - the javascript required for the page
*/
public static function getDisplayScript($install = false, $type = 'module', $releases = null, $types = array(), $isAlive = true)
{
global $sugar_version, $sugar_config;
global $current_language;
$mod_strings = return_module_language($current_language, "Administration");
$ss = new Sugar_Smarty();
$ss->assign('MOD', $mod_strings);
if(!$install){
if (!$install) {
$install = 0;
}
$ss->assign('INSTALLATION', $install);
$ss->assign('WAIT_IMAGE', SugarThemeRegistry::current()->getImage("loading","border='0' align='bottom'",null,null,'.gif',"Loading"));
$ss->assign('INSTALLATION', $install);
$ss->assign('WAIT_IMAGE', SugarThemeRegistry::current()->getImage("loading", "border='0' align='bottom'", null, null, '.gif', "Loading"));
$ss->assign('sugar_version', $sugar_version);
$ss->assign('js_custom_version', $sugar_config['js_custom_version']);
$ss->assign('IS_ALIVE', $isAlive);
$ss->assign('IS_ALIVE', $isAlive);
//if($type == 'patch' && $releases != null){
if($type == 'patch'){
if ($type == 'patch') {
$ss->assign('module_load', 'false');
$patches = PackageManagerDisplay::createJavascriptPackageArray($releases);
$ss->assign('PATCHES', $patches);
$ss->assign('GRID_TYPE', implode(',', $types));
}else{
$pm = new PackageManager();
$releases = $pm->getPackagesInStaging();
$patches = PackageManagerDisplay::createJavascriptModuleArray($releases);
$ss->assign('GRID_TYPE', implode(',', $types));
} else {
$pm = new PackageManager();
$releases = $pm->getPackagesInStaging();
$patches = PackageManagerDisplay::createJavascriptModuleArray($releases);
$ss->assign('PATCHES', $patches);
$installeds = $pm->getinstalledPackages();
$patches = PackageManagerDisplay::createJavascriptModuleArray($installeds, 'mti_installed_data');
$patches = PackageManagerDisplay::createJavascriptModuleArray($installeds, 'mti_installed_data');
$ss->assign('INSTALLED_MODULES', $patches);
$ss->assign('UPGARDE_WIZARD_URL', 'index.php?module=UpgradeWizard&action=index');
$ss->assign('UPGARDE_WIZARD_URL', 'index.php?module=UpgradeWizard&action=index');
$ss->assign('module_load', 'true');
}
if(!empty($GLOBALS['ML_STATUS_MESSAGE']))
$ss->assign('ML_STATUS_MESSAGE',$GLOBALS['ML_STATUS_MESSAGE']);
if (!empty($GLOBALS['ML_STATUS_MESSAGE'])) {
$ss->assign('ML_STATUS_MESSAGE', $GLOBALS['ML_STATUS_MESSAGE']);
}
//Bug 24064. Checking and Defining labels since these might not be cached during Upgrade
if(!isset($mod_strings['LBL_ML_INSTALL']) || empty($mod_strings['LBL_ML_INSTALL'])){
$mod_strings['LBL_ML_INSTALL'] = 'Install';
}
if(!isset($mod_strings['LBL_ML_ENABLE_OR_DISABLE']) || empty($mod_strings['LBL_ML_ENABLE_OR_DISABLE'])) {
$mod_strings['LBL_ML_ENABLE_OR_DISABLE'] = 'Enable/Disable';
}
if(!isset($mod_strings['LBL_ML_DELETE'])|| empty($mod_strings['LBL_ML_DELETE'])){
$mod_strings['LBL_ML_DELETE'] = 'Delete';
}
if (!isset($mod_strings['LBL_ML_INSTALL']) || empty($mod_strings['LBL_ML_INSTALL'])) {
$mod_strings['LBL_ML_INSTALL'] = 'Install';
}
if (!isset($mod_strings['LBL_ML_ENABLE_OR_DISABLE']) || empty($mod_strings['LBL_ML_ENABLE_OR_DISABLE'])) {
$mod_strings['LBL_ML_ENABLE_OR_DISABLE'] = 'Enable/Disable';
}
if (!isset($mod_strings['LBL_ML_DELETE'])|| empty($mod_strings['LBL_ML_DELETE'])) {
$mod_strings['LBL_ML_DELETE'] = 'Delete';
}
//Add by jchi 6/23/2008 to fix the bug 21667
$filegrid_column_ary = array(
'Name' => $mod_strings['LBL_ML_NAME'],
'Install' => $mod_strings['LBL_ML_INSTALL'],
'Delete' => $mod_strings['LBL_ML_DELETE'],
'Type' => $mod_strings['LBL_ML_TYPE'],
'Version' => $mod_strings['LBL_ML_VERSION'],
'Published' => $mod_strings['LBL_ML_PUBLISHED'],
'Uninstallable' => $mod_strings['LBL_ML_UNINSTALLABLE'],
'Description' => $mod_strings['LBL_ML_DESCRIPTION']
);
$filegrid_column_ary = array(
'Name' => $mod_strings['LBL_ML_NAME'],
'Install' => $mod_strings['LBL_ML_INSTALL'],
'Delete' => $mod_strings['LBL_ML_DELETE'],
'Type' => $mod_strings['LBL_ML_TYPE'],
'Version' => $mod_strings['LBL_ML_VERSION'],
'Published' => $mod_strings['LBL_ML_PUBLISHED'],
'Uninstallable' => $mod_strings['LBL_ML_UNINSTALLABLE'],
'Description' => $mod_strings['LBL_ML_DESCRIPTION']
);
$filegridinstalled_column_ary = array(
'Name' => $mod_strings['LBL_ML_NAME'],
'Install' => $mod_strings['LBL_ML_INSTALL'],
'Action' => $mod_strings['LBL_ML_ACTION'],
'Enable_Or_Disable' => $mod_strings['LBL_ML_ENABLE_OR_DISABLE'],
'Type' => $mod_strings['LBL_ML_TYPE'],
'Version' => $mod_strings['LBL_ML_VERSION'],
'Date_Installed' => $mod_strings['LBL_ML_INSTALLED'],
'Uninstallable' => $mod_strings['LBL_ML_UNINSTALLABLE'],
'Description' => $mod_strings['LBL_ML_DESCRIPTION']
);
$filegridinstalled_column_ary = array(
'Name' => $mod_strings['LBL_ML_NAME'],
'Install' => $mod_strings['LBL_ML_INSTALL'],
'Action' => $mod_strings['LBL_ML_ACTION'],
'Enable_Or_Disable' => $mod_strings['LBL_ML_ENABLE_OR_DISABLE'],
'Type' => $mod_strings['LBL_ML_TYPE'],
'Version' => $mod_strings['LBL_ML_VERSION'],
'Date_Installed' => $mod_strings['LBL_ML_INSTALLED'],
'Uninstallable' => $mod_strings['LBL_ML_UNINSTALLABLE'],
'Description' => $mod_strings['LBL_ML_DESCRIPTION']
);
$ss->assign('ML_FILEGRID_COLUMN',$filegrid_column_ary);
$ss->assign('ML_FILEGRIDINSTALLED_COLUMN',$filegridinstalled_column_ary);
//end
$ss->assign('ML_FILEGRID_COLUMN', $filegrid_column_ary);
$ss->assign('ML_FILEGRIDINSTALLED_COLUMN', $filegridinstalled_column_ary);
//end
$ss->assign('SHOW_IMG', SugarThemeRegistry::current()->getImage('advanced_search', 'border="0"', 8, 8, '.gif', 'Show'));
$ss->assign('HIDE_IMG', SugarThemeRegistry::current()->getImage('basic_search', 'border="0"', 8, 8, '.gif', 'Hide'));
$ss->assign('SHOW_IMG', SugarThemeRegistry::current()->getImage('advanced_search', 'border="0"', 8, 8, '.gif', 'Show'));
$ss->assign('HIDE_IMG', SugarThemeRegistry::current()->getImage('basic_search', 'border="0"', 8, 8, '.gif', 'Hide'));
$str = $ss->fetch('ModuleInstall/PackageManager/tpls/PackageManagerScripts.tpl');
return $str;
}
function createJavascriptPackageArray($releases){
public function createJavascriptPackageArray($releases)
{
$output = "var mti_data = [";
$count = count($releases);
$index = 1;
if(!empty($releases['packages'])){
foreach($releases['packages'] as $release){
$release = PackageManager::fromNameValueList($release);
$output .= "[";
$output .= "'".$release['description']."', '".$release['version']."', '".$release['build_number']."', '".$release['id']."'";
$output .= "]";
if($index < $count)
$output .= ",";
$index++;
}
if (!empty($releases['packages'])) {
foreach ($releases['packages'] as $release) {
$release = PackageManager::fromNameValueList($release);
$output .= "[";
$output .= "'".$release['description']."', '".$release['version']."', '".$release['build_number']."', '".$release['id']."'";
$output .= "]";
if ($index < $count) {
$output .= ",";
}
$index++;
}
}
$output .= "]\n;";
return $output;
}
static function createJavascriptModuleArray($modules, $variable_name = 'mti_data'){
public static function createJavascriptModuleArray($modules, $variable_name = 'mti_data')
{
$output = "var ".$variable_name." = [";
$count = count($modules);
$index = 1;
if(!empty($modules)){
foreach($modules as $module){
$output .= "[";
$output .= "'".$module['name']."', '".$module['file_install']."', '".$module['file']."', '";
if(!empty($module['enabled']))
$output .= $module['enabled'].'_'.$module['file']."', '";
$description = js_escape($module['description']);
$output .= $module['type']."', '".$module['version']."', '".$module['published_date']."', '".$module['uninstallable']."', '".$description."'".(isset($module['upload_file'])?" , '".$module['upload_file']."']":"]");
if($index < $count)
$output .= ",";
$index++;
}
if (!empty($modules)) {
foreach ($modules as $module) {
$output .= "[";
$output .= "'".$module['name']."', '".$module['file_install']."', '".$module['file']."', '";
if (!empty($module['enabled'])) {
$output .= $module['enabled'].'_'.$module['file']."', '";
}
$description = js_escape($module['description']);
$output .= $module['type']."', '".$module['version']."', '".$module['published_date']."', '".$module['uninstallable']."', '".$description."'".(isset($module['upload_file'])?" , '".$module['upload_file']."']":"]");
if ($index < $count) {
$output .= ",";
}
$index++;
}
}
$output .= "]\n;";
return $output;
}
/**
* This method is meant to be used to display the license agreement inline on the page
* if the system would like to perform the installation on the same page via an Ajax call
*/
function buildLicenseOutput($file){
global $current_language;
/**
* This method is meant to be used to display the license agreement inline on the page
* if the system would like to perform the installation on the same page via an Ajax call
*/
public function buildLicenseOutput($file)
{
global $current_language;
$mod_strings = return_module_language($current_language, "Administration");
$contents = '';
@ -518,103 +536,94 @@ class PackageManagerDisplay{
return $str;
}
static function getHeader(){
global $current_language;
public static function getHeader()
{
global $current_language;
$mod_strings = return_module_language($current_language, "Administration");
$header_text = '';
$isAlive = false;
$show_login = false;
if(!function_exists('curl_init') && $show_login){
$header_text = "<font color='red'><b>".$mod_strings['ERR_ENABLE_CURL']."</b></font>";
$show_login = false;
}else{
if (!function_exists('curl_init') && $show_login) {
$header_text = "<font color='red'><b>".$mod_strings['ERR_ENABLE_CURL']."</b></font>";
$show_login = false;
} else {
$credentials = PackageManager::getCredentials();
if(empty($credentials['username']) || empty($credentials['password'])){
//$header_text = "<font color='red'><b>".$mod_strings['ERR_CREDENTIALS_MISSING']."</b></font>";
}
else{
$result = PackageManagerComm::login();
if((is_array($result) && !empty($result['faultcode'])) || $result == false){
$header_text = "<font color='red'><b>".$result['faultstring']."</b></font>";
}else{
$header_text = PackageManager::getPromotion();
$isAlive = true;
}
if (empty($credentials['username']) || empty($credentials['password'])) {
//$header_text = "<font color='red'><b>".$mod_strings['ERR_CREDENTIALS_MISSING']."</b></font>";
} else {
$result = PackageManagerComm::login();
if ((is_array($result) && !empty($result['faultcode'])) || $result == false) {
$header_text = "<font color='red'><b>".$result['faultstring']."</b></font>";
} else {
$header_text = PackageManager::getPromotion();
$isAlive = true;
}
}
}
return array('text' => $header_text, 'isAlive' => $isAlive, 'show_login' => $show_login);
}
function buildInstallGrid($view){
$uh = new UpgradeHistory();
$installeds = $uh->getAll();
$upgrades_installed = 0;
$installed_objects = array();
foreach($installeds as $installed)
{
$filename = from_html($installed->filename);
$date_entered = $installed->date_entered;
$type = $installed->type;
$version = $installed->version;
$upgrades_installed++;
$link = "";
public function buildInstallGrid($view)
{
$uh = new UpgradeHistory();
$installeds = $uh->getAll();
$upgrades_installed = 0;
$installed_objects = array();
foreach ($installeds as $installed) {
$filename = from_html($installed->filename);
$date_entered = $installed->date_entered;
$type = $installed->type;
$version = $installed->version;
$upgrades_installed++;
$link = "";
switch($type)
{
case "theme":
case "langpack":
case "module":
case "patch":
$manifest_file = extractManifest($filename);
require_once($manifest_file);
switch ($type) {
case "theme":
case "langpack":
case "module":
case "patch":
$manifest_file = extractManifest($filename);
require_once($manifest_file);
$name = empty($manifest['name']) ? $filename : $manifest['name'];
$description = empty($manifest['description']) ? $mod_strings['LBL_UW_NONE'] : $manifest['description'];
if(($upgrades_installed==0 || $uh->UninstallAvailable($installeds, $installed))
&& is_file($filename) && !empty($manifest['is_uninstallable']))
{
$link = urlencode( $filename );
}
else
{
$link = 'false';
}
$name = empty($manifest['name']) ? $filename : $manifest['name'];
$description = empty($manifest['description']) ? $mod_strings['LBL_UW_NONE'] : $manifest['description'];
if (($upgrades_installed==0 || $uh->UninstallAvailable($installeds, $installed))
&& is_file($filename) && !empty($manifest['is_uninstallable'])) {
$link = urlencode($filename);
} else {
$link = 'false';
}
break;
default:
break;
}
break;
default:
break;
}
if($view == 'default' && $type != 'patch')
{
continue;
}
if ($view == 'default' && $type != 'patch') {
continue;
}
if($view == 'module'
&& $type != 'module' && $type != 'theme' && $type != 'langpack')
{
continue;
}
if ($view == 'module'
&& $type != 'module' && $type != 'theme' && $type != 'langpack') {
continue;
}
$target_manifest = remove_file_extension( $filename ) . "-manifest.php";
require_once( "$target_manifest" );
$target_manifest = remove_file_extension($filename) . "-manifest.php";
require_once("$target_manifest");
if(isset($manifest['icon']) && $manifest['icon'] != "")
{
$manifest_copy_files_to_dir = isset($manifest['copy_files']['to_dir']) ? clean_path($manifest['copy_files']['to_dir']) : "";
$manifest_copy_files_from_dir = isset($manifest['copy_files']['from_dir']) ? clean_path($manifest['copy_files']['from_dir']) : "";
$manifest_icon = clean_path($manifest['icon']);
$icon = "<img src=\"" . $manifest_copy_files_to_dir . ($manifest_copy_files_from_dir != "" ? substr($manifest_icon, strlen($manifest_copy_files_from_dir)+1) : $manifest_icon ) . "\">";
}
else
{
$icon = getImageForType( $manifest['type'] );
}
$installed_objects[] = array('icon' => $icon, 'name' => $name, 'type' => $type, 'version' => $version, 'date_entered' => $date_entered, 'description' => $description, 'file' => $link);
//print( "<form action=\"" . $form_action . "_prepare\" method=\"post\">\n" );
//print( "<tr><td>$icon</td><td>$name</td><td>$type</td><td>$version</td><td>$date_entered</td><td>$description</td><td>$link</td></tr>\n" );
//print( "</form>\n" );
}
if (isset($manifest['icon']) && $manifest['icon'] != "") {
$manifest_copy_files_to_dir = isset($manifest['copy_files']['to_dir']) ? clean_path($manifest['copy_files']['to_dir']) : "";
$manifest_copy_files_from_dir = isset($manifest['copy_files']['from_dir']) ? clean_path($manifest['copy_files']['from_dir']) : "";
$manifest_icon = clean_path($manifest['icon']);
$icon = "<img src=\"" . $manifest_copy_files_to_dir . ($manifest_copy_files_from_dir != "" ? substr($manifest_icon, strlen($manifest_copy_files_from_dir)+1) : $manifest_icon) . "\">";
} else {
$icon = getImageForType($manifest['type']);
}
$installed_objects[] = array('icon' => $icon, 'name' => $name, 'type' => $type, 'version' => $version, 'date_entered' => $date_entered, 'description' => $description, 'file' => $link);
//print( "<form action=\"" . $form_action . "_prepare\" method=\"post\">\n" );
//print( "<tr><td>$icon</td><td>$name</td><td>$type</td><td>$version</td><td>$date_entered</td><td>$description</td><td>$link</td></tr>\n" );
//print( "</form>\n" );
}
}
}
}

View file

@ -39,7 +39,8 @@
define('PACKAGE_MANAGER_DOWNLOAD_SERVER', 'https://depot.sugarcrm.com/depot/');
define('PACKAGE_MANAGER_DOWNLOAD_PAGE', 'download.php');
class PackageManagerDownloader{
class PackageManagerDownloader
{
/**
* Using curl we will download the file from the depot server
@ -51,23 +52,24 @@ class PackageManagerDownloader{
*
* @return the full path of the saved file
*/
function download($session_id, $file_name, $save_dir = '', $download_server = ''){
if(empty($save_dir)){
$save_dir = "upload://";
}
if(empty($download_server)){
$download_server = PACKAGE_MANAGER_DOWNLOAD_SERVER;
}
$download_server .= PACKAGE_MANAGER_DOWNLOAD_PAGE;
$ch = curl_init($download_server . '?filename='. $file_name);
$fp = sugar_fopen($save_dir . $file_name, 'w');
curl_setopt($ch, CURLOPT_COOKIE, 'PHPSESSID='.$session_id. ';');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
return $save_dir . $file_name;
}
public function download($session_id, $file_name, $save_dir = '', $download_server = '')
{
if (empty($save_dir)) {
$save_dir = "upload://";
}
if (empty($download_server)) {
$download_server = PACKAGE_MANAGER_DOWNLOAD_SERVER;
}
$download_server .= PACKAGE_MANAGER_DOWNLOAD_PAGE;
$ch = curl_init($download_server . '?filename='. $file_name);
$fp = sugar_fopen($save_dir . $file_name, 'w');
curl_setopt($ch, CURLOPT_COOKIE, 'PHPSESSID='.$session_id. ';');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
return $save_dir . $file_name;
}
}

View file

@ -1,5 +1,7 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@ -44,24 +46,24 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
"actionviewmap" => array("section" => "action_view_map","extdir" => "ActionViewMap", "file" => 'action_view_map.ext.php'),
"actionfilemap" => array("section" => "action_file_map","extdir" => "ActionFileMap", "file" => 'action_file_map.ext.php'),
"actionremap" => array("section" => "action_remap", "extdir" => "ActionReMap", "file" => 'action_remap.ext.php'),
"administration" => array("section" => "administration", "extdir" => "Administration", "file" => 'administration.ext.php', "module" => "Administration"),
"entrypoints" => array("section" => "entrypoints", "extdir" => "EntryPointRegistry", "file" => 'entry_point_registry.ext.php', "module" => "application"),
"exts" => array("section" => "extensions", "extdir" => "Extensions", "file" => 'extensions.ext.php', "module" => "application"),
"file_access" => array("section" => "file_access", "extdir" => "FileAccessControlMap", "file" => 'file_access_control_map.ext.php'),
"languages" => array("section" => "language", "extdir" => "Language", "file" => '' /* custom rebuild */),
"layoutdefs" => array("section" => "layoutdefs", "extdir" => "Layoutdefs", "file" => 'layoutdefs.ext.php'),
"administration" => array("section" => "administration", "extdir" => "Administration", "file" => 'administration.ext.php', "module" => "Administration"),
"entrypoints" => array("section" => "entrypoints", "extdir" => "EntryPointRegistry", "file" => 'entry_point_registry.ext.php', "module" => "application"),
"exts" => array("section" => "extensions", "extdir" => "Extensions", "file" => 'extensions.ext.php', "module" => "application"),
"file_access" => array("section" => "file_access", "extdir" => "FileAccessControlMap", "file" => 'file_access_control_map.ext.php'),
"languages" => array("section" => "language", "extdir" => "Language", "file" => '' /* custom rebuild */),
"layoutdefs" => array("section" => "layoutdefs", "extdir" => "Layoutdefs", "file" => 'layoutdefs.ext.php'),
"links" => array("section" => "linkdefs", "extdir" => "GlobalLinks", "file" => 'links.ext.php', "module" => "application"),
"logichooks" => array("section" => "hookdefs", "extdir" => "LogicHooks", "file" => 'logichooks.ext.php'),
"logichooks" => array("section" => "hookdefs", "extdir" => "LogicHooks", "file" => 'logichooks.ext.php'),
"menus" => array("section" => "menu", "extdir" => "Menus", "file" => "menu.ext.php"),
"modules" => array("section" => "beans", "extdir" => "Include", "file" => 'modules.ext.php', "module" => "application"),
"schedulers" => array("section" => "scheduledefs", "extdir" => "ScheduledTasks", "file" => 'scheduledtasks.ext.php', "module" => "Schedulers"),
"userpage" => array("section" => "user_page", "extdir" => "UserPage", "file" => 'userpage.ext.php', "module" => "Users"),
"utils" => array("section" => "utils", "extdir" => "Utils", "file" => 'custom_utils.ext.php', "module" => "application"),
"vardefs" => array("section" => "vardefs", "extdir" => "Vardefs", "file" => 'vardefs.ext.php'),
"jsgroupings" => array("section" => "jsgroups", "extdir" => "JSGroupings", "file" => 'jsgroups.ext.php'),
"aow" => array("section" => "aow_actions", "extdir" => "Actions", "file" => 'actions.ext.php', "module" => "AOW_Actions"),
"vardefs" => array("section" => "vardefs", "extdir" => "Vardefs", "file" => 'vardefs.ext.php'),
"jsgroupings" => array("section" => "jsgroups", "extdir" => "JSGroupings", "file" => 'jsgroups.ext.php'),
"aow" => array("section" => "aow_actions", "extdir" => "Actions", "file" => 'actions.ext.php', "module" => "AOW_Actions"),
);
if(file_exists("custom/application/Ext/Extensions/extensions.ext.php")) {
if (file_exists("custom/application/Ext/Extensions/extensions.ext.php")) {
include("custom/application/Ext/Extensions/extensions.ext.php");
}

View file

@ -1,6 +1,7 @@
## SuiteCRM 7.10.4
## SuiteCRM 7.10.7
[![Build Status](https://travis-ci.org/salesagility/SuiteCRM.svg?branch=develop)](https://travis-ci.org/salesagility/SuiteCRM)
[![Build Status](https://travis-ci.org/salesagility/SuiteCRM.svg?branch=hotfix)](https://travis-ci.org/salesagility/SuiteCRM)
[![codecov](https://codecov.io/gh/salesagility/SuiteCRM/branch/hotfix/graph/badge.svg)](https://codecov.io/gh/salesagility/SuiteCRM/branch/hotfix)
### What's in this repository ###
@ -42,7 +43,7 @@ SuiteCRM in your language: [ Download and install language packs from][suitecrm_
See our [Code of Conduct][code_of_conduct] on our Wiki.
[code_of_conduct]: https://suitecrm.com/wiki/index.php/Contributing_to_SuiteCRM#Code_of_Conduct
[code_of_conduct]: https://docs.suitecrm.com/community/code-of-conduct/
### Helpful links for the community ###
@ -66,7 +67,7 @@ The following links offer various ways to view, contribute and collaborate to th
[ View the Community Roadmap here and get involved][suitecrm_roadmap]
[suitecrm_roadmap]: https://suitecrm.com/community/roadmap
[suitecrm_roadmap]: https://suitecrm.com/roadmap
[More detailed SuiteCRM Community LTS Roadmap][suitecrm_detailed_roadmap]

10
RoboFile.php Normal file
View file

@ -0,0 +1,10 @@
<?php
/**
* This is project's console commands configuration for Robo task runner.
*
* @see http://robo.li/
*/
class RoboFile extends \Robo\Tasks
{
// define public methods as commands
}

View file

@ -1,4 +1,4 @@
<?PHP
<?php
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@ -41,128 +41,132 @@
class SugarSecure{
var $results = array();
function display(){
echo '<table>';
foreach($this->results as $result){
echo '<tr><td>' . nl2br($result) . '</td></tr>';
}
echo '</table>';
}
function save($file=''){
$fp = fopen($file, 'a');
foreach($this->results as $result){
fwrite($fp , $result);
}
fclose($fp);
}
function scan($path= '.', $ext = '.php'){
$dir = dir($path);
while($entry = $dir->read()){
if(is_dir($path . '/' . $entry) && $entry != '.' && $entry != '..'){
$this->scan($path .'/' . $entry);
}
if(is_file($path . '/'. $entry) && substr($entry, strlen($entry) - strlen($ext), strlen($ext)) == $ext){
$contents = file_get_contents($path .'/'. $entry);
$this->scanContents($contents, $path .'/'. $entry);
}
}
}
function scanContents($contents){
return;
}
class SugarSecure
{
public $results = array();
public function display()
{
echo '<table>';
foreach ($this->results as $result) {
echo '<tr><td>' . nl2br($result) . '</td></tr>';
}
echo '</table>';
}
public function save($file='')
{
$fp = fopen($file, 'a');
foreach ($this->results as $result) {
fwrite($fp, $result);
}
fclose($fp);
}
public function scan($path= '.', $ext = '.php')
{
$dir = dir($path);
while ($entry = $dir->read()) {
if (is_dir($path . '/' . $entry) && $entry != '.' && $entry != '..') {
$this->scan($path .'/' . $entry);
}
if (is_file($path . '/'. $entry) && substr($entry, strlen($entry) - strlen($ext), strlen($ext)) == $ext) {
$contents = file_get_contents($path .'/'. $entry);
$this->scanContents($contents, $path .'/'. $entry);
}
}
}
public function scanContents($contents)
{
return;
}
}
class ScanFileIncludes extends SugarSecure{
function scanContents($contents, $file){
$results = array();
$found = '';
/*preg_match_all("'(require_once\([^\)]*\\$[^\)]*\))'si", $contents, $results, PREG_SET_ORDER);
foreach($results as $result){
$found .= "\n" . $result[0];
}
$results = array();
preg_match_all("'include_once\([^\)]*\\$[^\)]*\)'si", $contents, $results, PREG_SET_ORDER);
foreach($results as $result){
$found .= "\n" . $result[0];
}
*/
$results = array();
preg_match_all("'require\([^\)]*\\$[^\)]*\)'si", $contents, $results, PREG_SET_ORDER);
foreach($results as $result){
$found .= "\n" . $result[0];
}
$results = array();
preg_match_all("'include\([^\)]*\\$[^\)]*\)'si", $contents, $results, PREG_SET_ORDER);
foreach($results as $result){
$found .= "\n" . $result[0];
}
$results = array();
preg_match_all("'require_once\([^\)]*\\$[^\)]*\)'si", $contents, $results, PREG_SET_ORDER);
foreach($results as $result){
$found .= "\n" . $result[0];
}
$results = array();
preg_match_all("'fopen\([^\)]*\\$[^\)]*\)'si", $contents, $results, PREG_SET_ORDER);
foreach($results as $result){
$found .= "\n" . $result[0];
}
$results = array();
preg_match_all("'file_get_contents\([^\)]*\\$[^\)]*\)'si", $contents, $results, PREG_SET_ORDER);
foreach($results as $result){
$found .= "\n" . $result[0];
}
if(!empty($found)){
$this->results[] = $file . $found."\n\n";
}
}
class ScanFileIncludes extends SugarSecure
{
public function scanContents($contents, $file)
{
$results = array();
$found = '';
/*preg_match_all("'(require_once\([^\)]*\\$[^\)]*\))'si", $contents, $results, PREG_SET_ORDER);
foreach($results as $result){
$found .= "\n" . $result[0];
}
$results = array();
preg_match_all("'include_once\([^\)]*\\$[^\)]*\)'si", $contents, $results, PREG_SET_ORDER);
foreach($results as $result){
$found .= "\n" . $result[0];
}
*/
$results = array();
preg_match_all("'require\([^\)]*\\$[^\)]*\)'si", $contents, $results, PREG_SET_ORDER);
foreach ($results as $result) {
$found .= "\n" . $result[0];
}
$results = array();
preg_match_all("'include\([^\)]*\\$[^\)]*\)'si", $contents, $results, PREG_SET_ORDER);
foreach ($results as $result) {
$found .= "\n" . $result[0];
}
$results = array();
preg_match_all("'require_once\([^\)]*\\$[^\)]*\)'si", $contents, $results, PREG_SET_ORDER);
foreach ($results as $result) {
$found .= "\n" . $result[0];
}
$results = array();
preg_match_all("'fopen\([^\)]*\\$[^\)]*\)'si", $contents, $results, PREG_SET_ORDER);
foreach ($results as $result) {
$found .= "\n" . $result[0];
}
$results = array();
preg_match_all("'file_get_contents\([^\)]*\\$[^\)]*\)'si", $contents, $results, PREG_SET_ORDER);
foreach ($results as $result) {
$found .= "\n" . $result[0];
}
if (!empty($found)) {
$this->results[] = $file . $found."\n\n";
}
}
}
class SugarSecureManager{
var $scanners = array();
function registerScan($class){
$this->scanners[] = new $class();
}
function scan(){
while($scanner = current($this->scanners)){
$scanner->scan();
$scanner = next($this->scanners);
}
reset($this->scanners);
}
function display(){
while($scanner = current($this->scanners)){
echo 'Scan Results: ';
$scanner->display();
$scanner = next($this->scanners);
}
reset($this->scanners);
}
function save(){
//reset($this->scanners);
$name = 'SugarSecure'. time() . '.txt';
while($this->scanners = next($this->scanners)){
$scanner->save($name);
}
}
class SugarSecureManager
{
public $scanners = array();
public function registerScan($class)
{
$this->scanners[] = new $class();
}
public function scan()
{
while ($scanner = current($this->scanners)) {
$scanner->scan();
$scanner = next($this->scanners);
}
reset($this->scanners);
}
public function display()
{
while ($scanner = current($this->scanners)) {
echo 'Scan Results: ';
$scanner->display();
$scanner = next($this->scanners);
}
reset($this->scanners);
}
public function save()
{
//reset($this->scanners);
$name = 'SugarSecure'. time() . '.txt';
while ($this->scanners = next($this->scanners)) {
$scanner->save($name);
}
}
}
$secure = new SugarSecureManager();
$secure->registerScan('ScanFileIncludes');

View file

@ -1,5 +1,7 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@ -57,8 +59,7 @@ $current_language = $GLOBALS['current_language'];
//module name and function name parameters are the only ones consumed
//by this file..
foreach ($_REQUEST as $key=>$value) {
switch ($key) {
switch ($key) {
case "function":
case "call_back_function":
@ -67,31 +68,32 @@ foreach ($_REQUEST as $key=>$value) {
break;
default:
$pssplit=explode('_',$key);
$pssplit=explode('_', $key);
if ($pssplit[0] =='PARAMT') {
unset($pssplit[0]);
$params1['TREE'][implode('_',$pssplit)]=$value;
unset($pssplit[0]);
$params1['TREE'][implode('_', $pssplit)]=$value;
} else {
if ($pssplit[0] =='PARAMN') {
$depth=$pssplit[count($pssplit)-1];
//parmeter is surrounded by PARAMN_ and depth info.
unset($pssplit[count($pssplit)-1]);unset($pssplit[0]);
$params1['NODES'][$depth][implode('_',$pssplit)]=$value;
} else {
if ($key=='module') {
if (!isset($params1['TREE']['module'])) {
$params1['TREE'][$key]=$value;
}
} else {
$params1['REQUEST'][$key]=$value;
}
}
if ($pssplit[0] =='PARAMN') {
$depth=$pssplit[count($pssplit)-1];
//parmeter is surrounded by PARAMN_ and depth info.
unset($pssplit[count($pssplit)-1]);
unset($pssplit[0]);
$params1['NODES'][$depth][implode('_', $pssplit)]=$value;
} else {
if ($key=='module') {
if (!isset($params1['TREE']['module'])) {
$params1['TREE'][$key]=$value;
}
} else {
$params1['REQUEST'][$key]=$value;
}
}
}
}
}
}
$modulename=$params1['TREE']['module']; ///module is a required parameter for the tree.
require('include/modules.php');
if (!empty($modulename) && !empty($func_name) && isset($beanList[$modulename]) ) {
if (!empty($modulename) && !empty($func_name) && isset($beanList[$modulename])) {
require_once('modules/'.$modulename.'/TreeData.php');
$TreeDataFunctions = array(
'ProductTemplates' => array('get_node_data'=>'','get_categories_and_products'=>''),
@ -137,11 +139,11 @@ if (!empty($modulename) && !empty($func_name) && isset($beanList[$modulename]) )
),
);
if (isset($TreeDataFunctions[$modulename][$func_name])) {
$ret=call_user_func($func_name,$params1);
if (isset($TreeDataFunctions[$modulename][$func_name])) {
$ret=call_user_func($func_name, $params1);
}
}
if (!empty($ret)) {
echo $ret;
echo $ret;
}

View file

@ -318,9 +318,12 @@ function var_exists($bname,$vname){
function rparse($bname) {
if (!empty($this->sub_blocks[$bname])) {
reset($this->sub_blocks[$bname]);
while (list($k,$v)=each($this->sub_blocks[$bname]))
if (!empty($v))
$this->rparse($v,$indent."\t");
foreach($this->sub_blocks[$bname] as $k => $v) {
if (!empty($v)) {
$this->rparse($v, $indent . "\t");
}
}
}
$this->parse($bname);
}
@ -436,8 +439,10 @@ function clear_autoreset() {
function scan_globals() {
reset($GLOBALS);
while (list($k,$v)=each($GLOBALS))
$GLOB[$k]=$v;
foreach ($GLOBALS as $k => $v) {
$GLOB[$k] = $v;
}
$this->assign("PHP",$GLOB); /* access global variables as {PHP.HTTP_HOST} in your template! */
}
@ -467,7 +472,7 @@ function maketree($con,$block) {
$block_names=array();
$blocks=array();
reset($con2);
while(list($k,$v)=each($con2)) {
foreach ($con2 as $k => $v) {
$patt="($this->block_start_word|$this->block_end_word)\s*(\w+)\s*$this->block_end_delim(.*)";
if (preg_match_all("/$patt/ims",$v,$res, PREG_SET_ORDER)) {
// $res[0][1] = BEGIN or END

View file

@ -477,7 +477,7 @@ abstract class Zend_Gdata_App_Base
$method = 'get'.ucfirst($name);
if (method_exists($this, $method)) {
return call_user_func(array(&$this, $method));
} else if (property_exists($this, "_${name}")) {
} elseif (property_exists($this, "_${name}")) {
return $this->{'_' . $name};
} else {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
@ -503,7 +503,7 @@ abstract class Zend_Gdata_App_Base
$method = 'set'.ucfirst($name);
if (method_exists($this, $method)) {
return call_user_func(array(&$this, $method), $val);
} else if (isset($this->{'_' . $name}) || ($this->{'_' . $name} === null)) {
} elseif (isset($this->{'_' . $name}) || ($this->{'_' . $name} === null)) {
$this->{'_' . $name} = $val;
} else {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';

View file

@ -113,7 +113,7 @@ abstract class Zend_Gdata_App_BaseMediaSource implements Zend_Gdata_App_MediaSou
$method = 'get'.ucfirst($name);
if (method_exists($this, $method)) {
return call_user_func(array(&$this, $method));
} else if (property_exists($this, "_${name}")) {
} elseif (property_exists($this, "_${name}")) {
return $this->{'_' . $name};
} else {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
@ -137,7 +137,7 @@ abstract class Zend_Gdata_App_BaseMediaSource implements Zend_Gdata_App_MediaSou
$method = 'set'.ucfirst($name);
if (method_exists($this, $method)) {
return call_user_func(array(&$this, $method), $val);
} else if (isset($this->{'_' . $name}) || ($this->{'_' . $name} === null)) {
} elseif (isset($this->{'_' . $name}) || ($this->{'_' . $name} === null)) {
$this->{'_' . $name} = $val;
} else {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';

View file

@ -40,8 +40,7 @@ require_once 'Zend/Gdata/App/FeedSourceParent.php';
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_App_Feed extends Zend_Gdata_App_FeedSourceParent
implements Iterator, ArrayAccess
class Zend_Gdata_App_Feed extends Zend_Gdata_App_FeedSourceParent implements Iterator, ArrayAccess
{
/**

View file

@ -105,7 +105,7 @@ class Zend_Gdata_Books extends Zend_Gdata
{
if ($location == null) {
$uri = self::VOLUME_FEED_URI;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -127,7 +127,7 @@ class Zend_Gdata_Books extends Zend_Gdata
{
if ($volumeId !== null) {
$uri = self::VOLUME_FEED_URI . "/" . $volumeId;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;

View file

@ -640,7 +640,7 @@ class Zend_Gdata_Books_VolumeEntry extends Zend_Gdata_Entry
require_once 'Zend/Gdata/App/Exception.php';
throw new Zend_Gdata_App_Exception('Slash not found in atom:id');
} else {
return substr($fullId, strrpos($fullId,'/') + 1);
return substr($fullId, strrpos($fullId, '/') + 1);
}
}

View file

@ -99,7 +99,7 @@ class Zend_Gdata_Calendar extends Zend_Gdata
{
if ($location == null) {
$uri = self::CALENDAR_EVENT_FEED_URI;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -118,7 +118,7 @@ class Zend_Gdata_Calendar extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -135,7 +135,7 @@ class Zend_Gdata_Calendar extends Zend_Gdata
public function getCalendarListFeed()
{
$uri = self::CALENDAR_FEED_URI . '/default';
return parent::getFeed($uri,'Zend_Gdata_Calendar_ListFeed');
return parent::getFeed($uri, 'Zend_Gdata_Calendar_ListFeed');
}
/**
@ -149,12 +149,12 @@ class Zend_Gdata_Calendar extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
}
return parent::getEntry($uri,'Zend_Gdata_Calendar_ListEntry');
return parent::getEntry($uri, 'Zend_Gdata_Calendar_ListEntry');
}
public function insertEvent($event, $uri=null)

View file

@ -94,22 +94,22 @@ class Zend_Gdata_Calendar_EventEntry extends Zend_Gdata_Kind_EventEntry
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gCal') . ':' . 'sendEventNotifications';
case $this->lookupNamespace('gCal') . ':' . 'sendEventNotifications':
$sendEventNotifications = new Zend_Gdata_Calendar_Extension_SendEventNotifications();
$sendEventNotifications->transferFromDOM($child);
$this->_sendEventNotifications = $sendEventNotifications;
break;
case $this->lookupNamespace('gCal') . ':' . 'timezone';
case $this->lookupNamespace('gCal') . ':' . 'timezone':
$timezone = new Zend_Gdata_Calendar_Extension_Timezone();
$timezone->transferFromDOM($child);
$this->_timezone = $timezone;
break;
case $this->lookupNamespace('atom') . ':' . 'link';
case $this->lookupNamespace('atom') . ':' . 'link':
$link = new Zend_Gdata_Calendar_Extension_Link();
$link->transferFromDOM($child);
$this->_link[] = $link;
break;
case $this->lookupNamespace('gCal') . ':' . 'quickadd';
case $this->lookupNamespace('gCal') . ':' . 'quickadd':
$quickadd = new Zend_Gdata_Calendar_Extension_QuickAdd();
$quickadd->transferFromDOM($child);
$this->_quickadd = $quickadd;

View file

@ -80,7 +80,7 @@ class Zend_Gdata_Calendar_EventFeed extends Zend_Gdata_Feed
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gCal') . ':' . 'timezone';
case $this->lookupNamespace('gCal') . ':' . 'timezone':
$timezone = new Zend_Gdata_Calendar_Extension_Timezone();
$timezone->transferFromDOM($child);
$this->_timezone = $timezone;

View file

@ -86,7 +86,7 @@ class Zend_Gdata_Calendar_Extension_Hidden extends Zend_Gdata_Extension
if ($attribute->nodeValue == "true") {
$this->_value = true;
}
else if ($attribute->nodeValue == "false") {
elseif ($attribute->nodeValue == "false") {
$this->_value = false;
}
else {

View file

@ -86,7 +86,7 @@ class Zend_Gdata_Calendar_Extension_QuickAdd extends Zend_Gdata_Extension
if ($attribute->nodeValue == "true") {
$this->_value = true;
}
else if ($attribute->nodeValue == "false") {
elseif ($attribute->nodeValue == "false") {
$this->_value = false;
}
else {

View file

@ -86,7 +86,7 @@ class Zend_Gdata_Calendar_Extension_Selected extends Zend_Gdata_Extension
if ($attribute->nodeValue == "true") {
$this->_value = true;
}
else if ($attribute->nodeValue == "false") {
elseif ($attribute->nodeValue == "false") {
$this->_value = false;
}
else {

View file

@ -85,7 +85,7 @@ class Zend_Gdata_Calendar_Extension_SendEventNotifications extends Zend_Gdata_Ex
if ($attribute->nodeValue == "true") {
$this->_value = true;
}
else if ($attribute->nodeValue == "false") {
elseif ($attribute->nodeValue == "false") {
$this->_value = false;
}
else {

View file

@ -118,32 +118,32 @@ class Zend_Gdata_Calendar_ListEntry extends Zend_Gdata_Entry
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gCal') . ':' . 'accesslevel';
case $this->lookupNamespace('gCal') . ':' . 'accesslevel':
$accessLevel = new Zend_Gdata_Calendar_Extension_AccessLevel();
$accessLevel->transferFromDOM($child);
$this->_accessLevel = $accessLevel;
break;
case $this->lookupNamespace('gCal') . ':' . 'color';
case $this->lookupNamespace('gCal') . ':' . 'color':
$color = new Zend_Gdata_Calendar_Extension_Color();
$color->transferFromDOM($child);
$this->_color = $color;
break;
case $this->lookupNamespace('gCal') . ':' . 'hidden';
case $this->lookupNamespace('gCal') . ':' . 'hidden':
$hidden = new Zend_Gdata_Calendar_Extension_Hidden();
$hidden->transferFromDOM($child);
$this->_hidden = $hidden;
break;
case $this->lookupNamespace('gCal') . ':' . 'selected';
case $this->lookupNamespace('gCal') . ':' . 'selected':
$selected = new Zend_Gdata_Calendar_Extension_Selected();
$selected->transferFromDOM($child);
$this->_selected = $selected;
break;
case $this->lookupNamespace('gCal') . ':' . 'timezone';
case $this->lookupNamespace('gCal') . ':' . 'timezone':
$timezone = new Zend_Gdata_Calendar_Extension_Timezone();
$timezone->transferFromDOM($child);
$this->_timezone = $timezone;
break;
case $this->lookupNamespace('gd') . ':' . 'where';
case $this->lookupNamespace('gd') . ':' . 'where':
$where = new Zend_Gdata_Extension_Where();
$where->transferFromDOM($child);
$this->_where[] = $where;

View file

@ -77,7 +77,7 @@ class Zend_Gdata_Calendar_ListFeed extends Zend_Gdata_Feed
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gCal') . ':' . 'timezone';
case $this->lookupNamespace('gCal') . ':' . 'timezone':
$timezone = new Zend_Gdata_Calendar_Extension_Timezone();
$timezone->transferFromDOM($child);
$this->_timezone = $timezone;

View file

@ -102,7 +102,7 @@ class Zend_Gdata_Contacts extends Zend_Gdata
$query = new Zend_Gdata_Query(self::CONTACT_FEED_URI);
$query->maxResults = $this->maxResults;
$query->startIndex = $this->startIndex;
return parent::getFeed($query,'Zend_Gdata_Contacts_ListFeed');
return parent::getFeed($query, 'Zend_Gdata_Contacts_ListFeed');
}
/**
@ -113,7 +113,7 @@ class Zend_Gdata_Contacts extends Zend_Gdata
*/
public function getContactEntry($entryID)
{
return parent::getEntry($entryID,'Zend_Gdata_Contacts_ListEntry');
return parent::getEntry($entryID, 'Zend_Gdata_Contacts_ListEntry');
}
/**

View file

@ -63,19 +63,19 @@ class Zend_Gdata_Contacts_Extension_Name extends Zend_Gdata_Extension
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName)
{
case $this->lookupNamespace('gd') . ':' . 'fullName';
case $this->lookupNamespace('gd') . ':' . 'fullName':
$entry = new Zend_Gdata_Entry();
$entry->transferFromDOM($child);
$this->_names['full_name'] = $entry->getText();
break;
case $this->lookupNamespace('gd') . ':' . 'givenName';
case $this->lookupNamespace('gd') . ':' . 'givenName':
$entry = new Zend_Gdata_Entry();
$entry->transferFromDOM($child);
$this->_names['first_name'] = $entry->getText();
break;
case $this->lookupNamespace('gd') . ':' . 'familyName';
case $this->lookupNamespace('gd') . ':' . 'familyName':
$entry = new Zend_Gdata_Entry();
$entry->transferFromDOM($child);
$this->_names['last_name'] = $entry->getText();

View file

@ -66,13 +66,13 @@ class Zend_Gdata_Contacts_Extension_Organization extends Zend_Gdata_Extension
switch ($absoluteNodeName)
{
case $this->lookupNamespace('gd') . ':' . 'orgName';
case $this->lookupNamespace('gd') . ':' . 'orgName':
$entry = new Zend_Gdata_Entry();
$entry->transferFromDOM($child);
$this->_orgName = $entry;
break;
case $this->lookupNamespace('gd') . ':' . 'orgTitle';
case $this->lookupNamespace('gd') . ':' . 'orgTitle':
$entry = new Zend_Gdata_Entry();
$entry->transferFromDOM($child);
$this->_orgTitle = $entry;

View file

@ -111,37 +111,37 @@ class Zend_Gdata_Contacts_ListEntry extends Zend_Gdata_Entry
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gd') . ':' . 'name';
case $this->lookupNamespace('gd') . ':' . 'name':
$item = new Zend_Gdata_Contacts_Extension_Name();
$item->transferFromDOM($child);
$this->_names = $item;
break;
case $this->lookupNamespace('gContact') . ':' . 'birthday';
case $this->lookupNamespace('gContact') . ':' . 'birthday':
$item = new Zend_Gdata_Contacts_Extension_Birthday();
$item->transferFromDOM($child);
$this->_birthday = $item;
break;
case $this->lookupNamespace('gd') . ':' . 'phoneNumber';
case $this->lookupNamespace('gd') . ':' . 'phoneNumber':
$item = new Zend_Gdata_Contacts_Extension_PhoneNumber();
$item->transferFromDOM($child);
$this->_phones[] = $item;
break;
case $this->lookupNamespace('gd') . ':' . 'email';
case $this->lookupNamespace('gd') . ':' . 'email':
$item = new Zend_Gdata_Contacts_Extension_Email();
$item->transferFromDOM($child);
$this->_emails[] = $item;
break;
case $this->lookupNamespace('gd') . ':' . 'structuredPostalAddress';
case $this->lookupNamespace('gd') . ':' . 'structuredPostalAddress':
$item = new Zend_Gdata_Contacts_Extension_Address();
$item->transferFromDOM($child);
$this->_addresses[] = $item;
break;
case $this->lookupNamespace('gd') . ':' . 'organization';
case $this->lookupNamespace('gd') . ':' . 'organization':
$item = new Zend_Gdata_Contacts_Extension_Organization();
$item->transferFromDOM($child);
$this->_organization = $item;

View file

@ -137,7 +137,7 @@ class Zend_Gdata_Docs extends Zend_Gdata
{
if ($location === null) {
$uri = self::DOCUMENTS_LIST_FEED_URI;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -157,7 +157,7 @@ class Zend_Gdata_Docs extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;

View file

@ -264,52 +264,52 @@ class Zend_Gdata_Exif_Extension_Tags extends Zend_Gdata_Extension
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('exif') . ':' . 'distance';
case $this->lookupNamespace('exif') . ':' . 'distance':
$distance = new Zend_Gdata_Exif_Extension_Distance();
$distance->transferFromDOM($child);
$this->_distance = $distance;
break;
case $this->lookupNamespace('exif') . ':' . 'exposure';
case $this->lookupNamespace('exif') . ':' . 'exposure':
$exposure = new Zend_Gdata_Exif_Extension_Exposure();
$exposure->transferFromDOM($child);
$this->_exposure = $exposure;
break;
case $this->lookupNamespace('exif') . ':' . 'flash';
case $this->lookupNamespace('exif') . ':' . 'flash':
$flash = new Zend_Gdata_Exif_Extension_Flash();
$flash->transferFromDOM($child);
$this->_flash = $flash;
break;
case $this->lookupNamespace('exif') . ':' . 'focallength';
case $this->lookupNamespace('exif') . ':' . 'focallength':
$focalLength = new Zend_Gdata_Exif_Extension_FocalLength();
$focalLength->transferFromDOM($child);
$this->_focalLength = $focalLength;
break;
case $this->lookupNamespace('exif') . ':' . 'fstop';
case $this->lookupNamespace('exif') . ':' . 'fstop':
$fStop = new Zend_Gdata_Exif_Extension_FStop();
$fStop->transferFromDOM($child);
$this->_fStop = $fStop;
break;
case $this->lookupNamespace('exif') . ':' . 'imageUniqueID';
case $this->lookupNamespace('exif') . ':' . 'imageUniqueID':
$imageUniqueId = new Zend_Gdata_Exif_Extension_ImageUniqueId();
$imageUniqueId->transferFromDOM($child);
$this->_imageUniqueId = $imageUniqueId;
break;
case $this->lookupNamespace('exif') . ':' . 'iso';
case $this->lookupNamespace('exif') . ':' . 'iso':
$iso = new Zend_Gdata_Exif_Extension_Iso();
$iso->transferFromDOM($child);
$this->_iso = $iso;
break;
case $this->lookupNamespace('exif') . ':' . 'make';
case $this->lookupNamespace('exif') . ':' . 'make':
$make = new Zend_Gdata_Exif_Extension_Make();
$make->transferFromDOM($child);
$this->_make = $make;
break;
case $this->lookupNamespace('exif') . ':' . 'model';
case $this->lookupNamespace('exif') . ':' . 'model':
$model = new Zend_Gdata_Exif_Extension_Model();
$model->transferFromDOM($child);
$this->_model = $model;
break;
case $this->lookupNamespace('exif') . ':' . 'time';
case $this->lookupNamespace('exif') . ':' . 'time':
$time = new Zend_Gdata_Exif_Extension_Time();
$time->transferFromDOM($child);
$this->_time = $time;

View file

@ -70,7 +70,7 @@ class Zend_Gdata_Extension_Comments extends Zend_Gdata_Extension
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gd') . ':' . 'feedLink';
case $this->lookupNamespace('gd') . ':' . 'feedLink':
$feedLink = new Zend_Gdata_Extension_FeedLink();
$feedLink->transferFromDOM($child);
$this->_feedLink = $feedLink;

View file

@ -81,7 +81,7 @@ class Zend_Gdata_Extension_EntryLink extends Zend_Gdata_Extension
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('atom') . ':' . 'entry';
case $this->lookupNamespace('atom') . ':' . 'entry':
$entry = new Zend_Gdata_Entry();
$entry->transferFromDOM($child);
$this->_entry = $entry;
@ -102,7 +102,7 @@ class Zend_Gdata_Extension_EntryLink extends Zend_Gdata_Extension
if ($attribute->nodeValue == "true") {
$this->_readOnly = true;
}
else if ($attribute->nodeValue == "false") {
elseif ($attribute->nodeValue == "false") {
$this->_readOnly = false;
}
else {

View file

@ -86,7 +86,7 @@ class Zend_Gdata_Extension_FeedLink extends Zend_Gdata_Extension
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('atom') . ':' . 'feed';
case $this->lookupNamespace('atom') . ':' . 'feed':
$feed = new Zend_Gdata_Feed();
$feed->transferFromDOM($child);
$this->_feed = $feed;
@ -110,7 +110,7 @@ class Zend_Gdata_Extension_FeedLink extends Zend_Gdata_Extension
if ($attribute->nodeValue == "true") {
$this->_readOnly = true;
}
else if ($attribute->nodeValue == "false") {
elseif ($attribute->nodeValue == "false") {
$this->_readOnly = false;
}
else {

View file

@ -94,7 +94,7 @@ class Zend_Gdata_Extension_OriginalEvent extends Zend_Gdata_Extension
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gd') . ':' . 'when';
case $this->lookupNamespace('gd') . ':' . 'when':
$when = new Zend_Gdata_Extension_When();
$when->transferFromDOM($child);
$this->_when = $when;

View file

@ -107,7 +107,7 @@ class Zend_Gdata_Extension_RecurrenceException extends Zend_Gdata_Extension
if ($attribute->nodeValue == "true") {
$this->_specialized = true;
}
else if ($attribute->nodeValue == "false") {
elseif ($attribute->nodeValue == "false") {
$this->_specialized = false;
}
else {

View file

@ -105,11 +105,11 @@ class Zend_Gdata_Extension_Reminder extends Zend_Gdata_Extension
$s = '';
if ($this->_absoluteTime)
$s = " at " . $this->_absoluteTime;
else if ($this->_days)
elseif ($this->_days)
$s = " in " . $this->_days . " days";
else if ($this->_hours)
elseif ($this->_hours)
$s = " in " . $this->_hours . " hours";
else if ($this->_minutes)
elseif ($this->_minutes)
$s = " in " . $this->_minutes . " minutes";
return $this->_method . $s;
}

View file

@ -84,7 +84,7 @@ class Zend_Gdata_Extension_When extends Zend_Gdata_Extension
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gd') . ':' . 'reminder';
case $this->lookupNamespace('gd') . ':' . 'reminder':
$reminder = new Zend_Gdata_Extension_Reminder();
$reminder->transferFromDOM($child);
$this->_reminders[] = $reminder;

View file

@ -338,7 +338,7 @@ class Zend_Gdata_Gapps extends Zend_Gdata
{
if ($domain !== null) {
return self::APPS_BASE_FEED_URI . '/' . $domain;
} else if ($this->_domain !== null) {
} elseif ($this->_domain !== null) {
return self::APPS_BASE_FEED_URI . '/' . $this->_domain;
} else {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
@ -361,7 +361,7 @@ class Zend_Gdata_Gapps extends Zend_Gdata
{
if ($location === null) {
$uri = $this->getBaseUrl() . self::APPS_USER_PATH;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -383,7 +383,7 @@ class Zend_Gdata_Gapps extends Zend_Gdata
{
if ($location === null) {
$uri = $this->getBaseUrl() . self::APPS_NICKNAME_PATH;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -407,7 +407,7 @@ class Zend_Gdata_Gapps extends Zend_Gdata
if ($location === null) {
$uri = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/';
$uri .= $this->getDomain();
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -432,7 +432,7 @@ class Zend_Gdata_Gapps extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -457,7 +457,7 @@ class Zend_Gdata_Gapps extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -480,7 +480,7 @@ class Zend_Gdata_Gapps extends Zend_Gdata
{
if ($location === null) {
$uri = $this->getBaseUrl() . self::APPS_NICKNAME_PATH;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -504,7 +504,7 @@ class Zend_Gdata_Gapps extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -527,7 +527,7 @@ class Zend_Gdata_Gapps extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -550,7 +550,7 @@ class Zend_Gdata_Gapps extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -573,7 +573,7 @@ class Zend_Gdata_Gapps extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -596,7 +596,7 @@ class Zend_Gdata_Gapps extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -619,7 +619,7 @@ class Zend_Gdata_Gapps extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -642,7 +642,7 @@ class Zend_Gdata_Gapps extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -665,7 +665,7 @@ class Zend_Gdata_Gapps extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;

View file

@ -121,12 +121,12 @@ class Zend_Gdata_Gapps_EmailListEntry extends Zend_Gdata_Entry
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('apps') . ':' . 'emailList';
case $this->lookupNamespace('apps') . ':' . 'emailList':
$emailList = new Zend_Gdata_Gapps_Extension_EmailList();
$emailList->transferFromDOM($child);
$this->_emailList = $emailList;
break;
case $this->lookupNamespace('gd') . ':' . 'feedLink';
case $this->lookupNamespace('gd') . ':' . 'feedLink':
$feedLink = new Zend_Gdata_Extension_FeedLink();
$feedLink->transferFromDOM($child);
$this->_feedLink[] = $feedLink;

View file

@ -107,7 +107,7 @@ class Zend_Gdata_Gapps_EmailListRecipientEntry extends Zend_Gdata_Entry
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gd') . ':' . 'who';
case $this->lookupNamespace('gd') . ':' . 'who':
$who = new Zend_Gdata_Extension_Who();
$who->transferFromDOM($child);
$this->_who = $who;

View file

@ -205,7 +205,7 @@ class Zend_Gdata_Gapps_Extension_Login extends Zend_Gdata_Extension
if ($attribute->nodeValue == "true") {
$this->_admin = true;
}
else if ($attribute->nodeValue == "false") {
elseif ($attribute->nodeValue == "false") {
$this->_admin = false;
}
else {
@ -217,7 +217,7 @@ class Zend_Gdata_Gapps_Extension_Login extends Zend_Gdata_Extension
if ($attribute->nodeValue == "true") {
$this->_agreedToTerms = true;
}
else if ($attribute->nodeValue == "false") {
elseif ($attribute->nodeValue == "false") {
$this->_agreedToTerms = false;
}
else {
@ -229,7 +229,7 @@ class Zend_Gdata_Gapps_Extension_Login extends Zend_Gdata_Extension
if ($attribute->nodeValue == "true") {
$this->_suspended = true;
}
else if ($attribute->nodeValue == "false") {
elseif ($attribute->nodeValue == "false") {
$this->_suspended = false;
}
else {
@ -241,7 +241,7 @@ class Zend_Gdata_Gapps_Extension_Login extends Zend_Gdata_Extension
if ($attribute->nodeValue == "true") {
$this->_changePasswordAtNextLogin = true;
}
else if ($attribute->nodeValue == "false") {
elseif ($attribute->nodeValue == "false") {
$this->_changePasswordAtNextLogin = false;
}
else {

View file

@ -105,7 +105,7 @@ class Zend_Gdata_Gapps_GroupEntry extends Zend_Gdata_Entry
switch ($absoluteNodeName) {
case $this->lookupNamespace('apps') . ':' . 'property';
case $this->lookupNamespace('apps') . ':' . 'property':
$property = new Zend_Gdata_Gapps_Extension_Property();
$property->transferFromDOM($child);
$this->_property[] = $property;

View file

@ -105,7 +105,7 @@ class Zend_Gdata_Gapps_MemberEntry extends Zend_Gdata_Entry
switch ($absoluteNodeName) {
case $this->lookupNamespace('apps') . ':' . 'property';
case $this->lookupNamespace('apps') . ':' . 'property':
$property = new Zend_Gdata_Gapps_Extension_Property();
$property->transferFromDOM($child);
$this->_property[] = $property;

View file

@ -120,12 +120,12 @@ class Zend_Gdata_Gapps_NicknameEntry extends Zend_Gdata_Entry
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('apps') . ':' . 'login';
case $this->lookupNamespace('apps') . ':' . 'login':
$login = new Zend_Gdata_Gapps_Extension_Login();
$login->transferFromDOM($child);
$this->_login = $login;
break;
case $this->lookupNamespace('apps') . ':' . 'nickname';
case $this->lookupNamespace('apps') . ':' . 'nickname':
$nickname = new Zend_Gdata_Gapps_Extension_Nickname();
$nickname->transferFromDOM($child);
$this->_nickname = $nickname;

View file

@ -105,7 +105,7 @@ class Zend_Gdata_Gapps_OwnerEntry extends Zend_Gdata_Entry
switch ($absoluteNodeName) {
case $this->lookupNamespace('apps') . ':' . 'property';
case $this->lookupNamespace('apps') . ':' . 'property':
$property = new Zend_Gdata_Gapps_Extension_Property();
$property->transferFromDOM($child);
$this->_property[] = $property;

View file

@ -110,7 +110,7 @@ abstract class Zend_Gdata_Gapps_Query extends Zend_Gdata_Query
if ($domain !== null) {
return Zend_Gdata_Gapps::APPS_BASE_FEED_URI . '/' . $domain;
}
else if ($this->_domain !== null) {
elseif ($this->_domain !== null) {
return Zend_Gdata_Gapps::APPS_BASE_FEED_URI . '/' . $this->_domain;
}
else {

View file

@ -150,22 +150,22 @@ class Zend_Gdata_Gapps_UserEntry extends Zend_Gdata_Entry
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('apps') . ':' . 'login';
case $this->lookupNamespace('apps') . ':' . 'login':
$login = new Zend_Gdata_Gapps_Extension_Login();
$login->transferFromDOM($child);
$this->_login = $login;
break;
case $this->lookupNamespace('apps') . ':' . 'name';
case $this->lookupNamespace('apps') . ':' . 'name':
$name = new Zend_Gdata_Gapps_Extension_Name();
$name->transferFromDOM($child);
$this->_name = $name;
break;
case $this->lookupNamespace('apps') . ':' . 'quota';
case $this->lookupNamespace('apps') . ':' . 'quota':
$quota = new Zend_Gdata_Gapps_Extension_Quota();
$quota->transferFromDOM($child);
$this->_quota = $quota;
break;
case $this->lookupNamespace('gd') . ':' . 'feedLink';
case $this->lookupNamespace('gd') . ':' . 'feedLink':
$feedLink = new Zend_Gdata_Extension_FeedLink();
$feedLink->transferFromDOM($child);
$this->_feedLink[] = $feedLink;

View file

@ -117,7 +117,7 @@ class Zend_Gdata_Gbase extends Zend_Gdata
{
if ($location === null) {
$uri = self::GBASE_ITEM_FEED_URI;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -137,7 +137,7 @@ class Zend_Gdata_Gbase extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -199,7 +199,7 @@ class Zend_Gdata_Gbase extends Zend_Gdata
{
if ($location === null) {
$uri = self::GBASE_SNIPPET_FEED_URI;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;

View file

@ -101,7 +101,7 @@ class Zend_Gdata_Geo_Extension_GeoRssWhere extends Zend_Gdata_Extension
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gml') . ':' . 'Point';
case $this->lookupNamespace('gml') . ':' . 'Point':
$point = new Zend_Gdata_Geo_Extension_GmlPoint();
$point->transferFromDOM($child);
$this->_point = $point;

View file

@ -101,7 +101,7 @@ class Zend_Gdata_Geo_Extension_GmlPoint extends Zend_Gdata_Extension
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gml') . ':' . 'pos';
case $this->lookupNamespace('gml') . ':' . 'pos':
$pos = new Zend_Gdata_Geo_Extension_GmlPos();
$pos->transferFromDOM($child);
$this->_pos = $pos;

View file

@ -162,7 +162,7 @@ class Zend_Gdata_Health extends Zend_Gdata
if($query === null) {
$uri = self::CLIENTLOGIN_PROFILELIST_FEED_URI;
} else if ($query instanceof Zend_Gdata_Query) {
} elseif ($query instanceof Zend_Gdata_Query) {
$uri = $query->getQueryUrl();
} else {
$uri = $query;
@ -195,10 +195,10 @@ class Zend_Gdata_Health extends Zend_Gdata
if ($query instanceof Zend_Gdata_Query) {
$uri = $query->getQueryUrl();
} else if ($this->_httpClient->getClientLoginToken() !== null &&
} elseif ($this->_httpClient->getClientLoginToken() !== null &&
$query == null) {
$uri = self::CLIENTLOGIN_PROFILE_FEED_URI . '/' . $this->getProfileID();
} else if ($query === null) {
} elseif ($query === null) {
$uri = self::AUTHSUB_PROFILE_FEED_URI;
} else {
$uri = $query;
@ -224,7 +224,7 @@ class Zend_Gdata_Health extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Query must not be null');
} else if ($query instanceof Zend_Gdata_Query) {
} elseif ($query instanceof Zend_Gdata_Query) {
$uri = $query->getQueryUrl();
} else {
$uri = $query;

View file

@ -169,58 +169,58 @@ class Zend_Gdata_Kind_EventEntry extends Zend_Gdata_Entry
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gd') . ':' . 'where';
case $this->lookupNamespace('gd') . ':' . 'where':
$where = new Zend_Gdata_Extension_Where();
$where->transferFromDOM($child);
$this->_where[] = $where;
break;
case $this->lookupNamespace('gd') . ':' . 'when';
case $this->lookupNamespace('gd') . ':' . 'when':
$when = new Zend_Gdata_Extension_When();
$when->transferFromDOM($child);
$this->_when[] = $when;
break;
case $this->lookupNamespace('gd') . ':' . 'who';
case $this->lookupNamespace('gd') . ':' . 'who':
$who = new Zend_Gdata_Extension_Who();
$who ->transferFromDOM($child);
$this->_who[] = $who;
break;
case $this->lookupNamespace('gd') . ':' . 'recurrence';
case $this->lookupNamespace('gd') . ':' . 'recurrence':
$recurrence = new Zend_Gdata_Extension_Recurrence();
$recurrence->transferFromDOM($child);
$this->_recurrence = $recurrence;
break;
case $this->lookupNamespace('gd') . ':' . 'eventStatus';
case $this->lookupNamespace('gd') . ':' . 'eventStatus':
$eventStatus = new Zend_Gdata_Extension_EventStatus();
$eventStatus->transferFromDOM($child);
$this->_eventStatus = $eventStatus;
break;
case $this->lookupNamespace('gd') . ':' . 'comments';
case $this->lookupNamespace('gd') . ':' . 'comments':
$comments = new Zend_Gdata_Extension_Comments();
$comments->transferFromDOM($child);
$this->_comments = $comments;
break;
case $this->lookupNamespace('gd') . ':' . 'transparency';
case $this->lookupNamespace('gd') . ':' . 'transparency':
$transparency = new Zend_Gdata_Extension_Transparency();
$transparency ->transferFromDOM($child);
$this->_transparency = $transparency;
break;
case $this->lookupNamespace('gd') . ':' . 'visibility';
case $this->lookupNamespace('gd') . ':' . 'visibility':
$visiblity = new Zend_Gdata_Extension_Visibility();
$visiblity ->transferFromDOM($child);
$this->_visibility = $visiblity;
break;
case $this->lookupNamespace('gd') . ':' . 'recurrenceException';
case $this->lookupNamespace('gd') . ':' . 'recurrenceException':
require_once 'Zend/Gdata/Extension/RecurrenceException.php';
$recurrenceException = new Zend_Gdata_Extension_RecurrenceException();
$recurrenceException ->transferFromDOM($child);
$this->_recurrenceException[] = $recurrenceException;
break;
case $this->lookupNamespace('gd') . ':' . 'originalEvent';
case $this->lookupNamespace('gd') . ':' . 'originalEvent':
$originalEvent = new Zend_Gdata_Extension_OriginalEvent();
$originalEvent ->transferFromDOM($child);
$this->_originalEvent = $originalEvent;
break;
case $this->lookupNamespace('gd') . ':' . 'extendedProperty';
case $this->lookupNamespace('gd') . ':' . 'extendedProperty':
$extProp = new Zend_Gdata_Extension_ExtendedProperty();
$extProp->transferFromDOM($child);
$this->_extendedProperty[] = $extProp;

View file

@ -58,7 +58,7 @@ class Zend_Gdata_Media_Extension_MediaCredit extends Zend_Gdata_Extension
* @param string $role
* @param string $scheme
*/
public function __construct($text = null, $role = null, $scheme = null)
public function __construct($text = null, $role = null, $scheme = null)
{
$this->registerAllNamespaces(Zend_Gdata_Media::$namespaces);
parent::__construct();

View file

@ -258,67 +258,67 @@ class Zend_Gdata_Media_Extension_MediaGroup extends Zend_Gdata_Extension
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('media') . ':' . 'content';
case $this->lookupNamespace('media') . ':' . 'content':
$content = new Zend_Gdata_Media_Extension_MediaContent();
$content->transferFromDOM($child);
$this->_content[] = $content;
break;
case $this->lookupNamespace('media') . ':' . 'category';
case $this->lookupNamespace('media') . ':' . 'category':
$category = new Zend_Gdata_Media_Extension_MediaCategory();
$category->transferFromDOM($child);
$this->_category[] = $category;
break;
case $this->lookupNamespace('media') . ':' . 'copyright';
case $this->lookupNamespace('media') . ':' . 'copyright':
$copyright = new Zend_Gdata_Media_Extension_MediaCopyright();
$copyright->transferFromDOM($child);
$this->_copyright = $copyright;
break;
case $this->lookupNamespace('media') . ':' . 'credit';
case $this->lookupNamespace('media') . ':' . 'credit':
$credit = new Zend_Gdata_Media_Extension_MediaCredit();
$credit->transferFromDOM($child);
$this->_credit[] = $credit;
break;
case $this->lookupNamespace('media') . ':' . 'description';
case $this->lookupNamespace('media') . ':' . 'description':
$description = new Zend_Gdata_Media_Extension_MediaDescription();
$description->transferFromDOM($child);
$this->_description = $description;
break;
case $this->lookupNamespace('media') . ':' . 'hash';
case $this->lookupNamespace('media') . ':' . 'hash':
$hash = new Zend_Gdata_Media_Extension_MediaHash();
$hash->transferFromDOM($child);
$this->_hash[] = $hash;
break;
case $this->lookupNamespace('media') . ':' . 'keywords';
case $this->lookupNamespace('media') . ':' . 'keywords':
$keywords = new Zend_Gdata_Media_Extension_MediaKeywords();
$keywords->transferFromDOM($child);
$this->_keywords = $keywords;
break;
case $this->lookupNamespace('media') . ':' . 'player';
case $this->lookupNamespace('media') . ':' . 'player':
$player = new Zend_Gdata_Media_Extension_MediaPlayer();
$player->transferFromDOM($child);
$this->_player[] = $player;
break;
case $this->lookupNamespace('media') . ':' . 'rating';
case $this->lookupNamespace('media') . ':' . 'rating':
$rating = new Zend_Gdata_Media_Extension_MediaRating();
$rating->transferFromDOM($child);
$this->_rating[] = $rating;
break;
case $this->lookupNamespace('media') . ':' . 'restriction';
case $this->lookupNamespace('media') . ':' . 'restriction':
$restriction = new Zend_Gdata_Media_Extension_MediaRestriction();
$restriction->transferFromDOM($child);
$this->_restriction[] = $restriction;
break;
case $this->lookupNamespace('media') . ':' . 'text';
case $this->lookupNamespace('media') . ':' . 'text':
$text = new Zend_Gdata_Media_Extension_MediaText();
$text->transferFromDOM($child);
$this->_mediaText[] = $text;
break;
case $this->lookupNamespace('media') . ':' . 'thumbnail';
case $this->lookupNamespace('media') . ':' . 'thumbnail':
$thumbnail = new Zend_Gdata_Media_Extension_MediaThumbnail();
$thumbnail->transferFromDOM($child);
$this->_thumbnail[] = $thumbnail;
break;
case $this->lookupNamespace('media') . ':' . 'title';
case $this->lookupNamespace('media') . ':' . 'title':
$title = new Zend_Gdata_Media_Extension_MediaTitle();
$title->transferFromDOM($child);
$this->_title = $title;

View file

@ -58,7 +58,7 @@ class Zend_Gdata_Media_Extension_MediaRestriction extends Zend_Gdata_Extension
* @param string $relationship
* @param string $type
*/
public function __construct($text = null, $relationship = null, $type = null)
public function __construct($text = null, $relationship = null, $type = null)
{
$this->registerAllNamespaces(Zend_Gdata_Media::$namespaces);
parent::__construct();

View file

@ -98,7 +98,7 @@ class Zend_Gdata_MediaMimeStream
}
$this->_fileHandle = fopen($filePath, 'rb', TRUE);
$this->_boundaryString = '=_' . md5(microtime(1) . rand(1,20));
$this->_boundaryString = '=_' . md5(microtime(1) . rand(1, 20));
$entry = $this->wrapEntry($xmlString, $fileContentType);
$closingBoundary = new Zend_Gdata_MimeBodyString("\r\n--{$this->_boundaryString}--\r\n");
$file = new Zend_Gdata_MimeFile($this->_fileHandle);

View file

@ -68,7 +68,7 @@ class Zend_Gdata_MimeBodyString
$len = strlen($this->_sourceString);
if($this->_bytesRead == $len) {
return FALSE;
} else if($bytesRequested > $len - $this->_bytesRead) {
} elseif($bytesRequested > $len - $this->_bytesRead) {
$bytesRequested = $len - $this->_bytesRead;
}

View file

@ -155,14 +155,14 @@ class Zend_Gdata_Photos extends Zend_Gdata
$location->setUser($userName);
}
$uri = $location->getQueryUrl();
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
if ($userName !== null) {
$location->setUser($userName);
}
$uri = $location->getQueryUrl();
} else if ($location !== null) {
} elseif ($location !== null) {
$uri = $location;
} else if ($userName !== null) {
} elseif ($userName !== null) {
$uri = self::PICASA_BASE_FEED_URI . '/' .
self::DEFAULT_PROJECTION . '/' . self::USER_PATH . '/' .
$userName;
@ -190,10 +190,10 @@ class Zend_Gdata_Photos extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Photos_UserQuery) {
} elseif ($location instanceof Zend_Gdata_Photos_UserQuery) {
$location->setType('feed');
$uri = $location->getQueryUrl();
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -218,10 +218,10 @@ class Zend_Gdata_Photos extends Zend_Gdata
$uri = self::PICASA_BASE_FEED_URI . '/' .
self::DEFAULT_PROJECTION . '/' .
self::COMMUNITY_SEARCH_PATH;
} else if ($location instanceof Zend_Gdata_Photos_UserQuery) {
} elseif ($location instanceof Zend_Gdata_Photos_UserQuery) {
$location->setType('feed');
$uri = $location->getQueryUrl();
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -243,10 +243,10 @@ class Zend_Gdata_Photos extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Photos_UserQuery) {
} elseif ($location instanceof Zend_Gdata_Photos_UserQuery) {
$location->setType('entry');
$uri = $location->getQueryUrl();
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -268,10 +268,10 @@ class Zend_Gdata_Photos extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Photos_UserQuery) {
} elseif ($location instanceof Zend_Gdata_Photos_UserQuery) {
$location->setType('entry');
$uri = $location->getQueryUrl();
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -293,10 +293,10 @@ class Zend_Gdata_Photos extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Photos_UserQuery) {
} elseif ($location instanceof Zend_Gdata_Photos_UserQuery) {
$location->setType('entry');
$uri = $location->getQueryUrl();
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -318,10 +318,10 @@ class Zend_Gdata_Photos extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Photos_UserQuery) {
} elseif ($location instanceof Zend_Gdata_Photos_UserQuery) {
$location->setType('entry');
$uri = $location->getQueryUrl();
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -343,10 +343,10 @@ class Zend_Gdata_Photos extends Zend_Gdata
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null');
} else if ($location instanceof Zend_Gdata_Photos_UserQuery) {
} elseif ($location instanceof Zend_Gdata_Photos_UserQuery) {
$location->setType('entry');
$uri = $location->getQueryUrl();
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;

View file

@ -266,62 +266,62 @@ class Zend_Gdata_Photos_AlbumEntry extends Zend_Gdata_Entry
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gphoto') . ':' . 'access';
case $this->lookupNamespace('gphoto') . ':' . 'access':
$access = new Zend_Gdata_Photos_Extension_Access();
$access->transferFromDOM($child);
$this->_gphotoAccess = $access;
break;
case $this->lookupNamespace('gphoto') . ':' . 'location';
case $this->lookupNamespace('gphoto') . ':' . 'location':
$location = new Zend_Gdata_Photos_Extension_Location();
$location->transferFromDOM($child);
$this->_gphotoLocation = $location;
break;
case $this->lookupNamespace('gphoto') . ':' . 'name';
case $this->lookupNamespace('gphoto') . ':' . 'name':
$name = new Zend_Gdata_Photos_Extension_Name();
$name->transferFromDOM($child);
$this->_gphotoName = $name;
break;
case $this->lookupNamespace('gphoto') . ':' . 'numphotos';
case $this->lookupNamespace('gphoto') . ':' . 'numphotos':
$numPhotos = new Zend_Gdata_Photos_Extension_NumPhotos();
$numPhotos->transferFromDOM($child);
$this->_gphotoNumPhotos = $numPhotos;
break;
case $this->lookupNamespace('gphoto') . ':' . 'commentCount';
case $this->lookupNamespace('gphoto') . ':' . 'commentCount':
$commentCount = new Zend_Gdata_Photos_Extension_CommentCount();
$commentCount->transferFromDOM($child);
$this->_gphotoCommentCount = $commentCount;
break;
case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled';
case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled':
$commentingEnabled = new Zend_Gdata_Photos_Extension_CommentingEnabled();
$commentingEnabled->transferFromDOM($child);
$this->_gphotoCommentingEnabled = $commentingEnabled;
break;
case $this->lookupNamespace('gphoto') . ':' . 'id';
case $this->lookupNamespace('gphoto') . ':' . 'id':
$id = new Zend_Gdata_Photos_Extension_Id();
$id->transferFromDOM($child);
$this->_gphotoId = $id;
break;
case $this->lookupNamespace('gphoto') . ':' . 'user';
case $this->lookupNamespace('gphoto') . ':' . 'user':
$user = new Zend_Gdata_Photos_Extension_User();
$user->transferFromDOM($child);
$this->_gphotoUser = $user;
break;
case $this->lookupNamespace('gphoto') . ':' . 'timestamp';
case $this->lookupNamespace('gphoto') . ':' . 'timestamp':
$timestamp = new Zend_Gdata_Photos_Extension_Timestamp();
$timestamp->transferFromDOM($child);
$this->_gphotoTimestamp = $timestamp;
break;
case $this->lookupNamespace('gphoto') . ':' . 'nickname';
case $this->lookupNamespace('gphoto') . ':' . 'nickname':
$nickname = new Zend_Gdata_Photos_Extension_Nickname();
$nickname->transferFromDOM($child);
$this->_gphotoNickname = $nickname;
break;
case $this->lookupNamespace('georss') . ':' . 'where';
case $this->lookupNamespace('georss') . ':' . 'where':
$geoRssWhere = new Zend_Gdata_Geo_Extension_GeoRssWhere();
$geoRssWhere->transferFromDOM($child);
$this->_geoRssWhere = $geoRssWhere;
break;
case $this->lookupNamespace('media') . ':' . 'group';
case $this->lookupNamespace('media') . ':' . 'group':
$mediaGroup = new Zend_Gdata_Media_Extension_MediaGroup();
$mediaGroup->transferFromDOM($child);
$this->_mediaGroup = $mediaGroup;

View file

@ -178,52 +178,52 @@ class Zend_Gdata_Photos_AlbumFeed extends Zend_Gdata_Feed
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gphoto') . ':' . 'id';
case $this->lookupNamespace('gphoto') . ':' . 'id':
$id = new Zend_Gdata_Photos_Extension_Id();
$id->transferFromDOM($child);
$this->_gphotoId = $id;
break;
case $this->lookupNamespace('gphoto') . ':' . 'user';
case $this->lookupNamespace('gphoto') . ':' . 'user':
$user = new Zend_Gdata_Photos_Extension_User();
$user->transferFromDOM($child);
$this->_gphotoUser = $user;
break;
case $this->lookupNamespace('gphoto') . ':' . 'nickname';
case $this->lookupNamespace('gphoto') . ':' . 'nickname':
$nickname = new Zend_Gdata_Photos_Extension_Nickname();
$nickname->transferFromDOM($child);
$this->_gphotoNickname = $nickname;
break;
case $this->lookupNamespace('gphoto') . ':' . 'name';
case $this->lookupNamespace('gphoto') . ':' . 'name':
$name = new Zend_Gdata_Photos_Extension_Name();
$name->transferFromDOM($child);
$this->_gphotoName = $name;
break;
case $this->lookupNamespace('gphoto') . ':' . 'location';
case $this->lookupNamespace('gphoto') . ':' . 'location':
$location = new Zend_Gdata_Photos_Extension_Location();
$location->transferFromDOM($child);
$this->_gphotoLocation = $location;
break;
case $this->lookupNamespace('gphoto') . ':' . 'access';
case $this->lookupNamespace('gphoto') . ':' . 'access':
$access = new Zend_Gdata_Photos_Extension_Access();
$access->transferFromDOM($child);
$this->_gphotoAccess = $access;
break;
case $this->lookupNamespace('gphoto') . ':' . 'timestamp';
case $this->lookupNamespace('gphoto') . ':' . 'timestamp':
$timestamp = new Zend_Gdata_Photos_Extension_Timestamp();
$timestamp->transferFromDOM($child);
$this->_gphotoTimestamp = $timestamp;
break;
case $this->lookupNamespace('gphoto') . ':' . 'numphotos';
case $this->lookupNamespace('gphoto') . ':' . 'numphotos':
$numphotos = new Zend_Gdata_Photos_Extension_NumPhotos();
$numphotos->transferFromDOM($child);
$this->_gphotoNumPhotos = $numphotos;
break;
case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled';
case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled':
$commentingEnabled = new Zend_Gdata_Photos_Extension_CommentingEnabled();
$commentingEnabled->transferFromDOM($child);
$this->_gphotoCommentingEnabled = $commentingEnabled;
break;
case $this->lookupNamespace('gphoto') . ':' . 'commentCount';
case $this->lookupNamespace('gphoto') . ':' . 'commentCount':
$commentCount = new Zend_Gdata_Photos_Extension_CommentCount();
$commentCount->transferFromDOM($child);
$this->_gphotoCommentCount = $commentCount;

View file

@ -131,12 +131,12 @@ class Zend_Gdata_Photos_CommentEntry extends Zend_Gdata_Entry
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gphoto') . ':' . 'id';
case $this->lookupNamespace('gphoto') . ':' . 'id':
$id = new Zend_Gdata_Photos_Extension_Id();
$id->transferFromDOM($child);
$this->_gphotoId = $id;
break;
case $this->lookupNamespace('gphoto') . ':' . 'photoid';
case $this->lookupNamespace('gphoto') . ':' . 'photoid':
$photoid = new Zend_Gdata_Photos_Extension_PhotoId();
$photoid->transferFromDOM($child);
$this->_gphotoPhotoId = $photoid;

View file

@ -294,67 +294,67 @@ class Zend_Gdata_Photos_PhotoEntry extends Zend_Gdata_Media_Entry
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gphoto') . ':' . 'albumid';
case $this->lookupNamespace('gphoto') . ':' . 'albumid':
$albumId = new Zend_Gdata_Photos_Extension_AlbumId();
$albumId->transferFromDOM($child);
$this->_gphotoAlbumId = $albumId;
break;
case $this->lookupNamespace('gphoto') . ':' . 'id';
case $this->lookupNamespace('gphoto') . ':' . 'id':
$id = new Zend_Gdata_Photos_Extension_Id();
$id->transferFromDOM($child);
$this->_gphotoId = $id;
break;
case $this->lookupNamespace('gphoto') . ':' . 'version';
case $this->lookupNamespace('gphoto') . ':' . 'version':
$version = new Zend_Gdata_Photos_Extension_Version();
$version->transferFromDOM($child);
$this->_gphotoVersion = $version;
break;
case $this->lookupNamespace('gphoto') . ':' . 'width';
case $this->lookupNamespace('gphoto') . ':' . 'width':
$width = new Zend_Gdata_Photos_Extension_Width();
$width->transferFromDOM($child);
$this->_gphotoWidth = $width;
break;
case $this->lookupNamespace('gphoto') . ':' . 'height';
case $this->lookupNamespace('gphoto') . ':' . 'height':
$height = new Zend_Gdata_Photos_Extension_Height();
$height->transferFromDOM($child);
$this->_gphotoHeight = $height;
break;
case $this->lookupNamespace('gphoto') . ':' . 'size';
case $this->lookupNamespace('gphoto') . ':' . 'size':
$size = new Zend_Gdata_Photos_Extension_Size();
$size->transferFromDOM($child);
$this->_gphotoSize = $size;
break;
case $this->lookupNamespace('gphoto') . ':' . 'client';
case $this->lookupNamespace('gphoto') . ':' . 'client':
$client = new Zend_Gdata_Photos_Extension_Client();
$client->transferFromDOM($child);
$this->_gphotoClient = $client;
break;
case $this->lookupNamespace('gphoto') . ':' . 'checksum';
case $this->lookupNamespace('gphoto') . ':' . 'checksum':
$checksum = new Zend_Gdata_Photos_Extension_Checksum();
$checksum->transferFromDOM($child);
$this->_gphotoChecksum = $checksum;
break;
case $this->lookupNamespace('gphoto') . ':' . 'timestamp';
case $this->lookupNamespace('gphoto') . ':' . 'timestamp':
$timestamp = new Zend_Gdata_Photos_Extension_Timestamp();
$timestamp->transferFromDOM($child);
$this->_gphotoTimestamp = $timestamp;
break;
case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled';
case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled':
$commentingEnabled = new Zend_Gdata_Photos_Extension_CommentingEnabled();
$commentingEnabled->transferFromDOM($child);
$this->_gphotoCommentingEnabled = $commentingEnabled;
break;
case $this->lookupNamespace('gphoto') . ':' . 'commentCount';
case $this->lookupNamespace('gphoto') . ':' . 'commentCount':
$commentCount = new Zend_Gdata_Photos_Extension_CommentCount();
$commentCount->transferFromDOM($child);
$this->_gphotoCommentCount = $commentCount;
break;
case $this->lookupNamespace('exif') . ':' . 'tags';
case $this->lookupNamespace('exif') . ':' . 'tags':
$exifTags = new Zend_Gdata_Exif_Extension_Tags();
$exifTags->transferFromDOM($child);
$this->_exifTags = $exifTags;
break;
case $this->lookupNamespace('georss') . ':' . 'where';
case $this->lookupNamespace('georss') . ':' . 'where':
$geoRssWhere = new Zend_Gdata_Geo_Extension_GeoRssWhere();
$geoRssWhere->transferFromDOM($child);
$this->_geoRssWhere = $geoRssWhere;

View file

@ -195,62 +195,62 @@ class Zend_Gdata_Photos_PhotoFeed extends Zend_Gdata_Feed
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gphoto') . ':' . 'id';
case $this->lookupNamespace('gphoto') . ':' . 'id':
$id = new Zend_Gdata_Photos_Extension_Id();
$id->transferFromDOM($child);
$this->_gphotoId = $id;
break;
case $this->lookupNamespace('gphoto') . ':' . 'version';
case $this->lookupNamespace('gphoto') . ':' . 'version':
$version = new Zend_Gdata_Photos_Extension_Version();
$version->transferFromDOM($child);
$this->_gphotoVersion = $version;
break;
case $this->lookupNamespace('gphoto') . ':' . 'albumid';
case $this->lookupNamespace('gphoto') . ':' . 'albumid':
$albumid = new Zend_Gdata_Photos_Extension_AlbumId();
$albumid->transferFromDOM($child);
$this->_gphotoAlbumId = $albumid;
break;
case $this->lookupNamespace('gphoto') . ':' . 'width';
case $this->lookupNamespace('gphoto') . ':' . 'width':
$width = new Zend_Gdata_Photos_Extension_Width();
$width->transferFromDOM($child);
$this->_gphotoWidth = $width;
break;
case $this->lookupNamespace('gphoto') . ':' . 'height';
case $this->lookupNamespace('gphoto') . ':' . 'height':
$height = new Zend_Gdata_Photos_Extension_Height();
$height->transferFromDOM($child);
$this->_gphotoHeight = $height;
break;
case $this->lookupNamespace('gphoto') . ':' . 'size';
case $this->lookupNamespace('gphoto') . ':' . 'size':
$size = new Zend_Gdata_Photos_Extension_Size();
$size->transferFromDOM($child);
$this->_gphotoSize = $size;
break;
case $this->lookupNamespace('gphoto') . ':' . 'client';
case $this->lookupNamespace('gphoto') . ':' . 'client':
$client = new Zend_Gdata_Photos_Extension_Client();
$client->transferFromDOM($child);
$this->_gphotoClient = $client;
break;
case $this->lookupNamespace('gphoto') . ':' . 'checksum';
case $this->lookupNamespace('gphoto') . ':' . 'checksum':
$checksum = new Zend_Gdata_Photos_Extension_Checksum();
$checksum->transferFromDOM($child);
$this->_gphotoChecksum = $checksum;
break;
case $this->lookupNamespace('gphoto') . ':' . 'timestamp';
case $this->lookupNamespace('gphoto') . ':' . 'timestamp':
$timestamp = new Zend_Gdata_Photos_Extension_Timestamp();
$timestamp->transferFromDOM($child);
$this->_gphotoTimestamp = $timestamp;
break;
case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled';
case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled':
$commentingEnabled = new Zend_Gdata_Photos_Extension_CommentingEnabled();
$commentingEnabled->transferFromDOM($child);
$this->_gphotoCommentingEnabled = $commentingEnabled;
break;
case $this->lookupNamespace('gphoto') . ':' . 'commentCount';
case $this->lookupNamespace('gphoto') . ':' . 'commentCount':
$commentCount = new Zend_Gdata_Photos_Extension_CommentCount();
$commentCount->transferFromDOM($child);
$this->_gphotoCommentCount = $commentCount;
break;
case $this->lookupNamespace('media') . ':' . 'group';
case $this->lookupNamespace('media') . ':' . 'group':
$mediaGroup = new Zend_Gdata_Media_Extension_MediaGroup();
$mediaGroup->transferFromDOM($child);
$this->_mediaGroup = $mediaGroup;

View file

@ -104,7 +104,7 @@ class Zend_Gdata_Photos_TagEntry extends Zend_Gdata_Entry
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gphoto') . ':' . 'weight';
case $this->lookupNamespace('gphoto') . ':' . 'weight':
$weight = new Zend_Gdata_Photos_Extension_Weight();
$weight->transferFromDOM($child);
$this->_gphotoWeight = $weight;

View file

@ -189,32 +189,32 @@ class Zend_Gdata_Photos_UserEntry extends Zend_Gdata_Entry
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gphoto') . ':' . 'nickname';
case $this->lookupNamespace('gphoto') . ':' . 'nickname':
$nickname = new Zend_Gdata_Photos_Extension_Nickname();
$nickname->transferFromDOM($child);
$this->_gphotoNickname = $nickname;
break;
case $this->lookupNamespace('gphoto') . ':' . 'thumbnail';
case $this->lookupNamespace('gphoto') . ':' . 'thumbnail':
$thumbnail = new Zend_Gdata_Photos_Extension_Thumbnail();
$thumbnail->transferFromDOM($child);
$this->_gphotoThumbnail = $thumbnail;
break;
case $this->lookupNamespace('gphoto') . ':' . 'user';
case $this->lookupNamespace('gphoto') . ':' . 'user':
$user = new Zend_Gdata_Photos_Extension_User();
$user->transferFromDOM($child);
$this->_gphotoUser = $user;
break;
case $this->lookupNamespace('gphoto') . ':' . 'quotacurrent';
case $this->lookupNamespace('gphoto') . ':' . 'quotacurrent':
$quotaCurrent = new Zend_Gdata_Photos_Extension_QuotaCurrent();
$quotaCurrent->transferFromDOM($child);
$this->_gphotoQuotaCurrent = $quotaCurrent;
break;
case $this->lookupNamespace('gphoto') . ':' . 'quotalimit';
case $this->lookupNamespace('gphoto') . ':' . 'quotalimit':
$quotaLimit = new Zend_Gdata_Photos_Extension_QuotaLimit();
$quotaLimit->transferFromDOM($child);
$this->_gphotoQuotaLimit = $quotaLimit;
break;
case $this->lookupNamespace('gphoto') . ':' . 'maxPhotosPerAlbum';
case $this->lookupNamespace('gphoto') . ':' . 'maxPhotosPerAlbum':
$maxPhotosPerAlbum = new Zend_Gdata_Photos_Extension_MaxPhotosPerAlbum();
$maxPhotosPerAlbum->transferFromDOM($child);
$this->_gphotoMaxPhotosPerAlbum = $maxPhotosPerAlbum;

View file

@ -119,17 +119,17 @@ class Zend_Gdata_Photos_UserFeed extends Zend_Gdata_Feed
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gphoto') . ':' . 'user';
case $this->lookupNamespace('gphoto') . ':' . 'user':
$user = new Zend_Gdata_Photos_Extension_User();
$user->transferFromDOM($child);
$this->_gphotoUser = $user;
break;
case $this->lookupNamespace('gphoto') . ':' . 'nickname';
case $this->lookupNamespace('gphoto') . ':' . 'nickname':
$nickname = new Zend_Gdata_Photos_Extension_Nickname();
$nickname->transferFromDOM($child);
$this->_gphotoNickname = $nickname;
break;
case $this->lookupNamespace('gphoto') . ':' . 'thumbnail';
case $this->lookupNamespace('gphoto') . ':' . 'thumbnail':
$thumbnail = new Zend_Gdata_Photos_Extension_Thumbnail();
$thumbnail->transferFromDOM($child);
$this->_gphotoThumbnail = $thumbnail;

View file

@ -138,7 +138,7 @@ class Zend_Gdata_Spreadsheets extends Zend_Gdata
{
if ($location == null) {
$uri = self::SPREADSHEETS_FEED_URI;
} else if ($location instanceof Zend_Gdata_Spreadsheets_DocumentQuery) {
} elseif ($location instanceof Zend_Gdata_Spreadsheets_DocumentQuery) {
if ($location->getDocumentType() == null) {
$location->setDocumentType('spreadsheets');
}
@ -183,7 +183,7 @@ class Zend_Gdata_Spreadsheets extends Zend_Gdata
$location->setDocumentType('worksheets');
}
$uri = $location->getQueryUrl();
} else if ($location instanceof Zend_Gdata_Spreadsheets_SpreadsheetEntry) {
} elseif ($location instanceof Zend_Gdata_Spreadsheets_SpreadsheetEntry) {
$uri = $location->getLink(self::WORKSHEETS_FEED_LINK_URI)->href;
} else {
$uri = $location;
@ -222,7 +222,7 @@ class Zend_Gdata_Spreadsheets extends Zend_Gdata
{
if ($location instanceof Zend_Gdata_Spreadsheets_CellQuery) {
$uri = $location->getQueryUrl();
} else if ($location instanceof Zend_Gdata_Spreadsheets_WorksheetEntry) {
} elseif ($location instanceof Zend_Gdata_Spreadsheets_WorksheetEntry) {
$uri = $location->getLink(self::CELL_FEED_LINK_URI)->href;
} else {
$uri = $location;
@ -257,7 +257,7 @@ class Zend_Gdata_Spreadsheets extends Zend_Gdata
{
if ($location instanceof Zend_Gdata_Spreadsheets_ListQuery) {
$uri = $location->getQueryUrl();
} else if ($location instanceof Zend_Gdata_Spreadsheets_WorksheetEntry) {
} elseif ($location instanceof Zend_Gdata_Spreadsheets_WorksheetEntry) {
$uri = $location->getLink(self::LIST_FEED_LINK_URI)->href;
} else {
$uri = $location;
@ -405,7 +405,7 @@ class Zend_Gdata_Spreadsheets extends Zend_Gdata
$cellQuery = null;
if ($location instanceof Zend_Gdata_Spreadsheets_CellQuery) {
$cellQuery = $location;
} else if ($location instanceof Zend_Gdata_Spreadsheets_WorksheetEntry) {
} elseif ($location instanceof Zend_Gdata_Spreadsheets_WorksheetEntry) {
$url = $location->getLink(self::CELL_FEED_LINK_URI)->href;
$cellQuery = new Zend_Gdata_Spreadsheets_CellQuery($url);
} else {

View file

@ -70,7 +70,7 @@ class Zend_Gdata_Spreadsheets_CellEntry extends Zend_Gdata_Entry
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gs') . ':' . 'cell';
case $this->lookupNamespace('gs') . ':' . 'cell':
$cell = new Zend_Gdata_Spreadsheets_Extension_Cell();
$cell->transferFromDOM($child);
$this->_cell = $cell;

View file

@ -101,12 +101,12 @@ class Zend_Gdata_Spreadsheets_CellFeed extends Zend_Gdata_Feed
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gs') . ':' . 'rowCount';
case $this->lookupNamespace('gs') . ':' . 'rowCount':
$rowCount = new Zend_Gdata_Spreadsheets_Extension_RowCount();
$rowCount->transferFromDOM($child);
$this->_rowCount = $rowCount;
break;
case $this->lookupNamespace('gs') . ':' . 'colCount';
case $this->lookupNamespace('gs') . ':' . 'colCount':
$colCount = new Zend_Gdata_Spreadsheets_Extension_ColCount();
$colCount->transferFromDOM($child);
$this->_colCount = $colCount;

View file

@ -333,7 +333,7 @@ class Zend_Gdata_Spreadsheets_CellQuery extends Zend_Gdata_Query
{
if (is_bool($value)) {
$this->_params['return-empty'] = ($value?'true':'false');
} else if ($value != null) {
} elseif ($value != null) {
$this->_params['return-empty'] = $value;
} else {
unset($this->_params['return-empty']);

View file

@ -259,7 +259,7 @@ class Zend_Gdata_Spreadsheets_DocumentQuery extends Zend_Gdata_Query
if ($this->_spreadsheetKey != null) {
$uri .= '/'.$this->_spreadsheetKey;
}
} else if ($this->_documentType == 'worksheets') {
} elseif ($this->_documentType == 'worksheets') {
if ($this->_spreadsheetKey != null) {
$uri .= '/'.$this->_spreadsheetKey;
} else {

View file

@ -83,7 +83,7 @@ class Zend_Gdata_Spreadsheets_ListEntry extends Zend_Gdata_Entry
protected function takeChildFromDOM($child)
{
switch ($child->namespaceURI) {
case $this->lookupNamespace('gsx');
case $this->lookupNamespace('gsx'):
$custom = new Zend_Gdata_Spreadsheets_Extension_Custom($child->localName);
$custom->transferFromDOM($child);
$this->addCustom($custom);

View file

@ -96,12 +96,12 @@ class Zend_Gdata_Spreadsheets_WorksheetEntry extends Zend_Gdata_Entry
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gs') . ':' . 'rowCount';
case $this->lookupNamespace('gs') . ':' . 'rowCount':
$rowCount = new Zend_Gdata_Spreadsheets_Extension_RowCount();
$rowCount->transferFromDOM($child);
$this->_rowCount = $rowCount;
break;
case $this->lookupNamespace('gs') . ':' . 'colCount';
case $this->lookupNamespace('gs') . ':' . 'colCount':
$colCount = new Zend_Gdata_Spreadsheets_Extension_ColCount();
$colCount->transferFromDOM($child);
$this->_colCount = $colCount;

View file

@ -255,7 +255,7 @@ class Zend_Gdata_YouTube extends Zend_Gdata_Media
{
if ($location == null) {
$uri = self::VIDEO_URI;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -285,7 +285,7 @@ class Zend_Gdata_YouTube extends Zend_Gdata_Media
} else {
$uri = self::VIDEO_URI . "/" . $videoId;
}
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -323,7 +323,7 @@ class Zend_Gdata_YouTube extends Zend_Gdata_Media
if ($videoId !== null) {
$uri = self::VIDEO_URI . "/" . $videoId . "/" .
self::RELATED_URI_SUFFIX;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -345,7 +345,7 @@ class Zend_Gdata_YouTube extends Zend_Gdata_Media
if ($videoId !== null) {
$uri = self::VIDEO_URI . "/" . $videoId . "/" .
self::RESPONSES_URI_SUFFIX;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -366,7 +366,7 @@ class Zend_Gdata_YouTube extends Zend_Gdata_Media
{
if ($videoId !== null) {
$uri = self::VIDEO_URI . "/" . $videoId . "/comments";
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -392,7 +392,7 @@ class Zend_Gdata_YouTube extends Zend_Gdata_Media
if ($location == null) {
$uri = $standardFeedUri;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
if ($location instanceof Zend_Gdata_YouTube_VideoQuery) {
if (!isset($location->url)) {
$location->setFeedType('top rated');
@ -424,7 +424,7 @@ class Zend_Gdata_YouTube extends Zend_Gdata_Media
if ($location == null) {
$uri = $standardFeedUri;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
if ($location instanceof Zend_Gdata_YouTube_VideoQuery) {
if (!isset($location->url)) {
$location->setFeedType('most viewed');
@ -455,7 +455,7 @@ class Zend_Gdata_YouTube extends Zend_Gdata_Media
if ($location == null) {
$uri = $standardFeedUri;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
if ($location instanceof Zend_Gdata_YouTube_VideoQuery) {
if (!isset($location->url)) {
$location->setFeedType('recently featured');
@ -487,7 +487,7 @@ class Zend_Gdata_YouTube extends Zend_Gdata_Media
if ($location == null) {
$uri = $standardFeedUri;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
if ($location instanceof Zend_Gdata_YouTube_VideoQuery) {
if (!isset($location->url)) {
$location->setFeedType('watch on mobile');
@ -512,7 +512,7 @@ class Zend_Gdata_YouTube extends Zend_Gdata_Media
{
if ($user !== null) {
$uri = self::USER_URI . '/' . $user . '/playlists';
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -550,7 +550,7 @@ class Zend_Gdata_YouTube extends Zend_Gdata_Media
{
if ($user !== null) {
$uri = self::USER_URI . '/' . $user . '/subscriptions';
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -570,7 +570,7 @@ class Zend_Gdata_YouTube extends Zend_Gdata_Media
{
if ($user !== null) {
$uri = self::USER_URI . '/' . $user . '/contacts';
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -591,7 +591,7 @@ class Zend_Gdata_YouTube extends Zend_Gdata_Media
if ($user !== null) {
$uri = self::USER_URI . '/' . $user . '/' .
self::UPLOADS_URI_SUFFIX;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -612,7 +612,7 @@ class Zend_Gdata_YouTube extends Zend_Gdata_Media
if ($user !== null) {
$uri = self::USER_URI . '/' . $user . '/' .
self::FAVORITES_URI_SUFFIX;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
@ -632,7 +632,7 @@ class Zend_Gdata_YouTube extends Zend_Gdata_Media
{
if ($user !== null) {
$uri = self::USER_URI . '/' . $user;
} else if ($location instanceof Zend_Gdata_Query) {
} elseif ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;

View file

@ -294,7 +294,7 @@ class Zend_Gdata_YouTube_VideoEntry extends Zend_Gdata_YouTube_MediaEntry
$where->transferFromDOM($child);
$this->_where = $where;
break;
case $this->lookupNamespace('atom') . ':' . 'link';
case $this->lookupNamespace('atom') . ':' . 'link':
$link = new Zend_Gdata_YouTube_Extension_Link();
$link->transferFromDOM($child);
$this->_link[] = $link;

View file

@ -30,4 +30,5 @@ require_once 'Zend/Exception.php';
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Oauth_Exception extends Zend_Exception {}
class Zend_Oauth_Exception extends Zend_Exception
{}

View file

@ -80,7 +80,7 @@ class Zend_Oauth_Http
* @return void
*/
public function __construct(
Zend_Oauth_Consumer $consumer,
Zend_Oauth_Consumer $consumer,
array $parameters = null,
Zend_Oauth_Http_Utility $utility = null
) {

View file

@ -43,7 +43,7 @@ class Zend_Oauth_Http_Utility
* @return array
*/
public function assembleParams(
$url,
$url,
Zend_Oauth_Config_ConfigInterface $config,
array $serviceProviderParams = null
) {

View file

@ -326,7 +326,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract
{
if ($options instanceof Zend_Config) {
$options = $options->toArray();
} else if (!is_array($options)) {
} elseif (!is_array($options)) {
$options = func_get_args();
$temp['allow'] = array_shift($options);
if (!empty($options)) {
@ -613,7 +613,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract
if ($status && ($this->_options['allow'] & self::ALLOW_DNS)) {
return true;
}
} else if ($this->_options['allow'] & self::ALLOW_DNS) {
} elseif ($this->_options['allow'] & self::ALLOW_DNS) {
$this->_error(self::INVALID_HOSTNAME);
}

View file

@ -63,7 +63,7 @@ class Zend_Validate_Ip extends Zend_Validate_Abstract
{
if ($options instanceof Zend_Config) {
$options = $options->toArray();
} else if (!is_array($options)) {
} elseif (!is_array($options)) {
$options = func_get_args();
$temp['allowipv6'] = array_shift($options);
if (!empty($options)) {

View file

@ -1,22 +0,0 @@
{
"name": "suitecrm",
"description": "The award-winning, enterprise-class open source CRM",
"main": "",
"authors": [
"Sales Agility"
],
"license": "AGPL-3.0",
"homepage": "https://suitecrm.com",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"jquery": "^3.2.1",
"fullcalendar": "^3.4.0"
}
}

View file

@ -1,370 +0,0 @@
[PHP]
;user_ini.filename = ".user.ini"
;user_ini.filename =
;user_ini.cache_ttl = 300
engine = On
short_open_tag = Off
asp_tags = Off
precision = 14
output_buffering = 4096
;output_handler =
zlib.output_compression = Off
;zlib.output_compression_level = -1
;zlib.output_handler =
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 17
;open_basedir =
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
disable_classes =
;highlight.string = #DD0000
;highlight.comment = #FF9900
;highlight.keyword = #007700
;highlight.default = #0000BB
;highlight.html = #000000
;ignore_user_abort = On
;realpath_cache_size = 16k
;realpath_cache_ttl = 120
zend.enable_gc = On
;zend.multibyte = Off
;zend.script_encoding =
expose_php = Off
max_execution_time = 200
max_input_time = 60
;max_input_nesting_level = 64
memory_limit = 128M
;;
;;
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
;report_zend_debug = 0
track_errors = Off
;xmlrpc_errors = 0
;xmlrpc_error_number = 0
html_errors = On
;docref_root = "/phpmanual/"
;docref_ext = .html
;error_prepend_string = "<span style='color: #ff0000'>"
;error_append_string = "</span>"
;error_log = php_errors.log
;error_log = syslog
;windows.show_crt_warning
;arg_separator.output = "&amp;"
;arg_separator.input = ";&"
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
;enable_post_data_reading = Off
post_max_size = 120M
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "UTF-8"
;internal_encoding =
;input_encoding =
;output_encoding =
;always_populate_raw_post_data = -1
;include_path = ".:/usr/share/php"
;include_path = ".;c:\php\includes"
doc_root =
user_dir =
enable_dl = Off
;cgi.force_redirect = 1
;cgi.nph = 1
;cgi.redirect_status_env =
;cgi.fix_pathinfo=1
;cgi.discard_path=1
;fastcgi.impersonate = 1
;fastcgi.logging = 0
;cgi.rfc2616_headers = 0
;cgi.check_shebang_line=1
;
;
file_uploads = On
;upload_tmp_dir =
upload_max_filesize = 60M
max_file_uploads = 20
;
;
allow_url_fopen = On
allow_url_include = Off
;from="john@doe.com"
;user_agent="PHP"
default_socket_timeout = 60
;auto_detect_line_endings = Off
[CLI Server]
cli_server.color = On
[Date]
;date.timezone =
;date.default_latitude = 31.7667
;date.default_longitude = 35.2333
;date.sunrise_zenith = 90.583333
;date.sunset_zenith = 90.583333
[filter]
;filter.default = unsafe_raw
;filter.default_flags =
[iconv]
;iconv.input_encoding =
;iconv.internal_encoding =
;iconv.output_encoding =
[intl]
;intl.default_locale =
;intl.error_level = E_WARNING
;intl.use_exceptions = 0
[sqlite3]
;sqlite3.extension_dir =
[Pcre]
;pcre.backtrack_limit=100000
;pcre.recursion_limit=100000
[Pdo]
;pdo_odbc.connection_pooling=strict
;pdo_odbc.db2_instance_name
[Pdo_mysql]
pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=
[Phar]
;phar.readonly = On
;phar.require_hash = On
;phar.cache_list =
[mail function]
SMTP = localhost
smtp_port = 25
;sendmail_from = me@example.com
;sendmail_path = /usr/bin/env catchmail -f some@from.address
;mail.force_extra_parameters =
mail.add_x_header = On
;mail.log =
;mail.log = syslog
[SQL]
sql.safe_mode = Off
[ODBC]
;odbc.default_db = Not yet implemented
;odbc.default_user = Not yet implemented
;odbc.default_pw = Not yet implemented
;odbc.default_cursortype
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
;birdstep.max_links = -1
[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
;ibase.default_db =
;ibase.default_user =
;ibase.default_password =
;ibase.default_charset =
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"
[MySQL]
mysql.allow_local_infile = On
mysql.allow_persistent = On
mysql.cache_size = 2000
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
[MySQLi]
mysqli.max_persistent = -1
;mysqli.allow_local_infile = On
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
;mysqlnd.debug =
;mysqlnd.log_mask = 0
;mysqlnd.mempool_default_size = 16000
;mysqlnd.net_cmd_buffer_size = 2048
;mysqlnd.net_read_buffer_size = 32768
;mysqlnd.net_read_timeout = 31536000
;mysqlnd.sha256_server_public_key =
[OCI8]
;oci8.privileged_connect = Off
;oci8.max_persistent = -1
;oci8.persistent_timeout = -1
;oci8.ping_interval = 60
;oci8.connection_class =
;oci8.events = Off
;oci8.statement_cache_size = 20
;oci8.default_prefetch = 100
;oci8.old_oci_close_semantics = Off
[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10
;sybct.timeout=
;sybct.packet_size
;sybct.login_timeout=
;sybct.hostname=
;sybct.deadlock_retry_count=
[bcmath]
bcmath.scale = 0
[browscap]
;browscap = extra/browscap.ini
[Session]
session.save_handler = files
;session.save_path = "/var/lib/php/sessions"
session.use_strict_mode = 0
session.use_cookies = 1
;session.cookie_secure =
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 0
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
;session.entropy_length = 32
;session.entropy_file = /dev/urandom
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
;session.upload_progress.enabled = On
;session.upload_progress.cleanup = On
;session.upload_progress.prefix = "upload_progress_"
;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS"
;session.upload_progress.freq = "1%"
;session.upload_progress.min_freq = "1"
[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatibility_mode = Off
;mssql.connect_timeout = 5
;mssql.timeout = 60
;mssql.textlimit = 4096
;mssql.textsize = 4096
;mssql.batchsize = 0
;mssql.datetimeconvert = On
mssql.secure_connection = Off
;mssql.max_procs = -1
;mssql.charset = "ISO-8859-1"
[Assertion]
;assert.active = On
;assert.warning = On
;assert.bail = Off
;assert.callback = 0
;assert.quiet_eval = 0
[COM]
;com.typelib_file =
;com.allow_dcom = true
;com.autoregister_typelib = true
;com.autoregister_casesensitive = false
;com.autoregister_verbose = true
;com.code_page=
[mbstring]
;mbstring.language = Japanese
;mbstring.internal_encoding =
;mbstring.http_input =
;mbstring.http_output =
;mbstring.encoding_translation = Off
;mbstring.detect_order = auto
;mbstring.substitute_character = none
;mbstring.func_overload = 0
;mbstring.strict_detection = On
;mbstring.http_output_conv_mimetype=
[gd]
;gd.jpeg_ignore_warning = 0
[exif]
;exif.encode_unicode = ISO-8859-15
;exif.decode_unicode_motorola = UCS-2BE
;exif.decode_unicode_intel = UCS-2LE
;exif.encode_jis =
;exif.decode_jis_motorola = JIS
;exif.decode_jis_intel = JIS
[Tidy]
;tidy.default_config = /usr/local/lib/php/default.tcfg
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[sysvshm]
;sysvshm.init_mem = 10000
[ldap]
ldap.max_links = -1
[mcrypt]
;mcrypt.algorithms_dir=
;mcrypt.modes_dir=
[dba]
;dba.default_handler=
[opcache]
;opcache.enable=0
;opcache.enable_cli=0
;opcache.memory_consumption=64
;opcache.interned_strings_buffer=4
;opcache.max_accelerated_files=2000
;opcache.max_wasted_percentage=5
;opcache.use_cwd=1
;opcache.validate_timestamps=1
;opcache.revalidate_freq=2
;opcache.revalidate_path=0
;opcache.save_comments=1
;opcache.load_comments=1
;opcache.fast_shutdown=0
;opcache.enable_file_override=0
;opcache.optimization_level=0xffffffff
;opcache.inherited_hack=1
;opcache.dups_fix=0
;opcache.blacklist_filename=
;opcache.max_file_size=0
;opcache.consistency_checks=0
;opcache.force_restart_timeout=180
;opcache.error_log=
;opcache.log_verbosity_level=1
;opcache.preferred_memory_model=
;opcache.protect_memory=0
[curl]
;curl.cainfo =
[openssl]
;openssl.cafile=
;openssl.capath=
date.timezone="UTC"

47
build/push_output.sh Executable file
View file

@ -0,0 +1,47 @@
#!/bin/bash
set -e;
SCRIPT=$(readlink -f $0);
SCRIPTPATH=`dirname $SCRIPT`;
ROOTPATH=`dirname $SCRIPTPATH`;
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;36m'
NC='\033[0m' # No Color
function push_output {
FILE=$1;
# html extension is not supported
echo -n "Error: ScreenShot $FILE: open ";
echo -ne $BLUE;
curl -F "files[]=@$FILE" https://rokket.space/upload\?output\=text;
echo -en $NC;
echo " in your favorite web browser";
echo " "
}
#
cd $ROOTPATH/tests/_output
# push fail.png
for filename in *.png; do
if [ -f $filename ]; then
push_output $filename;
else
echo "$filename is not a file";
continue;
fi;
done
# push fail.png
for filename in *.html; do
if [ -f $filename ]; then
cp $filename "$filename.txt"
push_output "$filename.txt";
else
echo "$filename is not a file";
continue;
fi;
done

25
build/travis-ci-apache Normal file
View file

@ -0,0 +1,25 @@
<VirtualHost *:80>
# [...]
DocumentRoot %TRAVIS_BUILD_DIR%
<Directory "%TRAVIS_BUILD_DIR%/">
Options FollowSymLinks MultiViews ExecCGI
AllowOverride All
Require all granted
</Directory>
# Wire up Apache to use Travis CI's php-fpm.
<IfModule mod_fastcgi.c>
AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
<Directory /usr/lib/cgi-bin>
Require all granted
</Directory>
</IfModule>
# [...]
</VirtualHost>

View file

@ -1,5 +1,7 @@
<?php
if(!defined('sugarEntry'))define('sugarEntry', true);
if (!defined('sugarEntry')) {
define('sugarEntry', true);
}
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@ -56,30 +58,27 @@ require_once('include/entryPoint.php');
require_once('modules/Campaigns/utils.php');
if(!empty($_REQUEST['identifier'])) {
$keys=log_campaign_activity($_REQUEST['identifier'],'link');
if (!empty($_REQUEST['identifier'])) {
$keys=log_campaign_activity($_REQUEST['identifier'], 'link');
}
if(empty($_REQUEST['track'])) {
$track = "";
if (empty($_REQUEST['track'])) {
$track = "";
} else {
$track = $_REQUEST['track'];
$track = $_REQUEST['track'];
}
$track = $db->quote($track);
if(preg_match('/^[0-9A-Za-z\-]*$/', $track))
{
$query = "SELECT refer_url FROM campaigns WHERE tracker_key='$track'";
$res = $db->query($query);
if (preg_match('/^[0-9A-Za-z\-]*$/', $track)) {
$query = "SELECT refer_url FROM campaigns WHERE tracker_key='$track'";
$res = $db->query($query);
$row = $db->fetchByAssoc($res);
$row = $db->fetchByAssoc($res);
$redirect_URL = $row['refer_url'];
sugar_cleanup();
header("Location: $redirect_URL");
}
else
{
sugar_cleanup();
$redirect_URL = $row['refer_url'];
sugar_cleanup();
header("Location: $redirect_URL");
} else {
sugar_cleanup();
}
exit;

File diff suppressed because it is too large Load diff

27
codecov.yml Normal file
View file

@ -0,0 +1,27 @@
codecov:
notify:
require_ci_to_pass: yes
coverage:
precision: 2
round: down
range: "70...100"
status:
project: yes
patch: yes
changes: no
target: 0%
parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no
comment:
layout: "header, diff"
behavior: default
require_changes: no

View file

@ -17,6 +17,7 @@
"ext-gd": "*",
"ext-curl": "*",
"ext-openssl": "*",
"ext-zip": "*",
"slim/slim": "^3.8",
"tuupola/slim-jwt-auth": "^2.0",
"league/url": "^3.3",
@ -24,7 +25,8 @@
"league/oauth2-server": "^5.1",
"justinrainbow/json-schema": "^5.2",
"onelogin/php-saml": "3.0.0.x-dev as 3.0.0",
"google/recaptcha": "^1.1"
"google/recaptcha": "^1.1",
"ezyang/htmlpurifier": "^4.10"
},
"require-dev": {
"leafo/scssphp": "dev-master",
@ -32,7 +34,9 @@
"codeception/codeception": "^2.0",
"fzaninotto/Faker": "^1.6",
"jeroendesloovere/vcard": "v1.5",
"browserstack/browserstack-local": "dev-master"
"browserstack/browserstack-local": "dev-master",
"consolidation/robo": "^1.0.0",
"mockery/mockery": "^0.9.9"
},
"scripts": {},
"prefer-stable": true,

View file

@ -1,5 +1,7 @@
<?php
if(!defined('sugarEntry'))define('sugarEntry', true);
if (!defined('sugarEntry')) {
define('sugarEntry', true);
}
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@ -64,15 +66,14 @@ if (!is_windows()) {
}
sugar_die('cron.php running with user that is not in allowed_cron_users in config.php');
}
}
else {
} else {
$GLOBALS['log']->warning('cron.php: missing expected allowed_cron_users entry in config.php. ' .
'No cron user checks will occur.');
}
}
if(empty($current_language)) {
$current_language = $sugar_config['default_language'];
if (empty($current_language)) {
$current_language = $sugar_config['default_language'];
}
$app_list_strings = return_app_list_strings_language($current_language);
@ -86,10 +87,10 @@ $GLOBALS['log']->debug('--------------------------------------------> at cron.ph
$cron_driver = !empty($sugar_config['cron_class'])?$sugar_config['cron_class']:'SugarCronJobs';
$GLOBALS['log']->debug("Using $cron_driver as CRON driver");
if(file_exists("custom/include/SugarQueue/$cron_driver.php")) {
require_once "custom/include/SugarQueue/$cron_driver.php";
if (file_exists("custom/include/SugarQueue/$cron_driver.php")) {
require_once "custom/include/SugarQueue/$cron_driver.php";
} else {
require_once "include/SugarQueue/$cron_driver.php";
require_once "include/SugarQueue/$cron_driver.php";
}
$jobq = new $cron_driver();
@ -101,14 +102,16 @@ sugar_cleanup(false);
// some jobs have annoying habit of calling sugar_cleanup(), and it can be called only once
// but job results can be written to DB after job is finished, so we have to disconnect here again
// just in case we couldn't call cleanup
if(class_exists('DBManagerFactory')) {
$db = DBManagerFactory::getInstance();
$db->disconnect();
if (class_exists('DBManagerFactory')) {
$db = DBManagerFactory::getInstance();
$db->disconnect();
}
// If we have a session left over, destroy it
if(session_id()) {
if (session_id()) {
session_destroy();
}
if($exit_on_cleanup) exit($jobq->runOk()?0:1);
if ($exit_on_cleanup) {
exit($jobq->runOk()?0:1);
}

View file

@ -31,5 +31,4 @@ if (!isset($hook_array) || !is_array($hook_array)) {
if (!isset($hook_array['after_save']) || !is_array($hook_array['after_save'])) {
$hook_array['after_save'] = array();
}
$hook_array['after_save'][] = Array(99, 'AOW_Workflow', 'modules/AOW_WorkFlow/AOW_WorkFlow.php','AOW_WorkFlow', 'run_bean_flows');
?>
$hook_array['after_save'][] = Array(99, 'AOW_Workflow', 'modules/AOW_WorkFlow/AOW_WorkFlow.php','AOW_WorkFlow', 'run_bean_flows');

View file

@ -1,5 +1,5 @@
<?php
// created: 2014-01-29 09:59:23
// created: 2018-05-16 12:26:27
$unified_search_modules_display = array (
'AOP_Case_Events' =>
array (

File diff suppressed because it is too large Load diff

View file

@ -307,13 +307,25 @@ class Link2
{
//First try the relationship
if ($this->relationship->getLHSLink() == $this->name &&
($this->relationship->getLHSModule() == $this->focus->module_name)
($this->relationship->getLHSModule() == (isset($this->focus->module_name) ? $this->focus->module_name : null))
) {
return REL_LHS;
}
if ($this->relationship->getRHSLink() == $this->name &&
($this->relationship->getRHSModule() == $this->focus->module_name)
$rhsLink = $this->relationship->getRHSLink();
$rhsModule = $this->relationship->getRHSModule();
if (!isset($this->focus)) {
LoggerManager::getLogger()->warn('No focus of Link2 when trying to get side.');
$focusModuleName = null;
} elseif (!isset($this->focus->module_name)) {
LoggerManager::getLogger()->warn('No module name degined in focus of Link2 when trying to get side.');
$focusModuleName = null;
} else {
$focusModuleName = $this->focus->module_name;
}
if ($rhsLink == $this->name &&
($rhsModule == $focusModuleName)
) {
return REL_RHS;
}

Some files were not shown because too many files have changed in this diff Show more