コード例 #1
0
 public function index_onDelete()
 {
     if (($checkedIds = post('checked')) && is_array($checkedIds) && count($checkedIds)) {
         foreach ($checkedIds as $recordId) {
             if (!($record = Subscriber::find($recordId))) {
                 continue;
             }
             $record->delete();
         }
         Flash::success(Lang::get('backend::lang.list.delete_selected_success'));
     } else {
         Flash::error(Lang::get('backend::lang.list.delete_selected_empty'));
     }
     return $this->listRefresh();
 }
コード例 #2
0
ファイル: Template.php プロジェクト: aydancoskun/octobercms
 protected function handleVerify($code)
 {
     $parts = explode('!', base64_decode($code));
     if (count($parts) < 2) {
         throw new ApplicationException('Invalid code');
     }
     list($subscriberId, $hash) = $parts;
     $subscriber = Subscriber::find((int) $subscriberId);
     if (!$subscriber) {
         throw new ApplicationException('Invalid code');
     }
     $verifyCode = $subscriber->getUniqueCode();
     if ($code != $verifyCode) {
         throw new ApplicationException('Invalid hash');
     }
     $subscriber->confirmed_ip_address = Request::ip();
     $subscriber->confirmed_at = $subscriber->freshTimestamp();
     $subscriber->unsubscribed_at = null;
     $subscriber->save();
     // @todo Template + Language
     return '<html><head><title>Verification successful</title></head><body><h1>Verification successful</h1><p>Your email has been successfully added to this list!</p></body></html>';
 }