package public


// AD-Control //

const	Host_adserver					string = "ADSERVER"
const	DaemonPort						string	= "16823"
const	DaemonListen					string	= ":" + DaemonPort
const	ADServerDaemon					string	= Host_adserver + DaemonListen
var		LocalDaemon						string	= User_computername + DaemonListen
const	RandMax							int		= 60
const	Version							string	= "1.0.1"


// user //

var 	User_profile					string	= GetEnv("USERPROFILE")
var 	User_computername				string	= GetEnv("COMPUTERNAME")
var 	User_homeshare					string	= GetEnv("HOMESHARE")
var 	User_userdomain					string	= GetEnv("USERDOMAIN")
var 	User_appdata					string	= GetEnv("appdata")
var 	User_name						string	= GetEnv("USERNAME")
var 	User_name_display				string	= GetEnvFqdn("CN")
var 	User_dept						string	= GetEnv("DEPT")
var 	User_dept_display				string	= GetEnvFqdn("OU")
var 	User_sid						string	= Reg_query_key_one(HKCU,`Software\Microsoft\Windows\CurrentVersion\FileAssociations`,"UserSid")
var		User_sessionID					string	= Reg_query_item_one(HKU,User_sid+`\Volatile Environment`)


// SMB //

const	SMB_adserver 					string	= `\\` +  Host_adserver + `\`
const	SMB_ADSoft						string	= SMB_adserver + `software\`
const	SMB_ADMain						string	= SMB_adserver + `ADMAIN\`
var		SMB_ADMainDept					string	= SMB_ADMain + User_dept_display
var		SMB_ADMainDeptShare				string	= SMB_ADMain + User_dept_display + `\` + "部门共享"
const	SMB_ADSoftlike					string	= SMB_ADSoft + "softlike"
const	SMB_ADSoftApplication			string	= SMB_ADSoft + `application\`	
const	SMB_ADSoftTool					string	= SMB_ADSoft + `tools\`
const	SMB_ADSoftOthTool				string	= SMB_ADSoft + `othtools\`


// Local Folder //

const	Dir_DocuBase					string	= `C:\Users\Public\Documents\AD-Control\`
const	Dir_ADsoftware_local			string	= `F:\software\softlike\`
var		Dir_Windows						string	= GetEnv("windir") + `\`
const	Dir_dept_share					string	= "办公室部门内部共享"
var		Dir_dept_share_full				string	= Reg_Value_WeDriveDir + `\` + Dir_dept_share
const	Dir_DCSave						string	= `D:\DomainUserBackupV2`
var 	Dir_WeDrive								= [2] string {User_appdata + `\Tencent\WXWork\Data`,User_profile + `\Documents\WXWork`}
var		Dir_Be									= []string {Dir_DocuBase}
var		Dir_tmp							string	= GetEnv("tmp")

// application ////

const	App_adct						string	= SMB_ADSoftApplication + "adct.exe"
const	App_MultiSplit					string	= SMB_ADSoftOthTool + "win_MultiSplit.exe"
const	App_FreeFileSyncExe				string	= `C:\Progra~2\zhiwei\FreeFileSync_10.22\FreeFileSync.exe`
//const	App_MulitOpenPages				string	= SMB_ADOtherTool + "MultiOpenPages.bat"


// AD User env //

const	AD_User_main_admin				string = "zhiweiadserver"
const	AD_User_tengfei					string = "tengfei"
const	AD_User_taotengfei				string = "taotengfei"
const	AD_User_huyibo					string = "huyibo"	
const	AD_User_xuwenqiang				string = "xuwenqiang"	
const	AD_User_wol						string = "wol@zhiweireach.com"	


const	Zhiwei_Dept_HB					string	= "HB"
const	Zhiwei_Dept_LP					string	= "LP"
const	Zhiwei_Dept_MT					string	= "MT"
const	Zhiwei_Dept_JR					string	= "JR"
const	Zhiwei_Dept_JD					string	= "JD"
const	Zhiwei_Dept_TXHD				string	= "TXHD"
const	Zhiwei_Dept_TXWJ				string	= "TXWJ"
const	Zhiwei_Dept_BGYJZX				string	= "BGYJZX"
const	Zhiwei_Dept_TECH				string	= "TECH"
const	Zhiwei_Dept_Count				      	= 9


// backup //

var		BackupVersion						string	= "0611B"
var		BackupExtFile						string	= ".ffs_batch"
var		BackupReplaceKey				          	=[]byte("-tengfei-")


// reg info //

const (
	HKCU									  	= iota
	HKLM
	HKU
)
const	Reg_Root_ac						int   	= HKLM
const	Reg_Root_dc						int		= HKCU					
const	Reg_Path_home					string	= `SOFTWARE\ADControl`
const	Reg_Path_home_ac				string	= Reg_Path_home + `\DomainComputer\`		// use for adserver,not for dc
const	Reg_Name_TurnOnTime				string	= "TurnOnTime"
const	Reg_Name_TurnOffTime			string	= "TurnOffTime"
const	Reg_Name_LoginUserName			string	= "loginUser"
const	Reg_Name_LoginTime				string	= "loginTime"
const	Reg_Name_LogOffTime				string	= "LogOffTime"
const	Reg_Name_BackupUserName			string	= "BackupUserName"
const	Reg_Name_BackupOverTime			string	= "BackupOverTime"
const	Reg_Name_WeDriveDir				string	= "WeDriveDir"
const	Reg_Name_MACaddress				string	= "MACaddress"
const	Reg_Name_PrimaryUser			string	= "PrimaryUser"
const	Reg_Name_PowerStatus			string	= "PowerStatus"


// reg value //

var		Reg_Value_WeDriveDir			string	= Reg_query_key_one(HKCU,Reg_Path_home,Reg_Name_WeDriveDir)
var		Reg_Value_PowerStatus_ON		string	= "ON"
var		Reg_Value_PowerStatus_OFF		string	= "OFF"


// other //

const	Link_WxworkBot					string	= `https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=59107f72-5b72-4a20-a33c-fdb1cd46f2c6`
const	Cmd_k							string	= "cmd /k "	
const	Cmd_K_Start						string	= "cmd /k start "
var		CopyStatusWeDrive				map [string]bool

