if ($_REQUEST['name'] == 'News') { if ($_REQUEST['action'] == 'add' && isset($_REQUEST['news_title']) && isset($_REQUEST['news_content'])) { $news = new News(''); $news->title = $_REQUEST['news_title']; if ($news->title == '') { $news->title = '(' . _('Untitled') . ')'; } $news->content = $_REQUEST['news_content']; $news->timestamp = time(); $ret = Abstract_News::save($news); if ($ret === true) { popup_info(_('News successfully added')); } redirect(); } elseif ($_REQUEST['action'] == 'del' && isset($_REQUEST['id'])) { $buf = Abstract_News::delete($_REQUEST['id']); if (!$buf) { popup_error(_('Unable to delete this news')); } else { popup_info(_('News successfully deleted')); } redirect(); } } if ($_REQUEST['name'] == 'password') { if ($_REQUEST['action'] == 'change') { if (isset($_REQUEST['password_current']) && isset($_REQUEST['password']) && isset($_REQUEST['password_confirm'])) { if ($_REQUEST['password'] == '') { popup_error(_('Password is empty')); } else { if ($_REQUEST['password'] != $_REQUEST['password_confirm']) {
public function news_remove($id_) { $this->check_authorized('manageNews'); $buf = Abstract_News::delete($id_); if (!$buf) { return false; } $this->log_action('news_remove', array('id' => $id_)); return true; }