moometric / GSuiteSignatureManager

Manage GSuite directory users signatures
https://moometric.com/
MIT License
42 stars 19 forks source link

Great idea, just can't get it working :( #1

Closed BHWWills closed 6 years ago

BHWWills commented 6 years ago

I'm just getting a blank page, if I echo anything before $mooSig = new mooSignature($domain, $admin_email); I can see it, but after just dies.

I have set my settings thus:

$admin_email = "me@test.church"; (not the real settings) $domain = "test.church"; $sigPath ="/public_html/GSuiteSignatureManager/signatures/"; (they haven't moved from the git clone) $serviceAccountPath = "/public_html/GSuiteSignatureManager/local_vars/";

Any ideas as to what i'm doing wrong.

I renamed the service-account.json from its original to service-account.json as that didn't work.

moometric commented 6 years ago

Hi BHWWills,

If you're just seeing a blank page, I would suggest turning on debugging first to see Place the following at the top of the file to turn on debugging.

error_reporting(E_ALL);
ini_set('display_errors', '1');
BHWWills commented 6 years ago

Many thanks... this is the error I get:

BHWWills commented 6 years ago

Warning: include(/home/bhww/public_html/GSuiteSignatureManager/vendor/composer/../../src/Gsuite.php): failed to open stream: No such file or directory in /home/bhww/public_html/GSuiteSignatureManager/vendor/composer/ClassLoader.php on line 444

Warning: include(): Failed opening '/home/bhww/public_html/GSuiteSignatureManager/vendor/composer/../../src/Gsuite.php' for inclusion (include_path='.:/opt/cpanel/ea-php56/root/usr/share/pear') in /home/bhww/public_html/GSuiteSignatureManager/vendor/composer/ClassLoader.php on line 444

Fatal error: Class 'Moometric\mooSignature' not found in /home/bhww/public_html/GSuiteSignatureManager/index.php on line 14

moometric commented 6 years ago

Appears to be missing a file or maybe has permissions issue on the directory. Make sure the below file exists and if it does that you have 777 permissions on the file/folder. /home/bhww/public_html/GSuiteSignatureManager/vendor/composer/ClassLoader.php

BHWWills commented 6 years ago

It would appear an issue might be that looking at your edits, Gsuite was renamed to mooSignature, changing ClassLoader to reflect this corrects that error. I then needed to move the /signatures/ and /local_var/ into the /src/ folder and now I have... Fatal error: Uncaught exception 'Google_Service_Exception' with message '{ "error": "unauthorized_client", "error_description": "Client is unauthorized to retrieve access tokens using this method." } ' in /home/bhww/public_html/GSuiteSignatureManager/vendor/google/apiclient/src/Google/Http/REST.php:118 Stack trace: #0 /home/bhww/public_html/GSuiteSignatureManager/vendor/google/apiclient/src/Google/Http/REST.php(94): Google_Http_REST::decodeHttpResponse(Object(GuzzleHttp\Psr7\Response), Object(GuzzleHttp\Psr7\Request), 'GoogleService...') #1 [internal function]: Google_Http_REST::doExecute(Object(GuzzleHttp\Client), Object(GuzzleHttp\Psr7\Request), 'GoogleService...') #2 /home/bhww/public_html/GSuiteSignatureManager/vendor/google/apiclient/src/Google/Task/Runner.php(176): call_user_func_array(Array, Array) #3 /home/bhww/public_html/GSuiteSignatureManager/vendor/google/apiclient/src/Google/Http/REST.php(58): Google_Task_Runner->run() #4 /home/bhww/public_html/GSuiteSignatureManager/vendor/google/apiclient/src/Google/C in /home/bhww/public_html/GSuiteSignatureManager/vendor/google/apiclient/src/Google/Http/REST.php on line 118

BHWWills commented 6 years ago

Should the admin_email be my email or the service-account email? also does it matter where the code is hosted?

moometric commented 6 years ago

It should be a gsuite admin email (i.e you login and can manage users through the admin.google.com gsuite portal).

It doesn't matter where the code is hosted - I just tested and it's working fine on my local machine (no SSL certificates or anything).

The easiest way to install would be through composer, rather than doing a gitclone. That way you can ensure that all the dependencies are installed correct.

BHWWills commented 6 years ago

ok, i'm not comfortable with composer, so thats a shame, i will have a go at working out the issue, it seems to be authorisation

BHWWills commented 6 years ago

Thanks, if anyone else gets this working, or experiences similar issues and can solve it i'd love to know :) thanks for the work so far

BHWWills commented 6 years ago

Hi i've not managed to solve this yet, would you be interest in having a look?