]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #2451: Removes (admin_)gatekeeper() calls from core plugin actions
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 24 Nov 2010 01:49:54 +0000 (01:49 +0000)
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 24 Nov 2010 01:49:54 +0000 (01:49 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7434 36083f99-b078-4883-b0ff-0f9b5a30f544

30 files changed:
mod/bookmarks/actions/add.php
mod/bookmarks/actions/edit.php
mod/defaultwidgets/actions/update.php
mod/defaultwidgets/start.php
mod/file/actions/upload.php
mod/groups/actions/addtogroup.php
mod/groups/actions/featured.php
mod/groups/actions/groupskillinvitation.php
mod/groups/actions/groupskillrequest.php
mod/groups/actions/invite.php
mod/groups/actions/join.php
mod/groups/actions/joinrequest.php
mod/groups/actions/leave.php
mod/groups/start.php
mod/messages/actions/delete.php
mod/pages/actions/pages/edit.php
mod/pages/actions/pages/editwelcome.php
mod/profile/actions/cropicon.php
mod/profile/actions/deletedefaultprofileitem.php
mod/profile/actions/edit.php
mod/profile/actions/editdefault.php
mod/profile/actions/editfield.php
mod/profile/actions/iconupload.php
mod/profile/actions/reorder.php
mod/profile/actions/resetdefaultprofile.php
mod/reportedcontent/actions/archive.php
mod/reportedcontent/actions/delete.php
mod/reportedcontent/start.php
mod/riverdashboard/actions/add.php
mod/riverdashboard/actions/delete.php

index 60859f90f55c06a1d1a9c905fa6729f5e5fb042e..b17ce76a41d41a62631168167e40ba2e203d8751 100644 (file)
@@ -5,8 +5,6 @@
  * @package ElggBookmarks
  */
        
-gatekeeper();
-action_gatekeeper();
 //set some required variables
 $title = strip_tags(get_input('title'));
 $address = get_input('address');
index dd0330b2d5d82a3ac26fd539f98831bff3131388..87de1c5e25b3688f031164f9bac89050dcde1c72 100755 (executable)
@@ -4,8 +4,6 @@
  * 
  */
        
-gatekeeper();
-action_gatekeeper();
 //set some required variables
 $guid = get_input('guid');
 $title = get_input('title');
index 466bae5a639e075f9aeb2859d70261ad5721b36f..9b34c228c015dfccb4b25f2f6644839571ee528d 100644 (file)
@@ -6,9 +6,6 @@
  * 
  **/
 
-// validate user is an admin
-admin_gatekeeper ();
-
 // get parameters
 $context = get_input ( 'context' );
 $leftbar = str_replace ( '::0', '', get_input ( 'debugField1' ) );
index f7adc35814d2fe6fda3fdb142ed20be3bf6d3fa9..acac3f33817df25a6cf44069a803f0646e75646c 100644 (file)
@@ -24,7 +24,7 @@ global $CONFIG;
  */
 function defaultwidgets_init() {
        // register create user event hook
-       register_elgg_event_handler ( 'create', 'user', 'defaultwidgets_newusers' );
+       elgg_register_event_handler('create', 'user', 'defaultwidgets_newusers' );
 
        // set the widget access to the default access on validation if this is not an admin-created user
        if (!isadminloggedin()) {
@@ -204,4 +204,4 @@ elgg_register_plugin_hook_handler('permissions_check', 'user', 'defaultwidgets_c
 elgg_register_plugin_hook_handler('permissions_check', 'object', 'defaultwidgets_can_edit');
 elgg_register_plugin_hook_handler('container_permissions_check', 'user', 'defaultwidgets_can_edit_container');
 
-elgg_register_action("defaultwidgets/update", $CONFIG->pluginspath . "defaultwidgets/actions/update.php");
+elgg_register_action("defaultwidgets/update", $CONFIG->pluginspath . "defaultwidgets/actions/update.php", 'admin');
index 6af52c7011d28aca530703f925691e8528289a51..081b6a3128a529899e68956bf5183d12922cbac9 100644 (file)
@@ -7,8 +7,6 @@
 
        global $CONFIG;
        
-       gatekeeper();
-       
        // Get variables
        $title = get_input("title");
        $desc = get_input("description");
index 346b6065eb7e5404aea112145ae2289b547ac11f..2da045fc6df44be445391b7603508072a21605e4 100644 (file)
@@ -9,8 +9,6 @@
        // Load configuration
        global $CONFIG;
 
-       gatekeeper();
-
        $logged_in_user = get_loggedin_user();
 
        $user_guid = get_input('user_guid');
index b49a76471f84e1613e2a6f54dc6d8f534cd2f1b4..a63b93c0d1d83ffdebb7d13ed056328ace1713ff 100644 (file)
@@ -6,11 +6,8 @@
         * @package ElggGroups
         */
 
-       // Load configuration
        global $CONFIG;
        
-       admin_gatekeeper();
-       
        $group_guid = get_input('group_guid');
        $action = get_input('action_type');
        
index 46d71bedeed50da5f066a038224e43fe429ce1f9..c5f1d9bf5518348159a2e13dcea6323543d6ad65 100644 (file)
@@ -8,8 +8,6 @@
        // Load configuration
        global $CONFIG;
 
-       gatekeeper();
-
        $user_guid = get_input('user_guid', get_loggedin_userid());
        $group_guid = get_input('group_guid');
 
index c0511cc0ec367ed7cc68ba37b8174fa6ff2f05b1..7b53fe37bd78e5216139b44823953bac7dba008e 100644 (file)
@@ -8,8 +8,6 @@
        // Load configuration
        global $CONFIG;
        
-       gatekeeper();
-       
        $user_guid = get_input('user_guid', get_loggedin_userid());
        $group_guid = get_input('group_guid');
        
index 6fe379fe100c04795a94d517aaf810f727466aee..eef8fb5ce52f8ef71e9726dcbca839997cf51c2a 100644 (file)
@@ -9,8 +9,6 @@
 // Load configuration
 global $CONFIG;
 
-gatekeeper();
-
 $logged_in_user = get_loggedin_user();
 
 $user_guid = get_input('user_guid');
index 40f227ba7a1b8e912bc965528d54d9419ef3af54..95c9660ff4ef12a373349d3ba59d29969115a290 100644 (file)
@@ -8,8 +8,6 @@
        // Load configuration
        global $CONFIG;
 
-       gatekeeper();
-
        $user_guid = get_input('user_guid', get_loggedin_userid());
        $group_guid = get_input('group_guid');
 
index f9bdf2f21557e12e074eabd325fd631e73cba63f..b61afbed6b65982ea227bfc3af7c5d0f68a34d17 100644 (file)
@@ -8,8 +8,6 @@
 // Load configuration
 global $CONFIG;
 
-gatekeeper();
-
 $user_guid = get_input('user_guid', get_loggedin_userid());
 $group_guid = get_input('group_guid');
 
index 78431961a8cef6d91c6b5c7cd7d219f16507e0d2..ebb4738179f8c00aa25873a2eab79273e42c57a9 100644 (file)
@@ -8,8 +8,6 @@
        // Load configuration
        global $CONFIG;
        
-       gatekeeper();
-       
        $user_guid = get_input('user_guid');
        $group_guid = get_input('group_guid');
        
index 7fa2f523378097ce56549a30508ddf55a5a9d26e..c09378c98daaf5c393f3bc4c81ab97904f1bc20f 100644 (file)
        elgg_register_action("groups/addpost", $CONFIG->pluginspath . "groups/actions/forums/addpost.php");
        elgg_register_action("groups/edittopic", $CONFIG->pluginspath . "groups/actions/forums/edittopic.php");
        elgg_register_action("groups/deletepost", $CONFIG->pluginspath . "groups/actions/forums/deletepost.php");
-       elgg_register_action("groups/featured", $CONFIG->pluginspath . "groups/actions/featured.php");
+       elgg_register_action("groups/featured", $CONFIG->pluginspath . "groups/actions/featured.php", 'admin');
        elgg_register_action("groups/editpost", $CONFIG->pluginspath . "groups/actions/forums/editpost.php");
 
 ?>
index d59aff025c4ea4557f90a40dd72056d23b3af5ff..4ccc1d2ba78466ed2f80bf66241dcd13f5f07cb1 100644 (file)
@@ -7,9 +7,6 @@
 * @package ElggMessages
 */
 
-// Need to be logged in to do this
-gatekeeper();
-
 // grab details sent from the form
 $message_id_array = get_input('message_id');
 if (!is_array($message_id_array)) $message_id_array = array($message_id_array);
@@ -21,8 +18,8 @@ $offset = get_input('offset');
 foreach($message_id_array as $message_id) {
 
 // get the message object
-    $message = get_entity($message_id);
-    
+       $message = get_entity($message_id);
+       
 // Make sure we actually have permission to edit and that the object is of sub-type messages
        if ($message && $message->getSubtype() == "messages") {
                
@@ -37,11 +34,11 @@ foreach($message_id_array as $message_id) {
                                $success = false;
                        }
                }
-        
-    }else{
-        
-        // display the error message
-        $success = false;
+               
+       }else{
+               
+               // display the error message
+               $success = false;
                
        }
 
@@ -54,11 +51,11 @@ if ($success) {
                system_message(elgg_echo("messages:markedread"));
        }
        // check to see if it is a sent message to be deleted
-    if($type == 'sent'){
-           forward("mod/messages/sent.php?offset={$offset}");
-    }else{
-           forward("mod/messages/?username=" . get_loggedin_user()->username . "&offset={$offset}");
-    }
+       if($type == 'sent'){
+               forward("mod/messages/sent.php?offset={$offset}");
+       }else{
+               forward("mod/messages/?username=" . get_loggedin_user()->username . "&offset={$offset}");
+       }
 } else {
        register_error(elgg_echo("messages:notfound"));
        forward(REFERER);
index b5ce6eb3bcd431bee96a85f40472f59889da6cd7..63382f1aa28b5d3d69c82221157db700f84cbe02 100644 (file)
@@ -8,7 +8,6 @@
 // Load configuration
 global $CONFIG;
 
-gatekeeper();
 elgg_set_context('pages');
 
 //boolean to select correct add to river. It will be new or edit
index 06897d8d3f49348b07e7680c56557b501be0deba..a13ae4c3574f248317a44ef921bbfb222c09759b 100644 (file)
@@ -5,11 +5,8 @@
  * @package ElggPages
  */
 
-// Load configuration
 global $CONFIG;
 
-gatekeeper();
-
 // Get group fields
 $message = get_input("pages_welcome");
 $container_guid = get_input("owner_guid");
index c44cee6bde9c52e907f9224306b75a05bd4c71c3..c65b5f56dcd40cf8b3026d61957364b66b96887a 100644 (file)
@@ -5,8 +5,6 @@
  * @package ElggProfile
  */
 
-gatekeeper();
-
 $profile_username = get_input('username');
 $profile_owner = get_user_by_username($profile_username);
 
index f3880954fdd9102a64789bedbd9b8a0336f882e6..6791d2c468224fdaad20a0f30e4f5ff37d5d64c6 100644 (file)
@@ -7,8 +7,6 @@
 
 global $CONFIG;
 
-admin_gatekeeper();
-
 $id = get_input('id');
 
 $fieldlist = get_plugin_setting('user_defined_fields', 'profile');
index 312b72a1a7cb4ce47a75afa3489123d16cdb975e..da7553b6e03f2f00723250b05eced04a7982b5f3 100644 (file)
@@ -6,7 +6,6 @@
  */
 
 global $CONFIG;
-gatekeeper();
 
 $profile_username = get_input('username');
 $profile_owner = get_user_by_username($profile_username);
index 1d50f432ae6c06d457f09ab4089922ac17831990..96e8784023199dc6569120feb3ccdef79f9d9609 100644 (file)
@@ -6,7 +6,6 @@
  */
 
 global $CONFIG;
-admin_gatekeeper();
 
 $label = sanitise_string(get_input('label'));
 $type = sanitise_string(get_input('type'));
index 7df7dd9ccd629782f8a60018846e4e5c7be78a98..b3bd887ef42c1601ea8e11b2990d08782c3d7258 100644 (file)
@@ -5,8 +5,6 @@
  * @package ElggProfile
  */
 
-admin_gatekeeper();
-
 $field = get_input('field');
 $text = get_input('value');
 
index d0a3cf28a28623df2decf6410f04a243b1d39a12..546aa0e9c082efeb0c9fa4708a82e339839acd7e 100644 (file)
@@ -5,8 +5,6 @@
  * @package ElggProfile
  */
 
-gatekeeper();
-
 $profile_username = get_input('username');
 $profile_owner = get_user_by_username($profile_username);
 
index dfb2bfb3db01025ece8ff1989ac35fdafae1246c..a30e97bac17615b6b49d22303b002c1462cdee70 100644 (file)
@@ -5,7 +5,6 @@
  * @package ElggProfile
  */
 
-admin_gatekeeper();
 $ordering = get_input('fieldorder');
 //if (!empty($ordering))
 $result = set_plugin_setting('user_defined_fields',$ordering,'profile');
index facc82f71b095450eb48ad2f5394ef0598fd07ea..3ada044e852f107c4388ac19be506d2987b28014 100644 (file)
@@ -6,7 +6,6 @@
  */
 
 global $CONFIG;
-admin_gatekeeper();
 
 if ($fieldlist = get_plugin_setting('user_defined_fields', 'profile')) {
        $fieldlistarray = explode(',', $fieldlist);
index 231ebdd355fe32259e4adaa598fb611b4784a1c5..c0169fa286be7e1d4cade85961bd7fac5c91e0ed 100644 (file)
@@ -5,9 +5,6 @@
  * @package ElggReportedContent
  */
 
-// Make sure we're logged in and are admin
-admin_gatekeeper();
-
 // Get input data
 $guid = (int) get_input('item');
 
index fa10c6d7e82d093523f5172ff99c308ef7be4961..b7d6fdaa51f08693889be5574b262606f99cdcd9 100644 (file)
@@ -5,9 +5,6 @@
  * @package ElggReportedCOntent
  */
 
-// Make sure we're logged in and are admin
-admin_gatekeeper();
-
 // Get input data
 $guid = (int) get_input('item');
 
index ed7eedd4f06ef4b0d87c418fb4851b09d731c61c..09ab714061df59e2ade2be540fe79d398e75a635 100644 (file)
@@ -25,8 +25,8 @@ function reportedcontent_init() {
 
        //register action
        elgg_register_action('reportedcontent/add', "{$CONFIG->pluginspath}reportedcontent/actions/add.php");
-       elgg_register_action('reportedcontent/delete', "{$CONFIG->pluginspath}reportedcontent/actions/delete.php");
-       elgg_register_action('reportedcontent/archive', "{$CONFIG->pluginspath}reportedcontent/actions/archive.php");
+       elgg_register_action('reportedcontent/delete', "{$CONFIG->pluginspath}reportedcontent/actions/delete.php", 'admin');
+       elgg_register_action('reportedcontent/archive', "{$CONFIG->pluginspath}reportedcontent/actions/archive.php", 'admin');
 }
 
 // Initialise Reported Content
index 8e19db6364e9093f6db5a3bb4e2ba5f0305a19b8..441723ebf21e1e334c40cc105842b1b245b83709 100644 (file)
@@ -6,10 +6,6 @@
  * @package ElggSiteMessage
  **/
 
-// Make sure we're logged in and are admin (send us to the front page if not)
-admin_gatekeeper();
-
-// Get input data
 $message = get_input('sitemessage');
 //$access = 1; //it is for all logged in users
 
index aa325e7c7ada1d11c2b24d5d5c9e3482aa1b0107..5352cc778b6662972b990a3999cc1f2176ac6ee7 100644 (file)
@@ -6,9 +6,6 @@
  * @package ElggBlog
  */
 
-// Make sure we're logged in (send us to the front page if not)
-gatekeeper();
-
 // Get input data
 $guid = (int) get_input('message');