Example #1
0
        <div style="" class="col-xs-12">

            <?php 
if (Yii::$app->authClientCollection->hasClient('facebook')) {
    ?>
                <?php 
    echo Button::widget(['button' => 'facebook', 'link' => Yii::$app->urlManager->createUrl(['/account/auth', 'authclient' => 'facebook']), 'label' => Yii::t('app', 'Login with Facebook')]);
    ?>
            <?php 
}
?>
            <?php 
if (Yii::$app->authClientCollection->hasClient('google')) {
    ?>
                <?php 
    echo Button::widget(['button' => 'google', 'link' => Yii::$app->urlManager->createUrl(['/account/auth', 'authclient' => 'google']), 'label' => Yii::t('app', 'Login with Google')]);
    ?>
            <?php 
}
?>


            <div>
                <hr/>
            </div>

            <?php 
$form = ActiveForm::begin(['id' => 'login-form']);
?>
            <?php 
echo $form->field($model, 'email');
Example #2
0
        echo Html::a(Yii::t('app', Icon::widget(['icon' => 'plus']) . ' ' . 'Add account'), Yii::$app->urlManager->createUrl(['/account/auth', 'authclient' => 'facebook']), ['class' => 'btn btn-success btn-xs']);
        ?>
                            <?php 
    }
    ?>
                        </td>
                    </tr>
                    <?php 
}
?>
                    <?php 
if (Yii::$app->authClientCollection->hasClient('google')) {
    ?>
                    <tr>
                        <td style="max-width: 50px"><?php 
    echo Button::widget(['button' => 'google btn-xs', 'iconOnly' => false, 'label' => 'Google']);
    ?>
</td>
                        <td>
                            <?php 
    if (in_array('google', array_keys($auths))) {
        ?>
                                <?php 
        echo Yii::t('app', 'Account linked');
        ?>
                            <?php 
    } else {
        ?>
                                <?php 
        echo Yii::t('app', 'Account not linked');
        ?>
Example #3
0
        <?php 
echo Yii::t('app', 'Note: You can manage site services in Settings &gt; API.');
?>
    </div>
    <div class="row">
        <?php 
if (Yii::$app->authClientCollection->hasClient('flickr-photo')) {
    ?>
        <div class="col-xs-6 col-sm-4 col-lg-3">
            <div class="box box-<?php 
    echo isset($services['flickr-photo']) ? 'success' : 'default';
    ?>
">
                <div class="box-header with-border">
                    <?php 
    echo Button::widget(['button' => 'flickr', 'iconOnly' => false, 'label' => 'Flickr Photo', 'link' => Yii::$app->urlManager->createUrl(['/service/auth', 'authclient' => 'flickr-photo'])]);
    ?>
                </div>
                <div class="box-body">
                    <h5 class="text-center">
                        <?php 
    if (isset($services['flickr-photo'])) {
        ?>
                            <?php 
        $userid = json_decode($services['flickr-photo']['data'], true)['userid'];
        ?>
                            <?php 
        echo Yii::t('app', 'Service is using account: {ID}', ['ID' => \yii\helpers\Html::a($userid, 'https://www.flickr.com/' . $userid, ['target' => '_blank'])]);
        ?>
                        <?php 
    } else {