]> git.mxchange.org Git - friendica.git/commitdiff
plugin settings were getting changed
authorFriendika <info@friendika.com>
Wed, 5 Jan 2011 21:10:47 +0000 (13:10 -0800)
committerFriendika <info@friendika.com>
Wed, 5 Jan 2011 21:10:47 +0000 (13:10 -0800)
addon/README
addon/randplace/randplace.php
mod/settings.php

index 7089634d2667abc5c5bb8f06ee556d89088da7cf..b92b418b42d1d83193c50c9e4b2156d2dd3801bb 100644 (file)
@@ -82,10 +82,13 @@ Current hooks:
 'settings_form' - called when generating the HTML for the user Settings page
        $b is the (string) HTML of the settings page before the final '</form>' tag.
 
+'settings_post' - called when the Settings pages are submitted.
+       $b is the $_POST array
+
 'plugin_settings' - called when generating the HTML for the addon settings page
        $b is the (string) HTML of the addon settings page before the final '</form>' tag.
 
-'settings_post' - called when the Settings and Addon Settings pages are submitted.
+'plugin_settings_post' - called when the Addon Settings pages are submitted.
        $b is the $_POST array
 
 'profile_advanced' - called when the HTML is generated for the 'Advanced profile', 
index 2f0ff038b622a9ab72b383441bf3cde3da4e6145..d7ea65c9d23e0b2083b2c38bf50f25d6afdf301c 100644 (file)
@@ -43,7 +43,7 @@ function randplace_install() {
         */
 
        register_hook('plugin_settings', 'addon/randplace/randplace.php', 'randplace_settings');
-       register_hook('settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
+       register_hook('plugin_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
 
        logger("installed randplace");
 }
@@ -61,7 +61,7 @@ function randplace_uninstall() {
 
        unregister_hook('post_local',    'addon/randplace/randplace.php', 'randplace_post_hook');
        unregister_hook('plugin_settings', 'addon/randplace/randplace.php', 'randplace_settings');
-       unregister_hook('settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
+       unregister_hook('plugin_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
 
 
        logger("removed randplace");
index 9a9fde5c6b4eee911fbcaed5430962e41bc0dd16..1923c58da1148d4f69742dd6df209fce410559b3 100644 (file)
@@ -15,15 +15,18 @@ function settings_post(&$a) {
                return;
        }
 
-       call_hooks('settings_post', $_POST);
-
-       if(($a->argc > 1) && ($a->argv[1] == 'addon'))
-               return;
-
        if(count($a->user) && x($a->user,'uid') && $a->user['uid'] != local_user()) {
                notice( t('Permission denied.') . EOL);
                return;
        }
+
+       if(($a->argc > 1) && ($a->argv[1] == 'addon')) {
+               call_hooks('plugin_settings_post', $_POST);
+               return;
+       }
+
+       call_hooks('settings_post', $_POST);
+
        if((x($_POST,'npassword')) || (x($_POST,'confirm'))) {
 
                $newpass = $_POST['npassword'];