BobRay / notify

Notify subscribers, Twitter, and Facebook of updates to your MODX Revolution site
https://bobsguides.com/notify-tutorial.html
5 stars 3 forks source link

Unauthorized Access -- must be a member of Administrator group #3

Closed DonQuicky closed 10 years ago

DonQuicky commented 10 years ago

Just installed Notify 1.1.4 on MODX Revolution 2.2.10 as admin and testing posting to Twitter also as admin, but on each choise in TV {new,update,custom} I receive follwing error when pushing Notify-button:

Check the appropriate boxes and submit the following form to send notifications:

Unauthorized Access -- must be a member of Administrator group

No exceptions or ACL's present which could interfere. Also made a duplicate of the chunk I want to use, but still no go.

Note: the site is multilangual using Babel and multiple contexts for the languages.

BobRay commented 10 years ago

Was this a new install of Notify, or an upgrade? If an upgrade, was the previous version working?

DonQuicky commented 10 years ago

Hi Bob,

Thanks for your reply. It was a fresh install, never used it before. I will use Notify for pushing a tweet to Twitter as alternative for the tweet function in Articles.

Note: I am using Opera 18 and tried Firefox 25 which gave me an error about missing unsubscribe.class.php. I believe this one is needed by Subscribe, but did not install this one because I don't intend to use Subscribe at this moment. Only sending tweets to Twitter.

After installing Subscribe, to resolve the missing php-file error, I do see the form for Notify in Firefox, but still same error mentioned in first post in Opera so that seems to be a browser issue. Clearing all the caches [in manager and browser] did not resolve that.

BobRay commented 10 years ago

I couldn't make it happen. I agree that it may be something with Opera. Some browsers also don't clear the cache fully when you tell them to.

There are several features in Notify that depend on Subscribe so it's good that you installed it.

DonQuicky commented 10 years ago

Oké Bob, thanks for your response. As this one seems a browser issue and is working on other [ more regular ;) ] browsers, I will close this issue.

Note: just tested on IE11 and this one gives me the error about Unauthorized Access also.

Again, thanks for your effort. To me, you are a true MODX guru!

DonQuicky commented 10 years ago

Hi Bob, just upgraded your Notify to v1.2.2 and getting this Unauthorized Access error again. The error log shows following:

[2014-03-16 00:20:34](ERROR @ /var/www/vhosts/codeplaza.com/httpdocs/core/cache/includes/elements/modplugin/27.include.cache.php : 106) PHP warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/codeplaza.com/httpdocs/core/model/modx/modresponse.class.php:189

Do you know what can be wrong? Cleared all caches including browser. Error shows in Opera, IE & Chrome.

BobRay commented 10 years ago

I had that briefly. I cured it by flushing permissions and sessions and deleting the files in the core/cache directory. It happened after I previewed the site from the Manager, which makes you the (anonymous) user in the front end.

DonQuicky commented 10 years ago

Hi Bob, did clean all I could clean. Still no go. But what about the error shown in the error log?

DonQuicky commented 10 years ago

Bob, I think I got the bug! When accessing the backend with www as prefix to my domainname and hitting the Notify button Notify drops with this error. I noticed the URL used by Notify is codeplaza.com instead of www.codeplaza.com and that's why the Unauthorized Access error.

When entering the backend without the www and hitting the Notify button all seems fine.

What to do to fix this one?

BobRay commented 10 years ago

The reason that's happening is that when you switch from one domain to the other (www to non-www) the $_SESSION variable is lost so MODX doesn't know who you are.

There are two possible solutions. One is to stop using www when accessing the Menu. That would be my choice.

The other would be to put an .htaccess file in the Manager directory containing just the www or non-www forcing code from the .htaccess in the root. This is less attractive because usually, the Manager directory's .htaccess file turns the rewrite engine off for security reasons.

Cheers,

Bob

On Mon, Mar 17, 2014 at 6:13 PM, DonQuicky notifications@github.com wrote:

Bob, I think I got the bug! When accessing the backend with www as prefix to my domainname and hitting the Notify button Notify drops with this error. I noticed the URL used by Notify is codeplaza.com instead of www.codeplaza.com and that's why the Unauthorized Access error.

When entering the backend without the www and hitting the Notify button all seems fine.

What to do to fix this one?

Reply to this email directly or view it on GitHubhttps://github.com/BobRay/notify/issues/3#issuecomment-37877587 .

DonQuicky commented 10 years ago

Bob,

