<commit_before><?php
/**
 *
 * @author <NAME> <<EMAIL>>
 * @created 24/11/13 07:40 PM
 */

namespace auth\components;

use yii\web\User as BaseUser;
use yii\db\Expression;

/**
 * User is the class for the "user" application component that manages the user authentication status.
 *
 * @property \auth\models\User $identity The identity object associated with the currently logged user. Null
 * is returned if the user is not logged in (not authenticated).
 *
 * @author <NAME> <<EMAIL>>
 */
class User extends BaseUser
{
	/**
	 * @inheritdoc
	 */
	public $identityClass = '\auth\models\User';

	/**
	 * @inheritdoc
	 */
	public $enableAutoLogin = true;

	/**
	 * @inheritdoc
	 */
	public $loginUrl = ['/auth/default/login'];

	/**
	 * @inheritdoc
	 */
	protected function afterLogin($identity, $cookieBased)
	{
		parent::afterLogin($identity, $cookieBased);
		$this->identity->setScenario(self::EVENT_AFTER_LOGIN);
		$this->identity->setAttribute('last_visit_time', new Expression('CURRENT_TIMESTAMP'));
		// $this->identity->setAttribute('login_ip', ip2long(\Yii::$app->getRequest()->getUserIP()));
		$this->identity->save(false);
	}

	public function getIsSuperAdmin()
	{
		return $this->identity->getIsSuperAdmin();
	}
}<commit_msg>CheckAccess function now returns always true for SuperAdmin users.<commit_after><?php
/**
 *
 * @author <NAME> <<EMAIL>>
 * @created 24/11/13 07:40 PM
 */

namespace auth\components;

use yii\web\User as BaseUser;
use yii\db\Expression;

/**
 * User is the class for the "user" application component that manages the user authentication status.
 *
 * @property \auth\models\User $identity The identity object associated with the currently logged user. Null
 * is returned if the user is not logged in (not authenticated).
 *
 * @author <NAME> <<EMAIL>>
 */
class User extends BaseUser
{
	/**
	 * @inheritdoc
	 */
	public $identityClass = '\auth\models\User';

	/**
	 * @inheritdoc
	 */
	public $enableAutoLogin = true;

	/**
	 * @inheritdoc
	 */
	public $loginUrl = ['/auth/default/login'];

	/**
	 * @inheritdoc
	 */
	protected function afterLogin($identity, $cookieBased)
	{
		parent::afterLogin($identity, $cookieBased);
		$this->identity->setScenario(self::EVENT_AFTER_LOGIN);
		$this->identity->setAttribute('last_visit_time', new Expression('CURRENT_TIMESTAMP'));
		// $this->identity->setAttribute('login_ip', ip2long(\Yii::$app->getRequest()->getUserIP()));
		$this->identity->save(false);
	}

	public function getIsSuperAdmin()
	{
		return $this->identity->getIsSuperAdmin();
	}

	public function checkAccess($operation, $params = [], $allowCaching = true)
	{
		// Always return true when SuperAdmin user
		if ($this->getIsSuperAdmin()) {
			return true;
		}
		return parent::checkAccess($operation, $params, $allowCaching);
	}
}
{'fraction_non_alphanumeric': 0.15717375630857966, 'fraction_numerical': 0.007930785868781542, 'mean_word_length': 4.336538461538462, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 40, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3262675', 'n_tokens_mistral': 910, 'n_tokens_neox': 855, 'n_words': 214}