Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

r2925@opsdev009 (orig r155416): yariv | 2009-04-01 16:38:58 -0700

 Add admin.banUsers() and related functions.
 
 Summary: Add admin.banUsers(), admin.unbanUsers() and admin.getBannedUsers().
 
 Trac Bug: #
 
 Blame Rev:
 
 Reviewed By: jleszcze
 
 Test Plan: tested on an external app
 
 Revert Plan:
 
 Database Impact:
 
 Memcache Impact:
 
 Other Notes:
 
 EImportant:
 
 - begin *PUBLIC* platform impact section -
 Bugzilla: #
 - end platform impact -
  • Loading branch information...
commit c0738572fad66d9f307e106bea3a6d15426a7a15 1 parent 8e960ac
(no author) authored
View
BIN  clients/packages/facebook-platform.tar.gz
Binary file not shown
View
15 clients/php/trunk/facebook.php
@@ -465,7 +465,20 @@ public function get_valid_fb_params($params, $timeout=null, $namespace='fb_sig')
return $fb_params;
}
- /*
+ /**
+ * Validates the account that a user was trying to set up an
+ * independent account through Facebook Connect.
+ *
+ * @param user The user attempting to set up an independent account.
+ * @param hash The hash passed to the reclamation URL used.
+ * @return bool True if the user is the one that selected the
+ * reclamation link.
+ */
+ public function verify_account_reclamation($user, $hash) {
+ return $hash == md5($user . $this->secret);
+ }
+
+ /**
* Validates that a given set of parameters match their signature.
* Parameters all match a given input prefix, such as "fb_sig".
*
View
42 clients/php/trunk/facebookapi_php5_restlib.php
@@ -2637,6 +2637,47 @@ public function admin_getRestrictionInfo() {
true);
}
+
+ /**
+ * Bans a list of users from the app. Banned users can't
+ * access the app's canvas page and forums.
+ *
+ * @param array $uids an array of user ids
+ * @return bool true on success
+ */
+ public function admin_banUsers($uids) {
+ return $this->call_method(
+ 'admin.banUsers', array('uids' => json_encode($uids)));
+ }
+
+ /**
+ * Unban users that have been previously banned with
+ * admin_banUsers().
+ *
+ * @param array $uids an array of user ids
+ * @return bool true on success
+ */
+ public function admin_unbanUsers($uids) {
+ return $this->call_method(
+ 'admin.unbanUsers', array('uids' => json_encode($uids)));
+ }
+
+ /**
+ * Gets the list of users that have been banned from the application.
+ * $uids is an optional parameter that filters the result with the list
+ * of provided user ids. If $uids is provided,
+ * only banned user ids that are contained in $uids are returned.
+ *
+ * @param array $uids an array of user ids to filter by
+ * @return bool true on success
+ */
+
+ public function admin_getBannedUsers($uids = null) {
+ return $this->call_method(
+ 'admin.getBannedUsers',
+ array('uids' => $uids ? json_encode($uids) : null));
+ }
+
/* UTILITY FUNCTIONS */
/**
@@ -2933,6 +2974,7 @@ class FacebookAPIErrorCodes {
const API_EC_PERMISSION_DENIED = 10;
const API_EC_DEPRECATED = 11;
const API_EC_VERSION = 12;
+ const API_EC_INTERNAL_FQL_ERROR = 13;
/*
* PARAMETER ERRORS
Please sign in to comment.
Something went wrong with that request. Please try again.