/**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     // action to execute
     $action = SpoonFilter::getGetValue('action', array('delete', 'export'), '');
     $this->groupId = SpoonFilter::getGetValue('group_id', null, '');
     // no id's provided
     if (!$action) {
         $this->redirect(BackendModel::createURLForAction('addresses') . '&error=no-action-selected');
     }
     if (!isset($_GET['emails'])) {
         $this->redirect(BackendModel::createURLForAction('addresses') . '&error=no-items-selected');
     } else {
         // redefine id's
         $this->emails = (array) $_GET['emails'];
         // evaluate $action, see what action was triggered
         switch ($action) {
             case 'delete':
                 $this->deleteAddresses();
                 break;
             case 'export':
                 $this->exportAddresses();
                 break;
         }
     }
 }
 /**
  * Execute the action
  *
  * @return	void
  */
 public function execute()
 {
     // call parent, this will probably add some general CSS/JS or other required files
     parent::execute();
     // action to execute
     $action = SpoonFilter::getGetValue('action', array('delete'), '');
     // get passed group ID
     $id = SpoonFilter::getGetValue('group_id', null, 0, 'int');
     // fetch group record
     $this->group = BackendMailmotorModel::getGroup($id);
     // set redirect URL
     $redirectURL = BackendModel::createURLForAction('custom_fields') . '&group_id=' . $this->group['id'];
     // no id's provided
     if (!$action) {
         $this->redirect($redirectURL . '&error=no-action-selected');
     }
     if (!isset($_GET['fields'])) {
         $this->redirect($redirectURL . '&error=no-items-selected');
     }
     if (empty($this->group)) {
         $this->redirect(BackendModel::createURLForAction('groups') . '&error=non-existing');
     } else {
         // redefine id's
         $this->fields = (array) $_GET['fields'];
         // evaluate $action, see what action was triggered
         switch ($action) {
             case 'delete':
                 $this->deleteCustomFields();
                 break;
         }
     }
 }
예제 #3
0
 /**
  * Execute the action
  */
 public function execute()
 {
     // call parent, this will probably add some general CSS/JS or other required files
     parent::execute();
     // action to execute
     $id = SpoonFilter::getGetValue('id', null, 0);
     // no id's provided
     if (empty($id) || !BackendMailmotorModel::existsMailing($id)) {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=mailing-does-not-exist');
     } else {
         // get the mailing and reset some fields
         $mailing = BackendMailmotorModel::getMailing($id);
         $mailing['status'] = 'concept';
         $mailing['send_on'] = null;
         $mailing['created_on'] = BackendModel::getUTCDate('Y-m-d H:i:s');
         $mailing['edited_on'] = $mailing['created_on'];
         $mailing['data'] = serialize($mailing['data']);
         unset($mailing['recipients'], $mailing['id'], $mailing['cm_id'], $mailing['send_on_raw']);
         // set groups
         $groups = $mailing['groups'];
         unset($mailing['groups']);
         // create a new mailing based on the old one
         $newId = BackendMailmotorModel::insertMailing($mailing);
         // update groups for this mailing
         BackendMailmotorModel::updateGroupsForMailing($newId, $groups);
         // trigger event
         BackendModel::triggerEvent($this->getModule(), 'after_copy_mailing', array('item' => $mailing));
     }
     // redirect
     $this->redirect(BackendModel::createURLForAction('index') . '&report=mailing-copied&var=' . $mailing['name']);
 }
예제 #4
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     // action to execute
     $action = SpoonFilter::getGetValue('action', array('delete'), '');
     // form id
     $formId = SpoonFilter::getGetValue('form_id', null, '', 'int');
     // no id's provided
     if (!isset($_GET['id'])) {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=no-items-selected');
     } elseif ($action == '') {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=no-action-selected');
     } elseif (!BackendFormBuilderModel::exists($formId)) {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
     } else {
         // redefine id's
         $ids = (array) $_GET['id'];
         // delete comment(s)
         if ($action == 'delete') {
             BackendFormBuilderModel::deleteData($ids);
         }
         // define report
         $report = count($ids) > 1 ? 'items-' : 'item-';
         // init var
         if ($action == 'delete') {
             $report .= 'deleted';
         }
         // redirect
         $this->redirect(BackendModel::createURLForAction('data') . '&id=' . $formId . '&report=' . $report);
     }
 }
예제 #5
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     BackendAuthentication::logout();
     // redirect to login-screen
     $this->redirect(BackendModel::createUrlForAction('index', $this->getModule()));
 }
