Browse Source

Switch to Mozilla Public License 2.0 for code consistency

Skylar Ittner 8 months ago
parent
commit
d10c6214a6
21 changed files with 484 additions and 59 deletions
  1. 370
    5
      LICENSE.md
  2. 33
    48
      README.md
  3. 4
    0
      action.php
  4. 5
    1
      api.php
  5. 5
    0
      app.php
  6. 1
    1
      composer.json
  7. 5
    0
      index.php
  8. 4
    0
      lang/en_us.php
  9. 4
    0
      lang/messages.php
  10. 4
    0
      lib/iputils.php
  11. 5
    1
      lib/login.php
  12. 4
    0
      lib/userinfo.php
  13. 4
    0
      mobile/index.php
  14. 4
    0
      pages.php
  15. 6
    1
      pages/404.php
  16. 5
    0
      pages/home.php
  17. 4
    0
      required.php
  18. 5
    1
      settings.template.php
  19. 4
    0
      static/css/app.css
  20. 4
    0
      static/css/index.css
  21. 4
    1
      static/js/app.js

+ 370
- 5
LICENSE.md View File

@@ -1,9 +1,374 @@
1
-Copyright (C) 2018 Netsyms Technologies.
1
+Copyright (c) 2018 Netsyms Technologies.
2 2
 
3
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3
+If you modify and redistribute this project, you must replace the branding
4
+assets with your own.
4 5
 
