Example #1
0
 private function newKeys()
 {
     set_time_limit(30000);
     $path = get_include_path();
     $rsa = new Crypt_RSA();
     $keys = $rsa->createKey($this->bits);
     set_include_path($path);
     if ($this->type == "filegallery") {
         FileGallery_File::filename($this->certName)->setParam("description", $this->certName)->replace(json_encode($keys));
     }
     if ($this->type == "file") {
         file_put_contents("temp/" . $this->certName, json_encode($keys));
     }
     return $keys;
 }
Example #2
0
 public function delete()
 {
     global $tikilib;
     if ($this->isFileGal == true) {
         FileGallery_File::filename($this->name)->delete();
     } else {
         TikiLib::lib("cache")->empty_type_cache(get_class($this));
     }
 }
Example #3
0
 function diffLatestWithArchive($archive = 0)
 {
     include_once "lib/diff/Diff.php";
     $textDiff = new Text_Diff(FileGallery_File::id($this->getParam('fileId'))->archive($archive)->data(), $this->data());
     return $textDiff->getDiff();
 }
Example #4
0
 public function listArchives()
 {
     $archives = array();
     if ($this->isFileGal == true) {
         $file = FileGallery_File::filename($this->name);
         foreach ($file->listArchives() as $archive) {
             $archive = $this->open();
             $archives[$archive->feed->date] = $archive->feed->entry;
         }
     }
     return $archives;
 }