예제 #6
0
 /**
  * Execute the action
  *
  * @return	void
  */
 public function execute()
 {
     // call parent, this will probably add some general CSS/JS or other required files
     parent::execute();
     // log out the current user
     BackendAuthentication::logout();
     // redirect to login-screen
     $this->redirect(BackendModel::createUrlForAction('index', $this->getModule()));
 }
예제 #7
0
 /**
  * Execute the action.
  */
 public function execute()
 {
     $this->id = $this->getParameter('id', 'int');
     // does the item exist
     if ($this->id !== null && BackendFormBuilderModel::exists($this->id)) {
         parent::execute();
         $this->setFilter();
         $this->setItems();
         BackendCSV::outputCSV(date('Ymd_His') . '.csv', $this->rows, $this->columnHeaders);
     } else {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
     }
 }
예제 #8
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     // action to execute
     $id = SpoonFilter::getGetValue('id', null, 0);
     // no id's provided
     if (!BackendMailmotorModel::existsMailing($id)) {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=mailing-does-not-exist');
     } else {
         BackendMailmotorModel::exportStatistics($id);
     }
     // redirect
     $this->redirect(BackendModel::createURLForAction('groups') . '&report=export-failed');
 }
 /**
  * Execute the action
  *
  * @return	void
  */
 public function execute()
 {
     // call parent, this will probably add some general CSS/JS or other required files
     parent::execute();
     // action to execute
     $id = SpoonFilter::getGetValue('id', null, 0);
     // no id's provided
     if (!BackendMailmotorModel::existsCampaign($id)) {
         $this->redirect(BackendModel::createURLForAction('campaigns') . '&error=campaign-does-not-exist');
     } else {
         BackendMailmotorModel::exportStatisticsByCampaignID($id);
     }
     // redirect
     $this->redirect(BackendModel::createURLForAction('groups') . '&report=export-failed');
 }
예제 #10
0
 /**
  * Execute the action.
  *
  * @return	void
  */
 public function execute()
 {
     // call parent, this will probably add some general CSS/JS or other required files
     parent::execute();
     // action to execute
     $action = SpoonFilter::getGetValue('action', array('addToGroup', 'delete'), '');
     $ids = isset($_GET['id']) ? (array) $_GET['id'] : array();
     $newGroupId = SpoonFilter::getGetValue('newGroup', array_keys(BackendProfilesModel::getGroups()), '');
     // at least one id
     if (!empty($ids)) {
         // delete the given profiles
         if ($action === 'delete') {
             BackendProfilesModel::delete($ids);
             $report = 'deleted';
         } elseif ($action === 'addToGroup') {
             // for which we need a group of course
             if ($newGroupId != '') {
                 // set new status
                 foreach ($ids as $id) {
                     // profile must exist
                     if (BackendProfilesModel::exists($id)) {
                         // make sure the user is not already part of this group without an expiration date
                         foreach (BackendProfilesModel::getProfileGroups($id) as $existingGroup) {
                             // if he is, skip to the next user
                             if ($existingGroup['group_id'] === $newGroupId) {
                                 continue 2;
                             }
                         }
                         // OK, it's safe to add the user to this group
                         BackendProfilesModel::insertProfileGroup(array('profile_id' => $id, 'group_id' => $newGroupId, 'starts_on' => BackendModel::getUTCDate()));
                     }
                 }
                 // report
                 $report = 'added-to-group';
             } else {
                 $this->redirect(BackendModel::createURLForAction('index') . '&error=no-group-selected');
             }
         } else {
             $this->redirect(BackendModel::createURLForAction('index') . '&error=unknown-action');
         }
         // report
         $report = (count($ids) > 1 ? 'profiles-' : 'profile-') . $report;
         // redirect
         $this->redirect(BackendModel::createURLForAction('index', null, null, array('offset' => SpoonFilter::getGetValue('offset', null, ''), 'order' => SpoonFilter::getGetValue('order', null, ''), 'sort' => SpoonFilter::getGetValue('sort', null, ''), 'email' => SpoonFilter::getGetValue('email', null, ''), 'status' => SpoonFilter::getGetValue('status', null, ''), 'group' => SpoonFilter::getGetValue('group', null, ''))) . '&report=' . $report);
     } else {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=no-profiles-selected');
     }
 }
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     $action = SpoonFilter::getGetValue('action', array('delete'), 'delete');
     // no id's provided
     if (!isset($_GET['id'])) {
         $this->redirect(BackendModel::createURLForAction('landing_pages') . '&error=no-items-selected');
     } else {
         // delete items
         if ($action == 'delete') {
             BackendAnalyticsModel::deleteLandingPage((array) $_GET['id']);
         }
     }
     // redirect
     $this->redirect(BackendModel::createURLForAction('landing_pages') . '&report=' . $action);
 }