5
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+The branding assets include:
7
+ * the application icon
8
+ * the Netsyms N punchcard logo
9
+ * the Netsyms for Business graph logo
10
+
11
+If you are unsure if your usage is allowed, please contact us:
12
+https://netsyms.com/contact
13
+legal@netsyms.com
14
+
15
+All other portions of this application,
16
+unless otherwise noted (in comments, headers, etc), are licensed as follows:
17
+
18
+Mozilla Public License Version 2.0
19
+==================================
20
+
21
+### 1. Definitions
22
+
23
+**1.1. “Contributor”**
24
+    means each individual or legal entity that creates, contributes to
25
+    the creation of, or owns Covered Software.
26
+
27
+**1.2. “Contributor Version”**
28
+    means the combination of the Contributions of others (if any) used
29
+    by a Contributor and that particular Contributor's Contribution.
30
+
31
+**1.3. “Contribution”**
32
+    means Covered Software of a particular Contributor.
33
+
34
+**1.4. “Covered Software”**
35
+    means Source Code Form to which the initial Contributor has attached
36
+    the notice in Exhibit A, the Executable Form of such Source Code
37
+    Form, and Modifications of such Source Code Form, in each case
38
+    including portions thereof.
39
+
40
+**1.5. “Incompatible With Secondary Licenses”**
41
+    means
42
+
43
+* **(a)** that the initial Contributor has attached the notice described
44
+    in Exhibit B to the Covered Software; or
45
+* **(b)** that the Covered Software was made available under the terms of
46
+    version 1.1 or earlier of the License, but not also under the
47
+    terms of a Secondary License.
48
+
49
+**1.6. “Executable Form”**
50
+    means any form of the work other than Source Code Form.
51
+
52
+**1.7. “Larger Work”**
53
+    means a work that combines Covered Software with other material, in
54
+    a separate file or files, that is not Covered Software.
55
+
56
+**1.8. “License”**
57
+    means this document.
58
+
59
+**1.9. “Licensable”**
60
+    means having the right to grant, to the maximum extent possible,
61
+    whether at the time of the initial grant or subsequently, any and
62
+    all of the rights conveyed by this License.
63
+
64
+**1.10. “Modifications”**
65
+    means any of the following:
66
+
67
+* **(a)** any file in Source Code Form that results from an addition to,
68
+    deletion from, or modification of the contents of Covered
69
+    Software; or
70
+* **(b)** any new file in Source Code Form that contains any Covered
71
+    Software.
72
+
73
+**1.11. “Patent Claims” of a Contributor**
74
+    means any patent claim(s), including without limitation, method,
75
+    process, and apparatus claims, in any patent Licensable by such
76
+    Contributor that would be infringed, but for the grant of the
77
+    License, by the making, using, selling, offering for sale, having
78
+    made, import, or transfer of either its Contributions or its
79
+    Contributor Version.
80
+
81
+**1.12. “Secondary License”**
82
+    means either the GNU General Public License, Version 2.0, the GNU
83
+    Lesser General Public License, Version 2.1, the GNU Affero General
84
+    Public License, Version 3.0, or any later versions of those
85
+    licenses.
86
+
87
+**1.13. “Source Code Form”**
88
+    means the form of the work preferred for making modifications.
89
+
90
+**1.14. “You” (or “Your”)**
91
+    means an individual or a legal entity exercising rights under this
92
+    License. For legal entities, “You” includes any entity that
93
+    controls, is controlled by, or is under common control with You. For
94
+    purposes of this definition, “control” means **(a)** the power, direct
95
+    or indirect, to cause the direction or management of such entity,
96
+    whether by contract or otherwise, or **(b)** ownership of more than
97
+    fifty percent (50%) of the outstanding shares or beneficial
98
+    ownership of such entity.
99
+
100
+
101
+### 2. License Grants and Conditions
102
+
103
+#### 2.1. Grants
104
+
105
+Each Contributor hereby grants You a world-wide, royalty-free,
106
+non-exclusive license:
107
+
108
+* **(a)** under intellectual property rights (other than patent or trademark)
109
+    Licensable by such Contributor to use, reproduce, make available,
110
+    modify, display, perform, distribute, and otherwise exploit its
111
+    Contributions, either on an unmodified basis, with Modifications, or
112
+    as part of a Larger Work; and
113
+* **(b)** under Patent Claims of such Contributor to make, use, sell, offer
114
+    for sale, have made, import, and otherwise transfer either its
115
+    Contributions or its Contributor Version.
116
+
117
+#### 2.2. Effective Date
118
+
119
+The licenses granted in Section 2.1 with respect to any Contribution
120
+become effective for each Contribution on the date the Contributor first
121
+distributes such Contribution.
122
+
123
+#### 2.3. Limitations on Grant Scope
124
+
125
+The licenses granted in this Section 2 are the only rights granted under
126
+this License. No additional rights or licenses will be implied from the
127
+distribution or licensing of Covered Software under this License.
128
+Notwithstanding Section 2.1(b) above, no patent license is granted by a
129
+Contributor:
130
+
131
+* **(a)** for any code that a Contributor has removed from Covered Software;
132
+    or
133
+* **(b)** for infringements caused by: **(i)** Your and any other third party's
134
+    modifications of Covered Software, or **(ii)** the combination of its
135
+    Contributions with other software (except as part of its Contributor
136
+    Version); or
137
+* **(c)** under Patent Claims infringed by Covered Software in the absence of
138
+    its Contributions.
139
+
140
+This License does not grant any rights in the trademarks, service marks,
141
+or logos of any Contributor (except as may be necessary to comply with
142
+the notice requirements in Section 3.4).
143
+
144
+#### 2.4. Subsequent Licenses
145
+
146
+No Contributor makes additional grants as a result of Your choice to
147
+distribute the Covered Software under a subsequent version of this
148
+License (see Section 10.2) or under the terms of a Secondary License (if
149
+permitted under the terms of Section 3.3).
150
+
151
+#### 2.5. Representation
152
+
153
+Each Contributor represents that the Contributor believes its
154
+Contributions are its original creation(s) or it has sufficient rights
155
+to grant the rights to its Contributions conveyed by this License.
156
+
157
+#### 2.6. Fair Use
158
+
159
+This License is not intended to limit any rights You have under
160
+applicable copyright doctrines of fair use, fair dealing, or other
161
+equivalents.
162
+
163
+#### 2.7. Conditions
164
+
165
+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
166
+in Section 2.1.
167
+
168
+
169
+### 3. Responsibilities
170
+
171
+#### 3.1. Distribution of Source Form
172
+
173
+All distribution of Covered Software in Source Code Form, including any
174
+Modifications that You create or to which You contribute, must be under
175
+the terms of this License. You must inform recipients that the Source
176
+Code Form of the Covered Software is governed by the terms of this
177
+License, and how they can obtain a copy of this License. You may not
178
+attempt to alter or restrict the recipients' rights in the Source Code
179
+Form.
180
+
181
+#### 3.2. Distribution of Executable Form
182
+
183
+If You distribute Covered Software in Executable Form then:
184
+
185
+* **(a)** such Covered Software must also be made available in Source Code
186
+    Form, as described in Section 3.1, and You must inform recipients of
187
+    the Executable Form how they can obtain a copy of such Source Code
188
+    Form by reasonable means in a timely manner, at a charge no more
189
+    than the cost of distribution to the recipient; and
190
+
191
+* **(b)** You may distribute such Executable Form under the terms of this
192
+    License, or sublicense it under different terms, provided that the
193
+    license for the Executable Form does not attempt to limit or alter
194
+    the recipients' rights in the Source Code Form under this License.
195
+
196
+#### 3.3. Distribution of a Larger Work
197
+
198
+You may create and distribute a Larger Work under terms of Your choice,
199
+provided that You also comply with the requirements of this License for
200
+the Covered Software. If the Larger Work is a combination of Covered
201
+Software with a work governed by one or more Secondary Licenses, and the
202
+Covered Software is not Incompatible With Secondary Licenses, this
203
+License permits You to additionally distribute such Covered Software
204
+under the terms of such Secondary License(s), so that the recipient of
205
+the Larger Work may, at their option, further distribute the Covered
206
+Software under the terms of either this License or such Secondary
207
+License(s).
208
+
209
+#### 3.4. Notices
210
+
211
+You may not remove or alter the substance of any license notices
212
+(including copyright notices, patent notices, disclaimers of warranty,
213
+or limitations of liability) contained within the Source Code Form of
214
+the Covered Software, except that You may alter any license notices to
215
+the extent required to remedy known factual inaccuracies.
216
+
217
+#### 3.5. Application of Additional Terms
218
+
219
+You may choose to offer, and to charge a fee for, warranty, support,
220
+indemnity or liability obligations to one or more recipients of Covered
221
+Software. However, You may do so only on Your own behalf, and not on
222
+behalf of any Contributor. You must make it absolutely clear that any
223
+such warranty, support, indemnity, or liability obligation is offered by
224
+You alone, and You hereby agree to indemnify every Contributor for any
225
+liability incurred by such Contributor as a result of warranty, support,
226
+indemnity or liability terms You offer. You may include additional
227
+disclaimers of warranty and limitations of liability specific to any
228
+jurisdiction.
229
+
230
+
231
+### 4. Inability to Comply Due to Statute or Regulation
232
+
233
+If it is impossible for You to comply with any of the terms of this
234
+License with respect to some or all of the Covered Software due to
235
+statute, judicial order, or regulation then You must: **(a)** comply with
236
+the terms of this License to the maximum extent possible; and **(b)**
237
+describe the limitations and the code they affect. Such description must
238
+be placed in a text file included with all distributions of the Covered
239
+Software under this License. Except to the extent prohibited by statute
240
+or regulation, such description must be sufficiently detailed for a
241
+recipient of ordinary skill to be able to understand it.
242
+
243
+
244
+### 5. Termination
245
+
246
+**5.1.** The rights granted under this License will terminate automatically
247
+if You fail to comply with any of its terms. However, if You become
248
+compliant, then the rights granted under this License from a particular
249
+Contributor are reinstated **(a)** provisionally, unless and until such
250
+Contributor explicitly and finally terminates Your grants, and **(b)** on an
251
+ongoing basis, if such Contributor fails to notify You of the
252
+non-compliance by some reasonable means prior to 60 days after You have
253
+come back into compliance. Moreover, Your grants from a particular
254
+Contributor are reinstated on an ongoing basis if such Contributor
255
+notifies You of the non-compliance by some reasonable means, this is the
256
+first time You have received notice of non-compliance with this License
257
+from such Contributor, and You become compliant prior to 30 days after
258
+Your receipt of the notice.
259
+
260
+**5.2.** If You initiate litigation against any entity by asserting a patent
261
+infringement claim (excluding declaratory judgment actions,
262
+counter-claims, and cross-claims) alleging that a Contributor Version
263
+directly or indirectly infringes any patent, then the rights granted to
264
+You by any and all Contributors for the Covered Software under Section
265
+2.1 of this License shall terminate.
266
+
267
+**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all
268
+end user license agreements (excluding distributors and resellers) which
269
+have been validly granted by You or Your distributors under this License
270
+prior to termination shall survive termination.
271
+
272
+
273
+### 6. Disclaimer of Warranty
274
+
275
+> Covered Software is provided under this License on an “as is”
276
+> basis, without warranty of any kind, either expressed, implied, or
277
+> statutory, including, without limitation, warranties that the
278
+> Covered Software is free of defects, merchantable, fit for a
279
+> particular purpose or non-infringing. The entire risk as to the
280
+> quality and performance of the Covered Software is with You.
281
+> Should any Covered Software prove defective in any respect, You
282
+> (not any Contributor) assume the cost of any necessary servicing,
283
+> repair, or correction. This disclaimer of warranty constitutes an
284
+> essential part of this License. No use of any Covered Software is
285
+> authorized under this License except under this disclaimer.
286
+
287
+### 7. Limitation of Liability
288
+
289
+> Under no circumstances and under no legal theory, whether tort
290
+> (including negligence), contract, or otherwise, shall any
291
+> Contributor, or anyone who distributes Covered Software as
292
+> permitted above, be liable to You for any direct, indirect,
293
+> special, incidental, or consequential damages of any character
294
+> including, without limitation, damages for lost profits, loss of
295
+> goodwill, work stoppage, computer failure or malfunction, or any
296
+> and all other commercial damages or losses, even if such party
297
+> shall have been informed of the possibility of such damages. This
298
+> limitation of liability shall not apply to liability for death or
299
+> personal injury resulting from such party's negligence to the
300
+> extent applicable law prohibits such limitation. Some
301
+> jurisdictions do not allow the exclusion or limitation of
302
+> incidental or consequential damages, so this exclusion and
303
+> limitation may not apply to You.
304
+
305
+
306
+### 8. Litigation
307
+
308
+Any litigation relating to this License may be brought only in the
309
+courts of a jurisdiction where the defendant maintains its principal
310
+place of business and such litigation shall be governed by laws of that
311
+jurisdiction, without reference to its conflict-of-law provisions.
312
+Nothing in this Section shall prevent a party's ability to bring
313
+cross-claims or counter-claims.
314
+
315
+
316
+### 9. Miscellaneous
317
+
318
+This License represents the complete agreement concerning the subject
319
+matter hereof. If any provision of this License is held to be
320
+unenforceable, such provision shall be reformed only to the extent
321
+necessary to make it enforceable. Any law or regulation which provides
322
+that the language of a contract shall be construed against the drafter
323
+shall not be used to construe this License against a Contributor.
324
+
325
+
326
+### 10. Versions of the License
327
+
328
+#### 10.1. New Versions
329
+
330
+Mozilla Foundation is the license steward. Except as provided in Section
331
+10.3, no one other than the license steward has the right to modify or
332
+publish new versions of this License. Each version will be given a
333
+distinguishing version number.
334
+
335
+#### 10.2. Effect of New Versions
336
+
337
+You may distribute the Covered Software under the terms of the version
338
+of the License under which You originally received the Covered Software,
339
+or under the terms of any subsequent version published by the license
340
+steward.
341
+
342
+#### 10.3. Modified Versions
343
+
344
+If you create software not governed by this License, and you want to
345
+create a new license for such software, you may create and use a
346
+modified version of this License if you rename the license and remove
347
+any references to the name of the license steward (except to note that
348
+such modified license differs from this License).
349
+
350
+#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
351
+
352
+If You choose to distribute Source Code Form that is Incompatible With
353
+Secondary Licenses under the terms of this version of the License, the
354
+notice described in Exhibit B of this License must be attached.
355
+
356
+## Exhibit A - Source Code Form License Notice
357
+
358
+    This Source Code Form is subject to the terms of the Mozilla Public
359
+    License, v. 2.0. If a copy of the MPL was not distributed with this
360
+    file, You can obtain one at http://mozilla.org/MPL/2.0/.
361
+
362
+If it is not possible or desirable to put the notice in a particular
363
+file, then You may include the notice in a location (such as a LICENSE
364
+file in a relevant directory) where a recipient would be likely to look
365
+for such a notice.
366
+
367
+You may add additional accurate notices of copyright ownership.
368
+
369
+## Exhibit B - “Incompatible With Secondary Licenses” Notice
370
+
371
+    This Source Code Form is "Incompatible With Secondary Licenses", as
372
+    defined by the Mozilla Public License, v. 2.0.
6 373
 
