handle info-site

@access private
@return null
193609
private function handleINFO()
    {
        header('Content-Type: text/html');

        $css = '
body {
    margin: 0px;
    padding: 10px;
    font-family: sans-serif;
}
#header {
    background-color: #339900;
    color: #FFFFFF;
    padding: 5px 10px;
    margin: -10px;
}
h1 {
    font-size: xx-large;
    color: #CCFF99;
}
#header p {
    font-size: large;
}

dt {
    margin-top: 1em;
}

.description {
    padding-left: 1.5em;
    margin-bottom: 1.5em;
}

a:link {
    color: #006600;
}

a:visited {
    color: #030;
}

a:hover {
    color: #003300;
}
';

        echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>' . $this->wsdlclassname . ' WebService</title>
<meta name="generator" content="PEAR::Services_Webservice" />
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css">
' . $css . '</style> </head> <body> <div id="header">'.
        '<h1>' . $this->wsdlclassname . '</h1> <p>' .
        htmlspecialchars($this->description)
        . '</p></div><p>The following operations are supported. ' .
        'For a formal definition, please review the <a href="' .
        htmlentities($this->getSelfUrl()) . '?WSDL">Service Description</a>.</p>
<ul>';

        foreach ($this->wsdlStruct[$this->wsdlclassname]['method'] as $methodName => $method) {
            $paramValue = array();
            foreach ($method['var'] as $methodVars) {
                if (isset($methodVars['param'])) {
                    $paramValue[] = $methodVars['type']
                                     . str_repeat('[]', $methodVars['length']);
                }
            }
            $returnValue = array();
            foreach ($method['var'] as $methodVars) {
                if (isset($methodVars['return'])) {
                    $returnValue[] = $methodVars['type']
                                     . str_repeat('[]', $methodVars['length']);
                }
            }
            echo sprintf(
                '<li><samp><var class="returnedValue">%s</var> '
                . '<b class="functionName">%s</b>'
                . '( <var class="parameter">%s</var> )</samp>%s</li>',
                implode(',', $returnValue),
                $methodName,
                implode(
                    '</var> , <var class="parameter">',
                    $paramValue
                ), ((empty($method['description'])) ?
                    '' : ('<br /><span class="description">'
                    . htmlspecialchars($method['description']) . '</span>'))
            );
        }
        echo '</ul>
