⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 authenticationhandlers.txt

📁 将本目录下的所有文件与目录传上您的服务器IIS虚拟目录下.并配置好ASP.NET的运行环境.更改好数据库连接地址即可.
💻 TXT
字号:
Authentication via connector::In my PHP connector the one from the FBXP project, it is possible to require authentication before a user can usethe connector. The works in the following manor:-A1/ File Browser Requests Command From ConnectorA2/ Connector.php recieves the request	B1/ File config.php imported	B2/ If authentication required load the authentication		handler file specified in the config, i.e.		$config['auth']['HandlerClass']='Default';		the Auth/Default.php will be imported	B3/ Create new instance of Auth class (defined in the		authentication handler imported.		C1/ Auth class, authenticate method called, passing			the data recieved in the ExtraParams variable			of the query string.		C2/ authenticate method returns a modified copy of the 			$config, to indicate successfull authentication			$config['authSuccess'] should be set to true, if			the authentication failed this should be set to false.			B4a/ on success command is executed and output sent to client	B4b/ on failure blank xml response returned.A3/ EndHow to create my own authentication handler::Create a file in the Auth folder with the name of the handler (your choice)i.e. If i wanted to call it MySQL the file i would create would beMySQL.php in the Auth folder.Skeleton for the new authentication class::<?phpclass Auth {	function authenticate($data,$config) {		}}?>as you can see the class must have a method called authenticate whichtakes two parameters, the value from the ExtraParams ($data) and a reference to the connector configuration $config (so you can changethings depending on the user if you wish) , you can now put whatever code you like in that method to determine if the user is allowed or not. (you may add extra function to the class for internal use too,these will not be called by the connector, but call them from insidethe authenticate method). The function returns a modified copy of the$config, with any changes you like + the addition of a top level array element key: authSuccess   value: true if authenticationsuccessful, else false.If you want to limit what the user can do then you may want to change the array at: $config['Commands']This holds an array of command that can be executed, if you remove sayDeleteFolder from the array then the user will not be able to delete a folder.By Example:: There is a default authentication handler that i wrote todistribute with the connector, so you may want to take a look at itto get a better idea of whats going on.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -