ultimix
subscription_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 $Security = false;
40 
51  function __construct()
52  {
53  try
54  {
55  $this->Security = get_package( 'security' , 'last' , __FILE__ );
56  $this->SubscriptionAlgorithms = get_package(
57  'subscription::subscription_algorithms' , 'last' , __FILE__
58  );
59  }
60  catch( Exception $e )
61  {
62  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
63  }
64  }
65 
84  function unsibscribe( $Options )
85  {
86  try
87  {
88  $UserId = $this->Security->get_gp( 'user_id' , 'integer' , false );
89 
90  if( $UserId !== false )
91  {
92  $Hash = $this->Security->get_gp( 'hash' , 'string' );
93 
94  $this->SubscriptionAlgorithms->unsubscribe_user( $UserId , $Hash );
95  }
96  }
97  catch( Exception $e )
98  {
99  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
100  }
101  }
102 
121  function controller( $Options )
122  {
123  try
124  {
125  $ContextSet = get_package_object( 'gui::context_set' , 'last' , __FILE__ );
126 
127  $Path = dirname( __FILE__ );
128 
129  $ContextSet->add_context( "$Path/conf/cfcxs_unsubscribe" );
130 
131  $ContextSet->execute( $Options , $this , __FILE__ );
132  }
133  catch( Exception $e )
134  {
135  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
136  }
137  }
138  }
139 
140 ?>