Zwraca czy dozwolone na ACL
@param array $params
@return boolean
481793
public function aclAllowed(array $params)
    {
        //łączenie parametrów z requestem Front Controllera
        $urlParams = array_merge(\Mmi\App\FrontController::getInstance()->getRequest()->toArray(), $params);
        //zwrot z ACL
        return \App\Registry::$acl->isAllowed(\App\Registry::$auth->getRoles(), strtolower($urlParams['module'] . ':' . $urlParams['controller'] . ':' . $urlParams['action']));
    }
387946
public function validate(array $params = [])
    {
        $name = array_get($params, 'name');
        if (is_null($name) or $name != config('antares/logger::operations.login')) {
            return false;
        }
        $params = array_merge($params, $this->getClientParams());
        try {
            $model = $this->model->newQuery()
                    ->where('user_id', $params['user_id'])
                    ->where('ip_address', $params['ip_address'])
                    ->where('browser', $params['browser'])
                    ->orderBy('created_at', 'desc')
                    ->firstOrFail();
            $model->touch();
        } catch (Exception $ex) {
            $this->saveNewDevice($params);
        }
        if (isset($model) and ! is_null($model) and ( $model->ip_address != $params['ip_address'] or $model->browser != $params['browser'])) {
            $this->saveNewDevice($params);
            $user = user();
            $this->dispatcher->fire('new-device-detect-notification', ['variables' => ['user' => $user, 'params' => $params, 'date' => date('Y-m-d', time()), 'time' => date("H:i", time())], 'recipients' => [$user]]);
        }
    }
225880
public function checkParams(array $params)
    {
        foreach ($params as $p) {
            $config = config('kregel.warden.models');
            $configKeys = array_keys($config);
//            dd($p, $config, $configKeys, !in_array($p, $config), !in_array($p, $configKeys), !in_array($p, $configKeys) && !in_array($p, $config));
            if (in_array($p, $configKeys) && in_array($p, $config)) {
                throw new \Exception('You\'re attempting to use a value that isn\'t in the config! '.print_r($configKeys, true));
            }
        }
    }
814422
protected function ensureAccess($params = [])
    {
        if (!isset($this->checkAccess))
            return;

        $params['action'] = $this;

        if (call_user_func($this->checkAccess, $params))
            return;

        $user = \Yii::$app->user;

        if ($user->getIsGuest())
            $user->loginRequired();
        else
            throw new ForbiddenHttpException(\Yii::t(
                Constants::MSG_CATEGORY_NAME,
                'You are not allowed to perform this action.'
            ));

    }
1124552
public function delete()
    {
        //usuwanie meta
        if (!parent::delete()) {
            return false;
        }
        //plik jest ciągle potrzebny (ma linki)
        if (0 != (new CmsFileQuery)->whereName()->equals($this->name)->count()) {
            return true;
        }
        //kasowanie z systemu plików
        (new \Cms\Model\FileSystemModel($this->name))->unlink();
        //usuwanie rekordu
        return true;
    }
153032
public function routeParams($params = '')
    {
        if (!empty($params)) {
            // Set the property
            if (is_a($params, 'stdClass')) {
                $this->routeParams = $params;
            } else {
                return false;
            }
        } else {
            // Get the property
            return $this->routeParams;
        }
    }
562926
public function select($params/*, ...*/)
    {
        $rel = $this->currentOrClone();
        
        $params = func_get_args();
        if (is_array($params[0])) {
            $params = array_shift($params);
        }
        $rel->select->columns($params);
        return $rel;
    }
1048038
public function hasMany(array $params)
    {
        foreach ($params as $param) {
            if (!$this->has($param)) {
                return false;
            }
        }

        return true;
    }
