<?php
include ROOT.'app/user/head.bad.php';
user_head('用户授权');
?>
<!-- content start -->
<div class="admin-content">

    <div class="am-cf am-padding">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">OAuth 2 网页授权登录</strong> / <small>form</small></div>
    </div>
<?php
$info=(new \auth\oauthapps)->info($_GET['client_id']);
?>
    <div class="am-g">
        <div class="am-u-sm-12 am-u-sm-centered">
            <h2><?=$info['name']?></h2>
            <p>开发者：<?=(new \user\account)->info($info['user_id'])['name']?>，首页地址：<?=$info['home']?></p>
            <p><?=$info['name']?> 将获取你的以下权限</p>
            <?php
            $scope=explode(' ',$scopes);
            $scope_calss=new \auth\scope();
            for ($i=0;$i<=count($scope)-1;$i++){
                    echo "<li>".$scope[$i] ." &nbsp;&nbsp;(" .$scope_calss->see($scope[$i])['name']. ")</li>";
            }
            ?>
            <p>请确认你是否要登录<?=$info['name']?>，并将以上权限授权给该应用</p>
            <hr/>
        </div>
    </div>
    <form method="post">
        <div class="am-margin">
            <button type="submit" name="authorized" value="yes" class="am-btn am-btn-primary am-btn-xs">授权并登录</button>
            <button type="submit" name="authorized" value="no" class="am-btn am-btn-primary am-btn-xs">取消</button>
        </div>
    </form>'
</div>
<!-- content end -->

<?php
user_foot();
?>
