<!--#
##
#	Project: PHPDISK File Storage Solution
#	This is NOT a freeware, use is subject to license terms.
#
#	Site: http://www.phpdisk.com
#
#	$Id: pd_account.tpl.php 64 2016-07-30 14:01:18Z along $
#
#	Copyright (C) 2008-2016 PHPDisk Team. All Rights Reserved.
#
##
#-->
<?php !defined('IN_PHPDISK') && exit('[PHPDisk] Access Denied!'); ?>
<!--#if(empty($action) || $action =='login' || $action =='relogin'){#-->
<!--#if(!$login_success){#-->
<!--#require_once template_echo('circle_box_header',$user_tpl_dir); #-->
<div class="cboxcontent">
<h1><?=__('phpdisk_login')?></h1>
<!--#
if(count($sysmsg)){
	for($i=0;$i<count($sysmsg);$i++){
#-->
<li><span>*</span> {#$sysmsg[$i]#}</li>
<!--#
	}
}
unset($sysmsg);
#-->
<form name="user_form" action="{#urr("account","")#}" method="post" onSubmit="return chkform(this);">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="{$action}" />
<input type="hidden" name="ref" value="{$ref}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<div class="account_wrap">
	<div class="txt">您的帐号：</div>
	<div><input class="u_input" type="text" name="username" value="" tabindex="1" maxlength="20">&nbsp;<a href="{#urr("account","action=register")#}"><?=__('user_register')?></a></div>
	<div class="txt">登录密码：</div>
	<div><input class="u_input" type="password" name="password" value="" tabindex="2" maxlength="20">&nbsp;<a href="{#urr("account","action=forget_pwd")#}"><?=__('forget_pwd')?></a></div>
	<!--#if($settings['login_verycode'] && $settings['open_verycode']){#-->  
	<div class="txt"><?=__('verycode')?>：</div>
	<div><input class="verycode" type="text" name="verycode" value="" size="8" tabindex="3" maxlength="6">&nbsp;请输入下面的验证码</div>
	<div style="margin-bottom:5px;"><img style="cursor:pointer" id="imgcode" alt="<?=__('refresh')?>" border="0" onclick="chg_img();"/></div>
	  <script type="text/javascript">
	  getId('imgcode').src = 'imagecode.php';
		function chg_img(){
			getId('imgcode').src = 'imagecode.php?'+Math.random();
		}
	  </script>
	<!--#}#--> 
	<div style="margin:5px 0;"><input type="checkbox" id="remember" name="remember" value="1"><label for="remember" title="<?=__('warning_remember')?>"><span><?=__('remember_me')?></span></label>&nbsp;&nbsp;<!--#if($settings['open_demo_login']){#--><a href="{#urr("account","action=demologin")#}"><img src="images/demo_icon.gif" align="absmiddle" border="0"> <?=__('demo_login')?></a><!--#}#--></div>
	<div><input class="btn_green" type="submit" tabindex="4" value="登录网盘">&nbsp;&nbsp;<input type="button" class="btn_gray" value="现在注册" onClick="go('{#urr("account","action=register")#}');" /></div>
</div>
</form>
<script language="javascript">
document.user_form.username.focus();
function chkform(o){
	if(o.username.value.strtrim().length <2){
		atips("<?=__('invalid_username')?>");
		o.username.focus();
		return false;
	}
	if(o.password.value.strtrim().length <6){
		atips("<?=__('invalid_password')?>");
		o.password.focus();
		return false;
	}
<!--#if($settings['login_verycode'] && $settings['open_verycode']){#-->  
	if(o.verycode.value.strtrim().length <4){
		atips("<?=__('invalid_verycode')?>");
		o.verycode.focus();
		return false;
	}
<!--#}#-->	
}
</script>
<p>&nbsp;</p></div>
<!--#require_once template_echo('circle_box_footer',$user_tpl_dir); #-->
<!--#}#-->

<!--#}elseif($action =='adminlogin'){#-->

<!--#require_once template_echo('circle_box_header',$user_tpl_dir); #-->
<div class="cboxcontent">
<h1><?=__('admin_login')?></h1>
<!--#
if(count($sysmsg)){
	for($i=0;$i<count($sysmsg);$i++){
#-->
<li><span>*</span> {#$sysmsg[$i]#}</li>
<!--#
	}
}
unset($sysmsg);
#-->
<form name="user_form" onSubmit="return chkform(this);" action="{#urr("account","")#}" method="post">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="{$action}" />
<input type="hidden" name="ref" value="{$ref}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<div class="account_wrap">
	<div class="txt">您的帐号：</div>
	<div><input class="u_input" tabindex="1" type="text" name="username" value="{$username}" maxlength="20"></div>
	<div class="txt">登录密码：</div>
	<div><input class="u_input" tabindex="2" type="password" name="password" maxlength="20"></div>
	<div class="txt"><?=__('verycode')?>：</div>
	<div><input class="verycode" type="text" name="verycode" value="" tabindex="3" maxlength="6">&nbsp;请输入下面的验证码</div>
	<div style="margin-bottom:5px;"><img style="cursor:pointer" id="imgcode" alt="<?=__('refresh')?>" border="0" onclick="chg_img();"/></div>
	  <script type="text/javascript">
	  getId('imgcode').src = 'imagecode.php';
		function chg_img(){
			getId('imgcode').src = 'imagecode.php?'+Math.random();
		}
	  </script>
	<div><input class="btn_green" type="submit" value="登录后台"></div>
</div>
</form>
<script language="javascript">
document.user_form.password.focus();
function chkform(o){
	if(o.username.value.strtrim().length <2){
		atips("<?=__('invalid_username')?>");
		o.username.focus();
		return false;
	}
	if(o.password.value.strtrim().length <6){
		atips("<?=__('invalid_password')?>");
		o.password.focus();
		return false;
	}
	if(o.verycode.value.strtrim().length <4){
		atips("<?=__('invalid_verycode')?>");
		o.verycode.focus();
		return false;
	}
}
</script>
<p>&nbsp;</p></div>
<!--#require_once template_echo('circle_box_footer',$user_tpl_dir); #-->

<!--#}elseif($action =='forget_pwd'){#-->

<!--#require_once template_echo('circle_box_header',$user_tpl_dir); #-->
<div class="cboxcontent">
<h1><?=__('forget_pwd')?></h1>
<!--#
if(count($sysmsg)){
	for($i=0;$i<count($sysmsg);$i++){
#-->
<li><span>*</span> {#$sysmsg[$i]#}</li>
<!--#
	}
}
unset($sysmsg);
#-->
<form name="user_form" action="{#urr("account","")#}" method="post" onSubmit="return dosubmit(this);">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="{$action}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<table width="90%" border="0">
  <tbody valign="top">
  <tr>
    <td align="right" width="25%"><?=__('reg_username')?></td>
    <td><input class="input" type="text" name="username" value="{$username}" maxlength="20">&nbsp;<span id="e1" class="txtred"></span>
    </td>
  </tr>
<!--#if($settings['forget_verycode'] && $settings['open_verycode']){#--> <tr>
    <td align="right"><?=__('verycode')?></td>
    <td><input class="verycode" type="text" name="verycode" value="" size="8" maxlength="6">&nbsp;<img style="cursor:pointer" alt="<?=__('refresh')?>" id="imgcode" border="0" onclick="chg_imgcode();" />&nbsp;<span id="e2" class="txtred"></span>
    </td>
  </tr>
  <script type="text/javascript">
  getId('imgcode').src = 'includes/imgcode.inc.php?verycode_type={$settings['verycode_type']}';
  function chg_imgcode(){
  	getId('imgcode').src = 'includes/imgcode.inc.php?verycode_type={$settings['verycode_type']}&t='+Math.random();
  }
  </script>
<!--#}#-->  
  <tr>
  	<td>&nbsp;</td>
    <td><input class="btn_green" id="s1" type="submit" value="<?=__('btn_submit')?>"></td>
  </tr>
</tbody>
</table>
</form>
<script type="text/javascript">
document.user_form.username.focus();
function dosubmit(o){
	if(o.username.value.strtrim().length <2){
		getId('e1').innerText = "<?=__('username_too_short')?>";
		o.username.focus();
		return false;
	}
<!--#if($settings['forget_verycode'] && $settings['open_verycode']){#--> if(o.verycode.value.strtrim().length <4){
		getId('e2').innerText = "<?=__('invalid_verycode')?>";
		o.verycode.focus();
		return false;
	}
<!--#}#-->	
	getId('s1').value = "<?=__('txt_processing')?>";
	getId('s1').disabled = true;
}
</script>
<p>&nbsp;</p></div>
<!--#require_once template_echo('circle_box_footer',$user_tpl_dir); #-->
<!--#}elseif($action =='reset_pwd'){#-->
<!--#require_once template_echo('circle_box_header',$user_tpl_dir); #-->
<div class="cboxcontent">
<h1><?=__('reset_pwd')?></h1>
<!--#
if(count($sysmsg)){
	for($i=0;$i<count($sysmsg);$i++){
#-->
<li><span>*</span> {#$sysmsg[$i]#}</li>
<!--#
	}
}
unset($sysmsg);
#-->
<form name="user_form" onSubmit="return dosubmit(this);" action="{#urr("account","")#}" method="post">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="{$action}" />
<input type="hidden" name="userid" value="{$userid}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<table width="90%" border="0">
  <tbody valign="top">
  <tr>
    <td align="right" width="25%"><?=__('password')?></td>
    <td><em class="u_em"><input class="input" type="password" name="pwd" value="" maxlength="20"></em>&nbsp;<span id="e1" class="txtred"></span>
    </td>
  </tr>
  <tr>
    <td align="right" width="25%"><?=__('confirm_password')?></td>
    <td><em class="u_em"><input class="input" type="password" name="pwd2" value="" maxlength="20"></em>&nbsp;<span id="e2" class="txtred"></span>
    </td>
  </tr>
  <tr>
  	<td>&nbsp;</td>
    <td><input class="btn_green" type="submit" value="<?=__('btn_submit')?>" {$disabled}></td>
  </tr>
</tbody>
</table>
</form>
<script type="text/javascript">
document.user_form.pwd.focus();
function dosubmit(o){
	if(o.pwd.value.strtrim().length <6){
		getId('e1').innerText = "<?=__('password_too_short')?>";
		o.pwd.focus();
		return false;
	}
	if(o.pwd2.value.strtrim() != o.pwd.value.strtrim()){
		getId('e2').innerText = "<?=__('confirm_password_invalid')?>";
		o.pwd2.focus();
		return false;
	}
}
</script>
<p>&nbsp;</p></div>
<!--#require_once template_echo('circle_box_footer',$user_tpl_dir); #-->

<!--#}elseif($action =='register' && $settings['allow_register']){#-->
<!--#require_once template_echo('circle_box_header',$user_tpl_dir); #-->
<div class="cboxcontent">
<h1><?=__('phpdisk_register')?></h1>
<!--#
if(count($sysmsg)){
	for($i=0;$i<count($sysmsg);$i++){
#-->
<li><span>*</span> {#$sysmsg[$i]#}</li>
<!--#
	}
}
unset($sysmsg);
#-->
<form name="user_form" onSubmit="return chkform(this);" action="{#urr("account","")#}" method="post">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="{$action}" />
<input type="hidden" name="invite_uid" value="{$invite_uid}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<div class="account_wrap">
	<!--#if($invite_uid){#-->
	<div class="txt"><?=__('invite_name')?>：</div>
	<div><a href="{$a_space}" target="_blank">{$invite_name}</a></div>
	<!--#}#-->
	<div class="txt"><?=__('reg_username')?>：</div>
	<div><input class="u_input" tabindex="1" type="text" name="username" value="{$username}" maxlength="20">&nbsp;<span style="color:#FF0000">*</span></div>
	<div class="txt">注册密码：</div>
	<div><input class="u_input" tabindex="2" type="password" name="password" maxlength="20">&nbsp;<span style="color:#FF0000">*</span></div>
	<div class="txt"><?=__('confirm_password')?>：</div>
	<div><input class="u_input" tabindex="3" type="password" name="confirm_password" maxlength="20">&nbsp;<span style="color:#FF0000">*</span></div>
	<!--#if($settings['reg_use_email']){#-->
	<div class="txt"><?=__('email')?>：</div>
	<div><input class="u_input" tabindex="4" type="text" name="email" value="{$email}" maxlength="50">&nbsp;<span style="color:#FF0000">*</span></div>
	<!--#}#-->
	<div class="txt">所属部门：</div>
	<div>
	<select name="depart_id">
	<option value="0">- 请选择 -</option>
	<!--#
	$arr = get_departs();
	if(count($arr)){
		foreach($arr as $v){
	#-->
	<option value="{$v[depart_id]}">{$v[depart_name]}</option>
	<!--#
		}
		unset($arr);
	}
	#-->
	</select>
	</div>
	<div class="txt"><?=__('verycode')?>：</div>
	<div><input class="verycode" type="text" name="verycode" value="" tabindex="3" maxlength="6">&nbsp;请输入下面的验证码</div>
	<div style="margin-bottom:5px;"><img style="cursor:pointer" id="imgcode" alt="<?=__('refresh')?>" border="0" onclick="chg_img();"/></div>
	  <script type="text/javascript">
	  getId('imgcode').src = 'imagecode.php';
		function chg_img(){
			getId('imgcode').src = 'imagecode.php?'+Math.random();
		}
	  </script>
	<div><input type="submit" class="btn_green" value="提 交"/>&nbsp;&nbsp;<input type="button" class="btn_gray" value="<?=__('already_register')?>" onClick="go('{#urr("account","action=login")#}');" /></div>
</div>
</form>
<script language="javascript">
<!--#if($reg_success ==1){#-->
function go_login(){
	document.location.href = '{#urr("account","action=login")#}';
}
setTimeout('go_login();',2000);
<!--#}#-->
document.user_form.username.focus();
function chkform(o){
	if(o.username.value.strtrim().length <2){
		atips("<?=__('username_too_short')?>");
		o.username.focus();
		return false;
	}
	if(o.password.value.strtrim().length <6){
		atips("<?=__('password_too_short')?>");
		o.password.focus();
		return false;
	}
	if(o.confirm_password.value.strtrim() != o.password.value.strtrim()){
		atips("<?=__('confirm_password_invalid')?>");
		o.password.focus();
		return false;
	}
	<!--#if($settings['reg_use_email']){#-->
	if(o.email.value.strtrim().length <6 || o.email.value.strtrim().indexOf('@') ==-1 || o.email.value.strtrim().indexOf('.') ==-1){
		atips("<?=__('invalid_email')?>");
		o.email.focus();
		return false;
	}
	<!--#}#-->
<!--#if($settings['register_verycode'] && $settings['open_verycode']){#--> if(o.verycode.value.strtrim().length <4){
		atips("<?=__('invalid_verycode')?>");
		o.verycode.focus();
		return false;
	}
<!--#}#-->	
}
</script>
<p>&nbsp;</p></div>
<!--#require_once template_echo('circle_box_footer',$user_tpl_dir); #-->

<!--#}elseif($action == 'demologin' && !$settings['open_demo_login']){#-->
<!--#require_once template_echo('circle_box_header',$user_tpl_dir); #-->
<div class="cboxcontent">
<h1><?=__('system_message')?></h1>
<!--#
if(count($sysmsg)){
	for($i=0;$i<count($sysmsg);$i++){
#-->
<li><span>*</span> {#$sysmsg[$i]#}</li>
<!--#
	}
}
unset($sysmsg);
#-->
<p>&nbsp;</p></div>
<!--#require_once template_echo('circle_box_footer',$user_tpl_dir); #-->

<!--#}elseif($action=='active'){#-->
<!--#require_once template_echo('circle_box_header',$user_tpl_dir); #-->
<div class="cboxcontent">
<h1><?=__('active_user_tit')?></h1>
<form name="user_form" action="{#urr("account","")#}" method="post" onSubmit="return dosubmit(this);">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="send" />
<input type="hidden" name="formhash" value="{$formhash}" />
<table width="90%" border="0">
  <tbody valign="top">
  <tr>
    <td colspan="2"><?=__('active_user_tips')?></td>
  </tr>
<!--#if($settings['active_verycode'] && $settings['open_verycode']){#--> <tr>
    <td align="right"><?=__('verycode')?></td>
    <td><input class="verycode" type="text" name="verycode" value="" size="8" maxlength="6">&nbsp;<img style="cursor:pointer" alt="<?=__('refresh')?>" id="imgcode" border="0" onclick="chg_imgcode();" />&nbsp;<span id="e2" class="txtred"></span>
    </td>
  </tr>
  <script type="text/javascript">
  getId('imgcode').src = 'includes/imgcode.inc.php?verycode_type={$settings['verycode_type']}';
  function chg_imgcode(){
  	getId('imgcode').src = 'includes/imgcode.inc.php?verycode_type={$settings['verycode_type']}&t='+Math.random();
  }
  </script>
<!--#}#-->  
  <tr>
  	<td>&nbsp;</td>
    <td><input class="btn_green" id="s1" type="submit" value="<?=__('btn_active')?>"></td>
  </tr>
</tbody>
</table>
</form>
<script type="text/javascript">
function dosubmit(o){
	<!--#if($settings['active_verycode'] && $settings['open_verycode']){#--> 
	if(o.verycode.value.strtrim().length <4){
		getId('e2').innerText = "<?=__('invalid_verycode')?>";
		o.verycode.focus();
		return false;
	}
	getId('s1').value = "<?=__('txt_processing')?>";
	<!--#}#-->	
	getId('s1').disabled = true;
}
</script>
<p>&nbsp;</p></div>
<!--#require_once template_echo('circle_box_footer',$user_tpl_dir); #-->

<!--#}else{#-->
<!--#require_once PHPDISK_ROOT."modules/front_msg.inc.php";#-->
<!--#}#-->
