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 miniorangedev\craftsinglesignon; use miniorangedev\craftsinglesign..
Decoded Output download
<?php
namespace miniorangedev\craftsinglesignon;
use miniorangedev\craftsinglesignon\services\App as AppService;
use miniorangedev\craftsinglesignon\variables\CraftsinglesignonVariable;
use miniorangedev\craftsinglesignon\twigextensions\CraftsinglesignonTwigExtension;
use miniorangedev\craftsinglesignon\models\Settings;
use miniorangedev\craftsinglesignon\utilities\Config as ConfigUtility;
use miniorangedev\craftsinglesignon\widgets\Settings as SettingsWidget;
use miniorangedev\craftsinglesignon\controllers\ResourcesController;
use craft\elements\User;
use Craft;
use craft\base\Plugin;
use craft\services\Plugins;
use craft\events\PluginEvent;
use craft\web\UrlManager;
use craft\services\Fields;
use craft\services\Utilities;
use craft\web\twig\variables\CraftVariable;
use craft\services\Dashboard;
use craft\events\RegisterComponentTypesEvent;
use craft\events\RegisterUrlRulesEvent;
use craft\helpers\UrlHelper;
use yii\base\Event;
class Craftsinglesignon extends Plugin
{
public static Plugin $plugin;
public string $schemaVersion = "1.0.0";
public bool $hasCpSettings = true;
public bool $hasCpSection = true;
public function init() : void
{
parent::init();
self::$plugin = $this;
Craft::$app->view->registerTwigExtension(new CraftsinglesignonTwigExtension());
Event::on(UrlManager::class, UrlManager::EVENT_REGISTER_SITE_URL_RULES, function (RegisterUrlRulesEvent $aF) {
$ma = ResourcesController::actionDatadb("oauthsettings");
if (!(isset($ma["callback_url"]) && isset(explode(UrlHelper::siteUrl(), $ma["callback_url"])[1]))) {
goto J_;
}
$DK = explode(UrlHelper::siteUrl(), $ma["callback_url"])[1];
$aF->rules[$DK] = "craft-single-sign-on/login/callback";
J_:
$aF->rules["mologin/login"] = "craft-single-sign-on/login";
$aF->rules["mologin/callback"] = "craft-single-sign-on/login/callback";
$aF->rules["mosinglesignon/create"] = "craft-single-sign-on/settings/create";
$aF->rules["mosinglesignon/check"] = "craft-single-sign-on/settings/check";
$aF->rules["mosinglesignon/delete"] = "craft-single-sign-on/settings/delete";
$aF->rules["mosinglesignon/issuer"] = "craft-single-sign-on/method/saml";
$aF->rules["mosinglesignon/callback"] = "craft-single-sign-on/method/callback";
$aF->rules["mosinglesignon/samllogin"] = "craft-single-sign-on/method/samllogin";
});
Event::on(UrlManager::class, UrlManager::EVENT_REGISTER_CP_URL_RULES, [self::class, "onRegisterCpUrlRules"], function (RegisterUrlRulesEvent $aF) {
});
Event::on(Dashboard::class, Dashboard::EVENT_REGISTER_WIDGET_TYPES, function (RegisterComponentTypesEvent $aF) {
$aF->types[] = SettingsWidget::class;
});
Event::on(CraftVariable::class, CraftVariable::EVENT_INIT, function (Event $aF) {
$PZ = $aF->sender;
$PZ->set("craftsinglesignon", CraftsinglesignonVariable::class);
});
Event::on(Plugins::class, Plugins::EVENT_AFTER_INSTALL_PLUGIN, function (PluginEvent $aF) {
if (!($aF->plugin === $this)) {
goto uM;
}
uM:
});
Craft::info(Craft::t("craft-single-sign-on", "{name} plugin loaded", ["name" => $this->name]), __METHOD__);
}
protected function createSettingsModel() : ?craft\base\Model
{
return new Settings();
}
protected function settingsHtml() : string
{
return Craft::$app->view->renderTemplate("craft-single-sign-on/settings", ["settings" => Craft::$app->getResponse()->redirect(UrlHelper::cpUrl("craft-single-sign-on"))->send()]);
}
public static function onRegisterCpUrlRules(RegisterUrlRulesEvent $aF)
{
if (Craft::$app->getUser()->getIdentity() == null) {
goto Y6;
}
$aF->rules["craft-single-sign-on"] = "craft-single-sign-on/settings/providers";
$aF->rules["craft-single-sign-on/oauth-settings"] = "craft-single-sign-on/settings/oauthsettings";
$aF->rules["craft-single-sign-on/oauth-attribute"] = "craft-single-sign-on/settings/oauthattribute";
$aF->rules["craft-single-sign-on/saml-settings"] = "craft-single-sign-on/settings/samlsettings";
$aF->rules["craft-single-sign-on/saml-attribute"] = "craft-single-sign-on/settings/samlattribute";
$aF->rules["craft-single-sign-on/saml-provider"] = "craft-single-sign-on/settings/samlprovider";
$aF->rules["craft-single-sign-on/custom-settings"] = "craft-single-sign-on/settings/customsettings";
$aF->rules["craft-single-sign-on/jwt-settings"] = "craft-single-sign-on/settings/jwtsettings";
goto xF;
Y6:
if (!\Craft::$app->getIsLive()) {
goto fD;
}
$aF->rules = array_merge($aF->rules, ["login" => "craft-single-sign-on/settings"]);
fD:
xF:
}
public function getCpNavItem() : ?array
{
$uZ = parent::getCpNavItem();
$uZ["subnav"] = ["custom_provider" => ["label" => "Providers", "url" => "craft-single-sign-on"], "custom_settings" => ["label" => "Settings", "url" => "craft-single-sign-on/custom-settings"]];
return $uZ;
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace miniorangedev\craftsinglesignon;
use miniorangedev\craftsinglesignon\services\App as AppService;
use miniorangedev\craftsinglesignon\variables\CraftsinglesignonVariable;
use miniorangedev\craftsinglesignon\twigextensions\CraftsinglesignonTwigExtension;
use miniorangedev\craftsinglesignon\models\Settings;
use miniorangedev\craftsinglesignon\utilities\Config as ConfigUtility;
use miniorangedev\craftsinglesignon\widgets\Settings as SettingsWidget;
use miniorangedev\craftsinglesignon\controllers\ResourcesController;
use craft\elements\User;
use Craft;
use craft\base\Plugin;
use craft\services\Plugins;
use craft\events\PluginEvent;
use craft\web\UrlManager;
use craft\services\Fields;
use craft\services\Utilities;
use craft\web\twig\variables\CraftVariable;
use craft\services\Dashboard;
use craft\events\RegisterComponentTypesEvent;
use craft\events\RegisterUrlRulesEvent;
use craft\helpers\UrlHelper;
use yii\base\Event;
class Craftsinglesignon extends Plugin
{
public static Plugin $plugin;
public string $schemaVersion = "\61\x2e\60\56\x30";
public bool $hasCpSettings = true;
public bool $hasCpSection = true;
public function init() : void
{
parent::init();
self::$plugin = $this;
Craft::$app->view->registerTwigExtension(new CraftsinglesignonTwigExtension());
Event::on(UrlManager::class, UrlManager::EVENT_REGISTER_SITE_URL_RULES, function (RegisterUrlRulesEvent $aF) {
$ma = ResourcesController::actionDatadb("\157\x61\x75\164\x68\163\145\164\164\151\x6e\147\x73");
if (!(isset($ma["\x63\141\154\x6c\x62\x61\143\x6b\x5f\x75\x72\154"]) && isset(explode(UrlHelper::siteUrl(), $ma["\143\141\x6c\154\x62\141\x63\153\x5f\x75\162\x6c"])[1]))) {
goto J_;
}
$DK = explode(UrlHelper::siteUrl(), $ma["\x63\x61\x6c\x6c\x62\x61\x63\153\x5f\165\162\154"])[1];
$aF->rules[$DK] = "\143\x72\141\x66\164\55\163\x69\156\x67\154\145\x2d\163\151\x67\156\55\x6f\x6e\57\x6c\x6f\x67\x69\156\57\143\x61\x6c\154\x62\141\x63\x6b";
J_:
$aF->rules["\155\157\x6c\x6f\147\x69\x6e\57\x6c\x6f\x67\x69\156"] = "\143\162\141\146\x74\x2d\x73\x69\156\147\x6c\x65\55\163\151\x67\156\55\x6f\156\x2f\x6c\x6f\147\x69\x6e";
$aF->rules["\x6d\x6f\154\157\x67\151\156\x2f\143\x61\154\x6c\x62\141\x63\153"] = "\143\x72\x61\146\x74\x2d\163\x69\x6e\x67\154\145\x2d\x73\x69\147\156\x2d\x6f\156\57\x6c\x6f\x67\x69\156\x2f\143\x61\x6c\154\142\141\143\x6b";
$aF->rules["\155\157\x73\151\156\147\154\x65\x73\x69\147\156\x6f\156\x2f\x63\x72\145\141\x74\145"] = "\x63\x72\x61\x66\x74\x2d\x73\x69\156\x67\x6c\145\x2d\163\x69\147\156\55\157\x6e\x2f\163\x65\164\x74\x69\156\x67\x73\x2f\x63\162\145\x61\x74\x65";
$aF->rules["\x6d\157\163\151\156\x67\x6c\x65\x73\151\x67\156\x6f\x6e\57\x63\x68\x65\143\x6b"] = "\x63\x72\141\x66\x74\x2d\163\x69\x6e\x67\154\x65\x2d\x73\x69\147\156\55\x6f\156\x2f\163\145\x74\x74\x69\156\x67\163\57\x63\150\145\x63\153";
$aF->rules["\155\x6f\x73\x69\156\147\154\145\163\151\x67\x6e\x6f\x6e\57\x64\145\154\x65\x74\x65"] = "\x63\162\141\146\x74\x2d\x73\x69\x6e\147\154\145\55\163\x69\147\156\x2d\157\x6e\x2f\x73\145\x74\x74\151\x6e\147\x73\57\x64\145\x6c\x65\x74\145";
$aF->rules["\x6d\x6f\x73\x69\156\147\154\x65\x73\151\147\156\x6f\x6e\57\x69\163\163\165\145\162"] = "\x63\x72\x61\146\x74\x2d\163\x69\156\x67\154\x65\55\163\x69\x67\x6e\55\x6f\x6e\x2f\155\x65\x74\150\157\144\57\x73\x61\x6d\154";
$aF->rules["\x6d\157\163\151\156\147\154\145\x73\151\x67\156\x6f\x6e\x2f\x63\141\154\154\x62\x61\x63\x6b"] = "\x63\x72\141\146\164\55\x73\151\156\147\154\x65\x2d\163\x69\x67\x6e\55\x6f\156\x2f\x6d\145\164\x68\x6f\144\57\143\x61\154\154\x62\x61\143\x6b";
$aF->rules["\155\157\x73\151\x6e\147\154\145\163\151\147\x6e\x6f\x6e\x2f\x73\141\155\154\154\x6f\x67\x69\156"] = "\143\x72\141\x66\x74\55\163\151\x6e\x67\x6c\x65\x2d\163\x69\147\156\55\157\156\x2f\155\x65\164\x68\x6f\x64\57\163\x61\x6d\x6c\x6c\157\x67\x69\156";
});
Event::on(UrlManager::class, UrlManager::EVENT_REGISTER_CP_URL_RULES, [self::class, "\x6f\x6e\122\145\147\151\x73\x74\x65\162\x43\160\125\162\x6c\122\x75\154\x65\163"], function (RegisterUrlRulesEvent $aF) {
});
Event::on(Dashboard::class, Dashboard::EVENT_REGISTER_WIDGET_TYPES, function (RegisterComponentTypesEvent $aF) {
$aF->types[] = SettingsWidget::class;
});
Event::on(CraftVariable::class, CraftVariable::EVENT_INIT, function (Event $aF) {
$PZ = $aF->sender;
$PZ->set("\143\x72\141\146\x74\x73\151\x6e\147\154\x65\x73\x69\147\156\157\x6e", CraftsinglesignonVariable::class);
});
Event::on(Plugins::class, Plugins::EVENT_AFTER_INSTALL_PLUGIN, function (PluginEvent $aF) {
if (!($aF->plugin === $this)) {
goto uM;
}
uM:
});
Craft::info(Craft::t("\x63\162\141\x66\164\x2d\163\x69\x6e\x67\x6c\145\55\163\x69\x67\156\x2d\157\x6e", "\x7b\156\141\155\x65\175\40\x70\154\165\x67\151\x6e\40\x6c\x6f\141\x64\x65\x64", ["\156\141\x6d\x65" => $this->name]), __METHOD__);
}
protected function createSettingsModel() : ?craft\base\Model
{
return new Settings();
}
protected function settingsHtml() : string
{
return Craft::$app->view->renderTemplate("\x63\x72\141\x66\164\x2d\163\151\x6e\147\x6c\145\55\163\151\x67\x6e\55\157\156\57\163\x65\164\164\151\x6e\x67\x73", ["\x73\145\x74\164\x69\x6e\x67\x73" => Craft::$app->getResponse()->redirect(UrlHelper::cpUrl("\x63\162\x61\146\x74\55\x73\x69\x6e\147\154\145\55\x73\151\147\156\55\157\156"))->send()]);
}
public static function onRegisterCpUrlRules(RegisterUrlRulesEvent $aF)
{
if (Craft::$app->getUser()->getIdentity() == null) {
goto Y6;
}
$aF->rules["\143\x72\141\146\164\x2d\163\x69\x6e\x67\154\145\x2d\x73\x69\147\x6e\x2d\157\156"] = "\x63\x72\141\x66\x74\55\x73\151\156\147\x6c\x65\55\163\151\147\x6e\55\157\156\x2f\163\145\x74\164\x69\x6e\x67\x73\x2f\x70\162\157\x76\151\x64\145\162\x73";
$aF->rules["\143\x72\141\146\164\x2d\x73\x69\156\147\x6c\x65\x2d\x73\151\x67\x6e\55\157\156\x2f\x6f\141\x75\164\150\x2d\163\145\x74\164\x69\156\x67\x73"] = "\143\x72\141\146\x74\55\163\151\156\147\154\145\55\163\x69\x67\156\x2d\x6f\156\57\163\x65\x74\x74\x69\x6e\147\163\x2f\157\x61\x75\164\150\163\x65\164\164\x69\156\147\x73";
$aF->rules["\143\x72\x61\x66\164\55\x73\x69\156\147\154\x65\x2d\163\151\x67\x6e\x2d\157\156\x2f\x6f\x61\165\164\x68\x2d\x61\164\164\x72\151\x62\165\x74\x65"] = "\143\x72\141\x66\164\55\163\x69\156\x67\154\x65\x2d\x73\151\147\x6e\55\157\156\x2f\163\145\x74\x74\151\x6e\147\x73\57\x6f\141\x75\x74\150\141\x74\164\x72\151\x62\165\164\145";
$aF->rules["\x63\162\141\x66\164\55\163\x69\x6e\147\x6c\x65\55\x73\x69\x67\x6e\x2d\157\156\57\163\141\x6d\x6c\x2d\x73\145\x74\x74\x69\156\147\163"] = "\143\x72\141\x66\164\55\163\x69\x6e\147\x6c\145\55\163\151\147\156\55\157\x6e\57\x73\x65\x74\x74\151\x6e\147\163\57\x73\x61\155\x6c\x73\145\164\x74\151\156\147\163";
$aF->rules["\x63\162\141\146\x74\55\x73\151\x6e\x67\x6c\145\x2d\x73\151\x67\x6e\x2d\x6f\156\x2f\163\141\155\x6c\55\141\x74\164\x72\151\142\165\164\145"] = "\x63\162\141\146\164\x2d\x73\x69\156\147\154\145\x2d\x73\x69\147\x6e\x2d\x6f\x6e\x2f\x73\x65\164\164\x69\x6e\147\163\x2f\x73\141\155\x6c\141\164\x74\162\x69\x62\x75\x74\x65";
$aF->rules["\143\x72\141\146\x74\55\x73\x69\x6e\x67\154\145\55\x73\151\x67\156\x2d\x6f\x6e\x2f\x73\x61\155\154\x2d\160\x72\157\x76\x69\x64\145\x72"] = "\x63\162\141\146\x74\x2d\163\151\156\147\x6c\145\x2d\x73\151\147\156\x2d\x6f\x6e\x2f\163\x65\x74\164\x69\x6e\147\x73\x2f\x73\x61\x6d\x6c\160\x72\157\x76\x69\x64\145\x72";
$aF->rules["\143\162\x61\x66\164\55\163\151\x6e\x67\x6c\145\x2d\163\151\147\x6e\x2d\157\156\x2f\x63\165\163\x74\x6f\x6d\55\163\x65\x74\164\151\156\x67\163"] = "\143\x72\141\x66\x74\x2d\x73\151\156\147\154\145\55\x73\x69\x67\156\x2d\157\x6e\57\x73\145\x74\164\x69\156\147\x73\x2f\143\165\163\164\x6f\x6d\x73\145\x74\x74\x69\x6e\x67\163";
$aF->rules["\143\162\x61\x66\x74\x2d\x73\151\x6e\147\x6c\x65\x2d\163\151\147\156\x2d\157\x6e\57\152\x77\x74\55\x73\x65\x74\164\x69\156\x67\x73"] = "\x63\x72\x61\x66\x74\55\x73\x69\156\x67\x6c\145\55\163\x69\147\x6e\55\x6f\x6e\x2f\163\145\164\164\x69\156\x67\x73\x2f\x6a\167\x74\163\x65\164\x74\151\156\x67\x73";
goto xF;
Y6:
if (!\Craft::$app->getIsLive()) {
goto fD;
}
$aF->rules = array_merge($aF->rules, ["\x6c\157\x67\x69\x6e" => "\143\x72\141\146\164\55\163\x69\x6e\147\x6c\x65\x2d\x73\x69\147\156\x2d\157\x6e\57\x73\x65\x74\x74\151\x6e\147\163"]);
fD:
xF:
}
public function getCpNavItem() : ?array
{
$uZ = parent::getCpNavItem();
$uZ["\163\x75\x62\156\x61\x76"] = ["\x63\165\163\164\157\x6d\x5f\160\x72\x6f\x76\x69\144\x65\162" => ["\x6c\141\142\x65\154" => "\120\x72\x6f\x76\151\x64\x65\x72\163", "\165\x72\x6c" => "\x63\162\x61\x66\164\x2d\163\x69\x6e\147\154\x65\x2d\x73\x69\x67\156\x2d\157\x6e"], "\x63\x75\x73\164\157\155\137\x73\x65\x74\164\x69\156\147\163" => ["\x6c\141\x62\145\154" => "\x53\145\x74\164\x69\156\x67\x73", "\x75\x72\x6c" => "\x63\162\141\x66\164\x2d\163\151\156\x67\x6c\145\55\163\151\147\x6e\55\x6f\x6e\x2f\x63\x75\163\164\x6f\x6d\55\x73\x65\x74\164\151\x6e\147\163"]];
return $uZ;
}
}
Function Calls
None |
Stats
MD5 | f7e3abfd796bda2008ccc94069f8bd92 |
Eval Count | 0 |
Decode Time | 38 ms |