stub out facebook app and delete profile

darcs-hash:20081212044600-84dde-b9fa8240a83457f9ed41c0bcdac4b20aff1f8aed.gz
This commit is contained in:
Evan Prodromou 2008-12-11 23:46:00 -05:00
parent 203bc45842
commit 09dd39a434
3 changed files with 41 additions and 37 deletions

4
README
View File

@ -117,6 +117,10 @@ This is a minor feature and security improvement version from version
- Code cleanup: checkboxes have proper <label> elements - Code cleanup: checkboxes have proper <label> elements
- Code cleanup: consolidated various notice-listing code in one place - Code cleanup: consolidated various notice-listing code in one place
- Better support for unsubscribing from a remote user - Better support for unsubscribing from a remote user
- Stump of experimental Facebook application (not ready for use! code
review only!)
- Stump of experimental user account deletion (not ready for use! code
review only!)
Prerequisites Prerequisites
============= =============

View File

@ -22,6 +22,8 @@ if (!defined('LACONICA')) { exit(1); }
class DeleteprofileAction extends Action { class DeleteprofileAction extends Action {
function handle($args) { function handle($args) {
parent::handle($args); parent::handle($args);
$this->server_error(_('Code not yet ready.'));
return;
if ('POST' === $_SERVER['REQUEST_METHOD']) { if ('POST' === $_SERVER['REQUEST_METHOD']) {
$this->handle_post(); $this->handle_post();
} }

View File

@ -29,9 +29,9 @@ class OthersettingsAction extends SettingsAction {
function show_form($msg=NULL, $success=false) { function show_form($msg=NULL, $success=false) {
$user = common_current_user(); $user = common_current_user();
$this->form_header(_('Other Settings'), $msg, $success); $this->form_header(_('Other Settings'), $msg, $success);
common_element('h2', NULL, _('URL Auto-shortening')); common_element('h2', NULL, _('URL Auto-shortening'));
common_element_start('form', array('method' => 'post', common_element_start('form', array('method' => 'post',
'id' => 'othersettings', 'id' => 'othersettings',
@ -50,15 +50,15 @@ class OthersettingsAction extends SettingsAction {
'snipr.com' => 'snipr.com', 'snipr.com' => 'snipr.com',
'metamark.net' => 'metamark.net' 'metamark.net' => 'metamark.net'
); );
common_dropdown('urlshorteningservice', _('Service'), $services, _('Automatic shortening service to use.'), FALSE, $user->urlshorteningservice); common_dropdown('urlshorteningservice', _('Service'), $services, _('Automatic shortening service to use.'), FALSE, $user->urlshorteningservice);
common_submit('save', _('Save')); common_submit('save', _('Save'));
common_element_end('form'); common_element_end('form');
common_element('h2', NULL, _('Delete my account')); // common_element('h2', NULL, _('Delete my account'));
$this->show_delete_form(); // $this->show_delete_form();
common_show_footer(); common_show_footer();
} }
@ -104,34 +104,32 @@ class OthersettingsAction extends SettingsAction {
common_element_end('li'); common_element_end('li');
} }
function show_delete_form() { // function show_delete_form() {
$user = common_current_user(); // $user = common_current_user();
$notices = DB_DataObject::factory('notice'); // $notices = DB_DataObject::factory('notice');
$notices->profile_id = $user->id; // $notices->profile_id = $user->id;
$notice_count = (int) $notices->count(); // $notice_count = (int) $notices->count();
//
common_element_start('form', array('method' => 'POST', // common_element_start('form', array('method' => 'POST',
'id' => 'delete', // 'id' => 'delete',
'action' => // 'action' =>
common_local_url('deleteprofile'))); // common_local_url('deleteprofile')));
//
common_hidden('token', common_session_token()); // common_hidden('token', common_session_token());
common_element('p', null, "You can copy your notices and contacts by saving the two links below before deleting your account. Be careful, this operation cannot be undone."); // common_element('p', null, "You can copy your notices and contacts by saving the two links below before deleting your account. Be careful, this operation cannot be undone.");
//
// $this->show_feeds_list(array(0=>array('href'=>common_local_url('userrss', array('limit' => $notice_count, 'nickname' => $user->nickname)),
$this->show_feeds_list(array(0=>array('href'=>common_local_url('userrss', array('limit' => $notice_count, 'nickname' => $user->nickname)), // 'type' => 'rss',
'type' => 'rss', // 'version' => 'RSS 1.0',
'version' => 'RSS 1.0', // 'item' => 'notices'),
'item' => 'notices'), // 1=>array('href'=>common_local_url('foaf',array('nickname' => $user->nickname)),
1=>array('href'=>common_local_url('foaf',array('nickname' => $user->nickname)), // 'type' => 'rdf',
'type' => 'rdf', // 'version' => 'FOAF',
'version' => 'FOAF', // 'item' => 'foaf')));
'item' => 'foaf'))); //
// common_submit('deleteaccount', _('Delete my account'));
common_submit('deleteaccount', _('Delete my account')); // common_element_end('form');
common_element_end('form'); // }
}
function handle_post() { function handle_post() {
@ -152,12 +150,12 @@ class OthersettingsAction extends SettingsAction {
function save_preferences() { function save_preferences() {
$urlshorteningservice = $this->trimmed('urlshorteningservice'); $urlshorteningservice = $this->trimmed('urlshorteningservice');
if (!is_null($urlshorteningservice) && strlen($urlshorteningservice) > 50) { if (!is_null($urlshorteningservice) && strlen($urlshorteningservice) > 50) {
$this->show_form(_('URL shortening service is too long (max 50 chars).')); $this->show_form(_('URL shortening service is too long (max 50 chars).'));
return; return;
} }
$user = common_current_user(); $user = common_current_user();
assert(!is_null($user)); # should already be checked assert(!is_null($user)); # should already be checked