ultimix
pmsg_controller.php
Go to the documentation of this file.
1 <?php
2 
3  /*
4  * This source code is a part of the Ultimix Project.
5  * It is distributed under BSD license. All other third side source code (like tinyMCE) is distributed under
6  * it's own license wich could be found from the corresponding files or sources.
7  * This source code is provided "as is" without any warranties or garanties.
8  *
9  * Have a nice day!
10  *
11  * @url http://ultimix.sorceforge.net
12  *
13  * @author Alexey "gdever" Dodonov
14  */
15 
27 
38  var $MessageAccess = false;
39  var $Security = false;
40 
51  function __construct()
52  {
53  try
54  {
55  $this->MessageAccess = get_package( 'pmsg::pmsg_access' , 'last' , __FILE__ );
56  $this->Security = get_package( 'security' , 'last' , __FILE__ );
57  }
58  catch( Exception $e )
59  {
60  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
61  }
62  }
63 
78  function set_read()
79  {
80  try
81  {
82  $id = $this->Security->get_gp( 'id' , 'integer' , 0 );
83 
84  $PmsgAlgorithms = get_package( 'pmsg::pmsg_algorithms' , 'last' , __FILE__ );
85  $PmsgAlgorithms->set_read( $id );
86  }
87  catch( Exception $e )
88  {
89  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
90  }
91  }
92 
107  function send_feedback()
108  {
109  try
110  {
111  $SecurityParser = get_package( 'security::security_parser' , 'last' , __FILE__ );
112 
113  $Captcha = get_package( 'captcha' , 'last' , __FILE__ );
114 
115  if( $Captcha->validate_captcha( $this->Security->get_p( 'captcha' , 'command' ) ) )
116  {
117  $Params = $SecurityParser->parse_http_parameters( 'message:string' );
118 
119  $this->MessageAccess->create(
120  'guest' , $this->MessageAccess->get_feedback_admin() , $Params->message
121  );
122 
123  $this->Security->reset_p( 'message' , '' );
124  }
125  }
126  catch( Exception $e )
127  {
128  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
129  }
130  }
131 
150  function controller( $Options )
151  {
152  try
153  {
154  $ContextSet = get_package( 'gui::context_set' , 'last' , __FILE__ );
155 
156  $ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcx_feedback' );
157  $ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcx_read' );
158  $ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcx_cleanup' );
159 
160  $ContextSet->execute( $Options , $this , __FILE__ );
161  }
162  catch( Exception $e )
163  {
164  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
165  }
166  }
167  }
168 
169 ?>