-
Notifications
You must be signed in to change notification settings - Fork 3
/
classes_access_apply.php
executable file
·29 lines (29 loc) · 1.04 KB
/
classes_access_apply.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
header("Content-Type:text/html;charset=utf-8");
include_once ('include_fns.php');
session_start();
if (!isset($_SESSION['email'])) {
middlepage("index.php", "请先登录");
}
if (!isset($_GET['classid'])) {
middlepage("classes.php", "请指定加入的班级");
}
$classid = safeGet('classid');
$email = $_SESSION['email'];
$admin = get_authority($classid, $email);
if ($admin != -1) {
middlepage("classes.php", "你已经是该班级的成员了!");
}
if (!isset($_POST['reason'])) {
middlepage("classes.php", "你穿越了吧?");
} else {
create_newmembernotice($classid, $email, safePost('reason'));
$manager_array = get_manager($classid);
$address_array = array();
foreach ($manager_array as $manager) {
array_push($address_array, $manager['useremail']);
}
send_emails($address_array, "班级联盟:有新的成员申请加入班级", $_SESSION['realname']."想加入你管理的班级,进去<a href=http://172.18.187.103/leagueofclass/main.php?classid=".$classid.">审批</a>吧!");
middlepage("classes.php", "申请成功");
}
?>