But what about that error in the error log? When using the manager without www-prefix results in a window loading Notify fine, but when selecting Send tweet and submit it, an error occurs about Javascript [catched in the console]:

Uncaught ReferenceError: value is not defined notify:54 Uncaught ReferenceError: value is not defined notify:54 (anonymous function) notify:54 $.ajax.success notify:53 j jquery.min.js:2 k.fireWith jquery.min.js:2 x jquery.min.js:4 b

Any suggestions?

Cheers, Ivar

DonQuicky commented 10 years ago

Bob,

Additional info: I just reinstalled Notify 1.2.2 completely.

The PHP-error about the "headers already been sent" was caused by the extension xFPC. Disabling this one did resolve this errors. In previous version of Notify, xFPC did no interrupt.

I also noticed a error about file OAuth.php which can't be loaded by Notify. This file seems to get installed with capitals while file is to be included as oauth.php. Renaming this file from OAuth.php to oauth.php solves that issue.

Also in the snippet I notice following in line 125: require_once 'c:/xampp/htdocs/addons/assets/mycomponents/instantiatemodx/instantiatemodx.php';

Is that one correct? It seems to be a local environment for you.

Also I can't load my custom Tpl for tweet section, although it is set in the propertyset

Cheers, Ivar

BobRay commented 10 years ago

Good catch on the OAuth file. I thought I had fixed that.

On the error message, are you using a custom form for Notify rather than the one in the install? It looks like this code may be missing from the bottom of your form:

[[%nf.results? &namespace=`notify` &topic=`form`]]

On Tue, Mar 18, 2014 at 5:30 AM, DonQuicky notifications@github.com wrote:

Bob,

Additional info: I just reinstalled Notify 1.2.2 completely. Still the PHP-error remains about the "headers already been sent".

I also noticed a error about file OAuth.php which can't be loaded by Notify. This file seems to get installed with capitals while file is to be included as oauth.php. Renaming this file from OAuth.php to oauth.php solves that issue.

Cheers, Ivar

Reply to this email directly or view it on GitHubhttps://github.com/BobRay/notify/issues/3#issuecomment-37913219 .

DonQuicky commented 10 years ago

Nope, I use the original files from your package. The part of the form you do mention is present. Do you have a suggestion about the other issues I did mention?

Also in the snippet I notice following in line 125: require_once
c:/xampp/htdocs/addons/assets/mycomponents/instantiatemodx/instantiatemodx.php';

Is that one correct? It seems to be a local environment for you.

Also I can't load my custom Tpl for tweet section, although it is set in the propertyset

BobRay commented 10 years ago

I'm not clear on which issues have been solved and which are still issues for you.

The instantiatemodx part would only take effect when running outside of MODX. I use it for testing You can remove it, but it shouldn't have any effect either way.

What property are you setting for the Tweet Tpl?

It should be one of these:

&nfTweetTplNew &nfTweetTplExisting &nfTweetTplCustom

Bob

On Tue, Mar 18, 2014 at 4:48 PM, DonQuicky notifications@github.com wrote:

Nope, I use the original files from your package. The part of the form you do mention is present. Do you have a suggestion about the other issues I did mention?

Also in the snippet I notice following in line 125:

require_oncec:/xampp/htdocs/addons/assets/mycomponents/instantiatemodx/instantiatemodx.php'; Is that one correct? It seems to be a local environment for you.

Also I can't load my custom Tpl for tweet section, although it is set in the propertyset

Reply to this email directly or view it on GitHubhttps://github.com/BobRay/notify/issues/3#issuecomment-37985751 .

DonQuicky commented 10 years ago

Oké, the instantiatemodx part can be ignored :)

I am using the propertyset you advised, NotifyProperties, which I call with [[!Notify@NotifyProperties]]. In the propertyset I did set the property for nfTweetTplCustom with my custom template for the tweet. But still loads the default template.

Cheers, Ivar

DonQuicky commented 10 years ago

Bob,

I believe I got the reason why the Javascript-error occurs. In notify.js on line 42 and 43 the variable value is not set. Changing value into err did solve this error.

Now the only problem that remains is the fact that my custom propertyset is not loaded by snippet and the defaults get loaded.

DonQuicky commented 10 years ago

Bob,

Yes!!!!! You did it. The attached version I did receive from you did the job. It's all fine now! Thanks for your efford.

Greets, Ivar

BobRay commented 10 years ago

Fixed in Commit 44fa6a March 20, 2014