From 2c7518873eddafcd041fe73a509756155f35ac9a Mon Sep 17 00:00:00 2001 From: millette Date: Wed, 3 Dec 2008 14:26:58 -0500 Subject: moving delete profile to its own space. darcs-hash:20081203192658-099f7-37d26abf7409ab2996a22de4aa71cb7a5f68d205.gz --- lib/deleteprofileaction.php | 61 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 lib/deleteprofileaction.php (limited to 'lib') diff --git a/lib/deleteprofileaction.php b/lib/deleteprofileaction.php new file mode 100644 index 000000000..5ba0e7e44 --- /dev/null +++ b/lib/deleteprofileaction.php @@ -0,0 +1,61 @@ +. + */ + +if (!defined('LACONICA')) { exit(1); } + +class DeleteAction extends Action { + + function handle($args) { + parent::handle($args); + $user = common_current_user(); + $notice_id = $this->trimmed('notice'); + $notice = Notice::staticGet($notice_id); + if (!$notice) { + common_user_error(_('No such notice.')); + exit; + } + + $profile = $notice->getProfile(); + $user_profile = $user->getProfile(); + + if (!common_logged_in()) { + common_user_error(_('Not logged in.')); + exit; + } else if ($notice->profile_id != $user_profile->id) { + common_user_error(_('Can\'t delete this notice.')); + exit; + } + } + + function show_top($arr=NULL) { + $instr = $this->get_instructions(); + $output = common_markup_to_html($instr); + common_element_start('div', 'instructions'); + common_raw($output); + common_element_end('div'); + } + + function get_title() { + return NULL; + } + + function show_header() { + return; + } +} -- cgit v1.2.3-54-g00ecf