summaryrefslogtreecommitdiff
path: root/plugins/UserFlag
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2009-11-30 10:28:58 -0800
committerZach Copley <zach@status.net>2009-11-30 10:28:58 -0800
commit9dc888894be179f767c59651d523d7eb66b1020f (patch)
tree6c7191b243eb9c8bbd564ae693cc25ce58360545 /plugins/UserFlag
parent10f40661a2f517393331b554c2fec295c8c160e8 (diff)
parentbb70f77a5c8801a9bf76a85584377eb55efdb392 (diff)
Merge branch 'master' into 0.9.x
* master: (67 commits) Ticket 2038: fix bad bug tracker link Fix regression in group posting: bug introduced in commit 1319002e1519fafb0e82fbfd2d2723abdb3112e7. Need to use actual profile object rather than an id on a variable that doesn't exist when checking blocks :D Log database errors when saving notice_inbox entries Drop the username from the log id for now; seems to trigger an error loop in some circumstances request id on logs... pid + random id per web request + username + method + url Add OpenID ini info back into statusnet.ini as a stopgap until we can Some changes to the OpenID DataObjects to make them emit the exact same OpenID plugin should set 'user_openid.display' as unique key Remove relationship: user_openid.user_id -> user.id. I don't think this Have OpenID plugin DataObjects emit their own .ini info Revert "Allow plugin DB_DataObject classes to not have to use the .ini file by overriding keys(), table(), and sequenceKey() for them" Catch and report exceptions from notice_to_omb_notice() instead of letting the OMB queue handler die. Fix regression in remote subscription; added hasRole() shadow method on Remote_profile. Fix fatal error on OMB subscription for first-timers Remove annoying log msg Drop error message on setlocale() failure; this is harmless, since we actually have a working locale set up. Catch uncaught exception Fixed bug where reply-sync bit wasn't getting saved Forgot to render the nav menu when on FB Connect login tab Facebook plugin no longer takes over Login and Connect settings nav menus ... Conflicts: db/08to09_pg.sql db/statusnet_pg.sql locale/pt_BR/LC_MESSAGES/statusnet.mo plugins/Mapstraction/MapstractionPlugin.php
Diffstat (limited to 'plugins/UserFlag')
-rw-r--r--plugins/UserFlag/UserFlagPlugin.php2
-rw-r--r--plugins/UserFlag/flagprofile.php26
-rw-r--r--plugins/UserFlag/flagprofileform.php12
3 files changed, 39 insertions, 1 deletions
diff --git a/plugins/UserFlag/UserFlagPlugin.php b/plugins/UserFlag/UserFlagPlugin.php
index 4717a63dd..60c0c2c0a 100644
--- a/plugins/UserFlag/UserFlagPlugin.php
+++ b/plugins/UserFlag/UserFlagPlugin.php
@@ -97,7 +97,7 @@ class UserFlagPlugin extends Plugin
{
$user = common_current_user();
- if (!empty($user)) {
+ if (!empty($user) && ($user->id != $profile->id)) {
$action->elementStart('li', 'entity_flag');
diff --git a/plugins/UserFlag/flagprofile.php b/plugins/UserFlag/flagprofile.php
index 8ff2f1f72..9bce7865b 100644
--- a/plugins/UserFlag/flagprofile.php
+++ b/plugins/UserFlag/flagprofile.php
@@ -72,6 +72,28 @@ class FlagprofileAction extends ProfileFormAction
return true;
}
+
+ /**
+ * Handle request
+ *
+ * Overriding the base Action's handle() here to deal check
+ * for Ajax and return an HXR response if necessary
+ *
+ * @param array $args $_REQUEST args; handled in prepare()
+ *
+ * @return void
+ */
+
+ function handle($args)
+ {
+ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
+ $this->handlePost();
+ if (!$this->boolean('ajax')) {
+ $this->returnToArgs();
+ }
+ }
+ }
+
/**
* Handle POST
*
@@ -97,6 +119,10 @@ class FlagprofileAction extends ProfileFormAction
}
$ufp->free();
+
+ if ($this->boolean('ajax')) {
+ $this->ajaxResults();
+ }
}
function ajaxResults() {
diff --git a/plugins/UserFlag/flagprofileform.php b/plugins/UserFlag/flagprofileform.php
index 262dad4a7..c20929a20 100644
--- a/plugins/UserFlag/flagprofileform.php
+++ b/plugins/UserFlag/flagprofileform.php
@@ -48,6 +48,18 @@ require_once INSTALLDIR.'/lib/form.php';
class FlagProfileForm extends ProfileActionForm
{
/**
+ * class of the form
+ * Action this form provides
+ *
+ * @return string class of the form
+ */
+
+ function formClass()
+ {
+ return 'form_entity_flag';
+ }
+
+ /**
* Action this form provides
*
* @return string Name of the action, lowercased.