 <?php /** @var $l \OCP\IL10N */ ?>
<?php
vendor_script('jsTimezoneDetect/jstz');
script('core', 'merged-login');
/*先锋授权登陆js 加入判断
if($_['registration_app']['auth_login']==1){
    script('registration', 'xfsdk');
    script('registration', 'config');
}*/
use OC\Core\Controller\XfplayLoginController;
?>
<header id="header">
		<div class="header-left">
			<span id="xfhead">
                            <h1 class="xflogo"><?php p($l->t('先锋号')); ?></h1>
			</span>
                    <?php if($_['step']=='showform'){?>
                    <span class="xftitle"> |  </span>
                    <span class="xftitle"><?php p($l->t('找回密码')); ?></span>
                    <?php } ?>
                    
		</div>
 
		<div class="header-right xfhead-right">
			<span id="header-primary-action" class="topbtn">
				<a href="/xflogin" class=" ">
					<span>   <?php p($l->t('登录')); ?></span>
				</a>
			</span>
                        <span  class="topbtn"> | </span>
			<span id="header-primary-register" class="topbtn">
				<a href="/xfreg" class=" ">
					<span>   <?php p($l->t('注册')); ?></span>
				</a>
			</span>  
		</div>
		 
	</header>

 <div class=" showLoginForm">
    <div class="welcome"><div class="xfloginslide"></div></div>
    <div class="xflogin-form">
            <div class="allow">
                 <?php if (isset($_['apacheauthfailed']) && $_['apacheauthfailed']): ?>
                            <div class="warning">
                                    <?php p($l->t('Server side authentication failed!')); ?><br>
                                    <small><?php p($l->t('Please contact your administrator.')); ?></small>
                            </div>
                    <?php endif; ?>
                    <?php foreach($_['messages'] as $message): ?>
                            <div class="warning">
                                    <?php p($message); ?><br>
                            </div>
                    <?php endforeach; ?>
                    <?php if (isset($_['internalexception']) && $_['internalexception']): ?>
                            <div class="warning">
                                    <?php p($l->t('An internal error occurred.')); ?><br>
                                    <small><?php p($l->t('Please try again or contact your administrator.')); ?></small>
                            </div>
                    <?php endif; ?>
                    <div id="message" class="hidden">
                            <img class="float-spinner" alt=""
                                    src="<?php p(image_path('core', 'loading-dark.gif'));?>">
                            <span id="messageText"></span>
                            <!-- the following div ensures that the spinner is always inside the #message div -->
                            <div style="clear: both;"></div>
                    </div>
            </div>
        <div class="authBox">

            <h3><?php p($l->t('欢迎使用先锋号')); ?></h3>
            <div class="tab-login-type">  
                <a class="login-type-ercode" data-curr="xfLoginFromBox" style="currsor:pointer;"><i class="login-icon-ercode"></i></a>
            </div>
            <img src="/core/css/xficon/code-tips.png" class="code-tips"/>
            <form id="xfLoginFromBox" class="authForm" method="post" name="login" >
                <?php if (!empty($_['redirect_url'])) {
                    print_unescaped('<input type="hidden" name="redirect_url" value="' . \OCP\Util::sanitizeHTML($_['redirect_url']) . '">');
            } ?>
                <div class="line">
                    <span class="icon"><img src="/core/css/images/nich.png"/></span>
                   <input type="text" name="user" id="user"
                                    placeholder="<?php p($l->t('手机号或昵称')); ?>"
                                    aria-label="<?php p($l->t('手机号或昵称')); ?>"
                                    value="<?php p($_['loginName']); ?>"
                                    <?php p($_['user_autofocus'] ? 'autofocus' : ''); ?>
                                    autocomplete="<?php p($_['login_form_autocomplete']); ?>" autocapitalize="none" autocorrect="off" required>
                </div>
                 <div class="line">
                    <span class="icon"><img src="/core/css/images/mima.png"/></span>
                    <input type="password" name="password" id="password" value=""
                                    placeholder="<?php p($l->t('请输入您的密码')); ?>"
                                    aria-label="<?php p($l->t('请输入您的密码')); ?>"
                                    <?php p($_['user_autofocus'] ? '' : 'autofocus'); ?>
                                    autocomplete="<?php p($_['login_form_autocomplete']); ?>" autocapitalize="none" autocorrect="off" required>
                </div>

                <div class="btdiv">
                   <input type="submit" id="submit" class="button primary" title="" value="<?php p($l->t('Log in')); ?>" />    
                </div>


                <div class="showlink">
                    <span><a href="/xfpassport"><?php p($l->t('忘记密码')); ?></a></span>

                    <span><?php p($l->t('还没有账号？')); ?><a href="/xfreg"><?php p($l->t('点击注册')); ?></a></span>
                </div>
                <div class="other">
                    <fieldset>
                        <legend><?php p($l->t('使用第三方账号登录')); ?></legend>
                        <div class="ways">
                            <span><a href="/xflogin/erweima/mevideo" title="<?php p($l->t('苹果mevideo扫码登录')); ?>"><img src="/core/css/images/mevideo.png"/></a></span>
                            <span><a href="/xflogin/erweima/xfplay" title="<?php p($l->t('Android影音先锋扫码登录')); ?>"><img src="/core/css/images/xfplay.png"/></a></span>
                            <span><a href="/xfoauth/weixin" title="<?php p($l->t('微信网页扫码登录')); ?>"><img src="/core/css/images/wechat.png"/></a></span>
                            <span><a href="/xfoauth/qq" title="<?php p($l->t('QQ网页授权登录')); ?>"><img src="/core/css/images/qq.png"/></a></span>
                              <span><a href="/xfoauth/weibo" title="<?php p($l->t('新浪微博网页授权登录')); ?>"><img src="/core/css/images/weibo.png"/></a></span>
                        </div>  
                    </fieldset>
                </div>
                    <input type="hidden" name="xfnickname" id="xfnickname"/><!--先锋号手机号转换-->
                    <input type="hidden" name="timezone_offset" id="timezone_offset"/>
                    <input type="hidden" name="timezone" id="timezone"/>
                    <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>">    

          

            </form>
