UnsubscribeController.php
1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
class UnsubscribeController extends QLib_Controller_Default_Action
{
public function init() {
parent::preDispatch();
$this->QLayoutLink()->appendStylesheet($this->_css('style_css'))->appendStylesheet($this->_css('common_style'));
if($this->uid < 1)
{
$this->helpRefresh('/passport/signin/unsubscribe');
}
}
public function indexAction()
{
$userinfo = $this->helpProfile($this->uid, 'less');
$info = QCSubscribe_Models_Client::checkUnsubscribe($userinfo['email']);
if(!empty($info))
{
$this->view->status = 3;
return $this->render('save');
}
}
public function saveAction()
{
$userinfo = $this->helpProfile($this->uid, 'less');
$remark = $this->helpGpost('remark');
$desc = '';
$i = 1;
foreach ($remark as $v)
{
$desc .= $i . '.' . $v . '<br />';
++$i;
}
$this->view->status = QCSubscribe_Models_Client::setUnsubscribe($userinfo['email'], $desc);
}
}