21 Commits
Author SHA1 Message Date
SowinskiBraeden c05e3a3879 Update Version to beta 2022-06-11 10:12:40 -07:00
SowinskiBraeden fa8acec7a8 change yog to any year 2022-06-11 10:08:42 -07:00
SowinskiBraeden 7ed53fc539 allow teachers to change personal email 2022-06-11 09:59:18 -07:00
SowinskiBraeden 315f33b3e7 Merge branch 'master' of https://github.com/SowinskiBraeden/school-management-api 2022-06-11 09:48:02 -07:00
SowinskiBraeden 3aa4f72b33 add variable school email 2022-06-11 09:47:51 -07:00
SowinskiBraeden 2071e94516 Merge pull request #25 from SowinskiBraeden/update-admin-information
add routes and functions to update admin
2022-06-11 09:41:39 -07:00
SowinskiBraeden 50e672849b add routes and functions to update admin 2022-06-11 09:40:20 -07:00
SowinskiBraeden 956fe306e5 minor bug fix 2022-06-10 15:42:19 -07:00
SowinskiBraeden dcabacdc8c Merge branch 'master' of https://github.com/SowinskiBraeden/school-management-api 2022-06-10 14:09:22 -07:00
SowinskiBraeden 8032b79989 remove deprecated debug response 2022-06-10 14:09:07 -07:00
SowinskiBraeden 255ea25edf Continue Documentation 2022-06-10 14:04:45 -07:00
SowinskiBraeden 7e85215fcc remove deprecated messages 2022-06-10 13:20:54 -07:00
SowinskiBraeden 84b8c1ae5e Finish updating documentation 2022-06-10 13:19:58 -07:00
SowinskiBraeden ca4020f0ee Update DOCUMENTATION.md 2022-06-10 12:29:29 -07:00
SowinskiBraeden 596533753c remove deprecated test response 2022-06-10 12:28:50 -07:00
SowinskiBraeden e97f185e22 remove deprecated test code 2022-06-10 10:45:56 -07:00
SowinskiBraeden fdd489345d Update DOCUMENTATION.md 2022-06-10 10:45:20 -07:00
SowinskiBraeden 724b61cc2e add previews 2022-06-09 19:21:40 -07:00
SowinskiBraeden b456a02178 remove debug 2022-06-09 19:19:58 -07:00
SowinskiBraeden 41e7ca4f87 work on documentation 2022-06-09 19:14:01 -07:00
SowinskiBraeden ae88f5d149 work on documentation 2022-06-09 19:00:56 -07:00
11 changed files with 1105 additions and 90 deletions

No files matched your search

