123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- if (!defined('GNUSOCIAL') && !defined('STATUSNET')) { exit(1); }
- class AddMirrorAction extends BaseMirrorAction
- {
- var $feedurl;
-
- protected function prepare(array $args=array())
- {
- parent::prepare($args);
- $feedurl = $this->getFeedUrl();
- $this->feedurl = $this->validateFeedUrl($feedurl);
- $this->profile = $this->profileForFeed($this->feedurl);
- return true;
- }
- function getFeedUrl()
- {
- $provider = $this->trimmed('provider');
- switch ($provider) {
- case 'feed':
- return $this->trimmed('feedurl');
- default:
-
- throw new Exception(_m('Internal form error: Unrecognized feed provider.'));
- }
- }
- protected function saveMirror()
- {
- $this->oprofile->subscribe();
- SubMirror::saveMirror($this->user, $this->profile);
- }
- }
|