[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/template/ -> templatesandbox.class.php (sommaire)

(pas de description)

Poids: 175 lignes (6 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

TemplateSandbox:: (6 méthodes):
  TemplateSandbox()
  checkForbiddenFiles()
  checkTemplateSet()
  checkTemplateFolder()
  cleanUp()
  toTemplateSetName()


Classe: TemplateSandbox  - X-Ref

\ingroup Template

This class checks that a file that is going to be added to a template, or
a packed file with a template set has the right contents.

Everything happens sandboxed because it could be possible that the user is
trying to upload an executable file (.php, etc) as part of the template. Sandboxed
means that everything happens in a random temporary folder and that in case of
error, everything is removed from disk.

TemplateSandbox()   X-Ref
Pas de description

checkForbiddenFiles( $folder )   X-Ref
Goes through all the files in the folder to see if any of the files
has any of the forbidden extensions.

param: folder The folder where files are, it will be scanned
return: Returns true if all files are ok or false otherwise.

checkTemplateSet( $file, $filePath )   X-Ref
Makes sure that the file is a valid template set. The file can be packed
in any of the formats supported by the Unpacker class (.tar.gz, .tar.bz2
and .zip as of the time of writing these lines)
Returns true if the template is valid or a negative value carrying an
error code.

param: file The file that contains the template set
return: Returns true (positive value) if template set is ok or a negative

checkTemplateFolder( $templateName, $templateFolder )   X-Ref
Once we have a folder with some template files, we make sure that what's
inside is fine (no forbidden files, etc)

param: templateName
param: templateFolder
return:

cleanUp( $folder )   X-Ref
Cleans all the temporary folders used by this class during
its execution.

param: $folder The name of the temporary folder used
return: Returns true

toTemplateSetName( $uploadFile )   X-Ref
Convert the upload file name to template set name

param: $uploadFile The name of the upload file
return: Return the template set name



Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics