[ Index ]
 

Code source de FCKeditor 2.4

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/editor/filemanager/browser/default/connectors/asp/ -> io.asp (source)

   1  <!--
   2   * FCKeditor - The text editor for Internet - http://www.fckeditor.net
   3   * Copyright (C) 2003-2007 Frederico Caldeira Knabben
   4   * 
   5   * == BEGIN LICENSE ==
   6   * 
   7   * Licensed under the terms of any of the following licenses at your
   8   * choice:
   9   * 
  10   *  - GNU General Public License Version 2 or later (the "GPL")
  11   *    http://www.gnu.org/licenses/gpl.html
  12   * 
  13   *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
  14   *    http://www.gnu.org/licenses/lgpl.html
  15   * 
  16   *  - Mozilla Public License Version 1.1 or later (the "MPL")
  17   *    http://www.mozilla.org/MPL/MPL-1.1.html
  18   * 
  19   * == END LICENSE ==
  20   * 
  21   * File Name: io.asp
  22   *     This file include IO specific functions used by the ASP Connector.
  23   * 
  24   * File Authors:
  25   *         Frederico Caldeira Knabben (www.fckeditor.net)
  26  -->
  27  <%
  28  Function GetUrlFromPath( resourceType, folderPath )
  29      If resourceType = "" Then
  30          GetUrlFromPath = RemoveFromEnd( sUserFilesPath, "/" ) & folderPath
  31      Else
  32          GetUrlFromPath = sUserFilesPath & LCase( resourceType ) & folderPath
  33      End If
  34  End Function
  35  
  36  Function RemoveExtension( fileName )
  37      RemoveExtension = Left( fileName, InStrRev( fileName, "." ) - 1 )
  38  End Function
  39  
  40  Function ServerMapFolder( resourceType, folderPath )
  41      ' Get the resource type directory.
  42      Dim sResourceTypePath
  43      sResourceTypePath = sUserFilesDirectory & LCase( resourceType ) & "\"
  44      
  45      ' Ensure that the directory exists.
  46      CreateServerFolder sResourceTypePath
  47  
  48      ' Return the resource type directory combined with the required path.
  49      ServerMapFolder = sResourceTypePath & RemoveFromStart( folderPath, "/" )
  50  End Function
  51  
  52  Sub CreateServerFolder( folderPath )
  53      Dim oFSO
  54      Set oFSO = Server.CreateObject( "Scripting.FileSystemObject" )
  55      
  56      Dim sParent
  57      sParent = oFSO.GetParentFolderName( folderPath )
  58      
  59      ' Check if the parent exists, or create it.
  60      If ( NOT oFSO.FolderExists( sParent ) ) Then CreateServerFolder( sParent )
  61      
  62      If ( oFSO.FolderExists( folderPath ) = False ) Then 
  63          oFSO.CreateFolder( folderPath )
  64      End If
  65      
  66      Set oFSO = Nothing
  67  End Sub
  68  
  69  Function IsAllowedExt( extension, resourceType )
  70      Dim oRE
  71      Set oRE    = New RegExp
  72      oRE.IgnoreCase    = True
  73      oRE.Global        = True
  74      
  75      Dim sAllowed, sDenied
  76      sAllowed    = ConfigAllowedExtensions.Item( resourceType )
  77      sDenied        = ConfigDeniedExtensions.Item( resourceType )
  78      
  79      IsAllowedExt = True
  80      
  81      If sDenied <> "" Then
  82          oRE.Pattern    = sDenied
  83          IsAllowedExt    = Not oRE.Test( extension )
  84      End If 
  85      
  86      If IsAllowedExt And sAllowed <> "" Then
  87          oRE.Pattern        = sAllowed
  88          IsAllowedExt    = oRE.Test( extension )
  89      End If
  90      
  91      Set oRE    = Nothing
  92  End Function
  93  %>


Généré le : Sun Feb 25 15:28:05 2007 par Balluche grâce à PHPXref 0.7