function checkLogin() { global $database; /* Check if user has been remembered */ if (isset($_SESSION['userID']) && $_SESSION['usertype'] == 0 && isset($_SESSION['usertype'])) { if ($database->confirmUserID($_SESSION['userID']) != 0) { unset($_SESSION['userID']); unset($_SESSION['usertype']); return false; } $temp = getStudentLogin($_SESSION['userID']); $this->userID = $temp->getID(); $this->name = $temp->getFullName(); $this->instituteID = $temp->getInstituteIDoFStudent(); $this->usertype = 0; return true; } else { return false; } }
function newStudentLogin($username, $classID, $examYear, $number_type) { $conn = getNewStudentConnection($classID); $query = "SELECT * FROM student WHERE (phone_stu LIKE '" . $username . "' OR phone_father LIKE '" . $username . "') AND examyear = '" . $examYear . "' AND activeflag = 1"; $result = mysql_query($query); $rows = mysql_num_rows($result); if ($rows != 1) { } else { $required_row = mysql_fetch_array($result); $authorised_studentID = $required_row['mainID']; if ($authorised_studentID != NULL) { $sobj = getStudentLogin($authorised_studentID); return array($sobj, 0); } } return NULL; }