<!--#
##
#	Project: PHPDISK File Storage Solution
#	This is NOT a freeware, use is subject to license terms.
#
#	Site: http://www.phpdisk.com
#
#	$Id: settings.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($action =='base'){
#-->
<div id="container">
<h1><?=__('base_setting')?><!--#sitemap_tag(__('base_setting'));#--></h1>
<div>
<div class="tips_box"><img class="img_light" src="images/light.gif" align="absmiddle" /> <b><?=__('tips')?>: </b>
<span class="txtgray"><?=__('setting_tips')?></span><br />
<span class="txtred">{$file_path_tips}</span>
</div>
<form action="{#urr(ADMINCP,"item=settings&menu=base")#}" method="post" onsubmit="return chksettings();">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="task" value="{$action}"/>
<input type="hidden" name="formhash" value="{$formhash}" />
<table align="center" width="100%" cellpadding="4" cellspacing="0" border="0" class="td_line">
<tr>
	<td width="50%"><span class="bold"><?=__('site_title')?></span>: <br /><span class="txtgray"><?=__('site_title_tips')?></span></td>
	<td><input type="text" id="site_title" name="setting[site_title]" value="{$setting['site_title']}" size="40" maxlength="50"/></td>
</tr>
<tr>
	<td><span class="bold"><?=__('site_stat')?></span>: <br /><span class="txtgray"><?=__('site_stat_tips')?></span></td>
	<td><textarea id="site_stat" name="setting[site_stat]" style="width:300px;height:30px">{$setting['site_stat']}</textarea><br />
	<a href="javascript:void(0);" onclick="resize_textarea('site_stat','plus');">[+]</a> <a href="javascript:void(0);" onclick="resize_textarea('site_stat','sub');">[-]</a>
	</td>
</tr>
<tr>
	<td><span class="bold"><?=__('miibeian')?></span>: <br /><span class="txtgray"><?=__('miibeian_tips')?></span></td>
	<td><input type="text" id="miibeian" name="setting[miibeian]" value="{$setting['miibeian']}" size="40" maxlength="50"/></td>
</tr>
<tr>
	<td><span class="bold"><?=__('contact_us')?></span>: <br /><span class="txtgray"><?=__('contact_us_tips')?></span></td>
	<td><input type="text" id="contact_us" name="setting[contact_us]" value="{$setting['contact_us']}" size="40" maxlength="50"/></td>
</tr>
<tr>
	<td><span class="bold"><?=__('phpdisk_url')?></span>: <br /><span class="txtgray"><?=__('phpdisk_url_tips')?></span></td>
	<td><input type="text" id="phpdisk_url" name="setting[phpdisk_url]" value="{$setting['phpdisk_url']}" size="40" maxlength="150"/></td>
