class_extension : verify that the file does exist

This commit is contained in:
Dany De Bontridder 2010-05-04 23:26:25 +00:00
parent 5c26cd14ba
commit 44a4fdf589

View file

@ -74,7 +74,9 @@ class Extension
// Verify that the elt we want to add is correct
if (trim($this->ex_code)=="") throw new Exception('Le code ne peut pas être vide');
if (trim($this->ex_name)=="") throw new Exception('Le nom ne peut pas être vide');
if (trim($this->ex_file)=="") throw new Exception('Chemin incorrect');
if (file_exists('..'.DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'ext'.DIRECTORY_SEPARATOR.$this->ex_file) == false)
throw new Exception ('Extension non trouvée, le chemin est-il correct?');
}
/*!\brief call insert for a new plugin or update if the plugin exist */
public function save() {