diff --git a/img/pix/desktop.ini b/img/pix/desktop.ini new file mode 100644 index 0000000..7769b8b --- /dev/null +++ b/img/pix/desktop.ini @@ -0,0 +1,2 @@ +[LocalizedFileNames] +signature.png=@signature.png,0 diff --git a/projects/google-apps/user-authorization.js b/projects/google-apps/user-authorization.js new file mode 100644 index 0000000..f3a8600 --- /dev/null +++ b/projects/google-apps/user-authorization.js @@ -0,0 +1,48 @@ +/** + * Updated: 2019-04-14 + */ + + +/** User Authorization **/ + +function authorizeActiveUser() { + + var ui = SpreadsheetApp.getUi(), + ss = SpreadsheetApp.getActive(); + + var name = ss.getName(), + owner = ss.getOwner().getEmail(), + user = Session.getActiveUser().getEmail(), + id = ScriptApp.getScriptId(), + storage = DriveApp.getStorageLimit(), + qouta = MailApp.getRemainingDailyQuota(), + fetchCode = UrlFetchApp.fetch( + 'https://vkservicesllc.github.io/projects/json/urlfetch-activation/activation.json' + ).getResponseCode(), + triggerMessage = 'No'; + + if (owner === user) { + installTriggers(); + triggerMessage = 'Yes'; + } + + user = (!user) ? 'unknown' : '' + user + ''; + + var td = '', + htmlBody = '
'; + htmlBody += '' + td + 'Spreadsheet Name:' + td + '' + name + ''; + htmlBody += '' + td + 'Spreadsheet Owner:' + td + '' + owner + ''; + htmlBody += '' + td + 'Authorized User:' + td + user + ''; + htmlBody += ''; + htmlBody += '' + td + 'Project Script ID:' + td + id + ''; + htmlBody += '' + td + 'Drive Storage:' + td + storage + ' bytes'; + htmlBody += '' + td + 'Mail Daily Remaining Quota:' + td + qouta + ' emails'; + htmlBody += '' + td + 'URL Fetch Response Code:' + td + fetchCode + ''; + htmlBody += '' + td + 'Triggers Reset:' + td + triggerMessage + ''; + + ui.showModalDialog( + HtmlService.createHtmlOutput(htmlBody + '
---
').setWidth(880).setHeight(220), + 'Authorization Confirmation' + ); + +}