summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-12-11 23:46:00 -0500
committerEvan Prodromou <evan@prodromou.name>2008-12-11 23:46:00 -0500
commit09dd39a434a3a21c4dd5367a2b77f1f7f451c571 (patch)
treefba45b5bea69839bd4829b716eb77d0a7f09ada6
parent203bc458420502289e2142a5649124a8b397d7e2 (diff)
stub out facebook app and delete profile
darcs-hash:20081212044600-84dde-b9fa8240a83457f9ed41c0bcdac4b20aff1f8aed.gz
-rw-r--r--README4
-rw-r--r--actions/deleteprofile.php2
-rw-r--r--actions/othersettings.php72
3 files changed, 41 insertions, 37 deletions
diff --git a/README b/README
index 6c73a327a..a3ea5fa58 100644
--- a/README
+++ b/README
@@ -117,6 +117,10 @@ This is a minor feature and security improvement version from version
- Code cleanup: checkboxes have proper <label> elements
- Code cleanup: consolidated various notice-listing code in one place
- 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
=============
diff --git a/actions/deleteprofile.php b/actions/deleteprofile.php
index 9823900c5..418ac998d 100644
--- a/actions/deleteprofile.php
+++ b/actions/deleteprofile.php
@@ -22,6 +22,8 @@ if (!defined('LACONICA')) { exit(1); }
class DeleteprofileAction extends Action {
function handle($args) {
parent::handle($args);
+ $this->server_error(_('Code not yet ready.'));
+ return;
if ('POST' === $_SERVER['REQUEST_METHOD']) {
$this->handle_post();
}
diff --git a/actions/othersettings.php b/actions/othersettings.php
index d956320d8..eccf90e91 100644
--- a/actions/othersettings.php
+++ b/actions/othersettings.php
@@ -29,9 +29,9 @@ class OthersettingsAction extends SettingsAction {
function show_form($msg=NULL, $success=false) {
$user = common_current_user();
-
+
$this->form_header(_('Other Settings'), $msg, $success);
-
+
common_element('h2', NULL, _('URL Auto-shortening'));
common_element_start('form', array('method' => 'post',
'id' => 'othersettings',
@@ -50,15 +50,15 @@ class OthersettingsAction extends SettingsAction {
'snipr.com' => 'snipr.com',
'metamark.net' => 'metamark.net'
);
-
+
common_dropdown('urlshorteningservice', _('Service'), $services, _('Automatic shortening service to use.'), FALSE, $user->urlshorteningservice);
-
+
common_submit('save', _('Save'));
-
+
common_element_end('form');
- common_element('h2', NULL, _('Delete my account'));
- $this->show_delete_form();
+// common_element('h2', NULL, _('Delete my account'));
+// $this->show_delete_form();
common_show_footer();
}
@@ -104,34 +104,32 @@ class OthersettingsAction extends SettingsAction {
common_element_end('li');
}
- function show_delete_form() {
- $user = common_current_user();
- $notices = DB_DataObject::factory('notice');
- $notices->profile_id = $user->id;
- $notice_count = (int) $notices->count();
-
- common_element_start('form', array('method' => 'POST',
- 'id' => 'delete',
- 'action' =>
- common_local_url('deleteprofile')));
-
- 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.");
-
-
- $this->show_feeds_list(array(0=>array('href'=>common_local_url('userrss', array('limit' => $notice_count, 'nickname' => $user->nickname)),
- 'type' => 'rss',
- 'version' => 'RSS 1.0',
- 'item' => 'notices'),
- 1=>array('href'=>common_local_url('foaf',array('nickname' => $user->nickname)),
- 'type' => 'rdf',
- 'version' => 'FOAF',
- 'item' => 'foaf')));
-
- common_submit('deleteaccount', _('Delete my account'));
- common_element_end('form');
- }
-
+// function show_delete_form() {
+// $user = common_current_user();
+// $notices = DB_DataObject::factory('notice');
+// $notices->profile_id = $user->id;
+// $notice_count = (int) $notices->count();
+//
+// common_element_start('form', array('method' => 'POST',
+// 'id' => 'delete',
+// 'action' =>
+// common_local_url('deleteprofile')));
+//
+// 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.");
+//
+// $this->show_feeds_list(array(0=>array('href'=>common_local_url('userrss', array('limit' => $notice_count, 'nickname' => $user->nickname)),
+// 'type' => 'rss',
+// 'version' => 'RSS 1.0',
+// 'item' => 'notices'),
+// 1=>array('href'=>common_local_url('foaf',array('nickname' => $user->nickname)),
+// 'type' => 'rdf',
+// 'version' => 'FOAF',
+// 'item' => 'foaf')));
+//
+// common_submit('deleteaccount', _('Delete my account'));
+// common_element_end('form');
+// }
function handle_post() {
@@ -152,12 +150,12 @@ class OthersettingsAction extends SettingsAction {
function save_preferences() {
$urlshorteningservice = $this->trimmed('urlshorteningservice');
-
+
if (!is_null($urlshorteningservice) && strlen($urlshorteningservice) > 50) {
$this->show_form(_('URL shortening service is too long (max 50 chars).'));
return;
}
-
+
$user = common_current_user();
assert(!is_null($user)); # should already be checked