예제 #12
0
 /**
  * Execute the action
  */
 public function execute()
 {
     $email = $this->getParameter('email', 'string');
     // does the user exist
     if ($email !== null) {
         parent::execute();
         // delete item
         if (BackendUsersModel::undoDelete($email)) {
             // get user
             $user = new BackendUser(null, $email);
             // item was deleted, so redirect
             $this->redirect(BackendModel::createURLForAction('edit') . '&id=' . $user->getUserId() . '&report=restored&var=' . $user->getSetting('nickname') . '&highlight=row-' . $user->getUserId());
         } else {
             $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
         }
     } else {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
     }
 }
예제 #13
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     // action to execute
     $action = SpoonFilter::getGetValue('action', array('delete'), 'delete');
     // no id's provided
     if (!isset($_GET['id'])) {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=no-selection');
     } else {
         // redefine id's
         $aIds = (array) $_GET['id'];
         // delete comment(s)
         if ($action == 'delete') {
             BackendTagsModel::delete($aIds);
         }
     }
     // redirect
     $this->redirect(BackendModel::createURLForAction('index') . '&report=deleted');
 }
 /**
  * Execute the action
  *
  * @return	void
  */
 public function execute()
 {
     // call parent, this will probably add some general CSS/JS or other required files
     parent::execute();
     // action to execute
     $action = SpoonFilter::getGetValue('action', array('delete'), 'delete');
     // no id's provided
     if (!isset($_GET['id'])) {
         $this->redirect(BackendModel::createURLForAction('landing_pages') . '&error=no-items-selected');
     } else {
         // redefine id's
         $ids = (array) $_GET['id'];
         // delete items
         if ($action == 'delete') {
             BackendAnalyticsModel::deleteLandingPage($ids);
         }
     }
     // redirect
     $this->redirect(BackendModel::createURLForAction('landing_pages') . '&report=' . $action);
 }
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     // action to execute
     $action = SpoonFilter::getGetValue('action', array('delete'), 'delete');
     // no id's provided
     if (!isset($_GET['id'])) {
         $this->redirect(BackendModel::createURLForAction('campaigns') . '&error=no-items-selected');
     } else {
         // redefine id's
         $ids = (array) $_GET['id'];
         // delete comment(s)
         if ($action == 'delete') {
             BackendMailmotorModel::deleteCampaigns($ids);
             // trigger event
             BackendModel::triggerEvent($this->getModule(), 'after_delete_campaigns', array('ids' => $ids));
         }
     }
     // redirect
     $this->redirect(BackendModel::createURLForAction('campaigns') . '&report=delete-campaigns');
 }
예제 #16
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     // action to execute
     $id = SpoonFilter::getGetValue('id', null, 0);
     // no id's provided
     if (empty($id)) {
         $this->redirect(BackendModel::createURLForAction('groups') . '&error=no-items-selected');
     } else {
         // export all addresses
         if ($id == 'all') {
             // fetch records
             $records = BackendMailmotorModel::getAddresses();
             // export records
             BackendMailmotorModel::exportAddresses($records);
         } else {
             BackendMailmotorModel::exportAddressesByGroupID($id);
         }
     }
     // redirect
     $this->redirect(BackendModel::createURLForAction('groups') . '&report=export-failed');
 }
예제 #17
0
 /**
  * Execute the action
  *
  * @return	void
  */
 public function execute()
 {
     // call parent, this will probably add some general CSS/JS or other required files
     parent::execute();
     // action to execute
     $action = SpoonFilter::getGetValue('action', array('delete'), 'delete');
     // no id's provided
     if (!isset($_GET['id'])) {
         $this->redirect(BackendModel::createURLForAction('groups') . '&error=no-selection');
     } else {
         // redefine id's
         $ids = (array) $_GET['id'];
         // delete comment(s)
         if ($action == 'delete') {
             BackendMailmotorCMHelper::deleteGroups($ids);
             // trigger event
             BackendModel::triggerEvent($this->getModule(), 'after_delete_groups', array('ids' => $ids));
         }
     }
     // redirect
     $this->redirect(BackendModel::createURLForAction('groups') . '&report=delete-groups');
 }
예제 #18
0
파일: base.php 프로젝트: richsage/forkcms
 /**
  * Execute the current action
  * This method will be overwriten in most of the actions, but still be called to add general stuff
  */
 public function execute()
 {
     parent::parse();
 }
예제 #19
0
 /**
  * Execute the current action
  * This method will be overwriten in most of the actions, but still be called to add general stuff
  *
  * @return	void
  */
 public function execute()
 {
     // call parent, will add general CSS and JS
     parent::execute();
 }
