aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/actions.php9
-rw-r--r--engine/lib/admin.php26
-rw-r--r--engine/lib/elgglib.php8
-rw-r--r--engine/lib/export.php2
-rw-r--r--engine/lib/plugins.php21
-rw-r--r--engine/lib/sessions.php6
-rw-r--r--engine/lib/users.php30
-rw-r--r--engine/lib/widgets.php8
8 files changed, 53 insertions, 57 deletions
diff --git a/engine/lib/actions.php b/engine/lib/actions.php
index 8abd03d64..d95fe0435 100644
--- a/engine/lib/actions.php
+++ b/engine/lib/actions.php
@@ -51,7 +51,7 @@
* @param string $forwarder Optionally, the location to forward to
*
* @link http://docs.elgg.org/Actions
-* @see register_action()
+* @see elgg_register_action()
*
* @return void
*/
@@ -128,7 +128,7 @@ function action($action, $forwarder = "") {
*
* Actions should be namedspaced for your plugin. Example:
* <code>
- * register_action('myplugin/save_settings', ...);
+ * elgg_register_action('myplugin/save_settings', ...);
* </code>
*
* @tip Put action files under the actions/ directory of your plugin.
@@ -370,9 +370,8 @@ function elgg_action_exist($action) {
/**
* Initialize some ajaxy actions features
*/
-function actions_init()
-{
- register_action('security/refreshtoken', TRUE);
+function actions_init() {
+ elgg_register_action('security/refreshtoken', '', 'public');
elgg_view_register_simplecache('js/languages/en');
diff --git a/engine/lib/admin.php b/engine/lib/admin.php
index 1e6f896ae..82351701c 100644
--- a/engine/lib/admin.php
+++ b/engine/lib/admin.php
@@ -112,19 +112,19 @@ function elgg_add_admin_submenu_item($section_id, $section_title, $parent_id = N
* @return void
*/
function admin_init() {
- register_action('admin/user/ban', FALSE, "", TRUE);
- register_action('admin/user/unban', FALSE, "", TRUE);
- register_action('admin/user/delete', FALSE, "", TRUE);
- register_action('admin/user/resetpassword', FALSE, "", TRUE);
- register_action('admin/user/makeadmin', FALSE, "", TRUE);
- register_action('admin/user/removeadmin', FALSE, "", TRUE);
-
- register_action('admin/site/update_basic', FALSE, "", TRUE);
- register_action('admin/site/update_advanced', FALSE, "", TRUE);
-
- register_action('admin/menu_items', FALSE, "", TRUE);
-
- register_action('admin/plugins/simple_update_states', FALSE, '', TRUE);
+ elgg_register_action('admin/user/ban', '', 'admin');
+ elgg_register_action('admin/user/unban', '', 'admin');
+ elgg_register_action('admin/user/delete', '', 'admin');
+ elgg_register_action('admin/user/resetpassword', '', 'admin');
+ elgg_register_action('admin/user/makeadmin', '', 'admin');
+ elgg_register_action('admin/user/removeadmin', '', 'admin');
+
+ elgg_register_action('admin/site/update_basic', '', 'admin');
+ elgg_register_action('admin/site/update_advanced', '', 'admin');
+
+ elgg_register_action('admin/menu_items', '', 'admin');
+
+ elgg_register_action('admin/plugins/simple_update_states', '', 'admin');
// admin area overview and basic site settings
elgg_add_admin_submenu_item('overview', elgg_echo('admin:overview'));
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 3e09c118a..8a8cecbfa 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -2186,10 +2186,10 @@ function elgg_walled_garden() {
function elgg_init() {
global $CONFIG;
- register_action('comments/add');
- register_action('comments/delete');
- register_action('likes/add');
- register_action('likes/delete');
+ elgg_register_action('comments/add');
+ elgg_register_action('comments/delete');
+ elgg_register_action('likes/add');
+ elgg_register_action('likes/delete');
register_page_handler('js', 'js_page_handler');
diff --git a/engine/lib/export.php b/engine/lib/export.php
index 4de10330f..f81bee2fe 100644
--- a/engine/lib/export.php
+++ b/engine/lib/export.php
@@ -214,7 +214,7 @@ function import($xml) {
function export_init() {
global $CONFIG;
- register_action("import/opendd", false);
+ elgg_register_action("import/opendd");
}
// Register a startup event
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php
index c0ec7f389..80b68eb5c 100644
--- a/engine/lib/plugins.php
+++ b/engine/lib/plugins.php
@@ -865,20 +865,17 @@ function plugin_run_once() {
* @return void
*/
function plugin_init() {
- // Now run this stuff, but only once
run_function_once("plugin_run_once");
- // Register some actions
- register_action("plugins/settings/save", false, "", true);
- register_action("plugins/usersettings/save");
-
- register_action('admin/plugins/enable', false, "", true);
- register_action('admin/plugins/disable', false, "", true);
- register_action('admin/plugins/enableall', false, "", true);
- register_action('admin/plugins/disableall', false, "", true);
-
- register_action('admin/plugins/reorder', false, "", true);
+ elgg_register_action("plugins/settings/save", '', 'admin');
+ elgg_register_action("plugins/usersettings/save");
+
+ elgg_register_action('admin/plugins/enable', '', 'admin');
+ elgg_register_action('admin/plugins/disable', '', 'admin');
+ elgg_register_action('admin/plugins/enableall', '', 'admin');
+ elgg_register_action('admin/plugins/disableall', '', 'admin');
+
+ elgg_register_action('admin/plugins/reorder', '', 'admin');
}
-// Register a startup event
elgg_register_event_handler('init', 'system', 'plugin_init');
diff --git a/engine/lib/sessions.php b/engine/lib/sessions.php
index 5cb3e8260..4cdc9bcce 100644
--- a/engine/lib/sessions.php
+++ b/engine/lib/sessions.php
@@ -369,7 +369,7 @@ function logout() {
unset($_SESSION['guid']);
unset($_SESSION['id']);
unset($_SESSION['user']);
-
+
setcookie("elggperm", "", (time() - (86400 * 30)), "/");
// pass along any messages
@@ -466,8 +466,8 @@ function session_init($event, $object_type, $object) {
set_last_action($_SESSION['guid']);
}
- register_action("login", true);
- register_action("logout");
+ elgg_register_action("login", '', 'public');
+ elgg_register_action("logout");
// Register a default PAM handler
register_pam_handler('pam_auth_userpass');
diff --git a/engine/lib/users.php b/engine/lib/users.php
index 9ed3d0863..cdabfddff 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -1512,31 +1512,31 @@ function users_init() {
register_page_handler('resetpassword', 'elgg_user_resetpassword_page_handler');
register_page_handler('login', 'elgg_user_login_page_handler');
- register_action("register", true);
- register_action("useradd", true);
- register_action("friends/add");
- register_action("friends/remove");
- //register_action('friends/addcollection');
- //register_action('friends/deletecollection');
- //register_action('friends/editcollection');
- //register_action("user/spotlight");
+ elgg_register_action("register", '', 'public');
+ elgg_register_action("useradd", '', 'public');
+ elgg_register_action("friends/add");
+ elgg_register_action("friends/remove");
+ //elgg_register_action('friends/addcollection');
+ //elgg_register_action('friends/deletecollection');
+ //elgg_register_action('friends/editcollection');
+ //elgg_register_action("user/spotlight");
- register_action("usersettings/save");
+ elgg_register_action("usersettings/save");
- register_action("user/passwordreset", TRUE);
- register_action("user/requestnewpassword", TRUE);
+ elgg_register_action("user/passwordreset", '', 'public');
+ elgg_register_action("user/requestnewpassword", '', 'public');
// User name change
extend_elgg_settings_page('user/settings/name', 'usersettings/user', 1);
- //register_action("user/name");
+ //elgg_register_action("user/name");
// User password change
extend_elgg_settings_page('user/settings/password', 'usersettings/user', 1);
- //register_action("user/password");
+ //elgg_register_action("user/password");
// Add email settings
extend_elgg_settings_page('user/settings/email', 'usersettings/user', 1);
- //register_action("email/save");
+ //elgg_register_action("email/save");
// Add language settings
extend_elgg_settings_page('user/settings/language', 'usersettings/user', 1);
@@ -1544,7 +1544,7 @@ function users_init() {
// Add default access settings
extend_elgg_settings_page('user/settings/default_access', 'usersettings/user', 1);
- //register_action("user/language");
+ //elgg_register_action("user/language");
// Register the user type
register_entity_type('user', '');
diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php
index f4cb8765b..e11e4b8e3 100644
--- a/engine/lib/widgets.php
+++ b/engine/lib/widgets.php
@@ -259,10 +259,10 @@ function elgg_widget_run_once() {
* @return void
*/
function elgg_widgets_init() {
- register_action('widgets/save');
- register_action('widgets/add');
- register_action('widgets/move');
- register_action('widgets/delete');
+ elgg_register_action('widgets/save');
+ elgg_register_action('widgets/add');
+ elgg_register_action('widgets/move');
+ elgg_register_action('widgets/delete');
run_function_once("elgg_widget_run_once");
}