示例#1
0
文件: ml.inc.php 项目: Ekleog/platal
 public function HandleAction($action)
 {
     switch ($action) {
         case 'suscribe':
             S::assert_xsrf_token();
             $subs = array_keys(Post::v('sub_ml'));
             $res = XDB::iterRow("SELECT  sub, domain\n                                   FROM  register_subs\n                                  WHERE  uid = {?} AND type = 'list'\n                               ORDER BY  domain", S::i('uid'));
             while (list($sub, $domain) = $res->next()) {
                 if (array_shift($subs) == "{$sub}@{$domain}") {
                     MailingList::subscribeTo($sub, $domain);
                 }
             }
             $this->UpdateOnYes();
             pl_redirect('lists');
             break;
         case 'dismiss':
             $this->UpdateOnDismiss();
             break;
         case 'no':
             $this->UpdateOnNo();
             break;
     }
 }