예제 #20
0
 /**
  * Execute the action
  *
  * @return	void
  */
 public function execute()
 {
     // call parent, this will probably add some general CSS/JS or other required files
     parent::execute();
     // current status
     $from = SpoonFilter::getGetValue('from', array('published', 'moderation', 'spam'), 'published');
     // action to execute
     $action = SpoonFilter::getGetValue('action', array('published', 'moderation', 'spam', 'delete'), 'spam');
     // no id's provided
     if (!isset($_GET['id'])) {
         $this->redirect(BackendModel::createURLForAction('comments') . '&error=no-comments-selected');
     } else {
         // redefine id's
         $ids = (array) $_GET['id'];
         // delete comment(s)
         if ($action == 'delete') {
             BackendBlogModel::deleteComments($ids);
         } elseif ($action == 'spam') {
             // is the spamfilter active?
             if (BackendModel::getModuleSetting($this->URL->getModule(), 'spamfilter', false)) {
                 // get data
                 $comments = BackendBlogModel::getComments($ids);
                 // loop comments
                 foreach ($comments as $row) {
                     // unserialize data
                     $row['data'] = unserialize($row['data']);
                     // check if needed data is available
                     if (!isset($row['data']['server']['REMOTE_ADDR'])) {
                         continue;
                     }
                     if (!isset($row['data']['server']['HTTP_USER_AGENT'])) {
                         continue;
                     }
                     // build vars
                     $userIp = $row['data']['server']['REMOTE_ADDR'];
                     $userAgent = $row['data']['server']['HTTP_USER_AGENT'];
                     $content = $row['text'];
                     $author = $row['author'];
                     $email = $row['email'];
                     $url = isset($row['website']) && $row['website'] != '' ? $row['website'] : null;
                     $referrer = isset($row['data']['server']['HTTP_REFERER']) ? $row['data']['server']['HTTP_REFERER'] : null;
                     $others = $row['data']['server'];
                     // submit as spam
                     BackendModel::submitSpam($userIp, $userAgent, $content, $author, $email, $url, null, 'comment', $referrer, $others);
                 }
             }
             // set new status
             BackendBlogModel::updateCommentStatuses($ids, $action);
         } else {
             // published?
             if ($action == 'published') {
                 // is the spamfilter active?
                 if (BackendModel::getModuleSetting($this->URL->getModule(), 'spamfilter', false)) {
                     // get data
                     $comments = BackendBlogModel::getComments($ids);
                     // loop comments
                     foreach ($comments as $row) {
                         // previous status is spam
                         if ($row['status'] == 'spam') {
                             // unserialize data
                             $row['data'] = unserialize($row['data']);
                             // check if needed data is available
                             if (!isset($row['data']['server']['REMOTE_ADDR'])) {
                                 continue;
                             }
                             if (!isset($row['data']['server']['HTTP_USER_AGENT'])) {
                                 continue;
                             }
                             // build vars
                             $userIp = $row['data']['server']['REMOTE_ADDR'];
                             $userAgent = $row['data']['server']['HTTP_USER_AGENT'];
                             $content = $row['text'];
                             $author = $row['author'];
                             $email = $row['email'];
                             $url = isset($row['website']) && $row['website'] != '' ? $row['website'] : null;
                             $referrer = isset($row['data']['server']['HTTP_REFERER']) ? $row['data']['server']['HTTP_REFERER'] : null;
                             $others = $row['data']['server'];
                             // submit as spam
                             BackendModel::submitHam($userIp, $userAgent, $content, $author, $email, $url, null, 'comment', $referrer, $others);
                         }
                     }
                 }
             }
             // set new status
             BackendBlogModel::updateCommentStatuses($ids, $action);
         }
         // define report
         $report = count($ids) > 1 ? 'comments-' : 'comment-';
         // init var
         if ($action == 'published') {
             $report .= 'moved-published';
         }
         if ($action == 'moderation') {
             $report .= 'moved-moderation';
         }
         if ($action == 'spam') {
             $report .= 'moved-spam';
         }
         if ($action == 'delete') {
             $report .= 'deleted';
         }
         // redirect
         $this->redirect(BackendModel::createURLForAction('comments') . '&report=' . $report . '#tab' . ucfirst($from));
     }
 }
예제 #21
0
 /**
  * Execute the action.
  *
  * @return	void
  */
 public function execute()
 {
     // get parameters
     $this->id = $this->getParameter('id', 'int');
     // does the item exist
     if ($this->id !== null && BackendFormBuilderModel::exists($this->id)) {
         // call parent, this will probably add some general CSS/JS or other required files
         parent::execute();
         // set filter
         $this->setFilter();
         // set csv items
         $this->setItems();
         // create csv
         $this->createCsv();
     } else {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
     }
 }