Beispiel #1
0
 private function deleteBackup()
 {
     if ($this->_realAccessLevel < ACCESS_LEVEL_SA) {
         CommonErrors::fatal(COMMONERROR_PERMISSION, $this);
         return;
         //$this->fatal(ERROR_NO_PERMISSION);
     }
     $attachments = new Attachments(CATS_ADMIN_SITE);
     $attachments->deleteAll(DATA_ITEM_COMPANY, $_SESSION['CATS']->getSiteCompanyID(), "AND content_type = 'catsbackup'");
     CATSUtility::transferRelativeURI('m=settings&a=createBackup');
 }
Beispiel #2
0
    $directory = $_SESSION['CATS']->retrieveValueByName('backupDirectory');
    @file_put_contents($directory . 'progress.txt', $command);
}


if ($action == 'start')
{
    $companyID = $_SESSION['CATS']->getSiteCompanyID();
    $attachmentsOnly = $interface->isChecked('attachmentsOnly');

    /* Delete any old backups. */
    $attachments = new Attachments(CATS_ADMIN_SITE);
    $attachments->deleteAll(
        DATA_ITEM_COMPANY,
        $companyID,
        "AND content_type = 'catsbackup'"
    );
    
    /* Build title string. */
    if ($attachmentsOnly)
    {
        $title = 'CATS Attachments Backup';
    }
    else
    {
        $title = 'CATS Backup';
    }

    $attachmentCreator = new AttachmentCreator(CATS_ADMIN_SITE);
    $attachmentCreator->createFromFile(