Skip to content

Commit d0ace99

Browse files
author
blacksmithgu
committed
Enabled teacher registration.
1 parent 6ebcd17 commit d0ace99

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

app/api/calls/UserManager.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static function addRoutes($app) {
1111
$last = $_GET["last"];
1212
$school = $_GET["school"];
1313
$email = $_GET["email"];
14-
$groupID = $_GET["group"];
14+
$groupID = isset($_GET["group"]) ? $_GET["group"] : null;
1515

1616
$type = isset($_GET["type"]) ? $_GET["type"] : 0;
1717

@@ -20,9 +20,11 @@ public static function addRoutes($app) {
2020

2121
User::loginCurrent($user_res);
2222

23-
$group = Group::id($groupID);
24-
if(!is_null($group))
25-
$group->addIndirect("Students", $user_res);
23+
if(!is_null($groupID)) {
24+
$group = Group::id($groupID);
25+
if(!is_null($group))
26+
$group->addIndirect("Students", $user_res);
27+
}
2628

2729
header("Location: /");
2830
});

views/teachers.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ <h3 class="masthead-brand" style="font-family: 'Lobster', cursive;text-spacing:2
3838
<div class="inner cover" style="background: rgba(255,255,255,0.2); padding: 10px; margin-bottom: 20px;">
3939
<h2 class="cover-heading">Teacher Sign Up </h2>
4040
<hr style="border-color: black;opacity:.2">
41-
<form class="form-signin" role="form" style="opacity:.8">
42-
<input type="text" name="name" class="form-control top" placeholder="Full Name" required autofocus>
43-
<input id="autoschool"type="text" name="school" class="form-control bottom" placeholder="School" required>
41+
<form class="form-signin" action="/api/register" role="form" style="opacity:.8">
42+
<input type="text" name="first" class="form-control top" placeholder="First Name" required autofocus>
43+
<input type="text" name="last" class="form-control bottom" placeholder="Last Name" required>
44+
<input id="autoschool" type="text" name="school" class="form-control bottom" placeholder="School" required>
4445
<input type="email" name="email" class="form-control" placeholder="Email address" required>
4546
<input type="password" name="password" class="form-control" placeholder="Password" required>
47+
<input type="hidden" name="type" value="1">
4648
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign Up</button>
4749
</form>
4850
</div>

0 commit comments

Comments
 (0)