Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace app\models\users; use app\models\rbac\Security; use yii\db\ActiveQuery; u..

Decoded Output download

<?php 
namespace app\models\users; use app\models\rbac\Security; use yii\db\ActiveQuery; use yii\db\Query; use yii\helpers\ArrayHelper; class UsersQuery extends ActiveQuery { public function active() { return $this->andWhere("[[active]]=1"); } public function administrators() { return $this->andWhere([Users::tableName() . ".id" => ArrayHelper::getColumn(array_filter(Users::getEntities(), function (Users $user) { return in_array(Groups::USER_ADMIN, ArrayHelper::getColumn(Security::getInstance()->getUserGroups($user), "role")); }), "id")]); } public function editors() { return $this->andWhere([Users::tableName() . ".id" => ArrayHelper::getColumn(array_filter(Users::getEntities(), function (Users $user) { goto vD8d4;  
D5nqY: UyTjP: goto Imx8H; Imx8H: return in_array(Groups::USER_EDITOR, ArrayHelper::getColumn(Security::getInstance()->getUserGroups($user), "role")); goto W0sEA; KfTl7: return true; goto D5nqY; e4ZCK: S30WT: goto ABZOp; vD8d4: if (!empty(Security::getInstance()->getUserGroups($user))) { goto S30WT; } goto hRgEc; ABZOp: if (!(!\Yii::$app->user->identity->hasRight("system.users.administrators.controller") && \Yii::$app->user->identity->roles[\app\models\users\Groups::USER_ADMIN] && $user->id === \Yii::$app->user->id)) { goto UyTjP; } goto KfTl7; hRgEc: return true; goto e4ZCK; W0sEA: }), "id")]); } public function students() { $groupId = Groups::getStudentGroupId(); return $this->andWhere([Users::tableName() . ".id" => ArrayHelper::getColumn(array_filter(Users::getEntities(), function (Users $user) use($groupId) { return in_array($groupId, ArrayHelper::getColumn(Security::getInstance()->getUserGroups($user), "id")); }), "id")]); } public function invited() { $groupId = Groups::getInvitedGroupId(); return $this->andWhere([Users::tableName() . ".id" => ArrayHelper::getColumn(array_filter(Users::getEntities(), function (Users $user) use($groupId) { return in_array($groupId, ArrayHelper::getColumn(Security::getInstance()->getUserGroups($user), "id")); }), "id")]); } public function entrants() { $groupId = Groups::getEntrantGroupId(); return $this->andWhere([Users::tableName() . ".id" => ArrayHelper::getColumn(array_filter(Users::getEntities(), function (Users $user) use($groupId) { return in_array($groupId, ArrayHelper::getColumn(Security::getInstance()->getUserGroups($user), "id")); }), "id")]); } } ?>

Did this file decode correctly?

Original Code

<?php
namespace app\models\users; use app\models\rbac\Security; use yii\db\ActiveQuery; use yii\db\Query; use yii\helpers\ArrayHelper; class UsersQuery extends ActiveQuery { public function active() { return $this->andWhere("\133\x5b\x61\x63\x74\151\166\x65\x5d\x5d\x3d\x31"); } public function administrators() { return $this->andWhere([Users::tableName() . "\56\x69\x64" => ArrayHelper::getColumn(array_filter(Users::getEntities(), function (Users $user) { return in_array(Groups::USER_ADMIN, ArrayHelper::getColumn(Security::getInstance()->getUserGroups($user), "\x72\157\x6c\145")); }), "\x69\144")]); } public function editors() { return $this->andWhere([Users::tableName() . "\x2e\151\x64" => ArrayHelper::getColumn(array_filter(Users::getEntities(), function (Users $user) { goto vD8d4; 
D5nqY: UyTjP: goto Imx8H; Imx8H: return in_array(Groups::USER_EDITOR, ArrayHelper::getColumn(Security::getInstance()->getUserGroups($user), "\x72\x6f\154\x65")); goto W0sEA; KfTl7: return true; goto D5nqY; e4ZCK: S30WT: goto ABZOp; vD8d4: if (!empty(Security::getInstance()->getUserGroups($user))) { goto S30WT; } goto hRgEc; ABZOp: if (!(!\Yii::$app->user->identity->hasRight("\163\171\163\164\x65\x6d\56\x75\163\x65\162\163\x2e\141\144\155\x69\156\x69\163\x74\162\x61\x74\x6f\x72\163\x2e\x63\x6f\x6e\164\x72\157\154\154\x65\x72") && \Yii::$app->user->identity->roles[\app\models\users\Groups::USER_ADMIN] && $user->id === \Yii::$app->user->id)) { goto UyTjP; } goto KfTl7; hRgEc: return true; goto e4ZCK; W0sEA: }), "\151\144")]); } public function students() { $groupId = Groups::getStudentGroupId(); return $this->andWhere([Users::tableName() . "\56\151\x64" => ArrayHelper::getColumn(array_filter(Users::getEntities(), function (Users $user) use($groupId) { return in_array($groupId, ArrayHelper::getColumn(Security::getInstance()->getUserGroups($user), "\x69\x64")); }), "\x69\144")]); } public function invited() { $groupId = Groups::getInvitedGroupId(); return $this->andWhere([Users::tableName() . "\56\x69\144" => ArrayHelper::getColumn(array_filter(Users::getEntities(), function (Users $user) use($groupId) { return in_array($groupId, ArrayHelper::getColumn(Security::getInstance()->getUserGroups($user), "\151\144")); }), "\x69\144")]); } public function entrants() { $groupId = Groups::getEntrantGroupId(); return $this->andWhere([Users::tableName() . "\56\x69\x64" => ArrayHelper::getColumn(array_filter(Users::getEntities(), function (Users $user) use($groupId) { return in_array($groupId, ArrayHelper::getColumn(Security::getInstance()->getUserGroups($user), "\151\144")); }), "\x69\x64")]); } }

Function Calls

None

Variables

None

Stats

MD5 66eb05831405b0e30bea88fdf91d42eb
Eval Count 0
Decode Time 87 ms