passman icon indicating copy to clipboard operation
passman copied to clipboard

Version check fails if proxy used

Open manfred-mp opened this issue 9 years ago • 11 comments

Cannot check version info against github if behind proxy.

manfred-mp avatar Feb 10 '17 12:02 manfred-mp

Anything in the error log?

brantje avatar Feb 10 '17 12:02 brantje

Error PHP Undefined variable: githubVersion at /usr/pbi/owncloud-amd64/www/owncloud/apps/passman/templates/part.admin.php#39 2017-02-10T12:19:08+00:00

BTW. This is great app for owncloud, thx!

manfred-mp avatar Feb 10 '17 12:02 manfred-mp

@manfred-mp Can you provide the config you use? Censor out all sensitive info

brantje avatar Feb 14 '17 22:02 brantje

Fork attached. After googling a bit it is clear that DOMdocument->load is not the best option with proxies and many suggested using curl. Anyway this approach is using OC's internal HTTPclient and works great - for me.

part.admin.php.txt

manfred-mp avatar Feb 15 '17 07:02 manfred-mp

Error PHP Undefined variable: githubVersion at /usr/pbi/owncloud-amd64/www/owncloud/apps/passman/templates/part.admin.php#39 is caused by missing check for $checkVersion boolean where compare is done (or define it in code or change code order)

manfred-mp avatar Feb 15 '17 08:02 manfred-mp

Thanks, will implement it in the part.admin.

brantje avatar Feb 15 '17 09:02 brantje

I think you got this $checkVersion fix wrong from my bad explanation, sry. $githubVersion is never defined if version check is not enabled and later on it is used in compare here: <?php if (version_compare($githubVersion, $localVersion) === 1) { p($l->t('A newer version of passman is available')); } ?>

It should be something like this: <?php if ($checkVersion && version_compare($githubVersion, $localVersion) === 1) { p($l->t('A newer version of passman is available')); } ?>

manfred-mp avatar Feb 15 '17 09:02 manfred-mp

FYI: isset($checkVersion) still in code in two places

manfred-mp avatar Feb 15 '17 09:02 manfred-mp

ATM busy with the android app, if you want you can make a PR to the V2.1.0 branch.

brantje avatar Feb 15 '17 09:02 brantje

But you added those in this fix. Just leave those as they were in original code.

manfred-mp avatar Feb 15 '17 09:02 manfred-mp

Fixed in 2.1

brantje avatar Feb 16 '17 10:02 brantje