849738
public function execute (Array $params)
    {
        try {
            // パラメータバリデート
            $this->_validateParameters($params);

            // スケルトンをコピーする
            $cmd   = GARNET.DS.'Command';
            $model = GARNET.DS.'Model';
            $file_name = ucfirst($params[0]).'.php';
            
            // モデル
            $data = file_get_contents($cmd.DS.'Sekeleton'.DS.'ModelSkeleton.php');
            $data = str_replace('${model}', $params[0]);
            $data = str_replace('${app}', APP);
            file_put_contents($model.DS.$params[0].'Model.php', $data);

            // クエリ
            $data = file_get_contents($cmd.DS.'Sekeleton'.DS.'QuerySkeleton.php');
            $data = str_replace('${query}', $params[0]);
            $data = str_replace('${app}', APP);
            file_put_contents($model.DS.'Query'.DS.$params[0].'Query.php', $data);

            // カラム
            $data = file_get_contents($cmd.DS.'Sekeleton'.DS.'ColumnSkeleton.php');
            $data = str_replace('${column}', $params[0]);
            $data = str_replace('${app}', APP);
            file_put_contents($model.DS.'Column'.DS.$params[0].'Column.php', $data);
        
        } catch (\Exception $e) {
            $this->errorLog($e->getMessage());
        }
    }
531907
public function insert($params)
    {
        $query = $this->query->insert($params);
        $prepare = $this->db->prepare($query);
        if ($prepare->execute()) {
            $last = $this->db->lastInsertId();
            $prepare->closeCursor();

            return $last;
        } else {
            return false;
        }
    }
1010706
public function headMeta(array $params = [], $replace = false, $conditional = '')
    {
        //jeśli brak parametrów - wyjście
        if (empty($params)) {
            return $this;
        }
        //warunek
        $params['conditional'] = $conditional;
        if (!array_key_exists(reset($params), $this->_data) || $replace) {
            //wstawienie pod danym kluczem
            $this->_data[reset($params)] = $params;
        }
        return '';
    }
563235
private function commands($params)
    {
        if (is_array($params)) {
            $param = '';
            $i = 0;
            $arrCount = count($params);

            foreach ($params as $key => $value) {
                $param .= $value;

                $comma = ($i < $arrCount - 1) ? ',' : '';

                $param .= $comma;

                $i++;
            }
        }

        if (is_string($params)) {
            $param = $params;
        }

        return $param;
    }
31593
protected function getAccessTokenRequest(array $params)
    {
        $request = parent::getAccessTokenRequest($params);
        $uri = $request->getUri()
            ->withUserInfo($this->clientId, $this->clientSecret);

        return $request->withUri($uri);
    }
43855
public function verifyRequest(array $params)
    {
        if ($this->apiSecret === null) {
            // Secret is required
            throw new Exception('API secret is missing');
        }

        // Ensure shop, timestamp, and HMAC are in the params
        if (array_key_exists('shop', $params)
            && array_key_exists('timestamp', $params)
            && array_key_exists('hmac', $params)
        ) {
            // Grab the HMAC, remove it from the params, then sort the params for hashing
            $hmac = $params['hmac'];
            unset($params['hmac']);
            ksort($params);

            // Encode and hash the params (without HMAC), add the API secret, and compare to the HMAC from params
            return $hmac === hash_hmac('sha256', urldecode(http_build_query($params)), $this->apiSecret);
        }

        // Not valid
        return false;
    }
198021
public function beforeSave()
    {
        if ($this->getElement('password')->getValue() != $this->getElement('confirmPassword')->getValue()) {
            $this->getElement('confirmPassword')->addError('form.register.confirmPassword.error');
            return false;
        }
        //opcja zmiany (w tym przypadku ustawienia nowego) hasłą
        $this->getRecord()->password = \Cms\Model\Auth::getSaltedPasswordHash($this->getElement('password')->getValue());
        //domyślny język
        $this->getRecord()->lang = \App\Registry::$translate->getLocale();
        return true;
    }
1216852
protected function _sign($params = array()) {
    $query = "";
    if (isset($params['sign_mode']) && $params['sign_mode'] == 1) {
      unset($params['items']);
    }
    if (is_array($params) && !empty($params)) {
      ksort($params);
      $query = $this->_buildQuery($params);
    }
    return md5($query . $this->clientSecret);
  }
628697
public function verifyCallbackRequest(array $params)
    {
        return $this->signatureCallback
            ->setOrderId(array_get($params, 'Order_ID'))
            ->setStatus(array_get($params, 'Status'))
            ->setFields(array_except($params, ['Order_ID', 'Status', 'Signature']))
            ->setPassword($this->getPassword())
            ->verify(array_get($params, 'Signature'));
    }