/
var
/
www
/
vhosts
/
nabawater
/
vendor
/
dektrium
/
yii2-user
/
widgets
/
/var/www/vhosts/nabawater/vendor/dektrium/yii2-user/widgets
mkdir
upload
Name
Size
Mode
Actions
views/
-
0755
rm
Connect.php
1685
0644
edit
dl
rm
Login.php
706
0644
edit
dl
rm
UserMenu.php
1332
0644
edit
dl
rm
Edit:
/var/www/vhosts/nabawater/vendor/dektrium/yii2-user/widgets/Connect.php
(1685B)
<?php /* * This file is part of the Dektrium project. * * (c) Dektrium project <http://github.com/dektrium> * * For the full copyright and license information, please view the LICENSE.md * file that was distributed with this source code. */ namespace dektrium\user\widgets; use Yii; use yii\authclient\ClientInterface; use yii\authclient\widgets\AuthChoice; use yii\authclient\widgets\AuthChoiceAsset; use yii\helpers\Html; use yii\helpers\Url; /** * @author Dmitry Erofeev <dmeroff@gmail.com> */ class Connect extends AuthChoice { /** * @var array|null An array of user's accounts */ public $accounts; /** * @inheritdoc */ public $options = []; /** * @inheritdoc */ public function init() { AuthChoiceAsset::register(Yii::$app->view); if ($this->popupMode) { Yii::$app->view->registerJs("\$('#" . $this->getId() . "').authchoice();"); } $this->options['id'] = $this->getId(); echo Html::beginTag('div', $this->options); } /** * @inheritdoc */ public function createClientUrl($provider) { if ($this->isConnected($provider)) { return Url::to(['/user/settings/disconnect', 'id' => $this->accounts[$provider->getId()]->id]); } else { return parent::createClientUrl($provider); } } /** * Checks if provider already connected to user. * * @param ClientInterface $provider * * @return bool */ public function isConnected(ClientInterface $provider) { return $this->accounts != null && isset($this->accounts[$provider->getId()]); } }
Save
cmd:
run