+1
View File
@@ -2,5 +2,6 @@ mongoURI=mongodb://localhost:27017
dbo=school
secret=<your 256 bit secret>
PORT=8000
SYSTEM_EMAIL_ADDRESS=<@exampleschoolemail.com>
SYSTEM_EMAIL=<your system email>
SYSTEM_PASSWORD=<your system password>
+759 -22
View File
@@ -7,18 +7,62 @@ The School Management API Documentation, defining all functions and their purpos
* [Getting Started](#getting-started)
* [General Functions](#general-functions)
* [Creating Accounts](#creating-accounts)
* [Creating Administrators](#creating-administrators)
* [Registering a Teacher](#registering-a-teacher)
* [Enrolling a Student](#enrolling-a-student)
* [Additional Info](#additional-information-after-creating-an-account)
* [Log into Accounts](#log-into-accounts)
* [Logging Into Admin](#logging-into-admin)
* [Logging Into Teacher](#logging-into-teacher)
* [Logging Into Student](#logging-into-student)
* [Get Account](#get-account)
* [Get Admin Account](#get-admin-account)
* [Get Teacher Account](#get-teacher-account)
* [Get Student Account](#get-student-account)
* [Updating Account information](#updating-accounts)
* **Update Student...**
* [Name](#update-student-name)
* [Grade Level](#update-student-grade-level)
* [Homeroom](#update-student-homeroom)
* [Locker](#update-student-locker)
* [YOG](#update-student-year-of-graduation)
* [Password](#update-student-password)
* [Email](#update-student-email)
* [Address](#update-student-address)
* [Photo](#update-student-photo)
<br></br>
* **Update Teacher...**
* [Name](#update-teacher-name)
* [Homeroom](#update-teacher-homeroom)
* [Password](#update-teacher-password)
* [Email](#update-teacher-email)
* [Address](#update-teacher-address)
* [Photo](#update-teacher-photo)
<br></br>
* **Update Admin...**
* [Name](#update-admin-name) - **(Coming Soon)**
* [Password](#update-admin-password) - **(Coming Soon)**
* [Email](#update-admin-email) - **(Coming Soon)**
* [Photo](#update-admin-photo) - **(Coming Soon)**
* [Managing Contacts](#managing-contacts) - **(Not Documented)**
* [Create Contact](#create-contact) - **(Not Documented)**
* [Update Contact Name](#update-contact-name) - **(Not Documented)**
* [Update Contact Address](#update-contact-address) - **(Not Documented)**
* [Update Contact Home Phone](#update-contact-home-phone) - **(Not Documented)**
* [Update Contact Work Phone](#update-contact-work-phone) - **(Not Documented)**
* [Update Contact Email](#update-contact-email) - **(Not Documented)**
* [Update Contact Priority](#update-contact-priority) - **(Not Documented)**
* [Delete Contact](#delete-contact) - **(Not Documented)**
<br>
## Getting Started
* ### Installation & Deployment
The API is an all in one package and is simple and easy to deploy. Eliminating any long unforgiving configurations you may face in other software.
The API is an all in one package and is simple and easy to deploy. Eliminating any long unforgiving configurations you may face in other software.
1. Clone the repo
```
```bash
$ git clone https://github.com/SowinskiBraeden/school-management-api
$ cd school-management-api
```
@@ -26,7 +70,7 @@ The School Management API Documentation, defining all functions and their purpos
2. Rename `.env.example` to `.env`
3. Enter desired values into `.env`
```
```bash
mongoURI='your mongo URI'
dbo='school'
secret='your 256 bit secret'
@@ -41,14 +85,14 @@ The School Management API Documentation, defining all functions and their purpos
```
4. Run the system in your terminal
```
```bash
$ go run main.go
```
Or...
5. Build and compile the system into an executable
```
```bash
$ go build
```
@@ -76,7 +120,7 @@ The School Management API Documentation, defining all functions and their purpos
**Returns:**
* Status 200: `OK`
* JSON:
```
```jsonc
{
"success": true,
"message": "the API is active"
@@ -92,17 +136,17 @@ There are several account that can be registered into the system. As you may gue
<br>
+ ### Creating Administrators
You can create Administratos who will have permissions to perform majority of the actions in the API. It is common that there are more than one Administrator to help manage the system.
You can create Administrates- who will have permissions to perform majority of the actions in the API. It is common that there are more than one Administrator to help manage the system.
**Method:** `POST`
```
<API_URL>/admin/create
<API_URL>/api/v1/admin/create
```
**Required:**
+ Logged into an existing Admin account
+ JSON:
```
```jsonc
{
"firstname": "John",
"lastname": "Doe",
@@ -114,7 +158,7 @@ There are several account that can be registered into the system. As you may gue
**Returns:**
+ Status 200: `OK`
+ JSON:
```
```jsonc
{
"success": true,
"message": "successfully inserted admin"
@@ -124,17 +168,17 @@ There are several account that can be registered into the system. As you may gue
<br>
+ ### Registering a Teacher
Obviosuly a school management system will require teachers to manage and teach students. Teachers have an important role for the system.
Obviously a school management system will require teachers to manage and teach students. Teachers have an important role for the system.
**Method:** `POST`
```
<API_URL>/teacher/register
<API_URL>/api/v1/teacher/register
```
**Required:**
+ Logged into an existing Admin account
+ JSON:
```
```jsonc
{
"firstname": "Homer",
"middlename": "Jay",
@@ -147,7 +191,7 @@ There are several account that can be registered into the system. As you may gue
**Returns:**
+ Status 200: `OK`
+ JSON:
```
```jsonc
{
"success": true,
"message": "successfully inserted teacher"
@@ -155,17 +199,17 @@ There are several account that can be registered into the system. As you may gue
```
+ ### Enrolling a Student
What is a school withouth students? A professional day, but not the point. Students when their application to the school has been accepted by an admin can be enrolled into the school.
What is a school without students? A professional day, but not the point. Students when their application to the school has been accepted by an admin can be enrolled into the school.
**Method:** `POST`
```
<API_URL>/student/enroll
<API_URL>/api/v1/student/enroll
```
**Required:**
+ Logged into an existing Admin account
+ JSON:
```
```jsonc
{
"firstname": "Bart",
"middlename": "JoJo",
@@ -183,21 +227,714 @@ There are several account that can be registered into the system. As you may gue
**Returns:**
+ Status 200: `OK`
+ JSON:
```
```jsonc
{
"success": true,
"successfully inserted student"
}
```
+ ### Additional Information After creating an account
1. After successfully creating an account for another admin, teacher or student. A school email will be generated for them using their first and last name, each formated differently based on the type of account.
1. After successfully creating an account for another admin, teacher or student. A school email will be generated for them using their first and last name, each formatted differently based on the type of account.
2. All users are given a random ID used to sign into the system. Each ID is a random 6 digit number.
3. Students are given a random PEN (Personal Education Number). A random 12 digit number.
4. Accounts are given a defaul profile image. This can be updated in the future.
4. Accounts are given a default profile image. This can be updated in the future.
5. All new users, once have verified their email, will recieve and email containing their ID.
**(Coming Soon)**
5. All new users, once have verified their email, will receive and email containing their ID.
6. All new users, once have verified their email, will recieve and email containing their temporary password.
**(Currently No verified email required)**
6. All new users, once have verified their email, will receive and email containing their temporary password.
<br>
## Log Into Accounts
+ ### Logging into Admin
**Method:** `POST`
```
<API_URL>/api/v1/admin/login
```
**Required:**
* JSON:
```jsonc
{
"tid": "123456",
"password": "myawesomepassword123"
}
```
**Returns:**
* Status 200: `OK`
* JSON:
```
{
"success": true,
"message": "correct password"
}
```
<br>
+ ### Logging into Teacher
**Method:** `POST`
```
<API_URL>/api/v1/teacher/login
```
**Required:**
* JSON:
```jsonc
{
"tid": "123456",
"password": "myawesomepassword123"
}
```
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "correct password"
}
```
<br>
+ ### Logging into Student
**Method:** `POST`
```
<API_URL>/api/v1/student/login
```
**Required:**
* JSON:
```jsonc
{
"sid": "123456",
"password": "myawesomepassword123"
}
```
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "correct password"
}
```
<br>
## Get Account
+ ### Get Admin Account
**Method:** `GET`
```
<API_URL>/api/v1/admin
```
**Required:**
* Logged into an admin account
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully logged into admin",
"admin:" <admin object>
}
```
<br>
+ ### Get Teacher Account
**Method:** `GET`
```
<API_URL>/api/v1/teacher
```
**Required:**
* Logged into an teacher account
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully logged into teacher",
"teacher:" <teacher object>
}
```
<br>
+ ### Get Student Account
**Method:** `GET`
```
<API_URL>/api/v1/student
```
**Required:**
* Logged into an admin account
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully logged into teacher",
"student:" <student object>
}
```
<br>
## Updating Account Information
+ ### Update Student Name
**Method:** `POST`
```
<API_URL>/api/v1/student/updateName
```
**Required:**
* Logged into an admin account
* JSON:
```jsonc
{
"sid": "123456",
"firstname": "Lisa",
"middlename": "Marie", // (OPTIONAL)
"lastname": "Simpson"
}
```
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully updated student"
}
```
<br></br>
+ ### Update Student Grade Level
**Method:** `POST`
```
<API_URL>/api/v1/student/updateGradeLevel
```
**Required:**
* Logged into an admin account
* JSON":
```jsonc
{
"sid": "123456",
"gradelevel": 11
}
```
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully updated student"
}
```
<br></br>
+ ### Update Student Homeroom
**Method:** `POST`
```
<API_URL>/api/v1/student/updateHomeroom
```
**Required:**
* Logged into an admin account
* JSON:
```jsonc
{
"sid": "123456",
"homeroom": "A123"
}
```
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully updated student"
}
```
<br></br>
+ ### Update Student Locker
**Method:** `POST`
```
<API_URL>/api/v1/student/updateLocker
```
**Required:**
* Logged into an admin account
* JSON:
```jsonc
{
"sid": "123456",
"lockernumber": "B123"
}
```
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully updated student"
}
```
<br></br>
+ ### Update Student Year of Graduation
**Method:** `POST`
```
<API_URL>/api/v1/student/updateYOG
```
**Required:**
* Logged into an admin account
* JSON:
```jsonc
{
"sid": "123456",
"yog": 2020
}
```
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully updated student"
}
```
<br></br>
+ ### Update Student Password
**Method:** `POST`
```
<API_URL>/api/v1/student/updatePassword
```
**Required:**
* Logged into students account
* JSON:
```jsonc
{
"password": "myOldPassword",
"newpassword1": "myNewPassword",
"newpassword2": "myNewPassword"
}
```
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully updated student password"
}
```
* Emails student an alert of password change
<br></br>
+ ### Update Student Email
**Method:** `POST`
```
<API_URL>/api/v1/student/updateEmail
```
**Required:**
* Logged into an admin account
__or__
* Logged into students account
* JSON:
```jsonc
{
"sid": "123456", // (Only required if signed in as admin)
"email": "BartSimpsonsCoolEmail@example.com"
}
```
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully updated"
}
```
<br></br>
+ ### Update Student Address
**Method:** `POST`
```
<API_URL>/api/v1/student/updateAddress
```
**Required:**
* Logged into an admin account
* JSON:
```jsonc
{
"sid": "123456",
"address": "742 Evergreen Terrace",
"city": "Springfield",
"province": "...",
"postal": "..."
}
```
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully updated student"
}
```
<br></br>
+ ### Update Student Photo
**Method:** `POST`
```
<API_URL>/api/v1/student/updatePhoto
```
**Required:**
* Logged into an admin account
* Form Submission:
```
sid: "123456"
image: newStudentPhoto.png
```
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully updated student photo"
}
```
<br></br>
+ ### Update Teacher Name
**Method:** `POST`
```
<API_URL>/api/v1/teacher/updateName
```
**Required:**
* Logged into an admin account
* JSON:
```jsonc
{
"tid": "123456",
"firstname": "Marjorie",
"middlename": "Jacqueline", // (Optional)
"lastname": "Simpson"
}
```
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully updated teacher"
}
```
<br></br>
+ ### Update Teacher Homeroom
**Method:** `POST`
```
<API_URL>/api/v1/teacher/updateHomeroom
```
**Required:**
* Logged into an admin account
* JSON:
```
{
"tid": "123456",
"homeroom": "A123"
}
```
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully updated teacher"
}
```
<br></br>
+ ### Update Teacher Password
**Method:** `POST`
```
<API_URL>/api/v1/teacher/updatePassword
```
**Required:**
* Logged into teacher account
* JSON:
```jsonc
{
"password": "myOldPassword",
"newpassword1": "myNewPassword",
"newpassword2": "myNewPassword"
}
```
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully updated teacher password"
}
```
* Emails teacher an alert of password change
<br></br>
+ ### Update Teacher Email
**Method:** `POST`
```
<API_URL>/api/v1/teacher/updateEmail
```
**Required:**
* Logged into an admin account
**or**
* Logged into teachers account
* JSON:
```jsonc
{
"tid": "123456", // (Only required if igned in as admin)
"email": "MargeSimpson@example.com"
}
```
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully updated teacher"
}
```
<br></br>
+ ### Update Teacher Address
**Method:** `POST`
```
<API_URL>/api/v1/teacher/updateAddress
```
**Required:**
* Logged into an admin account
* JSON:
```jsonc
{
"tid": "123456",
"address": "742 Evergreen Terrace",
"city": "Springfield",
"province": "...",
"postal": "..."
}
```
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully updated teacher"
}
```
<br></br>
+ ### Update Teacher Photo
**Method:** `POST`
```
<API_URL>/api/v1/teacher/updatePhoto
```
**Required:**
* Logged into an admin
* Form Submission:
```
tid: "123456"
image: newTeacherPhoto.png
```
**Returns:**
* Status 200: `OK`
* JSON:
```jsonc
{
"success": true,
"message": "successfully updated teacher photo"
}
```
<br></br>
+ ### Update Admin Name
**Coming Soon...**
<br></br>
+ ### Update Admin Password
**Coming Soon...**
<br></br>
+ ### Update Admin Email
**Coming Soon...**
<br></br>
+ ### Update Admin Photo
**Coming Soon...**
<br></br>
## Managing Conacts
**To be Documented...**
+ ### Creating Contact
**To be Documented...**
<br></br>
+ ### Update Contact Name
**To be Documented...**
<br></br>
+ ### Update Contact Address
**To be Documented...**
<br></br>
+ ### Update Contact Home Phone
**To be Documented...**
<br></br>
+ ### Update Contact Work Phone
**To be Documented...**
<br></br>
+ ### Update Contact Email
**To be Documented...**
<br></br>
+ ### Update Contact Priority
**To be Documented...**
<br></br>
+ ### Delete Conotact
**To be Documented...**
<br></br>
## Remove Users
**To be Documented...**
+ ### Remove Admin
**To be Documented...**
<br></br>
+ ### Remove Teacher
**To be Documented...**
<br></br>
+ ### Remove Student
**To be Documented...**
<br></br>
### Admin Commands
Administrators play a very important role in managing a school, they do much work behind the scenes to make sure that everything is correctly organized and working.
+ ### Update Locker Combination
**To be Documented...**
<br></br>
+ ### Enable Student Account
In the case a students acount has been disabled, an admin would require to enable the account.
**To be Documented...**
<br></br>
+ ### Enable Teacher Account
In the case a teachers acount has been disabled, an admin would require to enable the account.
**To be Documented...**
<br></br>
+1 -3
View File
@@ -63,9 +63,7 @@ func CreateDefaultAdmin() models.Admin {
admin.LastName = lastname
admin.Email = email
temp := admin.GenerateSchoolEmail()
fmt.Println(temp)
admin.SchoolEmail = temp
admin.SchoolEmail = admin.GenerateSchoolEmail()
pass := strings.TrimSuffix(string(password), "\n")
admin.Password = admin.HashPassword(pass)
+323 -55
View File
@@ -145,7 +145,7 @@ func UpdateStudentGradeLevel(c *fiber.Ctx) error {
},
}
result, updateErr := studentCollection.UpdateOne(
_, updateErr := studentCollection.UpdateOne(
ctx,
bson.M{"schooldata.sid": data["sid"].(string)},
update,
@@ -163,7 +163,6 @@ func UpdateStudentGradeLevel(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated student",
"result": result,
})
}
@@ -217,7 +216,7 @@ func UpdateStudentHomeroom(c *fiber.Ctx) error {
},
}
result, updateErr := studentCollection.UpdateOne(
_, updateErr := studentCollection.UpdateOne(
ctx,
bson.M{"schooldata.sid": data["sid"]},
update,
@@ -235,7 +234,6 @@ func UpdateStudentHomeroom(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated student",
"result": result,
})
}
@@ -322,7 +320,7 @@ func UpdateStudentPassword(c *fiber.Ctx) error {
},
}
result, updateErr := studentCollection.UpdateOne(
_, updateErr := studentCollection.UpdateOne(
ctx,
bson.M{"schooldata.sid": claims.Issuer},
update,
@@ -352,7 +350,6 @@ func UpdateStudentPassword(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated student password",
"result": result,
})
}
@@ -491,7 +488,7 @@ func UpdateStudentLocker(c *fiber.Ctx) error {
},
}
result, updateErr := studentCollection.UpdateOne(
_, updateErr := studentCollection.UpdateOne(
ctx,
bson.M{"schooldata.sid": data["sid"]},
update,
@@ -509,7 +506,6 @@ func UpdateStudentLocker(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated student",
"result": result,
})
}
@@ -555,7 +551,7 @@ func UpdateStudentAddress(c *fiber.Ctx) error {
},
}
result, updateErr := studentCollection.UpdateOne(
_, updateErr := studentCollection.UpdateOne(
ctx,
bson.M{"sid": data["sid"]},
update,
@@ -573,13 +569,12 @@ func UpdateStudentAddress(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated student",
"result": result,
})
}
// In the case a student gets held back a grade, we need to update their YOG (Year of Graduation)
func UpdateStudentYOG(c *fiber.Ctx) error {
var data map[string]string
var data map[string]interface{}
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
if err := c.BodyParser(&data); err != nil {
@@ -601,7 +596,7 @@ func UpdateStudentYOG(c *fiber.Ctx) error {
}
// Check required fields are included
if data["sid"] == "" {
if data["sid"] == "" || data["yog"] == nil {
cancel()
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
"success": false,
@@ -610,7 +605,7 @@ func UpdateStudentYOG(c *fiber.Ctx) error {
}
var student models.Student
findErr := studentCollection.FindOne(context.TODO(), bson.M{"schooldata.sid": data["sid"]}).Decode(&student)
findErr := studentCollection.FindOne(context.TODO(), bson.M{"schooldata.sid": data["sid"].(string)}).Decode(&student)
if findErr != nil {
cancel()
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
@@ -622,14 +617,14 @@ func UpdateStudentYOG(c *fiber.Ctx) error {
update_time, _ := time.Parse(time.RFC3339, time.Now().Format(time.RFC3339))
update := bson.M{
"$set": bson.M{
"schooldata.yog": student.SchoolData.YOG + 1,
"schooldata.yog": data["yog"].(int),
"updated_at": update_time,
},
}
result, updateErr := studentCollection.UpdateOne(
ctx,
bson.M{"schooldata.sid": data["sid"]},
bson.M{"schooldata.sid": data["sid"].(string)},
update,
)
if updateErr != nil {
@@ -889,7 +884,7 @@ func UpdateStudentPhoto(c *fiber.Ctx) error {
"updated_at": update_time,
},
}
result, updateErr := imageCollection.UpdateOne(
_, updateErr := imageCollection.UpdateOne(
ctx,
bson.M{"_id": photo.ID},
update,
@@ -910,7 +905,6 @@ func UpdateStudentPhoto(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated student photo",
"result": result,
})
}
@@ -927,8 +921,10 @@ func UpdateStudentEmail(c *fiber.Ctx) error {
})
}
var sid string
var verifiedStudent bool
verifiedAdmin, _ := AuthenticateUser(c, 3)
verifiedStudent, sid := AuthenticateUser(c, 1)
verifiedStudent, sid = AuthenticateUser(c, 1)
// Ensure Authenticated admin sent request
if !verifiedAdmin && !verifiedStudent {
cancel()
@@ -938,6 +934,16 @@ func UpdateStudentEmail(c *fiber.Ctx) error {
})
}
if verifiedAdmin && data["sid"] == "" {
cancel()
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
"success": false,
"message": "missing required fields",
})
} else if verifiedAdmin {
sid = data["sid"]
}
// Check required fields are included
if data["email"] == "" {
cancel()
@@ -1152,7 +1158,7 @@ func UpdateTeacherHomeroom(c *fiber.Ctx) error {
},
}
result, updateErr := teacherCollection.UpdateOne(
_, updateErr := teacherCollection.UpdateOne(
ctx,
bson.M{"schooldata.tid": data["tid"]},
update,
@@ -1170,7 +1176,6 @@ func UpdateTeacherHomeroom(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated teacher",
"result": result,
})
}
@@ -1203,7 +1208,7 @@ func UpdateTeacherPassword(c *fiber.Ctx) error {
claims := token.Claims.(*jwt.StandardClaims)
var teacher models.Teacher
findErr := studentCollection.FindOne(ctx, bson.M{"schooldata.tid": claims.Issuer}).Decode(&teacher)
findErr := teacherCollection.FindOne(ctx, bson.M{"schooldata.tid": claims.Issuer}).Decode(&teacher)
if findErr != nil {
cancel()
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
@@ -1257,7 +1262,7 @@ func UpdateTeacherPassword(c *fiber.Ctx) error {
},
}
result, updateErr := teacherCollection.UpdateOne(
_, updateErr := teacherCollection.UpdateOne(
ctx,
bson.M{"schooldata.tid": claims.Issuer},
update,
@@ -1286,7 +1291,6 @@ func UpdateTeacherPassword(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated teacher password",
"result": result,
})
}
@@ -1416,7 +1420,7 @@ func UpdateTeacherAddress(c *fiber.Ctx) error {
},
}
result, updateErr := teacherCollection.UpdateOne(
_, updateErr := teacherCollection.UpdateOne(
ctx,
bson.M{"schooldata.tid": data["tid"]},
update,
@@ -1434,7 +1438,6 @@ func UpdateTeacherAddress(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated teacher",
"result": result,
})
}
@@ -1530,7 +1533,7 @@ func UpdateTeacherPhoto(c *fiber.Ctx) error {
"updated_at": update_time,
},
}
result, updateErr := imageCollection.UpdateOne(
_, updateErr := imageCollection.UpdateOne(
ctx,
bson.M{"_id": photo.ID},
update,
@@ -1551,7 +1554,6 @@ func UpdateTeacherPhoto(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated teacher photo",
"result": result,
})
}
@@ -1568,8 +1570,13 @@ func UpdateTeacherEmail(c *fiber.Ctx) error {
})
}
var tid string
var verifiedTeacher bool
verifiedAdmin, _ := AuthenticateUser(c, 3)
verifiedTeacher, tid = AuthenticateUser(c, 2)
// Ensure Authenticated admin sent request
if verified, _ := AuthenticateUser(c, 3); !verified {
if !verifiedAdmin && !verifiedTeacher {
cancel()
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{
"success": false,
@@ -1577,8 +1584,18 @@ func UpdateTeacherEmail(c *fiber.Ctx) error {
})
}
if verifiedAdmin && data["tid"] == "" {
cancel()
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
"success": false,
"message": "missing required fields",
})
} else if verifiedAdmin {
tid = data["tid"]
}
// Check required fields are included
if data["tid"] == "" || data["email"] == "" {
if data["email"] == "" {
cancel()
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
"success": false,
@@ -1594,9 +1611,9 @@ func UpdateTeacherEmail(c *fiber.Ctx) error {
},
}
result, updateErr := teacherCollection.UpdateOne(
_, updateErr := teacherCollection.UpdateOne(
ctx,
bson.M{"schooldata.tid": data["tid"]},
bson.M{"schooldata.tid": tid},
update,
)
if updateErr != nil {
@@ -1612,7 +1629,6 @@ func UpdateTeacherEmail(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated teacher",
"result": result,
})
}
@@ -1659,17 +1675,23 @@ func UpdateTeacherName(c *fiber.Ctx) error {
})
}
var middlename string = ""
if data["middlename"] != "" {
middlename = data["middlename"]
}
update_time, _ := time.Parse(time.RFC3339, time.Now().Format(time.RFC3339))
update := bson.M{
"$set": bson.M{
"personaldata.firstname": data["firstname"],
"personaldata.middlename": data["middlename"],
"personaldata.middlename": middlename,
"personaldata.lastname": data["lastname"],
"updated_at": update_time,
},
}
result, updateErr := teacherCollection.UpdateOne(
_, updateErr := teacherCollection.UpdateOne(
ctx,
bson.M{"schooldata.tid": data["tid"]},
update,
@@ -1687,7 +1709,6 @@ func UpdateTeacherName(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated teacher",
"result": result,
})
}
@@ -1732,7 +1753,7 @@ func UpdateContactName(c *fiber.Ctx) error {
},
}
result, updateErr := contactCollection.UpdateOne(
_, updateErr := contactCollection.UpdateOne(
ctx,
bson.M{"_id": data["_id"]},
update,
@@ -1750,7 +1771,6 @@ func UpdateContactName(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated contact",
"result": result,
})
}
@@ -1796,7 +1816,7 @@ func UpdateContactAddress(c *fiber.Ctx) error {
},
}
result, updateErr := contactCollection.UpdateOne(
_, updateErr := contactCollection.UpdateOne(
ctx,
bson.M{"_id": data["_id"]},
update,
@@ -1814,7 +1834,6 @@ func UpdateContactAddress(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated contact",
"result": result,
})
}
@@ -1857,7 +1876,7 @@ func UpdateContactHomePhone(c *fiber.Ctx) error {
},
}
result, updateErr := contactCollection.UpdateOne(
_, updateErr := contactCollection.UpdateOne(
ctx,
bson.M{"_id": data["_id"]},
update,
@@ -1875,7 +1894,6 @@ func UpdateContactHomePhone(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated contact",
"result": result,
})
}
@@ -1918,7 +1936,7 @@ func UpdateContactWorkPhone(c *fiber.Ctx) error {
},
}
result, updateErr := contactCollection.UpdateOne(
_, updateErr := contactCollection.UpdateOne(
ctx,
bson.M{"_id": data["_id"]},
update,
@@ -1936,7 +1954,6 @@ func UpdateContactWorkPhone(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated contact",
"result": result,
})
}
@@ -1979,7 +1996,7 @@ func UpdateContactEmail(c *fiber.Ctx) error {
},
}
result, updateErr := contactCollection.UpdateOne(
_, updateErr := contactCollection.UpdateOne(
ctx,
bson.M{"_id": data["_id"]},
update,
@@ -1997,7 +2014,6 @@ func UpdateContactEmail(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated contact",
"result": result,
})
}
@@ -2040,7 +2056,7 @@ func UpdateContactPriority(c *fiber.Ctx) error {
},
}
result, updateErr := contactCollection.UpdateOne(
_, updateErr := contactCollection.UpdateOne(
ctx,
bson.M{"_id": data["_id"]},
update,
@@ -2058,7 +2074,6 @@ func UpdateContactPriority(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated contact",
"result": result,
})
}
@@ -2101,7 +2116,7 @@ func UpdateLockerCombo(c *fiber.Ctx) error {
},
}
result, updateErr := lockerCollection.UpdateOne(
_, updateErr := lockerCollection.UpdateOne(
ctx,
bson.M{"lockernumber": data["lockernumber"]},
update,
@@ -2119,7 +2134,6 @@ func UpdateLockerCombo(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated locker",
"result": result,
})
}
@@ -2164,7 +2178,7 @@ func RemoveStudent(c *fiber.Ctx) error {
})
}
result, deleteErr := studentCollection.DeleteOne(ctx, bson.M{"schooldata.sid": data["sid"]})
_, deleteErr = studentCollection.DeleteOne(ctx, bson.M{"schooldata.sid": data["sid"]})
if deleteErr != nil {
cancel()
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
@@ -2178,7 +2192,6 @@ func RemoveStudent(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully deleted student",
"result": result,
})
}
@@ -2223,7 +2236,7 @@ func RemoveTeacher(c *fiber.Ctx) error {
})
}
result, deleteErr := teacherCollection.DeleteOne(ctx, bson.M{"schooldata.tid": data["tid"]})
_, deleteErr = teacherCollection.DeleteOne(ctx, bson.M{"schooldata.tid": data["tid"]})
if deleteErr != nil {
cancel()
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
@@ -2237,7 +2250,6 @@ func RemoveTeacher(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully deleted teacher",
"result": result,
})
}
@@ -2282,7 +2294,7 @@ func RemoveAdmin(c *fiber.Ctx) error {
})
}
result, deleteErr := adminCollection.DeleteOne(ctx, bson.M{"aid": data["aid"]})
_, deleteErr = adminCollection.DeleteOne(ctx, bson.M{"aid": data["aid"]})
if deleteErr != nil {
cancel()
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
@@ -2296,6 +2308,262 @@ func RemoveAdmin(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully deleted admin",
"result": result,
})
}
func UpdateAdminName(c *fiber.Ctx) error {
var data map[string]string
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
if err := c.BodyParser(&data); err != nil {
cancel()
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
"success": false,
"message": "Failed to parse body",
"error": err,
})
}
cookie := c.Cookies("jwt")
token, err := jwt.ParseWithClaims(cookie, &jwt.StandardClaims{}, func(token *jwt.Token) (interface{}, error) {
return []byte(SecretKey), nil
})
if err != nil {
cancel()
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{
"success": false,
"message": "not authorized",
})
}
claims := token.Claims.(*jwt.StandardClaims)
var admin models.Admin
findErr := adminCollection.FindOne(ctx, bson.M{"aid": claims.Issuer}).Decode(&admin)
if findErr != nil {
cancel()
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
"success": false,
"message": "admin not found",
})
}
// Check required fields are included
if data["firstname"] == "" || data["lastname"] == "" {
cancel()
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
"success": false,
"message": "missing required fields",
})
}
update_time, _ := time.Parse(time.RFC3339, time.Now().Format(time.RFC3339))
update := bson.M{
"$set": bson.M{
"firstname": data["firstname"],
"lastname": data["lastname"],
"updated_at": update_time,
},
}
_, updateErr := teacherCollection.UpdateOne(
ctx,
bson.M{"aid": claims.Issuer},
update,
)
if updateErr != nil {
cancel()
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
"success": false,
"message": "the admin password could not be updated",
"error": updateErr,
})
}
defer cancel()
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated admin",
})
}
func UpdateAdminEmail(c *fiber.Ctx) error {
var data map[string]string
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
if err := c.BodyParser(&data); err != nil {
cancel()
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
"success": false,
"message": "Failed to parse body",
"error": err,
})
}
cookie := c.Cookies("jwt")
token, err := jwt.ParseWithClaims(cookie, &jwt.StandardClaims{}, func(token *jwt.Token) (interface{}, error) {
return []byte(SecretKey), nil
})
if err != nil {
cancel()
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{
"success": false,
"message": "not authorized",
})
}
claims := token.Claims.(*jwt.StandardClaims)
var admin models.Admin
findErr := adminCollection.FindOne(ctx, bson.M{"aid": claims.Issuer}).Decode(&admin)
if findErr != nil {
cancel()
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
"success": false,
"message": "admin not found",
})
}
// Check required fields are included
if data["email"] == "" {
cancel()
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
"success": false,
"message": "missing required fields",
})
}
update_time, _ := time.Parse(time.RFC3339, time.Now().Format(time.RFC3339))
update := bson.M{
"$set": bson.M{
"email": data["email"],
"updated_at": update_time,
},
}
_, updateErr := teacherCollection.UpdateOne(
ctx,
bson.M{"aid": claims.Issuer},
update,
)
if updateErr != nil {
cancel()
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
"success": false,
"message": "the admin password could not be updated",
"error": updateErr,
})
}
defer cancel()
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated admin",
})
}
func UpdateAdminPassword(c *fiber.Ctx) error {
var data map[string]string
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
if err := c.BodyParser(&data); err != nil {
cancel()
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
"success": false,
"message": "Failed to parse body",
"error": err,
})
}
cookie := c.Cookies("jwt")
token, err := jwt.ParseWithClaims(cookie, &jwt.StandardClaims{}, func(token *jwt.Token) (interface{}, error) {
return []byte(SecretKey), nil
})
if err != nil {
cancel()
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{
"success": false,
"message": "not authorized",
})
}
claims := token.Claims.(*jwt.StandardClaims)
var admin models.Admin
findErr := adminCollection.FindOne(ctx, bson.M{"aid": claims.Issuer}).Decode(&admin)
if findErr != nil {
cancel()
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
"success": false,
"message": "admin not found",
})
}
// Check required fields are included
if data["password"] == "" || data["newpassword1"] == "" || data["newpassword2"] == "" {
cancel()
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
"success": false,
"message": "missing required fields",
})
}
if !admin.ComparePasswords(data["password"]) {
cancel()
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": false,
"message": "Your password is incorrect",
})
}
if data["newpassword1"] != data["newpassword2"] {
cancel()
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
"success": false,
"message": "Your new passwords must match",
})
}
update_time, _ := time.Parse(time.RFC3339, time.Now().Format(time.RFC3339))
update := bson.M{
"$set": bson.M{
"password": admin.HashPassword(data["newpassword1"]),
"temppassword": false, // If it were a temp password, its not now
"updated_at": update_time,
},
}
_, updateErr := teacherCollection.UpdateOne(
ctx,
bson.M{"aid": claims.Issuer},
update,
)
if updateErr != nil {
cancel()
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
"success": false,
"message": "the admin password could not be updated",
"error": updateErr,
})
}
defer cancel()
subject := "Password Changed"
receiver := admin.Email
r := NewRequest([]string{receiver}, subject)
if sent := r.Send("./templates/selfPasswordChanged.html", map[string]string{"username": admin.FirstName}); !sent {
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
"success": false,
"message": "Could not send password to admins email",
})
}
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "successfully updated admin password",
})
}
+1 -1
View File
@@ -11,7 +11,7 @@ import (
"github.com/gofiber/fiber/v2/middleware/cors"
)
const version string = "\nv0.9.2-Alpha"
const version string = "\nv1.0.0-Beta"
func main() {
fmt.Println(version)
+3 -1
View File
@@ -2,6 +2,7 @@ package models
import (
"math/rand"
"os"
"strings"
"time"
"unicode"
@@ -25,7 +26,8 @@ type Admin struct {
}
func (a *Admin) GenerateSchoolEmail() string {
var email string = strings.ToLower(a.LastName) + "_" + strings.ToLower(string(a.FirstName[0])) + "@surreyschools.ca"
addr := os.Getenv("SYSTEM_EMAIL_ADDRESS")
var email string = strings.ToLower(a.LastName) + "_" + strings.ToLower(string(a.FirstName[0])) + addr
// Add check to see if email already exists
return email
}
+6 -4
View File
@@ -3,6 +3,7 @@ package models
import (
"context"
"math/rand"
"os"
"strconv"
"strings"
"time"
@@ -81,15 +82,16 @@ func (s *Student) EmailExists(email string) bool {
}
func (s *Student) GenerateSchoolEmail(offset int, lastEmail string) string {
var email string = strings.ToLower(string(s.PersonalData.FirstName[0])) + "." + strings.ToLower(s.PersonalData.LastName) + "@surreyschools.ca"
addr := os.Getenv("SYSTEM_EMAIL_ADDRESS")
var email string = strings.ToLower(string(s.PersonalData.FirstName[0])) + "." + strings.ToLower(s.PersonalData.LastName) + addr
if offset > 0 && offset < len([]rune(s.PersonalData.FirstName))-1 {
email = lastEmail[:offset] + strings.ToLower(string(s.PersonalData.FirstName[offset])) + lastEmail[offset:]
email = lastEmail[:offset] + strings.ToLower(string(s.PersonalData.FirstName[offset])) + lastEmail[offset:] + addr
}
if offset == len([]rune(s.PersonalData.FirstName))-1 {
email = strings.ToLower(s.PersonalData.FirstName) + "." + strings.ToLower(s.PersonalData.LastName) + "@surreyschools.ca"
email = strings.ToLower(s.PersonalData.FirstName) + "." + strings.ToLower(s.PersonalData.LastName) + addr
}
if offset > len([]rune(s.PersonalData.FirstName))-1 {
email = strings.ToLower(s.PersonalData.FirstName) + "." + strings.ToLower(s.PersonalData.LastName) + strconv.Itoa(offset-len([]rune(s.PersonalData.FirstName))) + "@surreyschools.ca"
email = strings.ToLower(s.PersonalData.FirstName) + "." + strings.ToLower(s.PersonalData.LastName) + strconv.Itoa(offset-len([]rune(s.PersonalData.FirstName))) + addr
}
return email
}
+6 -4
View File
@@ -3,6 +3,7 @@ package models
import (
"context"
"math/rand"
"os"
"strconv"
"strings"
"time"
@@ -79,15 +80,16 @@ func (t *Teacher) EmailExists(email string) bool {
}
func (t *Teacher) GenerateSchoolEmail(offset int, lastEmail string) string {
var email string = strings.ToLower(t.PersonalData.LastName) + "_" + strings.ToLower(string(t.PersonalData.FirstName[0])) + "@surreyschools.ca"
addr := os.Getenv("SYSTEM_EMAIL_ADDRESS")
var email string = strings.ToLower(t.PersonalData.LastName) + "_" + strings.ToLower(string(t.PersonalData.FirstName[0])) + addr
if offset > 0 && offset < len([]rune(t.PersonalData.FirstName))-1 {
email = lastEmail[:strings.Index(lastEmail, "_")+offset+1] + strings.ToLower(string(t.PersonalData.FirstName[offset])) + "@surreyschools.ca"
email = lastEmail[:strings.Index(lastEmail, "_")+offset+1] + strings.ToLower(string(t.PersonalData.FirstName[offset])) + addr
}
if offset == len([]rune(t.PersonalData.FirstName))-1 {
email = strings.ToLower(t.PersonalData.LastName) + "_" + strings.ToLower(t.PersonalData.FirstName) + "@surreyschools.ca"
email = strings.ToLower(t.PersonalData.LastName) + "_" + strings.ToLower(t.PersonalData.FirstName) + addr
}
if offset > len([]rune(t.PersonalData.FirstName))-1 {
email = strings.ToLower(t.PersonalData.LastName) + "_" + strings.ToLower(t.PersonalData.FirstName) + strconv.Itoa(offset-len([]rune(t.PersonalData.FirstName))) + "@surreyschools.ca"
email = strings.ToLower(t.PersonalData.LastName) + "_" + strings.ToLower(t.PersonalData.FirstName) + strconv.Itoa(offset-len([]rune(t.PersonalData.FirstName))) + addr
}
return email
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

+5
View File
@@ -72,6 +72,11 @@ func Setup(app *fiber.App) {
app.Post(routerPrefix+"/admin/create", controllers.CreateAdmin)
app.Post(routerPrefix+"/admin/login", controllers.AdminLogin)
// Admin Update Handler
app.Post(routerPrefix+"/admin/updateName", controllers.UpdateAdminName)
app.Post(routerPrefix+"/admin/updateEmail", controllers.UpdateAdminEmail)
app.Post(routerPrefix+"/admin/updatePassword", controllers.UpdateAdminPassword)
// General Command Handling
app.Post(routerPrefix+"/admin/updateLockerCombo", controllers.UpdateLockerCombo)
app.Post(routerPrefix+"/admin/enableStudent", controllers.RemoveStudentsDisabled)