* @param string $file Optional file that the function must reside in.
*
* @return bool
- * @todo This is neat but is it necessary?
+ *
+ * @deprecated 1.8 A neat but pointless function
*/
function call_gatekeeper($function, $file = "") {
+ elgg_deprecated_notice("call_gatekeeper() is neat but pointless", 1.8);
// Sanity check
if (!$function) {
return false;
* called by something on $path, if false the whole call stack is
* searched.
*
- * @todo Again, very neat, but is it necessary?
- *
* @return void
+ *
+ * @deprecated 1.8 A neat but pointless function
*/
function callpath_gatekeeper($path, $include_subdirs = true, $strict_mode = false) {
+ elgg_deprecated_notice("callpath_gatekeeper() is neat but pointless", 1.8);
+
global $CONFIG;
$path = sanitise_string($path);
function force_user_password_reset($user_guid, $password) {
global $CONFIG;
- if (call_gatekeeper('execute_new_password_request', __FILE__)) {
- $user = get_entity($user_guid);
+ $user = get_entity($user_guid);
- if ($user) {
- $salt = generate_random_cleartext_password(); // Reset the salt
- $user->salt = $salt;
+ if ($user) {
+ $salt = generate_random_cleartext_password(); // Reset the salt
+ $user->salt = $salt;
- $hash = generate_user_password($user, $password);
+ $hash = generate_user_password($user, $password);
- $query = "UPDATE {$CONFIG->dbprefix}users_entity
- set password='$hash', salt='$salt' where guid=$user_guid";
- return update_data($query);
- }
+ $query = "UPDATE {$CONFIG->dbprefix}users_entity
+ set password='$hash', salt='$salt' where guid=$user_guid";
+ return update_data($query);
}
return false;