<!--扫码登陆--> 
<form id="xfErweimaFromBox" class="authForm" method="post" name="erweimaLogin" style="display: none;">
                <?php if (!empty($_['redirect_url'])) {
                    print_unescaped('<input type="hidden" name="redirect_url" value="' . \OCP\Util::sanitizeHTML($_['redirect_url']) . '">');
            } ?>
                <div class="login-title"> 
                    <p class="saoma"><i class="icon-saomass"></i> 扫一扫登录</p>
                    <p style="text-align:center;">打开<span style="color:#3c89e9">影音先锋APP</span> ，扫码登录</p> 
                </div>
                
                <div id="erweima-box" class="erweima-form">
                    
                     <div class="erweima-warn erweimab hidden ">
                    <div class="icon"><i class="soc"></i></div>
                        <div class="notice">
                            <p><?php p($l->t('登录失败，刷新重试')); ?></p>
                        </div>
                    </div>
                    <div class="erweima-show erweimab">
                            <canvas class="avatar align-self-center" height="142" width="142"></canvas> 

                       </div>
                    <div class="erweima-refresh erweimab hidden">
                    <div class="icon"><i class="soc"></i></div>
                    <div class="notice">
                        <p> <?php p($l->t('已过期，刷新重试…')); ?></p>
                    </div>
                </div>
                
                <div class="erweima-confirm erweimab hidden">
                    <div class="icon"><i class="soc"></i></div>
                    <div class="notice">
                        <p><?php p($l->t('扫码成功')); ?></p>
                        <p><?php p($l->t('请在手机上确认登录')); ?></p>
                    </div>
                </div>
                
                <div class="erweima-success erweimab hidden">
                    <div class="icon"><i class="soc"></i></div>
                    <div class="notice">
                        <p><?php p($l->t('已确认')); ?></p>
                        <p><?php p($l->t('正在登录，请等待…')); ?></p>
                    </div>
                </div>
                </div>
                 <fieldset id="fieldesPanel" class="buttons">
                            
                        <a class="button primary refresh-qrcode "> <?php p($l->t('二维码生成中…')); ?></a>                     
             
                   
                     </fieldset>

            </form>
        </div>
    </div>
    
 </div>

<footer role="contentinfo">
		  <p class="info">
              <?php p($l->t('版权所有')); ?> @copy 2005-<?php p(date('Y'));?> <?php p($l->t('零与壹软件.保留所有权利')); ?>
        </p>
		</footer>