Untitled

mail@pastecode.io avatar
unknown
php
2 years ago
2.2 kB
1
Indexable
Never
<?php

namespace yii\web;

use Yii;
use yii\base\InlineAction;
use yii\helpers\Url;
use multebox\models\search\MulteModel;

/**
 * Controller is the base class of web controllers.
 *
 * For more details and usage information on Controller, see the [guide article on controllers](guide:structure-controllers).
 */
class YiiController extends \yii\web\Controller
{

	  /**
     * Redirects the browser to the specified URL.
     * This method is a shortcut to [[Response::redirect()]].
     *
     * You can use it in an action by returning the [[Response]] directly:
     *
     * ```php
     * // stop executing this action and redirect to login page
     * return $this->redirect(['login']);
     * ```
     *
     * @param string|array $url the URL to be redirected to. This can be in one of the following formats:
     *
     * - a string representing a URL (e.g. "http://example.com")
     * - a string representing a URL alias (e.g. "@example.com")
     * - an array in the format of `[$route, ...name-value pairs...]` (e.g. `['site/index', 'ref' => 1]`)
     *   [[Url::to()]] will be used to convert the array into a URL.
     *
     * Any relative URL that starts with a single forward slash "/" will be converted
     * into an absolute one by prepending it with the host info of the current request.
     *
     * @param int $statusCode the HTTP status code. Defaults to 302.
     * See <https://tools.ietf.org/html/rfc2616#section-10>
     * for details about HTTP status code
     * @return Response the current response object
	 */
  
    public function beforeAction($action)
    {
        parent::beforeAction($action);

		if(basename(Yii::getAlias('@app')) == 'multeback')
		{
			return true;
		}

		$baseurl = MulteModel::getCleanBase();
		
		/**
		 * Redirects the browser to the home page.
		 *
		 * You can use this method in an action by returning the [[Response]] directly:
		 *
		 * ```php
		 * // stop executing this action and redirect to home page
		 * return $this->goHome();
		 * ```
		 *
		 * @return Response the current response object
		 */

		if(!isset($_SESSION['INVALIDLIC']))
		{
            return true;
		}
		
    }
}