</tr>
<tr>
	<td><span class="bold">隐藏授权链接查询</span>: <br /><span class="txtgray">系统底部将会出现一个授权链接，可点击查询域名是否是官方正版授权用户，或快捷获得官方技术支持。</span></td>
	<td><input type="radio" name="setting[hide_license]" value="1" {#ifchecked(1,$setting['hide_license'])#} /> <?=__('yes')?>&nbsp;&nbsp;<input type="radio" name="setting[hide_license]" value="0" {#ifchecked(0,$setting['hide_license'])#}/> <?=__('no')?></td>
</tr>
<tr>
	<td><span class="bold"><?=__('encrypt_key')?></span>: <br /><span class="txtgray"><?=__('encrypt_key_tips')?></span></td>
	<td><input type="text" id="encrypt_key" name="setting[encrypt_key]" value="{$setting['encrypt_key']}" maxlength="16"/>&nbsp;<input type="button" value="<?=__('make_random')?>" class="btn" onclick="make_code();" /></td>
</tr>
<tr>
	<td><span class="bold"><?=__('allow_access')?></span>: <br /><span class="txtgray"><?=__('allow_access_tips')?></span></td>
	<td><input type="radio" name="setting[allow_access]" value="1" {#ifchecked(1,$setting['allow_access'])#} /> <?=__('yes')?>&nbsp;&nbsp;<input type="radio" name="setting[allow_access]" value="0" {#ifchecked(0,$setting['allow_access'])#}/> <?=__('no')?><br />
	<textarea name="setting[close_access_reason]" id="close_access_reason" style="width:300px; height:30px">{$settings['close_access_reason']}</textarea><br />
	<a href="javascript:void(0);" onclick="resize_textarea('close_access_reason','plus');">[+]</a> <a href="javascript:void(0);" onclick="resize_textarea('close_access_reason','sub');">[-]</a>
	</td>
</tr>
<tr>
	<td><span class="bold"><?=__('allow_register')?></span>: <br /><span class="txtgray"><?=__('allow_register_tips')?></span></td>
	<td><input type="radio" name="setting[allow_register]" value="1" {#ifchecked(1,$setting['allow_register'])#} /> <?=__('yes')?>&nbsp;&nbsp;<input type="radio" name="setting[allow_register]" value="0" {#ifchecked(0,$setting['allow_register'])#}/> <?=__('no')?><br />
	<textarea name="setting[close_register_reason]" id="close_register_reason" style="width:300px; height:30px">{$settings['close_register_reason']}</textarea><br />
	<a href="javascript:void(0);" onclick="resize_textarea('close_register_reason','plus');">[+]</a> <a href="javascript:void(0);" onclick="resize_textarea('close_register_reason','sub');">[-]</a>
	</td>
</tr>
<tr>
	<td>&nbsp;</td>
	<td><input type="submit" class="btn" value="<?=__('btn_update')?>"/></td>
</tr>
</table>
</form>
<script language="javascript">
function chksettings(){
	if(getId('site_title').value.strtrim().length <1){
		atips("<?=__('js_site_title')?>");
		getId('site_title').focus();
		return false;
	}
	if(getId('phpdisk_url').value.strtrim().length <1){
		atips("<?=__('js_phpdisk_url')?>");
		getId('phpdisk_url').focus();
		return false;
	}
	if(getId('encrypt_key').value.strtrim().length <8){
		atips("<?=__('js_encrypt_key')?>");
		getId('encrypt_key').focus();
		return false;
	}
}
function make_code(){
   var chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
   var tmp = "";
   var code = "";
   for(var i=0;i<12;i++){
	   code += chars.charAt(Math.ceil(Math.random()*100000000)%chars.length);
   }
   getId('encrypt_key').value = code;
}
</script>
</div>
</div>
<!--#}elseif($action =='advanced'){#-->
<div id="container">
<h1><?=__('advanced_setting')?><!--#sitemap_tag(__('advanced_setting'));#--></h1>
<div>
<div class="tips_box"><img class="img_light" src="images/light.gif" align="absmiddle" /> <b><?=__('tips')?>: </b>
<span class="txtgray"><?=__('setting_tips')?></span><br />
<span class="txtred">{$file_path_tips}</span>
</div>
<form action="{#urr(ADMINCP,"item=settings&menu=base")#}" method="post">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="task" value="{$action}"/>
<input type="hidden" name="formhash" value="{$formhash}" />
<table align="center" width="100%" cellpadding="4" cellspacing="0" border="0" class="td_line">
<tr>
	<td width="40%"><span class="bold"><?=__('max_file_size')?></span>: <br /><span class="txtgray"><?=__('max_file_size_tips')?></span></td>
	<td><input type="text" id="max_file_size" name="setting[max_file_size]" value="{$setting['max_file_size']}" maxlength="10"/> <?=__('current_file_size')?>: <b>{$max_user_file_size}</b></td>
</tr>
<tr>
	<td><span class="bold"><?=__('file_path')?></span>: <br /><span class="txtgray"><?=__('file_path_tips')?></span></td>
	<td><input type="text" id="file_path" name="setting[file_path]" value="{$setting['file_path']}" maxlength="30"/></td>
</tr>
<tr>
	<td><span class="bold">HTML5大文件单个文件最大上传大小</span>: <br /><span class="txtgray">留空或0为4G ,一般服务器允许最大为4G,填写格式为100M,2G 等,只对HTML5大文件上传功能有效</span></td>
	<td><input type="text" name="setting[h5_max_filesize]" value="{$setting['h5_max_filesize']}" maxlength="30"/></td>
</tr>
<tr>
	<td ><span class="bold">普通上传形式，允许/禁止上传文件类型:</span><br /><span class="txtgray">可以设定网盘只允许某些特殊格式允许/禁止上传，设定格式： exe,vbs,php,asp 文件扩展名以英文逗号隔开。</span></td>
	<td>
	<div style="padding:5px 0"><input type="radio" name="setting[upload_file_status]" value="0" {#ifchecked(0,$setting['upload_file_status'])#} />禁止上传&nbsp;&nbsp;<input type="radio" name="setting[upload_file_status]" value="1" {#ifchecked(1,$setting['upload_file_status'])#}/>允许上传</div>
	<textarea name="setting[deny_extension]" id="deny_extension" cols="50" rows="10" style="width:400px;height:90px" ondblclick="resize_textarea('deny_extension','expand');">{$settings['deny_extension']}</textarea><br />
	<a href="javascript:void(0);" onclick="resize_textarea('deny_extension','plus');">[+]</a> <a href="javascript:void(0);" onclick="resize_textarea('deny_extension','sub');">[-]</a>
	</td>
</tr>
<tr>
	<td ><span class="bold">HTML5大文件允许上传的文件类型:</span><br /><span class="txtgray">可以设定网盘只允许某些特殊格式，设定格式： exe,vbs,php,asp 文件扩展名以英文逗号隔开。</span></td>
	<td>
	<textarea name="setting[h5_upload_ext]" id="h5_upload_ext" cols="50" rows="10" style="width:400px;height:90px" ondblclick="resize_textarea('h5_upload_ext','expand');">{$settings['h5_upload_ext']}</textarea><br />
	<a href="javascript:void(0);" onclick="resize_textarea('h5_upload_ext','plus');">[+]</a> <a href="javascript:void(0);" onclick="resize_textarea('h5_upload_ext','sub');">[-]</a>
	</td>
</tr>
<tr>
	<td><span class="bold">首页是否直接显示登录页面</span>: <br /><span class="txtgray">设置为“是”，打开首页时会直接打开登录页面。</span></td>
	<td>
	<!--#if($settings[open_public_file]){#-->
	<input type="radio" name="setting[index_login]" value="2" {#ifchecked(2,$setting['index_login'])#} />公共文件&nbsp;&nbsp;<!--#}#--><input type="radio" name="setting[index_login]" value="1" {#ifchecked(1,$setting['index_login'])#} /> <?=__('yes')?>&nbsp;&nbsp;<input type="radio" name="setting[index_login]" value="0" {#ifchecked(0,$setting['index_login'])#}/> <?=__('no')?></td>
</tr>
<tr>
	<td><span class="bold"><?=__('open_demo_login')?></span>: <br /><span class="txtgray"><?=__('open_demo_login_tips')?></span></td>
	<td><input type="radio" name="setting[open_demo_login]" value="1" {#ifchecked(1,$setting['open_demo_login'])#} /> <?=__('yes')?>&nbsp;&nbsp;<input type="radio" name="setting[open_demo_login]" value="0" {#ifchecked(0,$setting['open_demo_login'])#}/> <?=__('no')?></td>
</tr>
<tr>
	<td><span class="bold"><?=__('gzipcompress')?></span>: <br /><span class="txtgray"><?=__('gzipcompress_tips')?></span></td>
	<td><input type="radio" name="setting[gzipcompress]" value="1" {#ifchecked(1,$setting['gzipcompress'])#} /> <?=__('yes')?>&nbsp;&nbsp;<input type="radio" name="setting[gzipcompress]" value="0" {#ifchecked(0,$setting['gzipcompress'])#}/> <?=__('no')?></td>
</tr>
<tr>
	<td><span class="bold"><?=__('perpage')?></span>: <br /><span class="txtgray"><?=__('perpage_tips')?></span></td>
	<td><input type="text" id="perpage" name="setting[perpage]" value="{$setting['perpage']}" maxlength="3"/></td>
</tr>
<tr>
	<td><span class="bold">Cookie作用域:</span><br><span class="txtgray">请填写您的根域名，格式如：phpdisk.com</span></td>
	<td><input type="text" name="setting[cookie_domain]" value="{$settings['cookie_domain']}" maxlength="50" /></td>
</tr>
<tr>
	<td><span class="bold"><?=__('create_default_folder')?></span>: <br /><span class="txtgray"><?=__('create_default_folder_tips')?></span></td>
	<td><input type="text" name="setting[create_default_folder]" value="{$settings['create_default_folder']}" maxlength="30" /></td>
</tr>
<tr>
	<td><span class="bold"><?=__('open_xsendfile')?></span>: <br /><span class="txtgray"><?=__('open_xsendfile_tips')?></span></td>
	<td><input type="radio" name="setting[open_xsendfile]" value="0" {#ifchecked(0,$settings['open_xsendfile'])#} /><?=__('php_flow')?>&nbsp;&nbsp;<input type="radio" name="setting[open_xsendfile]" value="1" {#ifchecked(1,$settings['open_xsendfile'])#}/><?=__('apache_flow')?>&nbsp;&nbsp;<input type="radio" name="setting[open_xsendfile]" value="2" {#ifchecked(2,$settings['open_xsendfile'])#}/><?=__('nginx_flow')?></td>
</tr>
<tr>
	<td><span class="bold">注册新用户是否需要填写邮箱</span>: <br /><span class="txtgray"></span></td>
	<td><input type="radio" name="setting[reg_use_email]" value="1" {#ifchecked(1,$settings['reg_use_email'])#} /><?=__('yes')?>&nbsp;&nbsp;<input type="radio" name="setting[reg_use_email]" value="0" {#ifchecked(0,$settings['reg_use_email'])#}/><?=__('no')?></td>
</tr>
<tr>
	<td><span class="bold">新用户注册后由管理员审核才能使用</span>: <br /><span class="txtgray"></span></td>
	<td><input type="radio" name="setting[check_new_user]" value="1" {#ifchecked(1,$settings['check_new_user'])#} /><?=__('yes')?>&nbsp;&nbsp;<input type="radio" name="setting[check_new_user]" value="0" {#ifchecked(0,$settings['check_new_user'])#}/><?=__('no')?></td>
</tr>
<tr>
	<td><span class="bold">新注册用户所属组</span>: <br /><span class="txtgray"> 设置新注册的用户对应的用户组ID</span></td>
	<td>
	<select name="setting[default_reg_gid]">
	<!--#if(count($gids)){
		foreach($gids as $v){
	#-->
	<option value="{$v[gid]}" {#ifselected($v[gid],$settings[default_reg_gid])#}>(ID:{$v[gid]}) {$v[group_name]}</option>
	<!--#
		}
	}
	#-->
	</select>
	</td>
</tr>

<tr>
	<td>&nbsp;</td>
	<td><input type="submit" class="btn" value="<?=__('btn_update')?>"/></td>
</tr>
</table>
</form>
</div>
</div>
<!--#}#-->
