1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- class BackupaccountAction extends FormAction
- {
- protected $form = 'BackupAccount';
- function title()
- {
-
- return _('Backup account');
- }
- protected function doPreparation()
- {
- if (!$this->scoped->hasRight(Right::BACKUPACCOUNT)) {
-
- throw new ClientException(_('You may not backup your account.'), 403);
- }
- return true;
- }
- protected function doPost()
- {
- $stream = new UserActivityStream($this->scoped->getUser(), true, UserActivityStream::OUTPUT_RAW);
- header('Content-Disposition: attachment; filename='.urlencode($this->scoped->getNickname()).'.atom');
- header('Content-Type: application/atom+xml; charset=utf-8');
-
-
- $this->raw($stream->getString());
-
- exit(0);
- }
- public function isReadOnly($args) {
- return true;
- }
- function lastModified()
- {
-
-
- return null;
- }
- function etag()
- {
- return null;
- }
- }
|