2 if (!defined('GNUSOCIAL')) { exit(1); }
5 * An exception for private streams
9 * @author Mikael Nordfeldth <mmn@hethane.se>
10 * @copyright 2016 Free Software Foundation, Inc.
11 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
14 class PrivateStreamException extends AuthorizationException
16 var $owner = null; // owner of the private stream
17 var $reader = null; // reader, may be null if not logged in
19 public function __construct(Profile $owner, Profile $reader=null)
21 $this->owner = $owner;
22 $this->reader = $reader;
24 // TRANS: Message when a private stream attemps to be read by unauthorized third party.
25 $msg = sprintf(_m('This stream is protected and only authorized subscribers may see its contents.'));
27 // If $reader is a profile, authentication has been made but still not accepted (403),
28 // otherwise authentication may give access to this resource (401).
29 parent::__construct($msg, ($reader instanceof Profile ? 403 : 401));