moometric / GSuiteSignatureManager

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

Limit with 100 user only #2

Closed imodar closed 4 years ago

imodar commented 5 years ago

Hi, thank you for your nice job, i try to use it and it's ok for me and i have 2 points

  1. is there any way to have if else inside signature html ? so maybe if there is no mobile number i will hide the link of website as an example.

  2. when i try to apply the signature, i found that only 100 hundred emails are affected. i got this info by small debug code. i list the users by add the following to line 173 : print_r ($this->user_array[$key]); into file : mooSignature.php

can you please help on this

moometric commented 5 years ago

Hi Imodar,

  1. I haven't added in any form of solid template engine to this, so the conditional logic you're talking about doesn't currently exist. If for example {{MobileNumber}} is a field in your template and it doesn't exist, the template will be updated with a blank value. Not exactly conditional logic, but at least the fields shouldn't be displayed if they don't have any attribute

  2. Looking at the google API, there is a limit of 100 users per "page" - I will need to modify the function on line 81 of MooSignature.php to check if the 'nextPageToken' exists, and if it does, to get the next page.

imodar commented 5 years ago

Thank you, i made the improvement for the code and now it getting all users from g suite account

now i notice another issue : if IsMailboxSetup is false inside response, then the code will hang. I pass this issue by assigning a license for unlicensed users

hnurwanto commented 5 years ago

Hi @imodar ,

Can you share how to get and update all users from g suite account that have more than 100 users?

Thanks,

Update To get more than 100 users (default), you can change the code on line 83 with this (500 is maximum allowed) $output = $this->googleServiceDirectory->users->listUsers(Array('domain' => "$this->domain", "projection" => "full", "maxResults" => 500));

mohsinalandsterling commented 2 years ago

looks like this issue is still not fixed.