ckfinder/_source/Connector/CommandHandlers/InitCommandHandler.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*
 * CKFinder
 * ========
 * http://ckfinder.com
 * Copyright (C) 2007-2012, CKSource - Frederico Knabben. All rights reserved.
 *
 * The software, this file and its contents are subject to the CKFinder
 * License. Please read the license.txt file before using, installing, copying,
 * modifying or distribute this file or part of its contents. The contents of
 * this file is part of the Source Code of CKFinder.
 */

using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace CKFinder.Connector.CommandHandlers
{
	internal class InitCommandHandler : XmlCommandHandlerBase
	{
		public const string K_CHARS = "123456789ABCDEFGHJKLMNPQRSTUVWXYZ";

		public InitCommandHandler()
			: base()
		{ }

		protected override bool MustCheckRequest()
		{
			return false;
		}

		protected override bool MustIncludeCurrentFolder()
		{
			return false;
		}

		protected override void BuildXml()
		{
			Config _Config = Config.Current;
			bool _IsEnabled = _Config.CheckAuthentication();

			// Create the "ConnectorInfo" node.
			XmlNode oConnInfo = XmlUtil.AppendElement( this.ConnectorNode, "ConnectorInfo" );
			XmlUtil.SetAttribute( oConnInfo, "enabled", _IsEnabled.ToString().ToLower() );

			if ( !_IsEnabled )
				ConnectorException.Throw( Errors.ConnectorDisabled );

			string ln = "" ;
			string lc = _Config.LicenseKey.ToUpper() ;
			int index = K_CHARS.IndexOf( lc[0] ) % 5;

			if ( 1 == index || 4 == index )
				ln = _Config.LicenseName.ToLower();

			XmlUtil.SetAttribute( oConnInfo, "imgWidth", _Config.Images.MaxWidth.ToString() );
			XmlUtil.SetAttribute( oConnInfo, "imgHeight", _Config.Images.MaxHeight.ToString() );
			XmlUtil.SetAttribute( oConnInfo, "s", ln );
			XmlUtil.SetAttribute( oConnInfo, "c", string.Concat( lc[11] , lc[0] , lc[8] , lc[12], lc[26], lc[2], lc[3], lc[25], lc[1] ).Trim() );
后面还有 79 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。