@@ -187,7 +187,7 @@ |
||
| 187 | 187 | $multitype = true; |
| 188 | 188 | if (self::IGNORE_MODULE === $tabid) { |
| 189 | 189 | $permittedTabIdList = \App\User::getCurrentUserId() ? \vtlib\Deprecated::getPermittedModuleIdList() : []; |
| 190 | - $permittedTabIdList[] = 0; // Added to support one link for all modules |
|
| 190 | + $permittedTabIdList[] = 0; // Added to support one link for all modules |
|
| 191 | 191 | foreach ($permittedTabIdList as $moduleId) { |
| 192 | 192 | foreach ($type as $typ) { |
| 193 | 193 | if (isset($rows[$moduleId][$typ])) { |
@@ -179,7 +179,7 @@ |
||
| 179 | 179 | $data = ['cur_sequence' => $actualSequence]; |
| 180 | 180 | $this->set('cur_sequence', $actualSequence); |
| 181 | 181 | if ($value = $this->getRelatedValue()) { |
| 182 | - $dbCommand->upsert('u_#__modentity_sequences', ['tabid' => $this->get('tabid'), 'value' => $value, 'cur_id' => $reqNo], ['cur_id' => $reqNo])->execute(); |
|
| 182 | + $dbCommand->upsert('u_#__modentity_sequences', ['tabid' => $this->get('tabid'), 'value' => $value, 'cur_id' => $reqNo], ['cur_id' => $reqNo])->execute(); |
|
| 183 | 183 | } else { |
| 184 | 184 | $data['cur_id'] = $reqNo; |
| 185 | 185 | $this->set('cur_id', $reqNo); |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | { |
| 19 | 19 | // Override the default expire time of token |
| 20 | 20 | \CsrfMagic\Csrf::$expires = \App\Config::security('csrfLifetimeToken', 7200); |
| 21 | - \CsrfMagic\Csrf::$callback = function ($tokens) { |
|
| 21 | + \CsrfMagic\Csrf::$callback = function($tokens) { |
|
| 22 | 22 | throw new \App\Exceptions\Csrf('Invalid request - Response For Illegal Access', 403); |
| 23 | 23 | }; |
| 24 | 24 | $js = 'vendor/yetiforce/csrf-magic/src/Csrf.min.js'; |
@@ -1,4 +1,4 @@ |
||
| 1 | 1 | <?php |
| 2 | -$is_admin=true; |
|
| 3 | -$user_info=['user_name'=>'admin','is_admin'=>'on','user_password'=>'$2y$10$mvy47VqQjd853TpAUr5aE.pd2fSTjBv.Z3G0g8AqyPwPNcV/YtB02','confirm_password'=>'','first_name'=>'','last_name'=>'Administrator','roleid'=>'H2','email1'=>'[email protected]','status'=>'Active','activity_view'=>'This Month','hour_format'=>'24','start_hour'=>'08:00','reports_to_id'=>0,'date_format'=>'yyyy-mm-dd','description'=>'','accesskey'=>'aOFXop10GCJ1uw0P','time_zone'=>'Europe/Sarajevo','currency_id'=>1,'currency_grouping_pattern'=>'123456789','currency_decimal_separator'=>'.','currency_grouping_separator'=>' ','currency_symbol_placement'=>'1.0$','imagename'=>'','internal_mailer'=>1,'theme'=>'twilight','language'=>'en-US','reminder_interval'=>'15 Minutes','phone_crm_extension'=>'','no_of_currency_decimals'=>'2','truncate_trailing_zeros'=>1,'dayoftheweek'=>'Monday','othereventduration'=>'[{"activitytype":"Call","duration":"60"},{"activitytype":"Meeting","duration":"60"},{"activitytype":"Task","duration":"60"}]','default_record_view'=>'Summary','leftpanelhide'=>0,'rowheight'=>'medium','defaulteventstatus'=>'PLL_PLANNED','defaultactivitytype'=>'Meeting','is_owner'=>'1','end_hour'=>'23:00','emailoptout'=>1,'available'=>1,'auto_assign'=>0,'view_date_format'=>'PLL_ELAPSED','login_method'=>'PLL_PASSWORD','sync_carddav'=>'PLL_OWNER','sync_caldav'=>'PLL_OWNER','secondary_email'=>'','default_search_operator'=>'PLL_CONTAINS','super_user'=>1,'currency_name'=>'Poland, Zlotych','currency_code'=>'PLN','currency_symbol'=>'zł','conv_rate'=>'1.00000','id'=>1]; |
|
| 4 | -return ['details'=>['user_name'=>'admin','is_admin'=>'1','user_password'=>'$2y$10$mvy47VqQjd853TpAUr5aE.pd2fSTjBv.Z3G0g8AqyPwPNcV/YtB02','confirm_password'=>'','first_name'=>'','last_name'=>'Administrator','roleid'=>'H2','email1'=>'[email protected]','status'=>'Active','activity_view'=>'This Month','hour_format'=>'24','start_hour'=>'08:00','reports_to_id'=>0,'date_format'=>'yyyy-mm-dd','description'=>'','accesskey'=>'aOFXop10GCJ1uw0P','time_zone'=>'Europe/Sarajevo','currency_id'=>1,'currency_grouping_pattern'=>'123456789','currency_decimal_separator'=>'.','currency_grouping_separator'=>' ','currency_symbol_placement'=>'1.0$','imagename'=>'','internal_mailer'=>1,'theme'=>'twilight','language'=>'en-US','reminder_interval'=>'15 Minutes','phone_crm_extension'=>'','no_of_currency_decimals'=>'2','truncate_trailing_zeros'=>1,'dayoftheweek'=>'Monday','othereventduration'=>'[{"activitytype":"Call","duration":"60"},{"activitytype":"Meeting","duration":"60"},{"activitytype":"Task","duration":"60"}]','default_record_view'=>'Summary','leftpanelhide'=>0,'rowheight'=>'medium','defaulteventstatus'=>'PLL_PLANNED','defaultactivitytype'=>'Meeting','is_owner'=>'1','end_hour'=>'23:00','emailoptout'=>1,'available'=>1,'auto_assign'=>0,'records_limit'=>'','phone_crm_extension_extra'=>'','date_password_change'=>'','force_password_change'=>'','view_date_format'=>'PLL_ELAPSED','authy_methods'=>'','authy_secret_totp'=>'','login_method'=>'PLL_PASSWORD','sync_carddav'=>'PLL_OWNER','sync_caldav'=>'PLL_OWNER','sync_carddav_default_country'=>'','default_search_module'=>'','default_search_override'=>'','primary_phone_extra'=>'','primary_phone'=>'','mail_scanner_actions'=>'','mail_scanner_fields'=>'','secondary_email'=>'','default_search_operator'=>'PLL_CONTAINS','super_user'=>1,'calendar_all_users_by_default'=>'','currency_name'=>'Poland, Zlotych','currency_code'=>'PLN','currency_symbol'=>'zł','conv_rate'=>'1.00000','record_id'=>1,'record_module'=>'Users'],'displayName'=>'Administrator','profiles'=>[1],'groups'=>[3],'leadersByGroup'=>[],'leader'=>[],'parent_roles'=>['H1'],'parent_role_seq'=>'H1::H2','roleName'=>'Board of Management','multiCompanyId'=>1,'multiCompanyLogo'=>['name'=>'logo_yetiforce.png','size'=>'3 KB','path'=>'public_html/layouts/resources/Logo/logo_login_page.png','key'=>'11111111111111111111111111111111111111111111111111'],'multiCompanyLogoUrl'=>'file.php?module=MultiCompany&action=Logo&record=1&key=11111111111111111111111111111111111111111111111111']; |
|
| 2 | +$is_admin = true; |
|
| 3 | +$user_info = ['user_name'=>'admin', 'is_admin'=>'on', 'user_password'=>'$2y$10$mvy47VqQjd853TpAUr5aE.pd2fSTjBv.Z3G0g8AqyPwPNcV/YtB02', 'confirm_password'=>'', 'first_name'=>'', 'last_name'=>'Administrator', 'roleid'=>'H2', 'email1'=>'[email protected]', 'status'=>'Active', 'activity_view'=>'This Month', 'hour_format'=>'24', 'start_hour'=>'08:00', 'reports_to_id'=>0, 'date_format'=>'yyyy-mm-dd', 'description'=>'', 'accesskey'=>'aOFXop10GCJ1uw0P', 'time_zone'=>'Europe/Sarajevo', 'currency_id'=>1, 'currency_grouping_pattern'=>'123456789', 'currency_decimal_separator'=>'.', 'currency_grouping_separator'=>' ', 'currency_symbol_placement'=>'1.0$', 'imagename'=>'', 'internal_mailer'=>1, 'theme'=>'twilight', 'language'=>'en-US', 'reminder_interval'=>'15 Minutes', 'phone_crm_extension'=>'', 'no_of_currency_decimals'=>'2', 'truncate_trailing_zeros'=>1, 'dayoftheweek'=>'Monday', 'othereventduration'=>'[{"activitytype":"Call","duration":"60"},{"activitytype":"Meeting","duration":"60"},{"activitytype":"Task","duration":"60"}]', 'default_record_view'=>'Summary', 'leftpanelhide'=>0, 'rowheight'=>'medium', 'defaulteventstatus'=>'PLL_PLANNED', 'defaultactivitytype'=>'Meeting', 'is_owner'=>'1', 'end_hour'=>'23:00', 'emailoptout'=>1, 'available'=>1, 'auto_assign'=>0, 'view_date_format'=>'PLL_ELAPSED', 'login_method'=>'PLL_PASSWORD', 'sync_carddav'=>'PLL_OWNER', 'sync_caldav'=>'PLL_OWNER', 'secondary_email'=>'', 'default_search_operator'=>'PLL_CONTAINS', 'super_user'=>1, 'currency_name'=>'Poland, Zlotych', 'currency_code'=>'PLN', 'currency_symbol'=>'zł', 'conv_rate'=>'1.00000', 'id'=>1]; |
|
| 4 | +return ['details'=>['user_name'=>'admin', 'is_admin'=>'1', 'user_password'=>'$2y$10$mvy47VqQjd853TpAUr5aE.pd2fSTjBv.Z3G0g8AqyPwPNcV/YtB02', 'confirm_password'=>'', 'first_name'=>'', 'last_name'=>'Administrator', 'roleid'=>'H2', 'email1'=>'[email protected]', 'status'=>'Active', 'activity_view'=>'This Month', 'hour_format'=>'24', 'start_hour'=>'08:00', 'reports_to_id'=>0, 'date_format'=>'yyyy-mm-dd', 'description'=>'', 'accesskey'=>'aOFXop10GCJ1uw0P', 'time_zone'=>'Europe/Sarajevo', 'currency_id'=>1, 'currency_grouping_pattern'=>'123456789', 'currency_decimal_separator'=>'.', 'currency_grouping_separator'=>' ', 'currency_symbol_placement'=>'1.0$', 'imagename'=>'', 'internal_mailer'=>1, 'theme'=>'twilight', 'language'=>'en-US', 'reminder_interval'=>'15 Minutes', 'phone_crm_extension'=>'', 'no_of_currency_decimals'=>'2', 'truncate_trailing_zeros'=>1, 'dayoftheweek'=>'Monday', 'othereventduration'=>'[{"activitytype":"Call","duration":"60"},{"activitytype":"Meeting","duration":"60"},{"activitytype":"Task","duration":"60"}]', 'default_record_view'=>'Summary', 'leftpanelhide'=>0, 'rowheight'=>'medium', 'defaulteventstatus'=>'PLL_PLANNED', 'defaultactivitytype'=>'Meeting', 'is_owner'=>'1', 'end_hour'=>'23:00', 'emailoptout'=>1, 'available'=>1, 'auto_assign'=>0, 'records_limit'=>'', 'phone_crm_extension_extra'=>'', 'date_password_change'=>'', 'force_password_change'=>'', 'view_date_format'=>'PLL_ELAPSED', 'authy_methods'=>'', 'authy_secret_totp'=>'', 'login_method'=>'PLL_PASSWORD', 'sync_carddav'=>'PLL_OWNER', 'sync_caldav'=>'PLL_OWNER', 'sync_carddav_default_country'=>'', 'default_search_module'=>'', 'default_search_override'=>'', 'primary_phone_extra'=>'', 'primary_phone'=>'', 'mail_scanner_actions'=>'', 'mail_scanner_fields'=>'', 'secondary_email'=>'', 'default_search_operator'=>'PLL_CONTAINS', 'super_user'=>1, 'calendar_all_users_by_default'=>'', 'currency_name'=>'Poland, Zlotych', 'currency_code'=>'PLN', 'currency_symbol'=>'zł', 'conv_rate'=>'1.00000', 'record_id'=>1, 'record_module'=>'Users'], 'displayName'=>'Administrator', 'profiles'=>[1], 'groups'=>[3], 'leadersByGroup'=>[], 'leader'=>[], 'parent_roles'=>['H1'], 'parent_role_seq'=>'H1::H2', 'roleName'=>'Board of Management', 'multiCompanyId'=>1, 'multiCompanyLogo'=>['name'=>'logo_yetiforce.png', 'size'=>'3 KB', 'path'=>'public_html/layouts/resources/Logo/logo_login_page.png', 'key'=>'11111111111111111111111111111111111111111111111111'], 'multiCompanyLogoUrl'=>'file.php?module=MultiCompany&action=Logo&record=1&key=11111111111111111111111111111111111111111111111111']; |
|
@@ -19,52 +19,52 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | class YetiForce extends Base |
| 21 | 21 | { |
| 22 | - /** {@inheritdoc} */ |
|
| 23 | - public function getCoordinates(array $addressInfo) |
|
| 24 | - { |
|
| 25 | - $product = \App\YetiForce\Register::getProduct('YetiForceMap'); |
|
| 26 | - if (empty($addressInfo) || !\App\RequestUtil::isNetConnection() || ((empty($product['params']['login']) || empty($product['params']['pass'])) && empty($product['params']['token']))) { |
|
| 27 | - return false; |
|
| 28 | - } |
|
| 29 | - $params = array_merge([ |
|
| 30 | - 'version' => 2.0, |
|
| 31 | - 'format' => 'json', |
|
| 32 | - 'addressdetails' => 1, |
|
| 33 | - 'limit' => 1, |
|
| 34 | - 'accept-language' => \App\Language::getLanguage() . ',' . \App\Config::main('default_language') . ',en-US', |
|
| 35 | - ], $addressInfo); |
|
| 36 | - $options = [ |
|
| 37 | - 'timeout' => 60, |
|
| 38 | - 'headers' => ['InsKey' => \App\YetiForce\Register::getInstanceKey()], |
|
| 39 | - ]; |
|
| 40 | - if (isset($product['params']['token'])) { |
|
| 41 | - $params['yf_token'] = $product['params']['token']; |
|
| 42 | - } else { |
|
| 43 | - $options['auth'] = [$product['params']['login'], $product['params']['pass']]; |
|
| 44 | - } |
|
| 45 | - $coordinates = false; |
|
| 46 | - try { |
|
| 47 | - $url = 'https://osm-search.yetiforce.eu/?' . \http_build_query($params); |
|
| 48 | - \App\Log::beginProfile("GET|YetiForce::getCoordinates|{$url}", __NAMESPACE__); |
|
| 49 | - $response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('GET', $url, $options); |
|
| 50 | - \App\Log::endProfile("GET|YetiForce::getCoordinates|{$url}", __NAMESPACE__); |
|
| 51 | - if (200 === $response->getStatusCode()) { |
|
| 52 | - $coordinates = \App\Json::decode($response->getBody()); |
|
| 53 | - } else { |
|
| 54 | - throw new \App\Exceptions\AppException('Error with connection |' . $response->getReasonPhrase() . '|' . $response->getBody()); |
|
| 55 | - } |
|
| 56 | - } catch (\Exception $ex) { |
|
| 57 | - \App\Log::error('Error - ' . $ex->getMessage(), __CLASS__); |
|
| 58 | - } |
|
| 59 | - return $coordinates; |
|
| 60 | - } |
|
| 22 | + /** {@inheritdoc} */ |
|
| 23 | + public function getCoordinates(array $addressInfo) |
|
| 24 | + { |
|
| 25 | + $product = \App\YetiForce\Register::getProduct('YetiForceMap'); |
|
| 26 | + if (empty($addressInfo) || !\App\RequestUtil::isNetConnection() || ((empty($product['params']['login']) || empty($product['params']['pass'])) && empty($product['params']['token']))) { |
|
| 27 | + return false; |
|
| 28 | + } |
|
| 29 | + $params = array_merge([ |
|
| 30 | + 'version' => 2.0, |
|
| 31 | + 'format' => 'json', |
|
| 32 | + 'addressdetails' => 1, |
|
| 33 | + 'limit' => 1, |
|
| 34 | + 'accept-language' => \App\Language::getLanguage() . ',' . \App\Config::main('default_language') . ',en-US', |
|
| 35 | + ], $addressInfo); |
|
| 36 | + $options = [ |
|
| 37 | + 'timeout' => 60, |
|
| 38 | + 'headers' => ['InsKey' => \App\YetiForce\Register::getInstanceKey()], |
|
| 39 | + ]; |
|
| 40 | + if (isset($product['params']['token'])) { |
|
| 41 | + $params['yf_token'] = $product['params']['token']; |
|
| 42 | + } else { |
|
| 43 | + $options['auth'] = [$product['params']['login'], $product['params']['pass']]; |
|
| 44 | + } |
|
| 45 | + $coordinates = false; |
|
| 46 | + try { |
|
| 47 | + $url = 'https://osm-search.yetiforce.eu/?' . \http_build_query($params); |
|
| 48 | + \App\Log::beginProfile("GET|YetiForce::getCoordinates|{$url}", __NAMESPACE__); |
|
| 49 | + $response = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request('GET', $url, $options); |
|
| 50 | + \App\Log::endProfile("GET|YetiForce::getCoordinates|{$url}", __NAMESPACE__); |
|
| 51 | + if (200 === $response->getStatusCode()) { |
|
| 52 | + $coordinates = \App\Json::decode($response->getBody()); |
|
| 53 | + } else { |
|
| 54 | + throw new \App\Exceptions\AppException('Error with connection |' . $response->getReasonPhrase() . '|' . $response->getBody()); |
|
| 55 | + } |
|
| 56 | + } catch (\Exception $ex) { |
|
| 57 | + \App\Log::error('Error - ' . $ex->getMessage(), __CLASS__); |
|
| 58 | + } |
|
| 59 | + return $coordinates; |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | - /** {@inheritdoc} */ |
|
| 63 | - public function getCoordinatesByValue(string $value): array |
|
| 64 | - { |
|
| 65 | - if (($coordinatesDetails = $this->getCoordinates(['q' => $value])) && ($coordinates = reset($coordinatesDetails)) && !empty($coordinates)) { |
|
| 66 | - return ['lat' => $coordinates['lat'], 'lon' => $coordinates['lon']]; |
|
| 67 | - } |
|
| 68 | - return []; |
|
| 69 | - } |
|
| 62 | + /** {@inheritdoc} */ |
|
| 63 | + public function getCoordinatesByValue(string $value): array |
|
| 64 | + { |
|
| 65 | + if (($coordinatesDetails = $this->getCoordinates(['q' => $value])) && ($coordinates = reset($coordinatesDetails)) && !empty($coordinates)) { |
|
| 66 | + return ['lat' => $coordinates['lat'], 'lon' => $coordinates['lon']]; |
|
| 67 | + } |
|
| 68 | + return []; |
|
| 69 | + } |
|
| 70 | 70 | } |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | } |
| 83 | 83 | foreach ((new \DirectoryIterator(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'app/Map/Address')) as $fileinfo) { |
| 84 | 84 | if ('php' === $fileinfo->getExtension() && 'Base' !== ($fileName = $fileinfo->getBasename('.php'))) { |
| 85 | - if($fileName === 'YetiForceGeocoder' && !\App\YetiForce\Shop::check('YetiForceGeocoder')){ |
|
| 85 | + if ($fileName === 'YetiForceGeocoder' && !\App\YetiForce\Shop::check('YetiForceGeocoder')) { |
|
| 86 | 86 | continue; |
| 87 | 87 | } |
| 88 | 88 | self::$providersCache[$fileName] = static::getInstance($fileName); |
@@ -162,12 +162,12 @@ discard block |
||
| 162 | 162 | 'filter' => ['mandatory' => true, 'type' => 'ExtExist', 'extName' => 'filter', 'container' => 'ext', 'testCli' => true], |
| 163 | 163 | 'ctype' => ['mandatory' => true, 'type' => 'ExtExist', 'extName' => 'ctype', 'container' => 'ext', 'testCli' => true], |
| 164 | 164 | 'hash' => ['mandatory' => true, 'type' => 'ExtExist', 'extName' => 'hash', 'container' => 'ext', 'testCli' => true], |
| 165 | - 'exif' => ['mandatory' => false, 'type' => 'ExtExist', 'extName' => 'exif', 'container' => 'ext', 'testCli' => true, 'showHelp' => true, 'mode' => 'showWarnings'], |
|
| 166 | - 'ldap' => ['mandatory' => false, 'type' => 'ExtExist', 'extName' => 'ldap', 'container' => 'ext', 'testCli' => true, 'showHelp' => true, 'mode' => 'showWarnings'], |
|
| 167 | - 'OPcache' => ['mandatory' => false, 'type' => 'ExtExist', 'extName' => 'Zend OPcache', 'container' => 'ext', 'testCli' => true, 'showHelp' => true, 'mode' => 'showWarnings'], |
|
| 168 | - 'apcu' => ['mandatory' => false, 'type' => 'ExtExist', 'extName' => 'apcu', 'container' => 'ext', 'testCli' => true, 'showHelp' => true, 'mode' => 'showWarnings'], |
|
| 169 | - 'imagick' => ['mandatory' => false, 'type' => 'ExtExist', 'extName' => 'imagick', 'container' => 'ext', 'testCli' => true, 'showHelp' => true, 'mode' => 'showWarnings'], |
|
| 170 | - 'pdo_sqlsrv' => ['mandatory' => false, 'type' => 'ExtExist', 'extName' => 'pdo_sqlsrv', 'container' => 'ext', 'testCli' => true, 'showHelp' => false, 'mode' => 'showWarnings'], |
|
| 165 | + 'exif' => ['mandatory' => false, 'type' => 'ExtExist', 'extName' => 'exif', 'container' => 'ext', 'testCli' => true, 'showHelp' => true, 'mode' => 'showWarnings'], |
|
| 166 | + 'ldap' => ['mandatory' => false, 'type' => 'ExtExist', 'extName' => 'ldap', 'container' => 'ext', 'testCli' => true, 'showHelp' => true, 'mode' => 'showWarnings'], |
|
| 167 | + 'OPcache' => ['mandatory' => false, 'type' => 'ExtExist', 'extName' => 'Zend OPcache', 'container' => 'ext', 'testCli' => true, 'showHelp' => true, 'mode' => 'showWarnings'], |
|
| 168 | + 'apcu' => ['mandatory' => false, 'type' => 'ExtExist', 'extName' => 'apcu', 'container' => 'ext', 'testCli' => true, 'showHelp' => true, 'mode' => 'showWarnings'], |
|
| 169 | + 'imagick' => ['mandatory' => false, 'type' => 'ExtExist', 'extName' => 'imagick', 'container' => 'ext', 'testCli' => true, 'showHelp' => true, 'mode' => 'showWarnings'], |
|
| 170 | + 'pdo_sqlsrv' => ['mandatory' => false, 'type' => 'ExtExist', 'extName' => 'pdo_sqlsrv', 'container' => 'ext', 'testCli' => true, 'showHelp' => false, 'mode' => 'showWarnings'], |
|
| 171 | 171 | 'allExt' => ['container' => 'ext', 'type' => 'AllExt', 'testCli' => true, 'label' => 'EXTENSIONS'], |
| 172 | 172 | ]; |
| 173 | 173 | |
@@ -345,13 +345,13 @@ discard block |
||
| 345 | 345 | 'lastCronStart' => ['container' => 'env', 'testCli' => false, 'label' => 'LAST_CRON_START', 'isHtml' => true], |
| 346 | 346 | 'crmProvider' => ['container' => 'env', 'testCli' => true, 'label' => 'CRM_PROVIDER'], |
| 347 | 347 | 'appId' => ['container' => 'env', 'testCli' => true, 'label' => 'APP_ID'], |
| 348 | - 'open_basedir' => ['container' => 'php', 'type' => 'OpenBasedir', 'testCli' => true, 'mode' => 'showWarnings'], |
|
| 348 | + 'open_basedir' => ['container' => 'php', 'type' => 'OpenBasedir', 'testCli' => true, 'mode' => 'showWarnings'], |
|
| 349 | 349 | 'caCertBundle' => ['recommended' => 'On', 'container' => 'env', 'type' => 'OnOff', 'testCli' => true, 'label' => 'CACERTBUNDLE'], |
| 350 | 350 | 'caCertBundlePath' => ['recommended' => 'On', 'container' => 'env', 'testCli' => true, 'label' => 'CACERTBUNDLE_PATH'], |
| 351 | 351 | 'SSL_CERT_FILE' => ['container' => 'env', 'testCli' => true, 'label' => 'SSL_CERT_FILE'], |
| 352 | 352 | 'SSL_CERT_DIR' => ['container' => 'env', 'testCli' => true, 'label' => 'SSL_CERT_DIR'], |
| 353 | - 'openssl.cafile' => ['container' => 'php', 'type' => 'NotEmpty', 'testCli' => true, 'mode' => 'showWarnings'], |
|
| 354 | - 'openssl.capath' => ['container' => 'php', 'type' => 'NotEmpty', 'testCli' => true, 'mode' => 'showWarnings'], |
|
| 353 | + 'openssl.cafile' => ['container' => 'php', 'type' => 'NotEmpty', 'testCli' => true, 'mode' => 'showWarnings'], |
|
| 354 | + 'openssl.capath' => ['container' => 'php', 'type' => 'NotEmpty', 'testCli' => true, 'mode' => 'showWarnings'], |
|
| 355 | 355 | ]; |
| 356 | 356 | |
| 357 | 357 | /** |
@@ -436,9 +436,9 @@ discard block |
||
| 436 | 436 | * @var array |
| 437 | 437 | */ |
| 438 | 438 | public static $functionalVerification = [ |
| 439 | - 'branding' => ['type' => 'Branding', 'testCli' => false, 'label' => 'FOOTER', 'mode' => 'onlyText'], |
|
| 440 | - 'watchdog' => ['type' => 'Watchdog', 'testCli' => true, 'label' => 'WATCHDOG', 'mode' => 'onlyText'], |
|
| 441 | - 'register' => ['type' => 'Register', 'testCli' => true, 'label' => 'REGISTER', 'mode' => 'onlyText'], |
|
| 439 | + 'branding' => ['type' => 'Branding', 'testCli' => false, 'label' => 'FOOTER', 'mode' => 'onlyText'], |
|
| 440 | + 'watchdog' => ['type' => 'Watchdog', 'testCli' => true, 'label' => 'WATCHDOG', 'mode' => 'onlyText'], |
|
| 441 | + 'register' => ['type' => 'Register', 'testCli' => true, 'label' => 'REGISTER', 'mode' => 'onlyText'], |
|
| 442 | 442 | ]; |
| 443 | 443 | /** |
| 444 | 444 | * Php variables. |
@@ -17,50 +17,50 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class YetiForce extends Base |
| 19 | 19 | { |
| 20 | - /** {@inheritdoc} */ |
|
| 21 | - public $url = 'YetiForce'; |
|
| 22 | - /** {@inheritdoc} */ |
|
| 23 | - public $infoUrl = 'index.php?module=YetiForce&parent=Settings&view=Shop&product=YetiForcePassword&mode=showProductModal'; |
|
| 20 | + /** {@inheritdoc} */ |
|
| 21 | + public $url = 'YetiForce'; |
|
| 22 | + /** {@inheritdoc} */ |
|
| 23 | + public $infoUrl = 'index.php?module=YetiForce&parent=Settings&view=Shop&product=YetiForcePassword&mode=showProductModal'; |
|
| 24 | 24 | |
| 25 | - /** {@inheritdoc} */ |
|
| 26 | - public function check(string $password): array |
|
| 27 | - { |
|
| 28 | - $status = ['status' => true]; |
|
| 29 | - $product = \App\YetiForce\Register::getProduct('YetiForcePassword'); |
|
| 30 | - if (empty($password) || !\App\RequestUtil::isNetConnection() || empty($product['params']['login']) || empty($product['params']['pass'])) { |
|
| 31 | - return $status; |
|
| 32 | - } |
|
| 33 | - try { |
|
| 34 | - $url = 'https://passwords.yetiforce.eu/pwned'; |
|
| 35 | - \App\Log::beginProfile("POST|YetiForce::check|{$url}", __NAMESPACE__); |
|
| 36 | - $request = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request( |
|
| 37 | - 'POST', |
|
| 38 | - $url, |
|
| 39 | - ['json' => ['sha1' => sha1($password)], 'timeout' => 2, 'http_errors' => false, 'auth' => [$product['params']['login'], $product['params']['pass']], 'headers' => ['InsKey' => \App\YetiForce\Register::getInstanceKey()]] |
|
| 40 | - ); |
|
| 41 | - \App\Log::endProfile("POST|YetiForce::check|{$url}", __NAMESPACE__); |
|
| 42 | - if (200 === $request->getStatusCode()) { |
|
| 43 | - $response = \App\Json::decode($request->getBody()); |
|
| 44 | - if (isset($response['count'])) { |
|
| 45 | - $status = [ |
|
| 46 | - 'message' => \App\Language::translate('LBL_ALERT_PWNED_PASSWORD', 'Settings:Password'), |
|
| 47 | - 'status' => 0 === (int) $response['count'], |
|
| 48 | - ]; |
|
| 49 | - } elseif ($response['error']) { |
|
| 50 | - throw new \App\Exceptions\AppException('Error with response |' . $response['error']); |
|
| 51 | - } |
|
| 52 | - } else { |
|
| 53 | - throw new \App\Exceptions\AppException('Error with connection |' . $request->getReasonPhrase()); |
|
| 54 | - } |
|
| 55 | - } catch (\Exception $ex) { |
|
| 56 | - \App\Log::error($ex->getMessage(), __CLASS__); |
|
| 57 | - } |
|
| 58 | - return $status; |
|
| 59 | - } |
|
| 25 | + /** {@inheritdoc} */ |
|
| 26 | + public function check(string $password): array |
|
| 27 | + { |
|
| 28 | + $status = ['status' => true]; |
|
| 29 | + $product = \App\YetiForce\Register::getProduct('YetiForcePassword'); |
|
| 30 | + if (empty($password) || !\App\RequestUtil::isNetConnection() || empty($product['params']['login']) || empty($product['params']['pass'])) { |
|
| 31 | + return $status; |
|
| 32 | + } |
|
| 33 | + try { |
|
| 34 | + $url = 'https://passwords.yetiforce.eu/pwned'; |
|
| 35 | + \App\Log::beginProfile("POST|YetiForce::check|{$url}", __NAMESPACE__); |
|
| 36 | + $request = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request( |
|
| 37 | + 'POST', |
|
| 38 | + $url, |
|
| 39 | + ['json' => ['sha1' => sha1($password)], 'timeout' => 2, 'http_errors' => false, 'auth' => [$product['params']['login'], $product['params']['pass']], 'headers' => ['InsKey' => \App\YetiForce\Register::getInstanceKey()]] |
|
| 40 | + ); |
|
| 41 | + \App\Log::endProfile("POST|YetiForce::check|{$url}", __NAMESPACE__); |
|
| 42 | + if (200 === $request->getStatusCode()) { |
|
| 43 | + $response = \App\Json::decode($request->getBody()); |
|
| 44 | + if (isset($response['count'])) { |
|
| 45 | + $status = [ |
|
| 46 | + 'message' => \App\Language::translate('LBL_ALERT_PWNED_PASSWORD', 'Settings:Password'), |
|
| 47 | + 'status' => 0 === (int) $response['count'], |
|
| 48 | + ]; |
|
| 49 | + } elseif ($response['error']) { |
|
| 50 | + throw new \App\Exceptions\AppException('Error with response |' . $response['error']); |
|
| 51 | + } |
|
| 52 | + } else { |
|
| 53 | + throw new \App\Exceptions\AppException('Error with connection |' . $request->getReasonPhrase()); |
|
| 54 | + } |
|
| 55 | + } catch (\Exception $ex) { |
|
| 56 | + \App\Log::error($ex->getMessage(), __CLASS__); |
|
| 57 | + } |
|
| 58 | + return $status; |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | - /** {@inheritdoc} */ |
|
| 62 | - public function isActive(): bool |
|
| 63 | - { |
|
| 64 | - return \App\YetiForce\Shop::check('YetiForcePassword'); |
|
| 65 | - } |
|
| 61 | + /** {@inheritdoc} */ |
|
| 62 | + public function isActive(): bool |
|
| 63 | + { |
|
| 64 | + return \App\YetiForce\Shop::check('YetiForcePassword'); |
|
| 65 | + } |
|
| 66 | 66 | } |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | $request = (new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->request( |
| 37 | 37 | 'POST', |
| 38 | 38 | $url, |
| 39 | - ['json' => ['sha1' => sha1($password)], 'timeout' => 2, 'http_errors' => false, 'auth' => [$product['params']['login'], $product['params']['pass']], 'headers' => ['InsKey' => \App\YetiForce\Register::getInstanceKey()]] |
|
| 39 | + ['json' => ['sha1' => sha1($password)], 'timeout' => 2, 'http_errors' => false, 'auth' => [$product['params']['login'], $product['params']['pass']], 'headers' => ['InsKey' => \App\YetiForce\Register::getInstanceKey()]] |
|
| 40 | 40 | ); |
| 41 | 41 | \App\Log::endProfile("POST|YetiForce::check|{$url}", __NAMESPACE__); |
| 42 | 42 | if (200 === $request->getStatusCode()) { |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | $fileName = $item->getBasename('.php'); |
| 43 | 43 | $className = "\\App\\Extension\\PwnedPassword\\$fileName"; |
| 44 | 44 | $instance = new $className(); |
| 45 | - if($instance->isActive()){ |
|
| 45 | + if ($instance->isActive()) { |
|
| 46 | 46 | $return[$fileName] = $instance; |
| 47 | 47 | } |
| 48 | 48 | } |