1: <?php
2: /**
3: * This provider fetches the data from a remote server by redirecting.
4: *
5: * PHP version 5
6: *
7: * @category Kolab
8: * @package Kolab_FreeBusy
9: * @author Gunnar Wrobel <wrobel@pardus.de>
10: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
11: * @link http://pear.horde.org/index.php?package=Kolab_FreeBusy
12: */
13:
14: /**
15: * This provider fetches the data from a remote server by redirecting.
16: *
17: * Copyright 2011-2012 Horde LLC (http://www.horde.org/)
18: *
19: * See the enclosed file COPYING for license information (LGPL). If
20: * you did not receive this file, see
21: * http://www.horde.org/licenses/lgpl21.
22: *
23: * @category Kolab
24: * @package Kolab_FreeBusy
25: * @author Gunnar Wrobel <wrobel@pardus.de>
26: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
27: * @link http://pear.horde.org/index.php?package=Kolab_FreeBusy
28: */
29: class Horde_Kolab_FreeBusy_Provider_Remote_Redirect
30: extends Horde_Kolab_FreeBusy_Provider_Remote
31: {
32: /**
33: * Trigger a resource.
34: *
35: * @param Horde_Controller_Response $response The response handler.
36: * @param array $params Additional parameters.
37: *
38: * @return NULL
39: */
40: public function trigger(
41: Horde_Controller_Response $response,
42: $params = array()
43: )
44: {
45: $this->_redirect($response);
46: }
47:
48: /**
49: * Fetch data for an owner.
50: *
51: * @param Horde_Controller_Response $response The response handler.
52: * @param array $params Additional parameters.
53: *
54: * @return NULL
55: */
56: public function fetch(
57: Horde_Controller_Response $response,
58: $params = array()
59: )
60: {
61: $this->_redirect($response);
62: }
63:
64: /**
65: * Redirect the user.
66: *
67: * @param Horde_Controller_Response $response The response handler.
68: *
69: * @return NULL
70: */
71: private function _redirect(Horde_Controller_Response $response)
72: {
73: $response->setRedirectUrl($this->getUrl());
74: }
75:
76: /**
77: * Delete data of an owner.
78: *
79: * @param Horde_Controller_Response $response The response handler.
80: * @param array $params Additional parameters.
81: *
82: * @return NULL
83: */
84: public function delete(
85: Horde_Controller_Response $response,
86: $params = array()
87: )
88: {
89: throw new Horde_Kolab_FreeBusy_Exception(
90: 'Action "regenerate" not supported for remote servers!'
91: );
92: }
93:
94: /**
95: * Regenerate all data accessible to the current user.
96: *
97: * @param Horde_Controller_Response $response The response handler.
98: * @param array $params Additional parameters.
99: *
100: * @return NULL
101: */
102: public function regenerate(
103: Horde_Controller_Response $response,
104: $params = array()
105: )
106: {
107: throw new Horde_Kolab_FreeBusy_Exception(
108: 'Action "regenerate" not supported for remote servers!'
109: );
110: }
111: }