<p><a href="' . htmlentities($this->getSelfUrl()) . '?DISCO">DISCO</a> makes it possible for clients to reflect against endpoints to discover services and their associated <acronym title="Web Service Description Language">WSDL</acronym> documents.</p>';

        if ($this->warningNamespace == true
            || $this->namespace == 'http://example.org/'
        ) {
            echo '
<p class="warning"><strong>This web service is using http://example.org/ as its default namespace.<br />
Recommendation: Change the default namespace before the <acronym title="eXtensible Markup Language">XML</acronym> Web service is made public.</strong></p>

<p>Each XML Web service needs a unique namespace in order for client applications to distinguish it from other services on the Web. http://example.org/ is available for XML Web services that are under development, but published XML Web services should use a more permanent namespace.<br />
Your XML Web service should be identified by a namespace that you control. For example, you can use your company`s Internet domain name as part of the namespace. Although many XML Web service namespaces look like <acronym title="Uniform Resource Locators">URLs</acronym>, they need not point to actual resources on the Web. (XML Web service namespaces are <acronym title="Uniform Resouce Identifiers">URIs</acronym>.)</p>

<p>For more details on XML namespaces, see the <acronym title="World Wide Web Consortium">W3C</acronym> recommendation on <a href="http://www.w3.org/TR/REC-xml-names/">Namespaces in XML</a>.<br />
For more details on <acronym title="Web Service Description Language">WSDL</acronym>, see the <a href="http://www.w3.org/TR/wsdl">WSDL Specification</a>.<br />
For more details on URIs, see <a href="http://www.ietf.org/rfc/rfc2396.txt"><acronym title="Request For Comment">RFC</acronym> 2396</a>.</p>
<p><small>Powered by PEAR <a href="http://pear.php.net/">http://pear.php.net</a></small></p>
';

        }
        echo '</body></html>';
    }
305530
public function onAfterInit()
    {
        if ($this->owner instanceof DatabaseAdmin) {
            //
            // 2016-12-16 -	This is disabled in sitetree.yml to stop users placing
            //				pages above a Site. However, during dev/build we don't
            //				want pages validated so they can be placed top-level, and
            //				then be moved underneath Site during it's
            //				requireDefaultRecords() call.
            //
			SiteTree::config()->can_be_root = true;
            return;
        }

        if ($this->owner instanceof DevelopmentAdmin ||
            $this->owner instanceof DevBuildController ||
            $this->owner instanceof DatabaseAdmin) {
            return;
        }

        $site = Multisites::inst()->getCurrentSite();
        if (!$site) {
            return;
        }

        // are we on the frontend?
        if (!$this->owner instanceof \SilverStripe\Admin\LeftAndMain) {
            $theme = $site->getSiteTheme();
            if ($theme) {
                SSViewer::set_themes([$theme, SSViewer::DEFAULT_THEME]);
            }
        }

        // Update default uploads folder to site
        $folder = $site->Folder();
        if ($folder->exists()) {
            Config::modify()->set(Upload::class, 'uploads_folder', $folder->Name);
        }
    }
730023
public function handleCustomError()
    {
        if (Config::get('app.debug', false)) {
            return null;
        }

        $theme = Theme::getActiveTheme();
        $router = new Router($theme);

        // Use the default view if no "/error" URL is found.
        if (!$router->findByUrl('/error')) {
            return View::make('cms::error');
        }

        // Route to the CMS error page.
        $controller = new CmsController($theme);
        $result = $controller->run('/error');

        // Extract content from response object
        if ($result instanceof \Symfony\Component\HttpFoundation\Response) {
            $result = $result->getContent();
        }

        return $result;
    }
167569
function dynamic_init( array $plugin_info ) {
            $this->_logger->entrance();

            $this->parse_settings( $plugin_info );

            if ( is_admin() && $this->is_theme() && $this->is_premium() && ! $this->has_active_valid_license() ) {
                $this->add_ajax_action(
                    'delete_theme_update_data',
                    array( &$this, '_delete_theme_update_data_action' )
                );
            }

            if ( ! self::is_ajax() ) {
                if ( ! $this->is_addon() || $this->is_only_premium() ) {
                    add_action(
                        ( $this->_is_network_active && fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu',
                        array( &$this, '_prepare_admin_menu' ),
                        WP_FS__LOWEST_PRIORITY
                    );
                }
            }

            if ( $this->should_stop_execution() ) {
                return;
            }

            if ( ! $this->is_registered() ) {
                if ( $this->is_anonymous() ) {
                    // If user skipped, no need to test connectivity.
                    $this->_has_api_connection = true;
                    $this->_is_on              = true;
                } else {
                    if ( ! $this->has_api_connectivity() ) {
                        if ( $this->_admin_notices->has_sticky( 'failed_connect_api_first' ) ||
                             $this->_admin_notices->has_sticky( 'failed_connect_api' )
                        ) {
                            if ( ! $this->_enable_anonymous || $this->is_premium() ) {
                                // If anonymous mode is disabled, add firewall admin-notice message.
                                add_action( 'admin_footer', array( 'Freemius', '_add_firewall_issues_javascript' ) );

                                $ajax_action_suffix = $this->_slug . ( $this->is_theme() ? ':theme' : '' );
                                add_action( "wp_ajax_fs_resolve_firewall_issues_{$ajax_action_suffix}", array(
                                    &$this,
                                    '_email_about_firewall_issue'
                                ) );

                                add_action( "wp_ajax_fs_retry_connectivity_test_{$ajax_action_suffix}", array(
                                    &$this,
                                    '_retry_connectivity_test'
                                ) );

                                /**
                                 * Currently the admin notice manager relies on the module's type and slug. The new AJAX actions manager uses module IDs, hence, consider to replace the if block above with the commented code below after adjusting the admin notices manager to work with module IDs.
                                 *
                                 * @author Vova Feldman (@svovaf)
                                 * @since  2.0.0
                                 */
                                /*$this->add_ajax_action( 'resolve_firewall_issues', array(
                                    &$this,
                                    '_email_about_firewall_issue'
                                ) );

                                $this->add_ajax_action( 'retry_connectivity_test', array(
                                    &$this,
                                    '_retry_connectivity_test'
                                ) );*/
                            }
                        }

                        return;
                    } else {
                        $this->_admin_notices->remove_sticky( array(
                            'failed_connect_api_first',
                            'failed_connect_api',
                        ) );

                        if ( $this->_anonymous_mode ) {
                            // Simulate anonymous mode.
                            $this->_is_anonymous = true;
                        }
                    }
                }
            }

            /**
             * This should be executed even if Freemius is off for the core module,
             * otherwise, the add-ons dialogbox won't work properly. This is esepcially
             * relevant when the developer decided to turn FS off for existing users.
             *
             * @author Vova Feldman (@svovaf)
             */
            if ( $this->is_user_in_admin() &&
                'plugin-information' === fs_request_get( 'tab', false ) &&
                 $this->should_use_freemius_updater_and_dialog() &&
                 (
                     ( $this->is_addon() && $this->get_slug() == fs_request_get( 'plugin', false ) ) ||
                     ( $this->has_addons() && $this->get_id() == fs_request_get( 'parent_plugin_id', false ) )
                 )
            ) {
                require_once WP_FS__DIR_INCLUDES . '/fs-plugin-info-dialog.php';

                new FS_Plugin_Info_Dialog( $this->is_addon() ? $this->get_parent_instance() : $this );
            }

            // Check if Freemius is on for the current plugin.
            // This MUST be executed after all the plugin variables has been loaded.
            if ( ! $this->is_registered() && ! $this->is_on() ) {
                return;
            }

            if ( $this->has_api_connectivity() ) {
                if ( self::is_cron() ) {
                    $this->hook_callback_to_sync_cron();
                } else if ( $this->is_user_in_admin() ) {
                    /**
                     * Schedule daily data sync cron if:
                     *
                     *  1. User opted-in (for tracking).
                     *  2. If skipped, but later upgraded (opted-in via upgrade).
                     *
                     * @author Vova Feldman (@svovaf)
                     * @since  1.1.7.3
                     *
                     */
                    if ( $this->is_registered() ) {
                        if ( ! $this->is_sync_cron_on() && $this->is_tracking_allowed() ) {
                            $this->schedule_sync_cron();
                        }
                    }

                    /**
                     * Check if requested for manual blocking background sync.
                     */
                    if ( fs_request_has( 'background_sync' ) ) {
                        $this->run_manual_sync();
                    }
                }
            }

            if ( $this->is_registered() ) {
                $this->hook_callback_to_install_sync();
            }

            if ( $this->is_addon() ) {
                if ( $this->is_parent_plugin_installed() ) {
                    // Link to parent FS.
                    $this->_parent = self::get_instance_by_id( $this->_plugin->parent_plugin_id );

                    // Get parent plugin reference.
                    $this->_parent_plugin = $this->_parent->get_plugin();
                }
            }

            if ( $this->is_user_in_admin() ) {
                if ( $this->is_addon() ) {
                    if ( ! $this->is_parent_plugin_installed() ) {
                        $parent_name = $this->get_option( $plugin_info, 'parent_name', null );

                        if ( isset( $plugin_info['parent'] ) ) {
                            $parent_name = $this->get_option( $plugin_info['parent'], 'name', null );
                        }

                        $this->_admin_notices->add(
                            ( ! empty( $parent_name ) ?
                                sprintf( $this->get_text_x_inline( '%s cannot run without %s.', 'addonX cannot run without pluginY', 'addon-x-cannot-run-without-y' ), $this->get_plugin_name(), $parent_name ) :
                                sprintf( $this->get_text_x_inline( '%s cannot run without the plugin.', 'addonX cannot run...', 'addon-x-cannot-run-without-parent' ), $this->get_plugin_name() )
                            ),
                            $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
                            'error'
                        );

                        return;
                    } else {
                        if ( $this->_parent->is_registered() && ! $this->is_registered() ) {
                            // If parent plugin activated, automatically install add-on for the user.
                            $this->_activate_addon_account( $this->_parent );
                        } else if ( ! $this->_parent->is_registered() && $this->is_registered() ) {
                            // If add-on activated and parent not, automatically install parent for the user.
                            $this->activate_parent_account( $this->_parent );
                        }

                        // @todo This should be only executed on activation. It should be migrated to register_activation_hook() together with other activation related logic.
                        if ( $this->is_premium() ) {
                            // Remove add-on download admin-notice.
                            $this->_parent->_admin_notices->remove_sticky( array(
                                'addon_plan_upgraded_' . $this->_slug,
                                'no_addon_license_' . $this->_slug,
                            ) );
                        }

//						$this->deactivate_premium_only_addon_without_license();
                    }
                }

                add_action( 'admin_init', array( &$this, '_admin_init_action' ) );

//				if ( $this->is_registered() ||
//				     $this->is_anonymous() ||
//				     $this->is_pending_activation()
//				) {
//					$this->_init_admin();
//				}
            }

            /**
             * Should be called outside `$this->is_user_in_admin()` scope
             * because the updater has some logic that needs to be executed
             * during AJAX calls.
             *
             * Currently we need to hook to the `http_request_host_is_external` filter.
             * In the future, there might be additional logic added.
             *
             * @author Vova Feldman
             * @since  1.2.1.6
             */
            if (
                $this->should_use_freemius_updater_and_dialog() &&
                (
                    $this->is_premium() ||
                    /**
                     * If not premium but the premium version is installed, also instantiate the updater so that the
                     * plugin information dialog of the premium version will have the information from the server.
                     *
                     * @author Leo Fajardo (@leorw)
                     * @since 2.2.3
                     */
                    ( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $this->premium_plugin_basename() ) ) )
                ) &&
                $this->has_release_on_freemius()
            ) {
                FS_Plugin_Updater::instance( $this );
            }

            $this->do_action( 'initiated' );

            if ( $this->_storage->prev_is_premium !== $this->_plugin->is_premium ) {
                if ( isset( $this->_storage->prev_is_premium ) ) {
                    $this->apply_filters(
                        'after_code_type_change',
                        // New code type.
                        $this->_plugin->is_premium
                    );
                } else {
                    // Set for code type for the first time.
                    $this->_storage->prev_is_premium = $this->_plugin->is_premium;
                }
            }

            if ( ! $this->is_addon() ) {
                if ( $this->is_registered() ) {
                    // Fix for upgrade from versions < 1.0.9.
                    if ( ! isset( $this->_storage->activation_timestamp ) ) {
                        $this->_storage->activation_timestamp = WP_FS__SCRIPT_START_TIME;
                    }

                    $this->do_action( 'after_init_plugin_registered' );
                } else if ( $this->is_anonymous() ) {
                    $this->do_action( 'after_init_plugin_anonymous' );
                } else if ( $this->is_pending_activation() ) {
                    $this->do_action( 'after_init_plugin_pending_activations' );
                }
            } else {
                if ( $this->is_registered() ) {
                    $this->do_action( 'after_init_addon_registered' );
                } else if ( $this->is_anonymous() ) {
                    $this->do_action( 'after_init_addon_anonymous' );
                } else if ( $this->is_pending_activation() ) {
                    $this->do_action( 'after_init_addon_pending_activations' );
                }
            }
        }
202604
public function hook_indexContent()
    {
        $this->addPageToSitemapIndex();

        $possibility = (int)GeneralUtility::getExtConf('sitemap_clearCachePossibility', 0);

        if ($possibility > 0) {
            $clearCacheChance = ceil(mt_rand(0, $possibility));
            if ($clearCacheChance == 1) {
                SitemapUtility::expire();
            }
        }
    }
17499
public function doAddSite() {
		$site = $this->owner->getNewItem('new-' . Site::class .'-0', false);
		$site->write();

		return $this->owner->redirect(
			singleton(CMSPageEditController::class)->Link("show/$site->ID")
		);
	}
1282662
protected function getCurrentSite()
    {
        if (!isset($this->data['site']) || $this->data['site'] === null) {
            return null;
        }

        return $this->siteRepository->findByIdentifier($this->data['site']);
    }
572768
public function newSiteAction(Site $site = null)
    {
        $sitePackages = $this->packageManager->getFilteredPackages('available', null, 'neos-site');
        $documentNodeTypes = $this->nodeTypeManager->getSubNodeTypes('Neos.Neos:Document', false);
        $this->view->assignMultiple([
            'sitePackages' => $sitePackages,
            'documentNodeTypes' => $documentNodeTypes,
            'site' => $site,
            'generatorServiceIsAvailable' => $this->packageManager->isPackageAvailable('Neos.SiteKickstarter')
        ]);
    }
704635
public function __HANDLER($structure = null)
    {
        $this->view('www/index')
            ->table(new Table($structure))
            ->structures($structure)
            ->title('Выгрузка материалов');
    }
402733
protected function controlAccessPage()
    {
        if (empty($this->data_page['status']) && !$this->access('page')) {
            $this->outputHttpStatus(403);
        }

        if ($this->data_page['store_id'] != $this->store_id) {
            $this->outputHttpStatus(404);
        }
    }
1029347
public function handle()
    {
        chdir(public_path());

        $this->line("<info>Zilf development server started:</info> <http://{$this->host()}:{$this->port()}>");

        passthru($this->serverCommand(), $status);

        return $status;
    }
1216593
def set_info_page(self):
        """"""
        if self.info_page is not None:
            self.infowidget.setHtml(
                self.info_page,
                QUrl.fromLocalFile(self.css_path)
            )
728764
public function stat_sysinfo()
    {
        if (!$this->is_loggedin) {
            return false;
        }

        $response = $this->exec_curl('/api/s/' . $this->site . '/stat/sysinfo');

        return $this->process_response($response);
    }
388486
public function handle()
    {
        $file = $this->getFileName();
        $path = $this->getPath();
        $filePath = $this->getFilePath();
        $eol = PHP_EOL;

        $this->generator->makeGitIgnore($file, $path);

        if (file_exists($this->getFilePath())) {
            $this->error(PHP_EOL . 'Wordpress is already down.' . PHP_EOL);
        } else {
            $this->generator->makeMaintenanceFile($filePath);
            $this->info("{$eol}Wordpress set to maintenance mode. Either run \"artisan wp:up\" to {$eol} bring the site back up or manually delete {$eol} {$filePath}.");
        }
    }
1067576
public function handleMaintenanceMode()
    {
        // Authorize logged in admins on the fly
        if ($this->doesCurrentUserHaveAccess())
        {
            return true;
        }

        if (Craft::$app->request->isSiteRequest && $this->settings->maintenanceModeEnabled)
        {
            $requestingIp   = $this->getRequestingIp();
            $authorizedIps  = $this->settings->maintenanceModeAuthorizedIps;
            $maintenanceUrl = $this->settings->maintenanceModePageUrl;

            if ($maintenanceUrl == Craft::$app->request->getUrl())
            {
                return true;
            }

            if (empty($authorizedIps))
            {
                $this->forceRedirect($maintenanceUrl);
            }

            if (is_array($authorizedIps) && count($authorizedIps))
            {
                if (in_array($requestingIp, $authorizedIps))
                {
                    return true;
                }

                foreach ($authorizedIps as $authorizedIp)
                {
                    $authorizedIp = str_replace('*', '', $authorizedIp);

                    if (stripos($requestingIp, $authorizedIp) === 0)
                    {
                        return true;
                    }
                }

                $this->forceRedirect($maintenanceUrl);
            }
        }
    }
1169636
public function handleRequest(): void
	{
		global $save, $restore;

		$request = $this->getRequest();
		if ((!empty($save) || !empty($restore)) && $request->isPost() && check_bitrix_sessid()) {
			if (!empty($restore)) {
				// Restore defaults
				Option::delete(ADMIN_MODULE_NAME);
				CAdminMessage::showMessage([
					'MESSAGE' => Loc::getMessage('REFERENCES_OPTIONS_RESTORED'),
					'TYPE' => 'OK',
				]);
			} else {
				try {
					// Save options
					foreach ($this->options->getFields() as $id => $opt) {
						switch ($opt['type']) {
							case 'checkbox':
								$value = $request->getPost($id) ? true : false;
								break;

							case 'number':
								$value = (int)$request->getPost($id);
								break;

							case 'text':
							default:
								$value = $request->getPost($id);
								break;
						}

						$event = new Event(ADMIN_MODULE_NAME, 'OnBeforeSetOption_' . $id, ['value' => &$value]);
						$event->send();

						$event = new Event(ADMIN_MODULE_NAME, 'OnBeforeSetOption', ['value' => &$value, 'name' => $id]);
						$event->send();

						Option::set(ADMIN_MODULE_NAME, $id, $value);
					}

					$event = new Event(ADMIN_MODULE_NAME, 'OnAfterSaveOptions');
					$event->send();

					CAdminMessage::showMessage([
						'MESSAGE' => Loc::getMessage('REFERENCES_OPTIONS_SAVED'),
						'TYPE' => 'OK',
					]);
				} catch (\Exception $exception) {
					CAdminMessage::showMessage($exception->getMessage());
				}
			}
		}
	}
199993
public function deleteSiteByIdAction()
    {
        $translator = $this->getServiceLocator()->get('translator');
        $request = $this->getRequest();
        $domainId = null;
        $success = 0;
        $textTitle = 'tr_meliscms_tool_site';
        $textMessage = '';
        
        $eventDatas = array();
        $this->getEventManager()->trigger('meliscms_site_delete_by_id_start', $this, $eventDatas);
        
        if($request->isPost()) {

            $domainTable = $this->getServiceLocator()->get('MelisEngineTableSiteDomain');
            $site404Table = $this->getServiceLocator()->get('MelisEngineTableSite404');
            
            $siteID = (int) $request->getPost('siteid');
            $siteEnv = $request->getPost('env');
            $site404PageId = $request->getPost('site404Page');
            
            $domainData = $domainTable->getDataBySiteIdAndEnv($siteID,$siteEnv);
            $domainData = $domainData->current();
            
            if($domainData)
            {
                $domainId = $domainData->sdom_id;
                
                $domainTable->deleteByField('sdom_id', $domainId);
                
                $success = 1;
                $textMessage = 'tr_meliscms_tool_site_delete_env_success';
            }
            else
            {
                $textMessage = 'tr_meliscms_tool_site_delete_env_failed';
            }
        }
        
        $response = array(
            'success' => $success,
            'textTitle' => $textTitle,
            'textMessage' => $textMessage,
        );
        
        $this->getEventManager()->trigger('meliscms_site_delete_by_id_end', $this, array_merge($response, array('typeCode' => 'CMS_SITE_ENV_DELETE', 'itemId' => $domainId)));
        
        return new JsonModel($response);
    }