7
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL NETSYMS TECHNOLOGIES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 374
 
9
-Except as contained in this notice, the name and other identifying marks of Netsyms Technologies shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Netsyms Technologies.

+ 33
- 48
README.md View File

@@ -1,8 +1,8 @@
1 1
 Business App Template
2 2
 =====================
3 3
 
4
-This is an empty (but fully functional) PHP application.  It is designed to 
5
-integrate with Portal, an account management web interface.  Portal manages 
4
+This is an empty (but fully functional) PHP application.  It is designed to
5
+integrate with Portal, an account management web interface.  Portal manages
6 6
 user credentials and account data, and is accessed by this app via [a simple API](http://docs.netsyms.com/docs/Portal/API%20Documentation/).
7 7
 
8 8
 [![Codacy Badge](https://api.codacy.com/project/badge/Grade/2aeadc6b65d545c4a4c2e77d286373fd)](https://www.codacy.com/app/Netsyms/BusinessAppTemplate?utm_source=github.com&utm_medium=referral&utm_content=Netsyms/BusinessAppTemplate&utm_campaign=Badge_Grade)
@@ -11,71 +11,56 @@ Program Structure
11 11
 -----------------
12 12
 
13 13
 ### Folders
14
-* lang  
15
-   Translations and alert messages.  
16
-   The language file that is loaded depends on the value of `LANGUAGE` in `settings.php`.  
14
+* lang
15
+   Translations and alert messages.
16
+   The language file that is loaded depends on the value of `LANGUAGE` in `settings.php`.
17 17
    Translate the values (but not the keys) in `en_us.php` into other languages and save in appropriately named files to add languages.
18
-* lib  
18
+* lib
19 19
    A good place to put helper functions that you don't want "in the way".
20
-* pages  
21
-   What it looks like.  If you go into `pages.php` and define a page with the name `foo`, there should be a `foo.php` in here.  
22
-   The app checks before loading, so it will give a friendly 404 error if it doesn't find your page.  
20
+* pages
21
+   What it looks like.  If you go into `pages.php` and define a page with the name `foo`, there should be a `foo.php` in here.
22
+   The app checks before loading, so it will give a friendly 404 error if it doesn't find your page.
23 23
    Woe to you if you delete `home.php` or `404.php`, as those are assumed to exist for fallback behavior.
24
-* static  
24
+* static
25 25
    CSS, JS, fonts, images...
26
-* vendor  
26
+* vendor
27 27
    If you don't know what this is about, or you don't have it, you need to read up on Composer.  Right now.
28 28
 
29 29
 ### Files
30
-* settings.template.php  
30
+* settings.template.php
31 31
    App configuration.  Copy to `settings.php` and customize.  Documented with inline comments.
32
-* required.php  
33
-   The "duct tape" that holds the app together.  Use `require_once __DIR__."/required.php"` at the top of every file.  
34
-   It loads Composer dependencies, app settings, language data, and creates `$database` for accessing the database.  
35
-   It also has some utility functions, including `dieifnotloggedin()`, `is_empty($var)`, and `lang('key')`.  
32
+* required.php
33
+   The "duct tape" that holds the app together.  Use `require_once __DIR__."/required.php"` at the top of every file.
34
+   It loads Composer dependencies, app settings, language data, and creates `$database` for accessing the database.
35
+   It also has some utility functions, including `dieifnotloggedin()`, `is_empty($var)`, and `lang('key')`.
36 36
    Read through it to see what those functions do.
37
-* action.php  
37
+* action.php
38 38
    A good place to post forms to.  By default it only handles logging out, but is easily expanded.
39 39
 * api.php
40 40
    Similar to action.php, but designed for user/pass authenticated JSON responses.
41
-* index.php  
42
-   Login page and handler.  Hands off to `app.php` after authenticating user.  
41
+* index.php
42
+   Login page and handler.  Hands off to `app.php` after authenticating user.
43 43
    It includes 2fa support, by the way.
44
-* app.php  
45
-   Main app page after login.  Handles loading app pages and 404 errors.  
46
-   Redirects to `index.php` if the user is not logged in.  
44
+* app.php
45
+   Main app page after login.  Handles loading app pages and 404 errors.
46
+   Redirects to `index.php` if the user is not logged in.
47 47
    Note: to show an alert message (success, error, whatever), set the GET argument `msg` to a message ID from `lang/messages.php`.
48
-* pages.php  
49
-   Define app pages/screens in an array.  The page ID/array key is assumed to exist as a file `pages/{key}.php`, or it will 404.  
50
-   __Optional parameters:__  
51
-      `'navbar' => true` will show the page as a button in the app menu bar.  
52
-      `'icon' => '...'` will show an icon from FontAwesome in the menu bar.  Setting this to `home` will show the icon `fa-home`.  
53
-      `'styles' => ["file.css"]` will inject the listed CSS files into the page header (after all other CSS, like Bootstrap).  
48
+* pages.php
49
+   Define app pages/screens in an array.  The page ID/array key is assumed to exist as a file `pages/{key}.php`, or it will 404.
50
+   __Optional parameters:__
51
+      `'navbar' => true` will show the page as a button in the app menu bar.
52
+      `'icon' => '...'` will show an icon from FontAwesome in the menu bar.  Setting this to `home` will show the icon `fa-home`.
53
+      `'styles' => ["file.css"]` will inject the listed CSS files into the page header (after all other CSS, like Bootstrap).
54 54
       `'scripts' => ["file.js"]` will inject the listed JavaScript files into the page footer (after jQuery and other builtin scripts).
55
-* lang/messages.php  
55
+* lang/messages.php
56 56
    Array of alert messages.
57 57
    `"string"` is the language string for the message, `"type"` is one of `success`, `info`, `warning`, or `danger` (i.e. Bootstrap alert classes).
58 58
    Changing the type changes the icon and color of the alert box.
59
-*lang/en_us.php  
59
+*lang/en_us.php
60 60
    Language data for US English.
61
-*lib/login.php  
61
+*lib/login.php
62 62
    Functions for logging in users and stuff like that.  Most functions transparently makes requests to the Portal API and return the results.
63
-*lib/userinfo.php  
63
+*lib/userinfo.php
64 64
    Functions for getting user data, like real names and managed employees.
65
-*static/css/app.css  
65
+*static/css/app.css
66 66
    Custom styles for the app.  See the comments inside for instructions on theming the app.
67
-
68
-License
69
--------
70
-
71
-tl;dr: MIT license, but also don't use our name in ads and stuff.
72
-
73
-Copyright (C) 2017 Netsyms Technologies.
74
-
75
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
76
-
77
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
78
-
79
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL NETSYMS TECHNOLOGIES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
80
-
81
-Except as contained in this notice, the name and other identifying marks of Netsyms Technologies shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Netsyms Technologies.

+ 4
- 0
action.php View File

@@ -1,5 +1,9 @@
1 1
 <?php
2 2
 
3
+/* This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
+
3 7
 /**
4 8
  * Make things happen when buttons are pressed and forms submitted.
5 9
  */

+ 5
- 1
api.php View File

@@ -1,8 +1,12 @@
1 1
 <?php
2 2
 
3
+/* This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
+
3 7
 /**
4 8
  * Simple JSON API to allow other apps to access data from this app.
5
- * 
9
+ *
6 10
  * Requests can be sent via either GET or POST requests.  POST is recommended
7 11
  * as it has a lower chance of being logged on the server, exposing unencrypted
8 12
  * user passwords.

+ 5
- 0
app.php View File

@@ -1,4 +1,9 @@
1 1
 <?php
2
+
3
+/* This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
+
2 7
 require_once __DIR__ . "/required.php";
3 8
 
4 9
 if ($_SESSION['loggedin'] != true) {

+ 1
- 1
composer.json View File

@@ -6,7 +6,7 @@
6 6
         "catfan/medoo": "^1.5",
7 7
         "guzzlehttp/guzzle": "^6.2"
8 8
     },
9
-    "license": "MIT",
9
+    "license": "MPL-2.0",
10 10
     "authors": [
11 11
         {
12 12
             "name": "Skylar Ittner",

+ 5
- 0
index.php View File

@@ -1,4 +1,9 @@
1 1
 <?php
2
+
3
+/* This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
+
2 7
 require_once __DIR__ . "/required.php";
3 8
 
4 9
 require_once __DIR__ . "/lib/login.php";

+ 4
- 0
lang/en_us.php View File

@@ -1,5 +1,9 @@
1 1
 <?php
2 2
 
3
+/* This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
+
3 7
 define("STRINGS", [
4 8
     "sign in" => "Sign In",
5 9
     "username" => "Username",

+ 4
- 0
lang/messages.php View File

@@ -1,5 +1,9 @@
1 1
 <?php
2 2
 
3
+/* This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
+
3 7
 define("MESSAGES", [
4 8
     "invalid_parameters" => [
5 9
         "string" => "invalid parameters",

+ 4
- 0
lib/iputils.php View File

@@ -1,5 +1,9 @@
1 1
 <?php
2 2
 
3
+/* This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
+
3 7
 /**
4 8
  * Check if a given ipv4 address is in a given cidr
5 9
  * @param  string $ip    IP to check in IPV4 format eg. 127.0.0.1

+ 5
- 1
lib/login.php View File

@@ -1,5 +1,9 @@
1 1
 <?php
2 2
 
3
+/* This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
+
3 7
 /**
4 8
  * Authentication and account functions.  Connects to an AccountHub instance.
5 9
  */
@@ -36,7 +40,7 @@ function checkLoginServer() {
36 40
 }
37 41
 
38 42
 /**
39
- * Checks if the given AccountHub API key is valid by attempting to 
43
+ * Checks if the given AccountHub API key is valid by attempting to
40 44
  * access the API with it.
41 45
  * @param String $key The API key to check
42 46
  * @return boolean TRUE if the key is valid, FALSE if invalid or something went wrong

+ 4
- 0
lib/userinfo.php View File

@@ -1,5 +1,9 @@
1 1
 <?php
2 2
 
3
+/* This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
+
3 7
 /**
4 8
  * Get user info for the given username.
5 9
  * @param int $u username

+ 4
- 0
mobile/index.php View File

@@ -1,5 +1,9 @@
1 1
 <?php
2 2
 
3
+/* This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
+
3 7
 /*
4 8
  * Mobile app API
5 9
  */

+ 4
- 0
pages.php View File

@@ -1,5 +1,9 @@
1 1
 <?php
2 2
 
3
+/* This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
+
3 7
 // List of pages and metadata
4 8
 define("PAGES", [
5 9
     "home" => [

+ 6
- 1
pages/404.php View File

@@ -1,5 +1,10 @@
1
+<?php
2
+/* This Source Code Form is subject to the terms of the Mozilla Public
3
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
4
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
+?>
1 6
 <div class="row justify-content-center">
2
-    <div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
7
+    <div class="col-12 col-sm-10 col-md-8 col-lg-6">
3 8
         <div class="alert alert-warning"><b><?php lang("404 error");?></b><br /> <?php lang("page not found"); ?></div>
4 9
     </div>
5 10
 </div>

+ 5
- 0
pages/home.php View File

@@ -1 +1,6 @@
1
+<?php
2
+/* This Source Code Form is subject to the terms of the Mozilla Public
3
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
4
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
+?>
1 6
 <h1>Hello World</h1>

+ 4
- 0
required.php View File

@@ -1,5 +1,9 @@
1 1
 <?php
2 2
 
3
+/* This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
+
3 7
 /**
4 8
  * This file contains global settings and utility functions.
5 9
  */

+ 5
- 1
settings.template.php View File

@@ -1,5 +1,9 @@
1 1
 <?php
2 2
 
3
+/* This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
+
3 7
 // Whether to show debugging data in output.
4 8
 // DO NOT SET TO TRUE IN PRODUCTION!!!
5 9
 define("DEBUG", false);
@@ -48,5 +52,5 @@ define('RECAPTCHA_SECRET_KEY', '');
48 52
 define('LANGUAGE', "en_us");
49 53
 
50 54
 
51
-define("FOOTER_TEXT", "<b>Free Software: MIT License</b>");
55
+define("FOOTER_TEXT", "");
52 56
 define("COPYRIGHT_NAME", "Netsyms Technologies");

+ 4
- 0
static/css/app.css View File

@@ -1,3 +1,7 @@
1
+/* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
+
1 5
 body {
2 6
     padding-top: 4rem;
3 7
 }

+ 4
- 0
static/css/index.css View File

@@ -1,3 +1,7 @@
1
+/* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
+
1 5
 .banner-image {
2 6
     max-height: 100px;
3 7
     margin: 2em auto;

+ 4
- 1
static/js/app.js View File

@@ -1,3 +1,6 @@
1
+/* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
1 4
 
2 5
 $(document).ready(function () {
3 6
     /* Fade out alerts */
@@ -19,5 +22,5 @@ function getniceurl() {
19 22
 try {
20 23
     window.history.replaceState("", "", getniceurl());
21 24
 } catch (ex) {
22
-    
25
+
23 26
 }